PsychoPy version 2023.1.2
I have a forced choice paradigm which shows two images using two separate image components (left_image, right_image) linked to columns in an excel sheet (excel sheet is in a loop). I want to use the mouse component so participants can select either the left or right image with the mouse, however, I heard this has a bug on this version of psychopy so I added a code component that I got from the forum (see below) to control the clicks, it runs for one trial (i.e shows the two faces and I can click one) and then after I select the face it goes to the second trial (i.e shows the next two faces from the excel file), however when I select the face on the second trial the experiment crashes with exit code 0. Maybe this is because the mouse click is not resetting each trial so it only works for the first one? How can I fix this?
CODE COMPONENT:
begin routine…
clickables = [left_image, right_image]
gotValidClick = False
each frame…
for click in clickables:
if mouseCFD.isPressedIn(click) and not gotValidClick:
gotValidClick = True # mark that this trial got a click
continueRoutine = False