The last response given by the participant for the specified element.
<block> <expt> <likert> <openended> <sliderTrial> <survey> <surveyPage> <trial>
event.name.response
Read Only
value
If the element is a block, this returns the response given on the most recent trial that was run within the block. If the element is a trial, this returns the response given the last time the trial was run.
For trials with keyboard input, 'response' will store the scancode of the key that was pressed.
The following displays the value of response in a text stimulus:
<text myText>
/ items= ("response = <% trial.myTrial.response %>")
</text>
The following displays the value of response in an instruction page:
<page myPage>
response = <% trial.myTrial.response %>
</page>
The following trial code with keyboard input shows how to save the given response in a custom variable 'values.resp'. For keyboard responses, 'response' provides the keys's scancode.
<trial myTrial>
/ inputDevice = keyboard
/ stimulusFrames = [1 = go]
/ validResponse = ("A", "B")
/ onTrialEnd = {
values.resp = this.response; //will save either '30' (scancode for A) or '48' (scancode for B)
}
</trial>
The following trial code with mouse/touch input shows how to save the given response in a custom variable 'values.resp'.
<trial myTrial>
/ inputDevice = mouse
/ stimulusFrames = [1 = go]
/ validResponse = (leftBox, rightBox)
/ onTrialEnd = {
values.resp = this.response; //will either save 'leftBox' or 'rightBox'; depending on the given response
}
</trial>