Skip to content

Commit

Permalink
Update the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwinc committed Nov 6, 2023
1 parent c3b1a8c commit b9f6357
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
11 changes: 11 additions & 0 deletions doc/en/Authoring/Parsons.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,14 @@ Additional display options including `height` and `width` may also be passed to
};
[[/parsons]]
````

## Adding plots to a Parson's block

TODO: confirm if we can embed HTML. If so, then the following should work.

Since HTML can be embedded into strings dragged within a Parson's block, images can be included with the HTML `<img>` tags as normal.

STACK-generated [plots](../Plots/index.md) cannot be included just using `{@plot(x^2,[x,-1,1])@}` as might be expected. This is because of the _order_ of evaluation. The full URL of the image is only created in the (complex) chain of events after the value has been substituted into the Javascript code. Instead, to embed STACK-generated images evaluate a static string using the Maxima `castext` function, and then use the value of `s1` in the Parson's block. For example.

s1:castext("{@plot(x^2,[x,-1,1],[size,250,250])@}");

29 changes: 18 additions & 11 deletions doc/en/Topics/Parsons.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ Notes

The following is a minimal Parson's question where there student is expected to create a list in one and only one order.

## Question variables

Define the following question variables:

````
stack_include("contribl://prooflib.mac");
ta:proof("assume","defn_rat","defn_rat2","defn_log","defn_log2","alg","alg_int","contra","conc");
````

The optional library `prooflib.mac` contain many useful functions for dealing with student's answers which represent proofs.

## Question text

The example question text below contains a Parson's block. Within the header of the Parson's block, ensure that `input="inputvar"` is included, where `inputvar` is the identifier of the input, for example `input="ans1"` as below. A minimal working example for the proof that _\(\log_2(3)\) is irrational_ is achieved by placing the following in the _Question text_ field:
Expand Down Expand Up @@ -72,15 +83,6 @@ Notes:

## Potential response tree: prt1

Define the following question variables:

````
stack_include("contribl://prooflib.mac");
ta:proof("assume","defn_rat","defn_rat2","defn_log","defn_log2","alg","alg_int","contra","conc");
````

The optional library `prooflib.mac` contain many useful functions for dealing with student's answers which represent proofs.

Define the feedback variables:

````
Expand All @@ -93,7 +95,7 @@ Then you can set up the potential response tree to be `ATAlgEquiv(sa,ta)` to con

# Parson's question with block order options

sThe following Parson's question is an _if and only if_ proof, containing two blocks in order.
The following Parson's question is an _if and only if_ proof, containing two blocks in order.

The input is unchanged from the above example. For the question variables use

Expand Down Expand Up @@ -163,4 +165,9 @@ Notice this proof has two sub-proofs, which can occur in any order. Therefore w
<td><div class="proof">{@ev(tad[2], map(lambda([ex], ex=dispproof_para), proof_types))@}</div></td>
</tr></table>
Can you see the differences between these proofs?
````
````

## Polish and tidy the question.

You should hide the inputs from students with CSS after testing, e.g. `<p style="display:none">...</p>`.

0 comments on commit b9f6357

Please sign in to comment.