up Inquisit Language Reference

responseText property

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

Member of

<block> <expt> <likert> <openended> <sliderTrial> <survey> <surveyPage> <trial> <caption> <checkboxes> <dropdown> <image> <listbox> <radioButtons> <slider> <textbox>

Syntax

object.name.responseText

Read Only

Type

string

Remarks

responseText refers to the label of a given response. For example, responseText of key 'A' is 'A'. Using 'responseText' can be less confusing than using 'response' for keyboard driven scripts, as 'response' stores a scancode instead, e.g. the scancode of key 'A' is 30. Note that the 'responseText' for the spacebar will be noted in the datafile as an empty field whereas 'response' will show the scancode of 57.

If the element is used in a block element, 'this' returns the responseText given on the most recent trial that was run within the block. If the element is a trial, 'this' returns the responseText given the last time the trial was run.

Examples

The following displays the value of responseText in a text stimulus:

<text myText>
/ items= ("responseText = <% trial.myTrial.responseText %>")
</text>

The following displays the value of responseText in an instruction page:

<page myPage>
responseText = <% trial.myTrial.responseText %>
</page>

The following trial code shows an example of how to store the responseText of the given response in a custom variable 'values.resp' (Note: 'this' represents 'trial.myTrial' in this context).

<trial myTrial>
/ stimulusFrames = [1 = go]
/ validResponse = ("A", "B")
/ onTrialEnd = {
  values.resp = this.responseText; //will save either 'A' or 'B', depending on which key was pressed
}
</trial>

Copyright Millisecond Software, LLC. All rights reserved.