Response Block
The response
block provides the ability to request a response from the participant to a provided stimulus
block. The structure of this block is summarised below.
Parameters
Note
Take note that these response
parameters are both optional itself and have an optional value. Not including the parameter at all excludes it from your trial, whereas specifying the parameter without value, includes it in your experiment with its default value.
- button
-
Optional, default value is localised 'Continue'.
Adds a button to the trial that will advance the trial if possible.
Optional String that specifies the text on the button to be shown to the participant.Example:
button = "Submit answer"
or simplybutton
to use the default value instead. - keyboard
-
Optional, default value is
[SPACE]
.
Adds a keyboard listener that will advance the trial if possible.
Optional list of Strings or Keywords that specifies character keys that can be used to advance the trial.Example:
keyboard = ["f", "j", ENTER]
or simplykeyboard
to use the default value instead.keyboard
has the following available Keywords:SPACEBAR
,ENTER
,ARROW_LEFT
,ARROW_UP
,ARROW_RIGHT
andARROW_DOWN
. Like all Keywords, these are used without surrounding quotes.
Members
- choice
- Optional.
choice
response that presents a number of choices. - slider
- Optional.
slider
response that presents a slider. - speech
- Optional.
speech
response that presents an audio recording response. - textfield
- Optional.
textfield
response that presents a textfield to type in.
Shorthands
- textfield
-
Optional String that specifies a
textfield
response with theplaceholder
set to the provided String.Example:
textfield = "Write your answer here"
or simplytextfield
to use the defaultplaceholder
instead.This shorthand with an optional value differs from the
textfield
member of aresponse
block. A shorthand always has a single value if any, whereas a member is a block with its own parameters for greater control. - choice
-
List of Strings that specifies a
choice
response with theoptions
set to the provided List.Example:
choices = ["High", "Moderate", "Low"]
.
Example usage
The code below illustrates how a response
block might be used.
experiment {
trial {
stimulus {
text = "Press the 'F' key for female speech and 'M' for male speech"
}
response {
button
}
}
trial {
stimulus {
audio = "audio_sample.mp3"
}
response {
keyboard = ['F', 'M']
}
}
}