diff --git a/doc/en/Authoring/Parsons.md b/doc/en/Authoring/Parsons.md index 8dea1c2b63e..38132cb7fb5 100644 --- a/doc/en/Authoring/Parsons.md +++ b/doc/en/Authoring/Parsons.md @@ -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 `` 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])@}"); + diff --git a/doc/en/Topics/Parsons.md b/doc/en/Topics/Parsons.md index 8a6a07fbeff..fc8024bf2b3 100644 --- a/doc/en/Topics/Parsons.md +++ b/doc/en/Topics/Parsons.md @@ -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: @@ -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: ```` @@ -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 @@ -163,4 +165,9 @@ Notice this proof has two sub-proofs, which can occur in any order. Therefore w
{@ev(tad[2], map(lambda([ex], ex=dispproof_para), proof_types))@}
Can you see the differences between these proofs? -```` \ No newline at end of file +```` + +## Polish and tidy the question. + +You should hide the inputs from students with CSS after testing, e.g. `

...

`. +