If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): PsychoPy version (e.g. 1.84.x): Standard Standalone? (y/n) If not then what?: What are you trying to achieve?:
I want to randomize two routine evenly. What did you try to make it work?:
I set outerloop in excel like
control comparison
1 0
0 1
I create an excel sheet as shown above, inset it into the outerloop, and the routines is actually presented in random order. What specifically went wrong when you tried that?:
The entire trial is 56 times, but looking at the resulting Excel sheet, cont comes first follwed by comp 29 times, conp comes first followed by cont 27 times.
Ideally, I would like to do these two sequence 28tines each.
thank you for your reply.
my explanation was insufficient.
An excel file is set in conditionloop, and there are 28 conditions. Since the nReps of this loop was set to 2, the total number of trials was 56.
What I want to achieve is, for example, if there are 28 total trials, 14 of them will be comp first, cont later, and the remaining 14 trials will be the other way round, in a random order.
I thought of another method. But it doesn’t work. I created a routine called comp and comp2, and tried setting comp2’s nReps to 0 when comp’s nReps is 1, or vice versa. comp and comp2 are exactly the same thing.
Add codecomponet to comp,
biginroutine
values = [1] + [0]
shuffle(values)
if [1, 0] in values:
trial1 = 1
trial2 = 0
elif [0, 1] in values:
trial1 = 0
trial2 = 1
I entered a code like this. I get an error that trial1 is not defined, but I don’t know what to do.