Skip to content

Type the answer

Collect a free-typed answer in an input box on a test trial and score it against the expected text.

Use this when recognition among offered options would contaminate the measure and you need recall: general-knowledge questions, cued recall, mental arithmetic, translation. Buttons and multiple choice let participants answer by elimination, while a typed response only succeeds when the answer is actually retrieved. For longer open-ended text, a multi-line comment response fits better, and for graded partial credit you will be scoring the typed strings offline anyway.

typestimFormatstim1responseTyperequiredkey
testwordWhat is the capital of France?box1Paris
testwordHow many legs does a spider have?box18
testwordWhat colour is a ripe banana?box1yellow
testwordWhich planet is closest to the sun?box1Mercury
testwordWhat is 7 times 6?box142

Each question is a word stimulus, and responseType set to box puts a single text input under it. Strictly, a one-stimulus test trial with no keyboard or buttons falls back to an input box anyway; writing box makes the intent explicit and keeps the behaviour if a second stimulus is ever added (two stimuli would otherwise flip the trial into click mode). While responseType is box, keyboard response collection is disabled, so typing letters never ends the trial early; pressing Enter submits.

required with any non-empty value stops empty submissions: on Enter with an empty box, an error message shows and the trial does not end.

key holds the expected text, and the typed response is scored against it into the correct results column, 1 for a match and 0 otherwise. The comparison is case-sensitive, with a twist worth designing around: a response that matches the key only after ignoring case, such as paris against a key of Paris, is recorded as unscored (a blank correct cell), not as incorrect. Blanks in correct therefore mean “right word, wrong casing” as well as “unscored trial”, which silently distorts accuracy averages. Either list the casings you accept as alternatives in key (see Variations) or use answers with no natural capitalisation.

  • Accept several spellings or casings by joining alternatives with | in key, for example Paris|paris.
  • Score leniently on content with has(...) in key: has(42) accepts 42, it is 42 and other wrappings.
  • Ask for several answers at once with box*3 in responseType; the boxes’ values are saved together, and required then forces every box to be filled before Enter submits.
  • Configure the input itself through responseOptions, which passes attr:value pairs to the box, for example placeholder:Type your answer;maxlength:20.