Hi, I’m trying to have my experiment have 2 different conditions given at random. As of right now, I have the participants view 80 images in one condition, and then in sequence have them view 80 images in another condition. I am trying to have it so they only experience only one of them, chosen at random. If anyone could help that would be greatly appreciated
what I have
Intro → experiment 1 → experiment 2 → over
What I’m trying to make
Intro → just experiment 1 or 2 → over
Hello,
Create a code component in your intro. When your experiment starts, choose a random int between 0 and 1:
#Begin Experiment:
import random
chooseExperiment = random.randint(0, 1)
Now, create a code component both in experiment 1 and experiment 2. The code will test the value of the chooseExperiment variable.
One experiment will check if the int is 0, and one will check if it’s 1:
# Begin Routine
if chooseExperiment:
continueRoutine = False
# Begin Routine
if not chooseExperiment:
continueRoutine = False
Because the numbers 0 and 1 can be seen as booleans, we don’t have to specify a condition such as if chooseExperiment == 0:.
One last question: this is the same study you assissted me with last week with the random image locations. With data collection in the excel sheet, would you happen to know how to store what side of the screen the image appeared on with the stored key input that they gave? As of right now, the excel sheet made by the experiment only attaches the inputs they gave, but it doesnt say if they were correct/the image location for me to determine if they were correct. Thanks
Ive done the code objects for the begining and the seperate conditions i want to be randomized though I havent notice any randomization. The first condition (Gain) is always being played.