Hi @jon, many thanks for your reply. To clarify:
I do use:
nameOfMyLoop.finished=true
to kill the loop.
I then also use:
continueRoutine=false
in the ‘each frame’ code component for the routine within the (inner) loop being ended. This is done within an if statement so that continueRoutine is only set to false if the conditional statement that should end the loop is true. Here is the code for the each frame component of the inner loop routine:
if (skip_step_two) {
step2_loop.finished = true;
continueRoutine = false;
}
I do this because in another thread @dvbridges suggests that while stopping the loop works fine with PsychoJS, this will not end the remaining components of the routine within the loop unless continueRoutine is set to false each frame.
The unexpected consequence in my code is that the outer loop and / or its routines also seem to be aborted when setting the inner loop to finished. In other words, when setting the inner loop to finished, and the inner loop routine to continueRoutine = false, this seems to affect the outer loop and its routines. So, I am wondering if the continueRoutine = false code is also unintentionally affecting other routines in the outer loop (outside of the specific routine were continueRoutine was set to false).
Thanks so much if you or @dvbridges have additional thoughts!