Okay let me explain clearer.
Here, I am repeating condition numbers so in every loop iteration I can randomly select one number from this list.
trial_order = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1]
shuffle(trial_order)
#begin routine
curr_item += 1 #increase every loop iteration by 1.
cond_n = trial_order[curr_item]
According to the current trial number (curr_item), the code randomly selects one of the numbers from the trial order to define a condition number.
And based on the condition number (1,2,3) selected from the trial order, I set my 3 item color from the code below (full version is in the file I sent)
shuffle(Choice)
if cond_n == 1: #allincongruent
if Choice [0] == 1:
thisImage = image1
thisImage_color = 'Red'
elif Choice [0] == 2:
thisImage = image2
thisImage_color = 'Purple'
...
Let’s say cond_n = 1 it means that all 3 item will have a different color. thisImage is Red, thisWord is Blue and thisImagery is Purple.
So in every loop iteration, for 96 trials, the cond_n is randomly determined by the trial_order list.
However, I realized that even though I set curr_item += 1, in every loop iteration it turns to be an odd number 1,3,5,… , not 1,2,3,4…
That is why I need more repeated 1,2,3 in the trial_order variable. Because:
If the trial no is 70 out of 96, the curr_item turns to be not 70 but 139 (i do not know why). However, there is no the trial_order [139] item in the trial order list, I have only 96 items. So, the experiment crushes.