+xI am having trouble with conditional branching in my experiment.
I want it so that there is training to criterion on a particular block, i.e. the block keeps running until a criterion is met (32/36 trials correct) with a maximum of say 6 blocks.
This is the syntax I’ve been using but it just doesn’t seem to work (the block keeps running in a loop, rather than skipping ahead when the number after the ‘>’ is reached - in this case '1' but the number doesn't seem to make a difference):
This is what I am copying from the help manual, but it doesn’t work:
Any advice on how to get this working would be greatly appreciated. I'm guessing it isn't too complicated, I must just be missing something.
Something like this should work:
<block training>
/ postinstructions = (summary)
/ trials = [1-36=noreplace(a,b)]
/ branch = [
if (block.training.correctcount < 32 && block.training.totalcount < 5)
block.training]
</block>
<block end>
/ preinstructions = (endoftraining)
</block>
<expt>
/ blocks = [1=training; 2=end]
</expt>
<trial a>
/ stimulusframes = [1=a, debug]
/ validresponse = ("a", "b")
/ correctresponse = ("a")
</trial>
<trial b>
/ stimulusframes = [1=b, debug]
/ validresponse = ("a", "b")
/ correctresponse = ("b")
</trial>
<text a>
/ items = ("correct response is A")
</text>
<text b>
/ items = ("correct response is B")
</text>
<text debug>
/ items = ("n correct: <%block.training.correctcount%> | training blocks completed: <%block.training.totalcount%>")
/ position = (50%, 10%)
/ size = (70%, 5%)
/ erase = false
</text>
<page summary>
^training block #<%block.training.totalcount%> complete.
^n correct in this block: <%block.training.correctcount%>
</page>
<page endoftraining>
^the training part is now over
</page>