question

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

On this page
A maths question asking for the wear read off a chart to one decimal place. The reader has typed 8.064, shown typeset beneath the field, and been told it is the right value but must be given to one decimal place.A maths question asking for the wear read off a chart to one decimal place. The reader has typed 8.064, shown typeset beneath the field, and been told it is the right value but must be given to one decimal place.

#Attributes

On any respond
respondRequiredImplicit
The 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.
textchoicemaths
Can be written as shorthand: question:value
marks
What a right answer scores.A partly right multiple choice scores a share of it.
Default1
attempts
How 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 withtextrespond
expectRequired
The 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 withchoicerespond
multiple
Lets 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.
Defaultfalse
shuffle
Shows the options in an order drawn for each reader, kept with their answer so it is the same when they return.
Defaultfalse
Only withmathsrespond
expectRequired
The 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.
variables
The 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.
Defaultx
form
The 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.

responseDerived
What 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.
verdictDerived
unanswered, 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.
correctDerived
Whether 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.
answeredDerived
Whether the reader has checked an answer.
scoreDerived
Marks 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

Body { } — the respond decides which of these are drawn

#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.

Last updated