+x+xThe error message is informative. For starters set:
/ branch = [if (trial.a1.response == 57) trial.a1]
The '=' is an assignment operator, while '==' is a comparison operator. That should fix the error message and make the branch functional. However, if any of the stims (i.e. start, blank, square1) has more than one item, the repeated trial will display a different item than its first instance (unless you've taken precautions against this).
~Dave
Hi Dave, thanks so much for this answer. I was wondering about the last thing you said- how would we take precautions against the stim loading different items? I'd like to repeat an item if subjects get it wrong, but after showing an error message.
You'll have to do something like this:
<values>
/ exampleitem = 1
</values>
<block exampleblock>
/ trials = [1-4 = example]
</block>
<trial example>
/ ontrialbegin = [if (trial.example.trialcount < 1 || trial.example.correct) values.exampleitem = list.items.nextindex]
/ stimulusframes = [1=examplestimulus]
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ errormessage = true(errormsg, 1000)
/ branch = [if (trial.example.error) trial.example]
</trial>
<list items>
/ poolsize = 4
</list>
<text examplestimulus>
/ items = exampleitems
/ select = values.exampleitem
</text>
<item exampleitems>
/ 1 = "Example A"
/ 2 = "Example B"
/ 3 = "Example C"
/ 4 = "Example D"
</item>
<text errormsg>
/ items = ("X")
/ txcolor = red
/ position = (50%, 75%)
</text>
I.e. only select a new item number if the response given in the previous instance of the trial was correct.