This example is identical to the previous “Delayed matching to spatial sample” example except that we have added the ability to have “correction trials”. Any time a subject abandons the current trial we set a variable that indicates the next trial should be a correction trial. The correction trial does not move the positions of either the correct shape or distractor shapes – keeping the same location as the previous abandoned trial.

The codes are as follows, with the new code in bold and slightly larger font: