Choice Block
The choice
block provides the ability to present the participant a number of options to choose from. This can be in the shape of radio buttons or a number of checkboxes. A choice
block has to be specified within a response
block. The structure of this block is summarised below.
Parameters
- options
- Required.
List of Strings that specifies the text for the various options. Theoptions
must consist of at least one element and can not contain any blank texts. - identifiers
-
Optional, defaults to increasing numbers
[1, 2, 3, ...]
.
List of Strings that identify the options presented in the choice block. The elements ofidentifiers
have to be unique and can each consist of a maximum of 10 characters. If not specified,identifiers
defaults to a list of increasing numbers, of the same length as theoptions
List.Tip
We recommend you supply this parameter. This parameter can later, during your analysis of results, help identify which choice a result belongs to.
- default_selection
-
Optional, defaults to empty list.
String or list of Strings that specify which options are selected by default. The elements ofdefault_selection
must also appear in theidentifiers
List.- When the type
RADIO
is used, thedefault_selection
can contain maximally one element. - When the type
BUTTONS
is used, thedefault_selection
should not be specified.
- When the type
- type
- Optional, defaults to
CHECKBOX
.
Keyword taking the value of eitherCHECKBOX
,RADIO
, orBUTTON
and specifying the type of selection of the options.- The type
CHECKBOX
can accept multiple answers and needs to be confirmed using another response, such as a button, or maximal duration. - The type
RADIO
can accept only one answer and needs to be confirmed using another response, such as a button, or maximal duration. - The type
BUTTON
can accept only one answer and will immediately continue the trial, much like combining theRADIO
type with a regularbutton
response combined.
- The type
- layout
- Optional, defaults to
VERTICAL
.
Keyword taking the value of eitherVERTICAL
orHORIZONTAL
, specifying in which way the options are aligned. - require_selection
-
Optional, defaults to
true
. Boolean that specifies whether at least one selection of the options is required.When the type
BUTTONS
is used,require_selection
takes no effect. To enforce a selection, leave out abutton
response and trialmax_duration
.
Example usage
The code below illustrates how the choice
block might be used.
experiment {
trial {
response {
choice {
options = ["one", "two", "three"]
default_selection = 1 //(1)
type = RADIO
layout = HORIZONTAL
}
button
}
}
}
- Since the
identifiers
have defaulted to[1, 2, 3]
, the current specification of thedefault_selection
now selects the first option ("one"
).
experiment {
trial {
stimulus {
text = "What do you like about dogs?"
}
response {
choice {
options = ["I like that their tails wiggle when they are excited.",
"I like how friendly dogs are.",
"I like that they get excited when I get home from work."]
identifiers = ["tails", "friendly", "home"]
default_selection = ["tails", "home"]
type = CHECKBOX
}
button
}
}
}