Data not saving to Pavlovia's servers (jsPsych)

URL of experiment: https://run.pavlovia.org/andreja/inverted_upright_nomask/inverted_upright_nomask.html

Description of the problem: My data will not save to Pavlovia’s servers at all, despite being in running mode and my having initialized integration with Pavlovia in my code. Instead, each time the experiment is completed, the ‘Sessions’ tab, which records successful and aborted attempts, remains at 0 and no data folder appears in my gitlab repository. I also don’t get an error messages in the console. Can someone from Pavlovia’s side have a look and let me know if this is an issue with my code or with Pavlovia itself? Thank you.

1 Like

Were you able to solve this issue? I am having the same problem with jsPsych and Pavlovia, both in pilotting and running mode.
Thanks
Ella

1 Like

Hi Ella,

Yes, I ended up diagnosing and fixing the issue myself. In my case, it had to do with where I was placing the object that cuts communication with Pavlovia’s servers at the end so that the data can be saved. I ended up placing it after the last trial (where the participant is required to make a choice and select a key on their keyboard) instead of after the instructions set (where no input from the participant is required), and that seemed to work. I think this may be because once you initialize with Pavlova, the plugin is always “listening” for a response, so if you place the object that cuts that communication after the last input you want to get from your subject, it makes sense that it then progresses to the next step, which is actually saving your data. The unintended but kinda awesome consequence of doing it this way is that it also gave me a buffer of about 6 seconds to make sure the data saves properly while the participants read the debrief at the end and then exit out of their screen. I’ve been playing around with Pavlovia long enough by now to know that data saving is not always immediate at the end – sometimes it takes a few seconds (and in one case, as much as 8!) to cut communication with the servers and save the data. Hope that helps!

Best,
Andreja

1 Like

Hi Andreja,
Ah yes your solution sounds like something that could be viable for me. I’ve just tried moving the pavlovia_finish variable earlier, straight after the point at which the data is saved (which comes before the debrief etc). But I’m still having no luck. Nothing is changing in terms of credits either, so I am wondering if perhaps I haven’t successfully initiated the communication with Pavlovia. I used the following code for initiation placed right under the timeline variable.

var timeline = []

var pavlovia_init = {
	type: "pavlovia",
	command: "init"
};

timeline.push(pavlovia_init);

document.body.style.backgroundColor = "hsl(0,0%,"+lightnessVal+"%)";

Math.seedrandom();
rSeed = Math.floor(Math.random()*9999999);
Math.seedrandom(rSeed);

var realVersion = true;

var sessionNum = 1;

Do you have any idea what could be causing this issue?
Thanks
Ella

Have you pushed your actual trials to the timeline?

Hmmm now you mention it, I think this could be the issue. I’ve got the pavlovia commands in the timeline, but there are two timelines - timeline and Expttimeline. Expttimeline is what’s specified in the jsPsych.init section. I’ve adapted this code from someone else, so I am not entirely sure of the purpose of having the two timelines but the experiment seems to only run if Expttimeline is specified in jsPsych.init. Adding the pavlovia commands into the Expttimeline does not solve the problem (and makes the experiment no longer load). Changing the jspsych.init specification to timeline, rather than Expttimeline, causes the experiment not to load. I also tried moving the contents of the expttimeline into the various parts of the script itself (getting rid of expttimeline entirely) and then specifying timeline in jspsych.init, but that didn’t work either.

Any suggestions for what to try next?

Can you link me to your experiment? It doesn’t matter that it doesn’t load, I just want to take a look at your full experiment script. If it really is just a timeline issue, then that would be relatively easy to solve.

Sure thing. Hopefully this link works.

Hi Andreja,
I’m pleased to report that I’ve just fixed the issue. I moved the pavlovia_init and pavlovia_finish into the experiment Timeline, but in different places than I had previously tried.

Thanks so much for your help and alerting me to this issue.
Ella

Hi Ella,
Amazing! I’m so glad that worked. Thanks for letting me know.
Best,
Andreja

Hi Ella! So I’m having the same problems as you did – would you be able to share where you moved the pavlovia_init and pavlovia_finish in the experiment Timeline that helped it work?

Would really appreciate! Thanks!
Faye

Hi Faye,
For sure. So I have the timeline and then also an ExptTimeline which is what is used to run the study. I’ve set up the pavlovia_init variable straight after setting up the timeline variable, and the pavlovia_finish variable at the end right before setting up the variable for the final screen where participants got their completion code for Mechanical turk. Then in the ExptTimeline I’ve pushed pavlovia_init straight after the welcome screen, and pavlovia_finish before the debriefing information. Where have you tried placing them at the moment? I also found that it wouldn’t run properly when just opened in a browser, but it did when I tried pilotting it from pavlovia itself so perhaps try doing that too?

Happy to share my source code if that’s helpful.
Ella

1 Like

Thank you! So I’ve played around with a few different placements after reading this initial thread. I just tried what you recommended with the “_init” at the beginning and “_finish” at the end. The experiment runs when I press Pilot in Pavlovia but there’s no data that downloads so I’m not sure what I’m missing.

Would you mind sharing your source code (if you’re comfortable) ? It may be helpful seeing an example. Thank you very much!

For sure. Can you access this link okay? https://gitlab.pavlovia.org/EMoeck/target-detection-study/blob/master/index.html

Glad it ran in pilot mode. Have you got credits on your Pavlovia account? That could be why it’s not saving. Maybe try and add a few (they shouldn’t get used up just by pilotting but it might help with getting the data to save) and let me know how you go.

1 Like

I’m having the same issue! any help would be amazing! it’s for my dissertation and this means I’ve already lost data!
https://run.pavlovia.org/MegLun123/bart/html

This thread is about jsPsych and has been solved. Are you using PsychoJS or jsPsych? Have you tried the given solution? Are your participants getting an error message?

Thank you for your reply, to be honest I’m completely clueless!
It’s for my dissertation and I’m basically a grandma when it comes to tech stuff. Ive asked my supervisor for help because:
So I have 2 tasks on Pavlovia (BART & stop signal)

Both tasks were cloned and forked the same way- I didn’t create them.

Bart is the one with the main issue- the data isn’t saving

One participant has also said that the task was still going and they had to click off it themselves.

The stop signal one also has its issues, even though the data seems to be saving

one participant keeps on getting an error message when they have to press the space bar.

He looked at where they were cloned/forked from and the Bart one is JavaScript, where as he was going to try and trouble shoot it on Psychopy.

I’m just feeling really overwhelmed as I’ve lost this weeks data and i don’t even know if i can salvage it.

Please any help would be amazing,

From one struggling student.