Unwanted skipping/ending of a particular routine

OS: MacOS Ventura 13.4.1 (22F82)
PsychoPy version: v2023.2.2
Standard Standalone: yes
What are you trying to achieve?: To fix random skipping of given routines.


I have this routine with sliders, a clickable “next” button appears after having answered the last of them.

The problem:
This particular routine 1 bugs, sometimes it is skipped in the sense that it shows on screen briefly before being ended without having done anything (next routine starts), sometimes the next button does not appear, and sometimes this skipping carries on to the following routine 2 (i.e., following routine also stopped early before having clicked on the “next” button (button which is not in the same place as for routine 1)).

What did you try to make it work?:

  • Remaking the routine
  • Remaking/editing its components
  • Making sure the prior and following routines don’t have “Next” buttons in the same location.


  • I’ve also tried setting the “Next” button and click possibility to appear after a given duration instead of appearing when a slider.rating condition is met.
  • I’ve tried adding a blank routine (lasting 1s) before and after the one that is ending early
  • Tried setting routine duration to 1000s instead of blank

I’m not sure how I can give more context, needed info, let me know.

Thanks in advance

After removing the routine entirely it seems that the bug has now just shifted to the next routine, which makes me think that it has something to do with the loop all of these routines are a part of.

Here is the general structure of the task loop:

The bug happens in the first few routines (slider routine is removed here, but should be before the StartBlock routine).
Interestingly this bug never occurs on the first block (starts happening only once I’ve looped back to start block number 2).

There is a single skip everytime I loop back to the start of a new block, this skip seems to happen some time after a new block has started, irrespective of what routine I am currently on.
E.g., I loop back to start of new block, StartBlock routine starts, I just wait without doing anything, it will be skipped after a few seconds. Or if I do play normally and click next on that routine, start the readyLocate routine, there the skip can happen.
So it seems to be independent of the routines, and happens once every iteration of the main loop after a few seconds have passed (approx. 5s)

Have a look at what is happening in the routine prior to the one being skipped, and what the end conditions are for the routine being skipped. Then use print commands in Begin Routine to see if the end conditions are already met.

Hi @wakecarter, thanks for the suggestions.
It’s still quite confusing, the routine prior doesn’t seem to be the source of the issue since I’ve had it (this issue) with various previous routines.
And the end conditions for the routine being skipped are that a button needs to getPressed() with a given mouse component (end routine on valid click only), no time limit to the routine etc.

For the print commands: I can’t seem to find a “endConditions.met” type of variable, do you have the variable name on hand?

I’ve found this workaround for now (in an each frame code component):

let keepGoing = true;

if ((slider_anxious_2.rating !== undefined) && mouse_5.isPressedIn(next_button_67)) {
    keepGoing = false;

continueRoutine = keepGoing;

Which works in preventing this unwanted ending of the routine.

Are you saying that that works but

if ((slider_anxious_2.rating !== undefined) && mouse_5.isPressedIn(next_button_67)) {
    continueRoutine = false;

does not?

Somehow, yes.