Add a rest within a loop, that will be used after 10 trials

I have created a study, where there will be many trials within. After 10 trials have been completed, participants will then get a text component that will tell them to take a 5 minute break. I am using an excel file within the script, where psychopy is getting all the information that needs to be displayed throughout the study, such as words and images.

I was thinking of using a code component, to tell the script that after 10 trials are completed, then move on to the ‘rest’ component, then once participants have finished with their rest, then they should go back to the rest of the study.

Image below shows my study, was unsure on whether to put the break component within the loop or outside.

If anyone is struggling, I found another thread which helped. Move the break routine within the loop, and create a code component, in the begin routine, input the code:

if name of loop.thisN == 0 or name of loop.thisN % 10 != 0:
continueRoutine = False

The link to the thread is below:

How to Pause a loop? - #21 by lauren001.

1 Like