Millisecond Forums

iscorrectresponse gets evaluated even if response was not valid

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

By Blackadder - 6/20/2015

Hi All,

I have defined a trial in which certain probe stimuli are shown and the observer has to click on a specific one of those stimuli (i.e., inputdevice = mouse). All stimuli are presented in front of a screen-wide background stimulus covering the complete display area. This background stimulus is not contained in the /validresponse property.

The names of the actual probe stimuli all contain a trailing index number so that I should be able to do this:

/ iscorrectresponse = [evaluate(substring(trial.trialname.response,5,1)) == 5]


What I'd expect to happen is that the /iscorrectresponse property is only invoked when the observer clicks on one of the valid stimuli. It shall not be invoked if the observer clicks somewhere in the background.

This is not what happens. The /iscorrectresponse property is invoked every time the observer clicks anywhere. Hence, the code produces expression errors whenever the background stimulus - the name of which does not end with a number - is clicked.

Is that supposed to happen?
By Dave - 6/21/2015

Based on your description, I assume you do something along the lines of (greatly simplified)

<block myblock>
/ trials = [1-4=trialname]
</block>

<trial trialname>
/ inputdevice = mouse
/ stimulusframes = [1=background, stim15, stim14]
/ validresponse = (stim15, stim14)
/ iscorrectresponse = [substring(trial.trialname.response,5,1) == "5"]
</trial>

<shape background>
/ shape = rectangle
/ size = (100%, 100%)
/ color = (blue)
</shape>

<text stim15>
/ items = ("A")
/ position = (40%, 50%)
</text>

<text stim14>
/ items = ("B")
/ position = (60%, 50%)
</text>

With the above I am unable to reproduce the issue you observed. The background stimulus is not accepted as response and the /iscorrectresponse evaluation works as expected.

I suspect there is something about your setup that I'm missing; what that is, I unfortunately have no idea.
By Blackadder - 6/26/2015

Dear Dave,

your code is spot-on. I'm going to compare our code to yours and post the result here.

Bye, Malte