I can’t really see, why the changes would affect this. Did you make sure to use allow_continue
in the correct spot (condition of keyboard)? You could inlcude print(match)
to see what is happening there. It should start as an empty array and grow by a 1 each time an image is inside a polygon. Ah, by the way, match
should probably be reset to [ ]
at the beginning of each frame.
Ah, the problem was that I totally forgot to use allow_continue in condition. Sorry to have taken your time on my dumbness
Hi, I hate to bother you (again!)
The experiment is running perfectly but I realized a problem with the output.
So, this code printed the polygon names, and below there is the information of which picture is put on which polygon. The empty polygons are printed as “no image”. There are only 4 pictures so only 4 polygons should contain pictures and 4 must say “no image”. This works for the first trial, but in the next trials, it looks like the same picture stimuli are placed on multiple polygons (see image). This is problematic because from the output I can’t understand which picture is actually placed on which polygon. I made sure one picture is not on two polygons at the same time, so I’m not sure why this is happening. Do you have any ideas?
Does this work?
match = []
for polygon in [top_left_PT1, top_center_PT1, top_right_PT1, left_center_PT1, right_center_PT1, bottom_left_PT1, bottom_center_PT1, bottom_right_PT1]: # for each polygon
for img in [P1_PT1,P2_PT1,P3_PT1,P4_PT1]: # for each image
if polygon.contains(img.pos): # check whether this polygon contains this image
match.append(1) # if so, add a 1 to the list
exec(polygon.name + '_contains = ' + '"' + img.name + '"')
break
else:
exec(polygon.name + '_contains = "no image"')
allow_continue = len(match) == 4 # allow respondents to continue if there are 4 1’s in the list
Yes! Thank you so much