OS: Win 10
PsychoPy version: v2020.2.5
I’m helping friend of mine with her thesis about Ranchsburg effect - a set of pictures are presented to the user - user then have to click on them in the same order.
The routine where user should click on the images contains:
7 image stimulis
1 mouse component
code
The idea is to check on what image user clicked and save it to results.
The code is pretty simple, in Begin Routine I’ve just declared variable:
selected_images=0
and in Each Frame block:
if selected_images == 6:
continueRoutine = False
if mouse1.isPressedIn(img1_Sidewalk1_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Sidewalk1_q)
elif mouse1.isPressedIn(img1_Cups1_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Cups1_q)
elif mouse1.isPressedIn(img1_Bark2_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Bark2_q)
elif mouse1.isPressedIn(img1_Cups2_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Cups2_q)
elif mouse1.isPressedIn(img1_Bark1_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Bark1_q)
elif mouse1.isPressedIn(img1_Sidewalk3_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Sidewalk3_q)
elif mouse1.isPressedIn(img1_Yarn4_q):
selected_images+=1
thisExp.addData('clicked' + str(selected_images), img1_Yarn4_q)
‘img1_somethignX_q’ is the name of the image stimulit used in the routine.
Every time I click on any image for the first time, routine ends immediately - I would expect that to happen when - selected_images == 6. Not even the first clicked image is saved to the .csv which is generated after the experiment is done.
I’m not even able to print() the value of ‘selected_images’ variable in “Each Frame” code block. I think I’m missing something simple, but I’m not able to figure it out…I just feel like an idiot
Here is how the mouse1 component is configured in the routine:
I’ve tried putting the names of image stimulis to ‘Clickable stimuli $’ field - but that didn’t help.
Thank you very much for any advice!
Jiri Srna