Struggling to define acc for feedback
My experiment is an oddity task where a participant hears three sounds and click on the circles that lit up with the sound that was the odd one out. The cursor_roi are coded as 'left', 'centre' and 'right' for the positions of the circles.
After the mouse click response I have used the inline script below, which successfully runs feedback after each trial.
if var.target_visual in var.cursor_roi: var.correct = 1 else: var.correct = 0
However, I want to give feedback at the end of the block with acc% but I cannot figure out how to define the variable. I tried adding the variable 'correct_response' to the block loop, however when I use 'left', 'right' and 'centre' or [target_visual] in order to correspond to the correct roi the experiment no longer runs and says that they are invalid.
Could you let me know where I'm going wrong?