question
A question the reader answers, written in a scene's detail.


#Attributes
On any respond
respondThe kind of answer:
text, a typed word or phrase; choice, one or more of the body's options; maths, a value judged by what it is worth, so 2x + x answers 3x. It fills the head's slot, so question#q:maths{…} is the usual spelling, and it decides which of the attributes below apply.textchoicemathsCan be written as shorthand:
question:valuemarksWhat a right answer scores.A partly right
multiple choice scores a share of it.Default
1attemptsHow many answers the reader may check before the question closes. Absent, there is no limit. A maths answer that cannot be read is not checked and spends no attempt. A single-answer choice with two options and more than one attempt draws a warning.
Only with
textrespondexpectThe right answer. On a
text question, one or more accepted strings, any of which is right, compared ignoring case and extra spaces: expect: contour, level set. On a maths question, one value — a number, an expression in the letters variables: lists, a bracketed tuple, a vector or a matrix: expect: 8.1, expect: w / (L v t), expect: (2016, 6.72), expect: vec(3, -1), expect: mat(0, -1; 1, 0). A maths answer must be the same shape, and each part takes the same value at a fixed spread of points, so equivalent expressions match however they are written.Only with
choicerespondmultipleLets the reader tick any number of options, and needs at least one marked
correct. The score is the right options ticked less the wrong ones, as a share of the right options, never below 0 — so ticking every option scores nothing.Default
falseshuffleShows the options in an order drawn for each reader, kept with their answer so it is the same when they return.
Default
falseOnly with
mathsrespondexpectThe right answer. On a
text question, one or more accepted strings, any of which is right, compared ignoring case and extra spaces: expect: contour, level set. On a maths question, one value — a number, an expression in the letters variables: lists, a bracketed tuple, a vector or a matrix: expect: 8.1, expect: w / (L v t), expect: (2016, 6.72), expect: vec(3, -1), expect: mat(0, -1; 1, 0). A maths answer must be the same shape, and each part takes the same value at a fixed spread of points, so equivalent expressions match however they are written.variablesThe letters a maths answer may use.A Greek letter is listed by its name —
alpha, Omega — and a subscripted letter as written: x_1, v_max. An expectation using another letter is refused, and a reader's answer using one is marked incorrect, with the letter named.Default
xformThe form a maths answer must be written in once its value is right.
exact: no number with a decimal point, so 1/3 rather than 0.333. simplified: no arithmetic between numbers left undone except a fraction in lowest terms, and no *1, +0, ^1, x/x or sqrt(4). rounded(n), n from 0 to 10: a number written to exactly n decimal places, equal to the expectation rounded to n; refused on an expectation with letters. A right value in the wrong form is marked incorrect, and the reader is told the value was right.#Derived attributes
Computed while the element renders — read one with #id.name in attribute position or {{#id.name}} in prose, never set.
responseWhat the reader last answered, as text: the words typed, the chosen options' text joined with commas, or a maths answer as it was read, so
2*x reads back as 2x. Absent until they answer.verdictunanswered, correct, partial (a multiple choice partly right), incorrect, or indeterminate — a maths answer that could not be checked, because too few of the sampled points were defined for it. {{#q.verdict}} shows the word.correctWhether the last answer was right.
{{#q.correct}} shows yes or no; it is true or false, so it cannot be added up — total the scores instead.answeredWhether the reader has checked an answer.
scoreMarks awarded for the last answer:
marks: when right, a share of it for a partly right multiple, otherwise 0. It reads 0 before the reader answers, so a total in the prose is a number from the start.#Allowed content
#Allowed in
#Examples
question#shape:choice{
What shape is a contour of $f(L, v) = Lv$?
option{ A hyperbola }(correct)
option{ A straight line }[
That would be a contour of a sum.
]
}question#name-it:text{
What is a line of equal height called?
}(
expect: contour, isoline
)question#recover:maths{
Archard's law is $w = kLvt$. Write it for $k$.
}[
Divide both sides by everything that is not $k$.
](
expect: w / (L v t)
variables: w, L, v, t
marks: 2
attempts: 3
)question#reading:maths{
Read the wear at 4 kN off the chart.
}(
expect: 8.064
form: rounded(1)
)#Writing guidance
- Questions & tasks — A question beside only what it needs, opposite the task that sets it, after the reasoning rather than the answer.