Randomise trials across multiple blocks

OS (e.g. Win10): Win10
PsychoPy version (e.g. 2024.2.4 Py 3.8): v2023.2.3

I have 45 trials that I would like to fully randomise, but divided into 3 blocks of 15 trials, with a break in between each block. I have already built routines for stimuli display/task/break etc and it works fine as a single block.

Is there a way I can randomise the order of all 45 trials across three separate blocks? I assumed I’d be able to use a loop function to complete one routine three times, showing 15 different trials each time, but I can’t work it out.

I’ve had a look through the forum, I found this thread (Random selection of stimuli without repeating in different blocks). It is the same idea, however I have multiple routines looped together to form one block, so I’m not sure where I would insert this code to initiate a break after 15 trials.

Any help either implementing the above thread, or a different idea, would be much appreciated!

Thanks, Aimee

I’ve sorted it now.

I used the code from the highlighted thread, and added that into a break routine inside the loop function I had, and it worked fine. I previously misunderstood where the code component was meant to go.

Hopefully this thread will assist someone else in the future :slight_smile:

Or if anyone else has a more straightforward suggestion, feel free to discuss!