I have four images (image_1, image_2, image_3, image_4) on screen and one of them is target. I want the trial to if one of the four images is selected (using mouse). And if the response selected is correct (corrAns), it gives score of 1 or score of 0.
for stimulus in [image_1, image_2, image_3, image_4]:
# check if the mouse is pressed within the current one: if mouse.isPressedIn(stimulus): # Yes, so store the reaction time in the data: thisExp.addData('RT', t) # check if the stimulus' image filename matches the correct answer: if stimulus.image == eval(corrAns): thisExp.addData('correct_responses', 1) else: thisExp.addData('correct_responses', 0) # end the trial once done here: continueRoutine = False # stop any further checking: break
It runs but the problem is …
It skips through some items in my ‘condition’ file. For example I have 47 items/trials in my condition file but it plays only 15 or so items.I have a feeling that it skips through the items.
Note the same experiment works perfectly, if I remove the code component and set the mouse click to ‘end routine’. So I understand that there is something wrong with the code that is causing this problem. I need the code so I can register the correct response.
Can anybody figure out what the problem is
conditions.xlsx (11.5 KB)
Routine1,Recall, Mouse.psyexp (13.2 KB)
I am also attaching the program
Thanks for your help.