Issues saving data for incomplete online study

URL of experiment:

Description of the problem:
If I run my online study all the way to the end the .csv file is created and all the data are there. However, if I click any of the buttons that deliberately end my study (decline consent items), or if I quit the study half way through (simulate a bored participant), I get a .csv file that is completely blank. If I run the study locally through builder, and quit half way through the .csv file is fine and has all the data.

I’ve tried putting the consent items in a blank loop as suggested in other topics, but this doesn’t work. And both my practice trials and experimental trials are in loops anyway, and if I quit the study here the data still isn’t saved.

As far as I can see in the JS code after each routine there is a - psychoJS.experiment.addData - command, and the data is obviously being stored somewhere because if you finish the whole study all that data is there.

Is there a way to ensure that the .csv file contains all the data collected up to that point, even for participants who do not finish the study?

Many thanks!

Hi Katie, I think this is one for @dvbridges

@KDaughters, would you mind trying again, but setting your experiment to use version 3.1.5 in Experiment Settings? You will need to set the version, then resync your project, which should upload your newly generated scripts using 3.1.5 to Pavlovia. The reason being, 3.1.5 adds some code to save any data at the end of loops and when PsychoJS quits

Hi David - Thanks for the suggestion. Unfortunately using 3.1.5 doesn’t seem to be solving the problem. I’ve tried completing the first loop and quitting the study on the ‘half-way instruction’ screen, and also carrying onto the first few items in the second loop - for both of these attempts no data was saved (there isn’t even a blank data file).

Is there a way to manually insert the 3.1.5 relevant code at the end of loops perhaps?

If you would not mind, can you first try refreshing your browser cache? If on Windows, use Shift + F5, then try again. I just ran your task, pressed escape, and the data has been saved.

Hi David,

Ah, yep that’s working great now!

Thanks very much!