saving data with on_close doesn't work after certain point in experiment #1596
-
Hello, I'm having trouble with saving data when participants close the browser before the end of the experiment. I'm saving data for both on_close and on_finish when I run the experiment timeline (reached_finish is set to 0 at beginning of expt) :
However, if I close my browser prematurely after a certain point in the experiment, the data doesn't save. It doesn't save if I close the browser once reaching the last page of the repeat practice loop (code for last page and loop are shown below), or any time in the experiment after that point. Any idea what might be going wrong? I've also attached the whole experiment script here in case that helps. Thank you in advance for your thoughts on this.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Web browsers impose some limits on what you can and can't do during the unload event that closing the browser initiates. One limitation seems to be the amount of data that can be transferred. If you'd like to make sure to save all the data from a participant who exits prematurely I suggest saving the data after every trial using the |
Beta Was this translation helpful? Give feedback.
-
@jodeleeuw Thank you so much for your quick and helpful reply, that fixed the issue! |
Beta Was this translation helpful? Give feedback.
Hi @patiencerosestevens,
Web browsers impose some limits on what you can and can't do during the unload event that closing the browser initiates. One limitation seems to be the amount of data that can be transferred. If you'd like to make sure to save all the data from a participant who exits prematurely I suggest saving the data after every trial using the
on_data_update
event handler injsPsych.init()
.Docs here.