Millisecond Forums

branch question

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

By sjstran12 - 11/21/2014

Hey all,

I'm trying to get a timeout to branch to warning text. If I let it timeout, it goes to a warning but if I hit the correct response it goes to the warning as well.  Help please

<trial zpress>
/correctresponse = (50)
/responsetrial = (50, method2)
/branch = [ if (trial.zpress.timeout) trial.warnings]
/timeout = 5000
</trial>
By Dave - 11/21/2014

trial.zpress.timeout
A trial's timeout property returns the specified timeout, in your case 5000. You can see this for yourself by running

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
/ timeout = 5000
</trial>

<text mytext>
/ items = ("<%trial.mytrial.timeout%>")
</text>

In a branch condition, any non-zero value (here: 5000) will be interpreted as 'true'. Thus your branch always fires.

The correct way to do this is to check for 'no response'.

/branch = [ if (trial.zpress.response == 0) trial.warnings]