How to end experiment early with all data saved? Crashes using psychoJS.quit()

I want to create a routine (after one of my loops) which forces the experiment to end. I do not want it to be conditional, i want it to time out after a ‘thank you’ message.

I currently have a dummy loop around the Thank_you routines to skip those for an if_else statement for branching.

I tried to use core.quit() after each Thank_you routine, instead… but this solution appears to crash the JS version on Pavlovia. I then tried psychoJS.quit(), but still it crashes at the beginning of the routine.


Thanks.

Hello trevcaru,

I am using core.quit(); to quit an experiment on the Python side and quitPsychoJS() on the JS-side (set Code-Type to Both)).

Best wishes Jens

Thanks for the response. I tried that, but had the same issue. The problem is resolved via a workaround:

I simply created dummy loops for every routine and then used if_else statements after setting all loop values for those equal to 0. This has each branch, when finished, jump to the end of the experiment.