continueRoutine = false, but routine still running without stimuli

This is to do with non-slip timing. Essentially, if you set continueRoutine = False during the frame loop, it takes note of the fact that the routine ended before the planned time so that the timer can be reset to 0 rather than having the expected duration subtracted (which we do for routines with a fixed duration as it prevents timing from slipping over several repeats). Because continueRoutine = False was set here before the routine, the frame loop never executes so it never learns that the routine was force ended.

I’ll put in a fix for the next version of PsychoPy so that what you did will work, in the meantime there’s two things you can do to avoid the problem:

  1. In your Begin Routine code, add routineForceEnded = True after continueRoutine = False - this means your experiment will know that the routine was skipped before its intended end time so won’t subtract the duration from the timer
  2. Move the code from Begin Routine to Each Frame, but put it inside of this if statement: if frameN == -1:. This means that continueRoutine will be set to False on the first frame, rather than before the first frame.