Hi all,
I’m creating an experiment for my research project and am so close to completing it and uploading it online. However, I have a problem which I can seem to fix so would really appreciate some help. I am using Builder to do this, but with quite a few code components.
In my experiment, participants are shown a picture of a lake, then have to press either ‘a’ or ‘b’ and if they choose the correct one then they “catch a fish” and are presented with a picture of this fish, but if not they are shown an empty fishing rod.
I am trying to add a “fish counter” that is present at the bottom of the screen throughout the trials (with 6 different fish as all 6 lakes have different kinds of fish in them), which is working in psychopy, but not in pavlovia. Below is a screenshot of how this appears in psychopy, but the numbers stay at 0 when I put the study online.
This is the code I am using at the moment…
In ‘Begin Experiment’:
#set no. of fish collected to 0
fish1_pointsA = 0
fish2_pointsA = 0
fish3_pointsA = 0
fish4_pointsA = 0
fish5_pointsA = 0
fish6_pointsA = 0
In “Begin Routine” of my outcome routine (where the corresponding fish image is presented):
if corroutcome_imageA.image == 'stimuli/fish1.png':
fish1_pointsA += 1
elif corroutcome_imageA.image == 'stimuli/fish2.png':
fish2_pointsA += 1
elif corroutcome_imageA.image == 'stimuli/fish3.png':
fish3_pointsA += 1
elif corroutcome_imageA.image == 'stimuli/fish4.png':
fish4_pointsA += 1
elif corroutcome_imageA.image == 'stimuli/fish5.png':
fish5_pointsA += 1
elif corroutcome_imageA.image == 'stimuli/fish6.png':
fish6_pointsA += 1
I then have a text component in my trial outcome routine below each fish image which, the text of which is “$fish1_pointsA” etc. for the remaining fish.
I have also tried replacing “1” with a variable which corresponds to a column in my conditions file with all rows in that column (besides the header) containing the value “1”.
I’m not sure what else I can try to get this working online, so I would really appreciate some advice
Thanks,
Sofie