required
Experiments Surveys & forms In surveys, exactly 1 makes the question required; on experiment trials with slider, box, or label responses other values configure requiredness per response type.
Marks a survey question or response widget as mandatory, so the participant cannot advance without answering. The exact semantics depend on the trial context; there are four distinct behaviors:
type=formtrials:requiredset to exactly1makes the question required.- Non-form trials with
responseType=slider: any non-empty value makes the slider “required”, which hides the Next button until the slider is touched. - Non-form trials with
responseType=label(drag-and-drop labeling):requiredcarries a structured minimum-condition syntaxlabels:N;stim:Nthat gates the submit button. - Non-form trials with
responseType=box/box*N: any non-empty value requires every input box to be non-empty. On Enter submission a translated error message is shown until all boxes are filled; on button submission an empty first box makes the button click do nothing.
Syntax
Section titled “Syntax”Put 1 in the cell to make the question required.
Form trials (must be exactly 1):
required1Slider and box trials (any non-empty value activates it):
required1Label trials (semicolon-separated key:value conditions):
requiredlabels:3;stim:2Options
Section titled “Options”| Context | Value | Behavior |
|---|---|---|
type=form | exactly 1 | the question becomes required; with responseRows, every generated row input is also required, and matrix questions additionally require every matrix row to be answered, not just one; a required form slider must be touched (click/drag/keyboard) before the survey validates |
type=form | anything else (0, yes, true) | not required; only the exact value 1 works, no other spelling |
responseType=slider (non-form trial) | any non-empty value | the Next button is not shown initially and only appears after the slider is touched |
responseType=label (non-form trial) | labels:N | at least N labels must be used before the submit button shows |
responseType=label (non-form trial) | stim:N | at least N stims must be labeled before the submit button shows |
responseType = box / box*N (non-form) | any non-empty value | on Enter, every box must contain a value, else a red error message is displayed and the trial does not end; with custom buttons, a button click while the first box is empty silently does nothing |
responseType in {mic,clicks,comment,drag} (non-form) | any | no effect for these response types; for comment, mandatory input comes from a required token inside responseOptions instead |
Defaults & missing values
Section titled “Defaults & missing values”When the column is absent or the cell is left blank, nothing is required in any context: form questions, sliders, boxes and label trials all let the participant advance without answering.
Works with
Section titled “Works with”responseRows(form trials): when rows exist,checkboxes/radiobecome a single matrix question, andrequired=1demands an answer in every matrix row, not just one; all other response types are generated one input per row, and each row’s input becomes required.- Form sliders (
type=form,responseType=slider): a required form slider must actually be touched (clicked, dragged, or operated by keyboard) before the survey validates; the slider sitting at its start value does not count as an answer. Conversely, an untouched slider that is not required is recorded as unanswered rather than at its start value. - JSON forms: when the
formcolumn references JSON form data, the form renders from that JSON and this column is not read. - Buttons plus slider: a required slider (or a trial with active
button1-button6) suppresses the initial Next button, which is then added on first touch unlessresponseOptionscontainsnoButton. responseOptions: arequiredtoken inresponseOptionsalso exists forbox/comment. Forcommentit is the only requiredness mechanism. Forboxthe token only produces the browser’s own invalid-field styling; the actual validation reads this column instead.
Examples
Section titled “Examples”Required survey question (must be exactly 1):
| type | responseType | head | responseOptions | required |
|---|---|---|---|---|
| form | radio | Do you consent? | Yes;No | 1 |
type,responseType,head,responseOptions,required form,radio,Do you consent?,Yes;No,1
Required slider on a test trial (Next appears only after the participant moves/touches the slider):
| type | responseType | responseOptions | required |
|---|---|---|---|
| test | slider | 0;100 | 1 |
type,responseType,responseOptions,required test,slider,0;100,1
Label trial requiring at least 2 labels placed on at least 2 stims:
| type | stimFormat | stim1 | stim2 | stim3 | responseType | responseOptions | required |
|---|---|---|---|---|---|---|---|
| test | .jpg | face1 | face2 | face3 | label | Happy;Sad;Angry | labels:2;stim:2 |
type,stimFormat,stim1,stim2,stim3,responseType,responseOptions,required test,.jpg,face1,face2,face3,label,Happy;Sad;Angry,labels:2;stim:2
Three input boxes that must all be filled before Enter submits:
| type | stimFormat | stim1 | responseType | required |
|---|---|---|---|---|
| test | .jpg | scene | box*3 | 1 |
type,stimFormat,stim1,responseType,required test,.jpg,scene,box*3,1
Tips & gotchas
Section titled “Tips & gotchas”- The label-trial syntax (
labels:N;stim:N) gives this column a completely different grammar; unknown keys are silently ignored. - On non-form trials,
requiredhas no effect forresponseTypevalues other thanslider,labelandbox/box*N; forcommentuse therequiredtoken insideresponseOptions.
- Box enforcement happens at submission time and covers all boxes of a
box*Ntrial when submitting with Enter, but the button-click check looks only at the first box, so on abox*Ntrial with buttons the other boxes can be left empty when submitting via a button.
Common combinations
Section titled “Common combinations”required appears in these worked recipes:
- Label choice task: Let participants assign on-screen text labels to images by drag and drop, requiring a minimum amount of labelling before they can continue.
- Slider rating trial: Rate each stimulus on a configurable slider scale inside an experiment trial.
- Type the answer: Collect a free-typed answer in an input box on a test trial and score it against the expected text.
- Factorial vignette study: Show each participant one version of a scenario from a factorial design, then have everyone rate it on the same questions.
- Likert scale with scored options: Sum a block of likert items into a named scale total by attaching points to each answer option.