Type the answer
Collect a free-typed answer in an input box on a test trial and score it against the expected text.
When to use it
Section titled “When to use it”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.
Trial file
Section titled “Trial file”| type | stimFormat | stim1 | responseType | required | key |
|---|---|---|---|---|---|
| test | word | What is the capital of France? | box | 1 | Paris |
| test | word | How many legs does a spider have? | box | 1 | 8 |
| test | word | What colour is a ripe banana? | box | 1 | yellow |
| test | word | Which planet is closest to the sun? | box | 1 | Mercury |
| test | word | What is 7 times 6? | box | 1 | 42 |
type,stimFormat,stim1,responseType,required,key test,word,What is the capital of France?,box,1,Paris test,word,How many legs does a spider have?,box,1,8 test,word,What colour is a ripe banana?,box,1,yellow test,word,Which planet is closest to the sun?,box,1,Mercury test,word,What is 7 times 6?,box,1,42
How it works
Section titled “How it works”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.
Variations
Section titled “Variations”- Accept several spellings or casings by joining alternatives with
|inkey, for exampleParis|paris. - Score leniently on content with
has(...)inkey:has(42)accepts42,it is 42and other wrappings. - Ask for several answers at once with
box*3inresponseType; the boxes’ values are saved together, andrequiredthen forces every box to be filled before Enter submits. - Configure the input itself through
responseOptions, which passesattr:valuepairs to the box, for exampleplaceholder:Type your answer;maxlength:20.