Skip to content

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:

  1. type=form trials: required set to exactly 1 makes the question required.
  2. Non-form trials with responseType=slider: any non-empty value makes the slider “required”, which hides the Next button until the slider is touched.
  3. Non-form trials with responseType=label (drag-and-drop labeling): required carries a structured minimum-condition syntax labels:N;stim:N that gates the submit button.
  4. 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.

Put 1 in the cell to make the question required.

Form trials (must be exactly 1):

required
1

Slider and box trials (any non-empty value activates it):

required
1

Label trials (semicolon-separated key:value conditions):

required
labels:3;stim:2
ContextValueBehavior
type=formexactly 1the 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=formanything else (0, yes, true)not required; only the exact value 1 works, no other spelling
responseType=slider (non-form trial)any non-empty valuethe Next button is not shown initially and only appears after the slider is touched
responseType=label (non-form trial)labels:Nat least N labels must be used before the submit button shows
responseType=label (non-form trial)stim:Nat least N stims must be labeled before the submit button shows
responseType = box / box*N (non-form)any non-empty valueon 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)anyno effect for these response types; for comment, mandatory input comes from a required token inside responseOptions instead

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.

  • responseRows (form trials): when rows exist, checkboxes/radio become a single matrix question, and required=1 demands 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 form column 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 unless responseOptions contains noButton.
  • responseOptions: a required token in responseOptions also exists for box/comment. For comment it is the only requiredness mechanism. For box the token only produces the browser’s own invalid-field styling; the actual validation reads this column instead.

Required survey question (must be exactly 1):

typeresponseTypeheadresponseOptionsrequired
formradioDo you consent?Yes;No1

Required slider on a test trial (Next appears only after the participant moves/touches the slider):

typeresponseTyperesponseOptionsrequired
testslider0;1001

Label trial requiring at least 2 labels placed on at least 2 stims:

typestimFormatstim1stim2stim3responseTyperesponseOptionsrequired
test.jpgface1face2face3labelHappy;Sad;Angrylabels:2;stim:2

Three input boxes that must all be filled before Enter submits:

typestimFormatstim1responseTyperequired
test.jpgscenebox*31
  • The label-trial syntax (labels:N;stim:N) gives this column a completely different grammar; unknown keys are silently ignored.
  • On non-form trials, required has no effect for responseType values other than slider, label and box/box*N; for comment use the required token inside responseOptions.
  • Box enforcement happens at submission time and covers all boxes of a box*N trial when submitting with Enter, but the button-click check looks only at the first box, so on a box*N trial with buttons the other boxes can be left empty when submitting via a button.

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.