A choice response allows participants to choose between several alternatives.
"type"
must be specified as "choice"
.choices
{
"type": "choice",
"choices": ["optionA", "optionB"]
}
"optionA"
) or the names of a defined image, video, or text stimulus, in a special format ("%s:name-of-stimulus"
). Plain text labels and stimulus references can be mixed, but in some cases, it doesn't make sense to do so (e.g., mixing labels and videos).multi_select
, which currently works for plain text labels only.Example using plain text labels
{
"type": "choice",
"choices": ["optionA", "optionB"]
}
Example using stimulus references
{
"type": "choice",
"choices": ["%s:stimulus1", "%s:stimulus2"]
}
true,false
false
{
"type": "choice",
"choices": ["optionA","optionB"],
"duration_timer": true
}
Relevant only if "duration_timer"
is true
.
"start"
, the timer will appear as soon as the response is displayed and animate a stopwatch effect. When set to "end"
, the duration timer will only appear once the participant has made a reponse with no stopwatch effect."start"
, "end"
"start"
{
"type": "choice",
"choices": ["optionA","optionB"],
"duration_timer": true,
"duration_timer_onset": "start"
}
Relevant only if "target"
is defined.
"target"
, participants will be informed that their response is correct ("Your response is correct!"), and they will hear a “ding!” bell sound. If the option selected does not match the "target"
, participants will be informed of the correct response ("Sorry! The correct answer is highlighted in green."), and they will hear a “buzz” sound.true
,false
false
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"target": "optionC",
"feedback": true
}
Relevant only if "target"
is defined and "feedback"
is true
.
"target"
is defined and "feedback"
is set to true
, by default, participants will receive auditory feedback on their responses (a “ding!” bell sound for correct responses and a “buzz” sound for incorrect responses). Setting "feedback_audio"
to false
disables these sounds.true
,false
true
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"target": "optionC",
"feedback": true,
"feedback_audio": false
}
"px"
, "em"
, or "rem"
, or 2) a percentage of the default size{
"type": "choice",
"choices": [
"LEFT",
"RIGHT"
],
"font_size": "25px",
"target": "LEFT",
"instruction": "Choose wisely, Indiana Jones!"
}
Relevant only when "key_mapping"
is defined
false
, the text will not be visible (which may potentially cause confusion for participants as to how to continue the study if key_only
is set to true
).true,false
true
{
"type": "choice",
"choices": ["optionA", "optionB"],
"key_mapping": ["F","J"],
"key_only": true,
"hint": true
}
Relevant only if "multi_select"
is true
and target
is defined
true
,false
false
"feedback"
is true
and "incremental_feedback"
is false
, then participants will only receive feedback after they confirm their selections. If "incremental_feedback"
is true
and "feedback"
is false
, then participants will receive feedback after each selection, but not once they confirm all of their selections.{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"multi_select": true,
"incremental_feedback": true,
"target": ["optionA", "optionB"]
}
""
) to remove the instruction text.{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"instruction": "The text in these quotation marks will be displayed."
}
["F", "J"]
), specifying which key can be pressed to choose the option presented."locations"
is "fixed"
(the default), the first key (e.g., "F"
) will correspond to the first option listed in choices
, the second key (e.g., "J"
) will correspond to the second option listed in "choices"
, etc."locations"
is set to "random"
, key mappings will not be randomly assigned alongside options. Rather, keys will be mapped to options appearing from left to right. For example, the first key (e.g., "F"
) will correspond to the option randomly assigned to appear on the left, the second key (e.g., "J"
) will correspond to the option randomly assigned to appear to the right of the first, etc. That is, correspondence between options and keys is location-aligned (keys are tied to locations rather than to particular options).{
"type": "choice",
"choices": ["optionA", "optionB"],
"key_mapping": ["F", "J"]
}
In this example, because "locations"
is left at its default setting, optionA will appear on the left, with the instruction to press F, and optionB will appear on the right, with the instruction to press J. However, if "locations"
were set to random, F would always be associated with the option on the left, and J with the option on the right, but the locations of optionA and optionB would be randomized.
Relevant only if key_mapping
is set.
"key_mapping"
is defined, setting this property to true
will allow participants to respond with key presses only.true
,false
false
{
"type": "choice",
"choices": ["optionA", "optionB"],
"key_mapping": ["F", "J"],
"key_only": true
}
"choices"
. Options may be displayed in multiple rows if desired.[M, N]
, where M is the number of rows and N is the number of options per row (e.g. [2,2]
, corresponding to options displayed in 2 rows, with 2 options per row)."horizontal"
and "vertical"
are also available, standing for [1, N]
and [M, 1]
, respectively. That is, setting "layout"
to "horizontal"
places all options in one row, while setting "layout"
to "vertical"
places all options in one column.[1, N]
, where N is the number of options defined in choices
(equivalent to text shortcut "horizontal"
)"choices"
. For example, when there are 4 options, [1, 4]
, [2, 2]
, and [4, 1]
are valid layout options.{
"type": "choice",
"choices": ["optionA", "optionB", "optionC", "optionD"],
"layout": [2, 2]
}
In this example code, "optionA"
and "optionB"
appear in one row, and "optionC"
and "optionD"
in another.
"fixed"
or "random"
"fixed"
"fixed"
(or by default), options will be displayed in the order in which they are listed in "choices"
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC", "optionD"],
"locations": "random"
}
Avalable since August 14, 2023
Definition: The display mode for the choice options. By default (i.e., not specifying the mode explicitly), each choice is displayed as a button. The alternative is to display the options as a dropdown (important: see the warning message below).
Possible values: "button"
,"dropdown"
Default: "button"
Dropdown for single-select only: Setting both multi_select to
true
and mode to"dropdown"
will crash an experiment. We are working on supporting this feature in the next study grammar update.
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC", "optionD"],
"mode": "dropdown"
}
"choices"
. Participants will be prompted to confirm their responses (via a "Confirm" button) before submitting them.true
,false
false
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC", "optionD"],
"multi_select": true
}
Relevant only if "target"
is defined and "multi_select"
is true
"target"
to be considered correct.true
, false
false
"target"
.{
"type": "choice",
"choices": ["optionA", "optionB", "optionC", "optionD", "optionE", "optionF"],
"target": ["optionC", "optionE"],
"multi_select": true,
"ordered": true
}
In this example, if participants select optionC first and optionE second, then their response will be marked as correct. However, if participants select optionE first and optionC second, then their response will be marked as incorrect.
Given a response named "choices1"
that is defined as follows:
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"instruction": "Please indicate which of the following options you find most appealing"
}
We can define a second response called "choices2"
that inherits the instruction of "choices1"
but has it own set of choices:
{
"type": "choice",
"choices": ["optionD", "optionE", "optionF"],
"parent": "choices1"
}
Available since November 11, 2022 (Grammar Version 3.4.0)
locations
is set to "random".true
, false
"false"
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC", "optionD", "optionE", "optionF"],
"record_location": true
}
In this example, the results CSV will include the location of the choice selected by the participant within the "response_mode" column. For example, if the participant selects optionA, the "response_mode" column will include "1", representing the first choice location (or "2" for optionB, "3" for optionC, etc.).
Note that this is most useful if locations
is set to "random", as the locations of the choices can not be determined based on their ordering in the response definition.
"target"
is defined, those options will always be presented and count towards k. The number of options not specified as targets that are displayed will be equal to k - the number of defined targets."choices"
"choices"
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"target": "optionC",
"sample_k": 2
}
Here, optionA will be automatically displayed because it is defined as a "target"
. In addition, one (k - 1) of the remaining options (optionB or optionC, determined at random) will be presented.
"choices"
.["correct"]
) or stimulus reference (e.g., ["%s:stimulus1"]
). Also supported: lists of plain text labels (e.g., ["correct", "also correct"]
) or stimulus references (e.g., ["%s:stimulus1", "%s:stimulus2"]
.{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"target": "optionC"
}
Relevant only if "target"
is set
true
, participants must select an answer that matches the "target"
as defined above in order to continue the study.true
,false
false
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"target": "optionC",
"target_match": true
}
"feedback"
is set to true
, then feedback will be given.1.5
)0
, meaning that the choice response stays active indefinitely until a participant response is received.{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"timeout": 5
}
true
,false
false
{
"type": "choice",
"choices": ["optionA", "optionB", "optionC"],
"wrap": true
}
"target"