Answer box placeholders: Difference between revisions
No edit summary |
No edit summary |
||
Line 28: | Line 28: | ||
The formulas question should look like this: | The formulas question should look like this: | ||
[[File:FormulasDocumentation03a.png| | [[File:FormulasDocumentation03a.png|690px]] | ||
<div style="margin:20px 0 20px;"> | <div style="margin:20px 0 20px;"> | ||
Line 61: | Line 61: | ||
gives | gives | ||
[[File:En29FormulasDocumentation04.png| | [[File:En29FormulasDocumentation04.png|690px]] | ||
Neither do the answers have to be in increasing order and we would get exactly the same as above with the following: | Neither do the answers have to be in increasing order and we would get exactly the same as above with the following: | ||
Line 107: | Line 107: | ||
The formulas question should look like this: | The formulas question should look like this: | ||
[[File:En29FormulasDocumentation05.png| | [[File:En29FormulasDocumentation05.png|690px]] | ||
</div> | </div> |
Revision as of 02:19, 28 December 2017
Answer box placeholders provide a simple way to arrange the answer boxes in the part's text. It is particularly useful when the subquestion requires more than one answer. This flexibility allows you to arrange the answer boxes in the form of a matrix, coordinates, embedding into the question text or any other way you want.
There are two answer box types: the quantity box and the unit box. The placeholder names are _0 for the first quantity box, _1 for the second quantity box, etc, and _u for the unit box. The number of placeholder names that can be used is the same as the number of elements entered in the answer field, plus one if the unit is specified.
A subquestion that has two elements in the answer field and a common unit:
General Question name ! Two quantity and one unit answer boxes Main question Question text ! Using answer box placeholders Given: Point A is at position x = 100 mm and y = 200 mm. Part 1 Part's mark* 1 Answer type Number Answer* [100, 200] Grading criteria* Absolute error == 0 Unit mm Part's text Question: What are the coordinates of point A? The answer must be given as follows: '(x,y) unit'. A(x,y) = ({_0},{_1}) {_u}
The formulas question should look like this:
Play it (Open in new tab: Ctrl+Shift+Click)
Each answer box placeholder can only be used once in a part. For example, none of the following will be accepted:
Part's text {_0}{_0} Comment: {_0} can not be used twice Part's text {_0}{_1}{_1} Comment: {_1} can not be used twice Part's text {_0}{_u}{_1}{_u} Comment: {_u} can not be used twice Part's text {_3}{_3} Comment: {_3} can not be used twice
The placeholder names do not have to appear in any particular order such as the increasing order {_0}{_1}{_2}...{_u}. The order of the quantity boxes and the unit box correspond to the order of the placeholder names in the part's text. For example, the following:
Part 1 Answer* [0, 100, 200, 300] Unit mm Part's text {_2}{_0}{_3}{_u}{_1}
gives
Neither do the answers have to be in increasing order and we would get exactly the same as above with the following:
Answer* [200, 0, 300, 100] Unit mm Part's text {_0}{_1}{_2}{_u}{_3}
By default, all missing placeholder are automatically appended at the end. That is {_0}{_u} for one answer subquestion, and {_0}{_1}{_u} for two answers subquestion.
The box {_0} corresponds to the special variable _0 in the Grading variables.
Quantity and unit boxes side by side or merged
When the quantity placeholder {_0} and the unit placeholder {_u} are directly side by side, such as {_0}{_u}, the quantity box and the unit box merge into a longer single answer box in which both quantity and unit must be entered.
When the quantity placeholder and the unit placeholder are not directly side by side, i.e. when they are separated by a space or any other string of characters, the answer boxes do not merge and hence they are displayed side by side.
Answer with both quantity and unit:
Main question Question text* What is 2 mm + 3 mm? Part 1 Part's mark* 1 Answer type Number Answer* 5 Grading criteria* Absolute error == 0 Unit mm Part's text {_0} {_u} Separate placeholders give separate quantity and unit boxes. Part 2 Part's mark* 1 Answer type Number Answer* 5 Grading criteria* Absolute error == 0 Unit mm Part's text {_0}{_u} Attached placeholders give a merged quantity and unit box.
The formulas question should look like this: