Random selection of stimuli without repeating in different blocks

Hi David,

Welcome along…

Well, below is a quick code snippet to show you how a tiny bit of Python can go a long way…

You don’t need to break your trials into blocks. The easiest arrangement to have here is a single loop surrounding your trial routine so that it will run all 96 trials in random order. What you can then have is a pause routine that interrupts that single loop, but only on trials 32 and 64.

i.e. insert a new routine. Just put a text stimulus on it saying something like “Take a break. Then press any key to continue.” Set it to last indefinitely (i.e. don’t give it a duration). Insert a keyboard component too, also set to last indefinitely and to force the end of the routine. The trick is to use a tiny bit of code that will only let this routine appear on the two specified trials. So insert a code component. In its Begin routine tab, put something like the code below. I’m assuming your loop is called trials. If it is called something else, use that name instead. Also, remember that Python is zero-based, so we will insert the pause after trials 31 and 63:

# Conditionally execute this pause routine:
if not trials.thisN in [31, 63]: # on most trials:
    continueRoutine = False # don't even start this routine
2 Likes