Millisecond Forums

Inserting a value for validresponse attribute

https://forums.millisecond.com/Topic15920.aspx

By DCole9 - 4/3/2015

Hi Inquisiteers,
I'm trying to change the validresponse of a trial based on user input (right or left handed) to ensure the button they need to press is for their non-dominant hand.  I'm running into an issue using the typical <%values.handedness%> formula.

Here is what I've tried.
<values>
/handedness = 38
</values>
<trial mytrial>
/stimulusframes = [1 = fixation, target]
/validresponse = (<%values.handedness%>)
</trial>

I've tried /handedness = "38", ("<%values.handedness%>"), (values.handedness), and plain <%values.handedness, to no avail.
Is this not possible to do or is there perhaps another way to solve the problem?

Thanks!

By Dave - 4/3/2015

You ought to use /isvalidresponse, not /validresponse, as in

<trial sometrial>
...
/ isvalidresponse = [trial.sometrial.response == values.handedness]
...
</trial>
By DCole9 - 4/3/2015

Thanks Dave, did the trick.