Hi everyone! I’m trying to set up an experiment for my research project and have been stuck on something for a while. I’ll explain a bit here…
Basically the premise is that participants are presented with a picture of fruit (e.g., apple), then can press either L or R, with one key being rewarded (they are shown a same or different fruit) and the other not (they are shown an empty box). The different types of fruit are in a conditions file so they are looped through randomly and there are two different outcome loops (one for outcome and one for no outcome). This is working fine and was achieved as shown in the screenshots below.
- e.g., apple → presses L → watermelon + “Reward = 5 points!”
apple → presses R → empty box + “No reward!”
For the next stage, at the beginning of each block, the participants are presented with a screen containing all of the fruit outcomes (note the outcomes, not the stimuli, as I’m trying to see whether they have learnt the outcomes too), but two of the fruits are circled. The positions of the outcome fruits are set on the screen in this part of every block, but the circles loop randomly through combinations of positions, as decided by the conditions file labelled “circlepositions” (screenshot of this below) with one circle being assigned to a position in the “position1” column and the other “position2”. This is working fine.
The circles indicate that if, in this block, they respond to the stimuli fruit that correspond to the circled outcome fruit, with the previously incorrect key, they will be rewarded double. If the corresponding outcome fruit was not circled, the outcome is the same as in the first part of the experiment.
-e.g., if the apple is circled…
apple → presses L → watermelon + “Reward = 5 points!”
apple → presses R → watermelon + “Reward = 10 points!”
- e.g., if the apple is not circled…
apple → presses L → watermelon + “Reward = 5 points!”
apple → presses R → empty box + “No reward!”
I therefore have three different outcomes: standard outcome, upvaluation (double) outcome and no outcome. I can’t seem to work out how to make it so that the key labelled as incorrect in the conditions file can lead to the upvaluation reward outcome only for the fruit that are circled.
One thing I tried was the following code that used the equivalence of positions of outcome fruit and circles, repeated for all outcomes (and therefore stimuli).
if response.corr:
reward = ‘Reward = 10 points!’
upvaluationoutcome = 0
yesstandardoutcome = 1
nostandardoutcome = 0
elif response.corr == 0 and watermelon_upvaluation.pos == circle.pos in upvaluation_values and upvaluation_image == apple.png:
reward = ‘Reward = 20 points!’
upvaluationoutcome = 1
yesstandardoutcome = 0
nostandardoutcome = 0
elif response.corr == 0 and watermelon_upvaluation.pos == circle2.pos in upvaluation_values and upvaluation_image == apple.png:
reward = ‘Reward = 20 points!’
upvaluationoutcome = 1
yesstandardoutcome = 0
nostandardoutcome = 0
elif response.corr == 0 and watermelon_upvaluation.pos != circle.pos in upvaluation_values and watermelon_upvaluation.pos == circle2.pos in upvaluation_values and upvaluation_image == apple.png:
reward = ‘No reward!’
upvaluationoutcome = 0
yesstandardoutcome = 0
nostandardoutcome = 1
elif response.corr == 0 and response.corr != None:
reward = ‘Too slow!’
upvaluationoutcome = 0
yesstandardoutcome = 0
nostandardoutcome = 1
But this came back with the error… “ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()”.
One thought I had was, in the initial screen with all the outcome fruit, to open a file and write something in it if the position of the outcome fruit is equal to one of the circles, then read this file in each trial to change the change the outcome. However, I wasn’t sure how to form an IF statement relating the positions of the two stimuli together as using “watermelon_upvaluation.pos == circle.pos” doesn’t work (the images of the watermelon and circle and labelled as “watermelon_upvaluation” and “circle” in builder).
If anyone has any ideas to help it would be much appreciated!!