Wakefield's Daily Tips

Saving incomplete results

When I create a new study on Pavlovia, one of the first things I do is turn off “save incomplete results”.

The reason I do this is to avoid having lots of data files getting created while I build and test the experiment. This is especially important if you use credits rather than a licence, since each data file will cost a credit.

Even when turned on, saving incomplete results can be a bit hit and miss. The data is always saved if you press escape to exit full screen and then press escape again. It also seems to work if you press escape and then close the tab, but not if you press escape and then navigate to another web page within the same tab.

The other issue is that if you have saving incomplete results turned on, you will get near empty data files from anyone who exits near the start of the experiment, for example before consenting or while reading the instructions.

My recommendation is to turn on incomplete data saving in code at the point where enough results have been collected that you would consider using them. Be mindful of research ethics. If you have told your participants that they have the right to withdraw at any point in the study and the only way to withdraw is by pressing escape, then ethically you should not use their data.

With this in mind, the code to turn on incomplete data saving is:

psychoJS._config.experiment.saveIncompleteResults = true;

It should appear in a JavaScript code component or on the JS side of a Both code component.

In the example I wrote to test this today, I turn on saving incomplete results on the fourth iteration of the loop with:

if ((trials.thisN === 3)) {
    psychoJS._config.experiment.saveIncompleteResults = true; // enable partial data collection
}

As noted in the linked thread, this code may not work in Firefox, but I don’t know if that means that incomplete data saving doesn’t work at all, whether the value can’t be changed in code, or whether changing the value after the start of the experiment has no affect.

1 Like