| Reference | Downloads | Github

Major data loss from Pavlovia / jspsych

URL of experiment: Effect of Frame of Reference on Biological Motion [jsPsych]

Description of the problem: About 50% of participant data is not saving - despite “save incomplete results” being on. Can’t replicate the issue with despite trying with five other people using various browser combinations. Both complete experiments and incomplete experiments were saved during testing. The participants are are funneled from SONA for credits and they are completing the experiment (confirmed through contact) but no data file is created. My data files that do save are 99kb so it is unlikely an internet connection problem. I notice that this is a recurring problem that many Pavlovia/ jspsych users have to varying degrees (there are many others but I can only post two link as a new forum user:

  1. Three other experiments - one with 40% data loss - Issues with data - missing or lost

Any help would be appreciated


Here is some of my code:

Plugin version

Pavlovia init and username creation

	/* create timeline */
	var timeline = [];

	/* init connection with */
	var pavlovia_init = {
		type: "pavlovia",
		command: "init"
	/* generate a random subject ID that contains 8 alphanumeric characters*/
    var rand_subject_id = jsPsych.randomization.randomID(8);
    /* add the ID to the data for all trials */{ID: rand_subject_id});
    /* get SONA is from URL*/
    let sona_id =['sona_id']
    /* add the SONA ID to the data for all trials */{SONA_ID: sona_id});

Pavlovia finish

// exit fullscreen mode
type: ‘fullscreen’,
fullscreen_mode: false

var debrief_block = {
  type: "html-keyboard-response",
  stimulus: function() {

    var trials ={task: 'response'});
    var correct_trials = trials.filter({correct: true});
    var accuracy = Math.round(correct_trials.count() / trials.count() * 100);
    var rt = Math.round('rt').mean());

    return `<p>You responded correctly on ${accuracy}% of the trials.</p>
      <p>Your average response time was ${rt}ms.</p>
      <p>Press any key to complete the experiment. Thank you!</p>`;

	/* finish connection with */
	var pavlovia_finish = {
		type: "pavlovia",
		command: "finish"

	/* start the experiment */
		timeline: timeline,

		function (data) {


Hi There,

I’ve been kindly informed that some users encountered an issue with the older jspsych-pavlovia plugin when participants were redirected to another website after the experiment (is this the case in your study?). A possible quick fix might be to update the plug in you are using to a newer version (thanks @thomas_pronk !) jsPsych Pavlovia plugin · Discussion #1738 · jspsych/jsPsych · GitHub

Hope this helps,

1 Like

Thanks Becca - will try these out.