URL of experiment: https://gitlab.pavlovia.org/evanmaclean/loop_test
Description of the problem: I am experiencing a problem where I have nested loops and wish to terminate the inner loop (only) given certain responses in the outer loop. However, the outer loop (or its routines) seems to also be cancelled inadvertently.
The experiment runs correctly using the python code but I encounter an error when using PsychoJS. Specifically, when I abort the inner loop I use:
continueRoutine = false
…in the ‘each frame’ code component, in order to prevent the remainder of the routine in the aborted loop from being conducted. However, as a side effect, this seems to either (1) also exit the outer loop prematurely, or (2) cancel the routines in the outer loop as well. The experiment simply ends when it should not because there are additional iterations in the outer loop remaining. Importantly, if I do not attempt to end the inner loop early, the outer loop completes all iterations without a problem.
The linked experiment above is a minimal reproducible example of the phenomenon. I wonder if the continueRoutine = false code is also affecting other routines, perhaps due to global scope? Is there a way to specify a specific routine to be discontinued?
I’ve been struggling with this for days and am very grateful for any insights!