up Inquisit Language Reference

response property

The last response given by the participant for the specified element.

Member of

<block> <expt> <likert> <openended> <sliderTrial> <survey> <surveyPage> <trial>

Syntax

event.name.response

Read Only

Type

value

Remarks

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.

Examples

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>

Copyright Millisecond Software, LLC. All rights reserved.