| Reference | Downloads | Github

How to prevent data from being saved when closing the dialog box or pressing ESC

While testing my script, I have noticed that if the dialog box at the beginning is closed by clicking the upper right X, the data will be sent to the server. The same thing happens if a subject mistakenly hit ESC in the middle of the experiment.

I was wondering if there’s any way to prevent both things from happening. That is, I would like data to be sent to the server only at the end of the experiment, so as to ensure that all subjects went through the entire set of trials.


@apitiot I think this needs a change to the psychoJS.quit() call. We currently have a setting to say whether or not the task was completed, but not whether or not we want data saved. Maybe we could add that as an argument to quit()? Then we could set in the Experiment Settings in PsychoPy an option for what to do with incomplete data (save or not).

1 Like