continueRoutine not working? Psychopy 2022.2.4

I’m using PsychoPy 2022.2.4 Standalone.

The overarching issue I’m having is that ‘continueRoutine’ does not seem to be working for me. I have not been successful in using it in either the Begin Routine tab or the Each Frame tab of a code component.

The experiment I’m trying to program is slightly complicated (at least to me), so I’m sure that my experiment flow is not the most elegant; but it works…except for conditionally skipping a routine. (I can explain why I’m struggling making this more elegant if anyone needs more info or could help with that also, but it shouldn’t be relevant to the current issue)


Basically, I have participants read a set of sentences in order (Trial routine). After the 2nd sentence in a set, they should be interrupted with a different task (Interruption routine). This routine should be skipped after every sentence except the 2nd one. E.g., Sentence 1, Sentence 2, Interruption, Sentence 3, Sentence 4, etc.

Currently, the Interruption routine is playing after every sentence presentation (Trial routine). I only have an image set to show up on the Interruption routine after the 2nd sentence, so every other time the routine is just blank.

Additionally, I will have participants divided into 3 groups (Group 1 will always skip the Interruption routine; Group 2 & Group 3 will see the Interruption routine after 2 sentence presentations, but they will differ in what they do after that). If it matters, Group 2 will see the interruption and continue to read the following sentences as if they weren’t interrupted. Group 3 will see the interruption and then start the entire Trial_Loop_1 over (but without seeing the interruption again).

What I have tried currently is setting up the ‘ContinueRoutine = False’ to occur by group.
Begin Experiment tab:
Group = expInfo['condition']
Begin Routine tab (also tried in the Each Frame tab):

if Group == 1:
    continueRoutine = False
    continueRoutine = True

The Interruption routine refuses to be skipped. To the best of my knowledge, the ‘ContinueRoutine’ function is not working. Potential confirmation of this issue: I built a bare-bones experiment with 2 routines and asked it to always skip the 2nd routine; it didn’t work.

Any and all help that can be provided is greatly appreciated!

Hi Elisabeth, this is weird. I build a similar minimal example and it works fine. Maybe compare your version to mine and see what is different.

123.psyexp (11.6 KB)

In your original experiment, check if your condition is actually met by running

print(Group == 1)

Okay, so we seem to have a bigger problem here then…


returns the expected value (the number I put in the expInfo[‘condition’] box)

print(Group == 1)

returns false…even when I enter 1 in the expInfo[‘condition’] box

print(expInfo['condition'] == 1)

also returns false…

I deleted that expInfo box and created a new one (named something different) and I have the same issue…I’ve never had this happen before

Maybe it’s simply "1"?

Total brain fart moment…


works perfectly. I completely forgot to include the brackets around the number! It seems that everything is working the way I want it now. :woman_facepalming:

Thank you for your help!


expInfo returns strings not integers :wink: Look the same for humans but not for computers.

Best wishes Jens

This code is superfluous, since continueRoutine is set to True by default.

I’ve just confirmed that continueRoutine = False does not work in 2022.2.x offline. It results in a blank screen for the normal duration of the routine.

continueRoutine code | try it

The expected behaviour is correct online. It also works offline if you set the version as 2022.1.4