Hi Everyone,
I have a routine that loops for 10 reps (10 trials). I would like to display a fixation cross for 2, 3, or 5 seconds at the beginning of each trial. However, I want these presentations to occur in a 6:3:1 ratio respectively. In other words, I want 6 of the 10 trials to have a 2 second fixation cross, 3 of the 10 trials to have a 3 second fixation cross, and 1 of the 10 trials to have a 5 second fixation cross.
I have tried the following code:
fix_time = [2, 2, 2, 2, 2, 2, 3, 3, 3, 5]
random.shuffle(fix_time)
I have a trial counter that = 0 at the start of my a block but increases by 1 at the end of each trial. I use this counter to index my fix_time list such that:
counter = 0 #increases by 1 at the end of every trial
#my Fixation Cross is a text component so in the text properties window:
Start $time(s) = 0
Stop $time(s) = fix_time[counter]
The idea being: since the counter will range from 0 - 9, I can use it to index the elements of my fix_time list such that the list shuffles once at the beginning of a block, and from that shuffled list I index fix_time[0] for trial 1, fix_time[1] for trial 2, …, fix_time[9] for trial 10. Thus, allowing me to change the duration of the fixation cross every trial and still achieve my desired 6:3:1 ratio
Now, this works in that my experiment does not crash. However, my problem is that sometimes the cross is displayed, sometimes it’s not, and when it is displayed, the durations are about .5 - 1.0 seconds less than what they are supposed to be.
Are there better ways to code the presentation of this fixation cross to not only change in duration from 2, 3, or 5 seconds in each trial but also maintain a 6:3:1 ratio of the 2, 3, 5 second durations respectively?
Thank you!