Skip to content

Text-based inputs in STACK

Sometimes it is necessary for students to type in text, rather than an interpreted mathematical expression.

Some of the dynamic question blocks, e.g. the Parsons block, create a JSON object. The only way to store state in STACK is via an input, and so a text-based input is used to store this state.

String input

This is a normal input into which students may type whatever they choose. It is always converted into a Maxima string internally.

Notes

  1. There is no way whatsoever to parse the student's string into a Maxima expression. If you accept a string, then it will always remain a string! You can't later check for algebraic equivalence. The only tests available will be simple string matches, etc.
  2. An empty answer will be blank unless you use the allowempty option in which case the answer will be interpreted as an empty string, i.e. "" rather than EMPTYANSWER as would be the case with other inputs.
  3. STACK does some sanitation on students' input within strings to stop students typing in HTML code. For example, you may find that a string "a<b" actually ends up in Maxima with the less-than sign inside the string changed into an html entity &lt;, so your string inside Maxima becomes "a&lt;b". In cases where string matches unexpectedly fail, look at the testing page to see what is actually being compared within the PRT and re-build the teacher's answer to match.

Free-text input

This input is a text area into which students may type whatever they choose. This input is intended to capture text input, such as a mathematical proof. It is always converted into a Maxima string internally. We accept, for now, there are limitations on the ability to automatically assess free-text proofs.

Notes

  1. All the notes for "string" inputs above still apply.
  2. The freetext input defaults to manualgraded:true. If manualgraded:true is set then the whole STACK question will require manual grading!
  3. Part of this input can be linked to an automatically graded STACK input via [[extractor]] blocks inside an [[ascii]] display block, e.g. an algebraic input (final answer), textarea (last lines) or units input.
  4. The align extra option controls text alignment within the textarea: align:right aligns the text to the right; the default is align:left.
  5. The monospace extra option renders the textarea in a monospace font when set to monospace:true.

JSON input

The JSXGraph, GeoGebra and Parsons blocks return a JSON object. When linking to a STACK input we recommend using the dedicated JSON/Geogebra/Parsons inputs rather than the string input. String inputs will continue to work (maintaining legacy JSXGraph questions), but using the JSON input for inputs linked to JSXGraph logically indicates the expected type of string.

This input gives the teacher a JSON pretty print view of the JSON object for debugging.

JSON input can be used in PRTs, but note these are always strings. STACK provides limited faciliites to process JSON within Maxima, to extract parts of the JSON.

For example, if you have

s1: "{\"matches\":[ \"Apple\", \"Bannan\", \"Cherry\"]}";
l1: stackmap_get(stackjson_parse(s1), "matches");

Then the value of l1 will be the Maxima list ["Apple", "Bannan", "Cherry"].

By design it is impossible to parse the value of these strings as Maxima expressions. If you want Maxima expressions from students then these must be entered via a STACK input (such as algebraic).

Parsons input

A special Parsons input, is available to store the JSON object generated by the Parsons block.

GeoGebra input

A special GeoGebra input, is available to store the JSON object generated by the GeoGebra block.

Notes input

This input is a text area into which students may type whatever they choose. It can be used to gather their notes or "working". However, this input is always considered as "invalid", so that any potential response tree which relies on this input will never get evaluated!

This input type can be used for

  1. surveys;
  2. answers which are not automatically marked, contributing to semi-automatic marking. Set the extra option manualgraded:true, but note that the whole STACK question will require manual grading!

Note, for consistency with other inputs the teacher must still supply an answer, e.g. the empty string "". This answer is not used.