Skip to content

Commit

Permalink
Update the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangwinc committed Oct 27, 2023
1 parent 46560e7 commit 720510b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions doc/en/Authoring/Parsons.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,10 @@ Users interact with the strings, dragging them into a tree structure. Note, a l

## Authoring JSON within the question text itself.

Assume the question author writes a list of strings in Maxima, `proof_steps` with both the correct and incorrect strings.
Here is a basic example of use:

````
[[ parsons state="maxima_value1" ]]
{# stackjson_stringify(proof_steps) #}
[[/ parsons ]]
````

or they can avoid strings going via Maimxa at all by writing JSON directly

````
[[ parsons state="maxima_value1" ]]
[[ parsons input="ans1" ]]
{
"1":"Assume that \\(n\\) is odd.",
"2":"Then there exists an \\(m\\in\\mathbb{Z}\\) such that \\(n=2m+1\\).",
Expand All @@ -29,10 +21,21 @@ or they can avoid strings going via Maimxa at all by writing JSON directly
[[/ parsons ]]
````

Assume the question author writes a list of strings in Maxima, `proof_steps` in the question variables with both the correct and incorrect strings.

````
[[ parsons input="ans1" ]]
{# stackjson_stringify(proof_steps) #}
[[/ parsons ]]
````

or they can avoid strings going via Maimxa at all by writing JSON directly


Both these approaches can be combined

````
[[ parsons state="maxima_value1" ]]
[[ parsons input="ans1" ]]
{
"1":{#proof_steps[1]#},
"2":"Then there exists an \\(m\\in\\mathbb{Z}\\) such that \\(n=2m+1\\).",
Expand All @@ -47,7 +50,7 @@ Both these approaches can be combined
The `[[parsons]]` block is a wrapper for the Javascript library "Sortable.js", optimised and with default options for Parson's problems. As such, there are a very wide range of options for this javascript library. These options are all passed into the block as a JSON string. To do this we separate out the arguments to the block into separate "steps" and "options" fields.

````
[[ parsons state="maxima_value1" ]]
[[ parsons input="ans1" ]]
{ "steps": {{# stackjson_stringify(proof_steps) #}},
"options": {....}
}
Expand All @@ -59,5 +62,5 @@ The default options are TODO: confirm the above syntax and the default options!
## Block paramaters

1. Parameter `state` gives the tree built up from the keys from which the applet should be initialised.
2. The applet returns up updated state (indentical format: maxima expression) for evaluation by a PRT. This is linked to an input with parameter `input-ref-???`.
2. The applet returns up updated state (indentical format: maxima expression) for evaluation by a PRT. This is linked to an input with parameter `input=`.
3. `height` and `width` paramaters exist. TODO: examples/specs.

0 comments on commit 720510b

Please sign in to comment.