-
I have been saving data to csv files without any issue in the past. Specifically,
Recently I have shifted from MTurk to Prolific. The latter provides a URL for granting credit. So, I added a redirection to the completion URL in on_finish:
The problem is that 75% of the data I get is either missing or incomplete, even though the participants are clearly finishing the study. I believe it's because the data does not have enough time to save before the redirection happens? In that case, would a good fix be to force some period of waiting before the redirection takes place, e.g. adding a new final trial that's 30 seconds long, for saving the data? I'm on 6.0.5 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @dreamerie ,
Yes, that's probably right. The optimal fix here would be to wait for the reply from the server that the data has been saved before moving on. I'd need to know more about how your Waiting for 30 seconds would probably work too, but it's also probably way more than what you need to wait for. The callback method will be robust, and result in much shorter wait times for your participants. BTW, what I do on Prolific is save the data to my server right after the second-to-last trial. And then the last trial is a debrief screen with a link that the participant clicks on to end the experiment. The link takes them to same place as the redirect, but the participant initiates it. I've never had data loss this way. It looks something like this: var second_to_last_trial = {
...,
on_finish: function(data){
// execute my save to server function
}
}
var last_trial = {
type: 'html-keyboard-response',
stimulus: `<p>Thanks! You've completed the experiment.</p>
<p>Debrief info, blah, blah...</p>
<p><a href="URLTOPROLIFIC">Please click here to return to Prolific and complete the experiment.</a></p>.`,
choices: jsPsych.NO_KEYS // prevents them from accidentally skipping this trial
} |
Beta Was this translation helpful? Give feedback.
Hi @dreamerie ,
Yes, that's probably right.
The optimal fix here would be to wait for the reply from the server that the data has been saved before moving on. I'd need to know more about how your
saveData
function works to suggest specifics, but it's probably using anXMLHttpRequest
. If you can put the redirect inside the callback function from the server request that should solve the issue.Waiting for 30 seconds would probably work too, but it's also probably way more than what you need to wait for. The callback method will be robust, and result in much shorter wait times for your partici…