No files being saved to pavlovia

Currently, I am trying to get a decision making task in jsPsych 6.2 to run on pavlovia. However, while the experiment itself runs fine, the data is not being saved on pavlovia. While the number of submissions goes up, the folder which should contain the csv files for the participants is empty when downloaded. When running the script locally or when including a local save in the pavlovia code, the data saves fine in the format of csv. I’ve now tried a bunch of different things to fix this, however, I’ve reached a bit of a limit for my level of jsPsych knowledge.

As the experiment was previously run through a different server system, the code still contains a lot of functions to communicate to that server. I have, as far as I can see, deactivated all those functions. So I am hoping that there is no issue with an overlapping communication or something similar, but then again, I might have overlooked something.

Secondly, the pavlovia plug in I am using is an old one I found with some previous experiment code. It seems to run fine with running the experiment but I am wondering if this is the issue with saving the data. One of the solutions would perhaps be to rewrite the whole code into version 7 or higher, however, there are a couple custom plug-ins which I would need to rewrite and I am hoping there might be a simpler solution.

I get a couple of warning/error messages at the end of the experiment which I am not quite sure how to deal with:

Loading failed for the with source “https://accounts.google.com/gsi/client”.
Uncaught (in promise) Error: Unable to preload CSS for /assets/FeatureUnderDevelopment-WmT6Xsm1.css
Loading failed for the with source “https://content.pendo.prolific.com/ag
Loading failed for the with source “https://api.kiprotect.com/v1/privacy-managers/45d9179def48e1744fa5188db10976b8/klaro.js”.
Loading failed for the with source “https://browser-update.org/update.min.js”.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://c.prolific.com/com.snowplowanalytics.snowplow/tp2. (Reason: CORS request did not succeed). Status code: (null).
Use of navigator.sendBeacon instead of synchronous XMLHttpRequest during unload and pagehide improves user experience.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://clientstream.launchdarkly.com/eval/60f04be2cc470d24935cb9ad/eyJraW5kIjoidXNlciIsImtleSI6ImxvY2FsIiwiYW5vbnltb3VzIjp0cnVlfQ. (Reason: CORS request did not succeed). Status code: (null).
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content.

However, none of these seem to block either the run of the experiment, the screen that says ‘Please wait a moment while we’re uplaoding the data to the pavlovia server’ or the redirect to prolific after.

I’ve put up a previous question about this but with a lot less detail but have not gotten a response so far. ’ve had a look at different data saving issues on the help forum as well but have unfortunately not found a solution to this yet. Therefore, I am trying again, hopefully with enough detail to allow someone to guess at what the problem is - my hope is still that this is a minor thing somewhere which I have just overlooked.

The project is this one: Pavlovia - but as it is not officialy running yet, there’s only a temp pilot here: pedlr-task (currently this is only the break of the experiment - I’ve run once through the whole thing and all of it works but for saving time I’ve shortenend this. There should also be data saved from this which it does for local saves.)

Pavlovia has a custom save function for jsPsych. Unfortunately, it’s only for jsPsych version 7.1.2 (instructions for inserting the relevant functions into your timeline can be found here: Pavlovia)

The raw code for the plugin, with all the functions necessary to interact with the Pavlovia server, can be found here: https://lib.pavlovia.org/jspsych-pavlovia-3.0.0.js

You could, in principle, try adapting this for use with jsPsych 6.2, but I don’t know enough about the pre-7.0 plugin system to say how easy or difficult that would be. The alternative is to rewrite your experiment in jsPsych 7.1.2 and use this as-is. Neither is ideal, but because Pavlovia is not exactly an off-the-shelf server I’m afraid there really isn’t another solution.

1 Like

Thanks a lot for your suggestions, Jonathan! I’ve now rewritten the experiment into version 7, and again it runs fine locally and saves data ok there. However, it still seems like there’s a persisting issue with the server.

I’ve now tried two different plug ins, which all seem to not work ind different ways - I am hoping this might give someone more with more knowledge about this a hint about what isn’t working:

  1. The one you provided does not let me run the experiment but gives me two error: one is a migration error, however, this seems to trace back to the jspsych file. The version I have downloaded for js psych is js psych 7.1. - I don’t know if this might be the issue? I am also seeing, that the software platform and version is unknown on the pavlovia website - maybe the issue is there? The second one is that the jsPsych plug in is undefined, and this refers back to the pavlovia plug in. Given those two errors, it seems to make sense that it does not work, however, I don’t really know how to get around this.

  2. The second plug in i tried is version 2022.1.1 which I had lying around with an old experiment. This plug in allows me to run the experiment one weird thing about this is that instead of calling on pavlovia by putting in type: “pavlovia”, I have to put in type: type: jsPsychPavlovia (which is also the name of the plug in). Also, some issues still persist: no data is being saved nor do the sessions numbers on the pavlovia website change; the version for the software platform is still unkown; I get a relatively long list of migration errors that refer back to either jsPsych.js or specific plug ins.

Again, I would be very grateful for any tips or hints that might help with this!

Indeed, the version I linked is out of date and the documentation is too. Here is the code I use in a project I have just launched, which I have tested and confirmed that it does save data to the server:

First, the plugin import:

<script src="lib/vendors/jspsych-7.1.2/jspsych.js"></script>
<script type="text/javascript" src="lib/jspsych-7-pavlovia-2022.1.1.js"></script>

Then there are two jsPsychPavlovia timeline elements, and they are the first and last things in the timeline:

// First element in timeline
  /* init connection with pavlovia.org */
  var pavlovia_init = {
      type: jsPsychPavlovia,
      command: "init"
  };
  timeline.push(pavlovia_init);
//Last element in timeline
  /* finish connection with pavlovia.org */
  var pavlovia_finish = {
      type: jsPsychPavlovia,
      command: "finish"
      };
  timeline.push(pavlovia_finish);

I also figured out how to do a redirect from the end of the experiment to prolific by adding an “on_finish” trigger to the second one: How to redirect to Prolific after completing a jsPsych experiment on Pavlovia

Thanks a lot for responding so quickly! This acutally fixes the error messages and the version is now also correctly shown on pavlovia. However, data is still not being saved… It does seem to create a local save every time though, even though (if I see correctly) I’ve not specified this anywhere in the code.

I do get this message now:

pavlovia 2022.1.1] finish | _save.response= 
Object { origin: "_save", context: "when saving results for experiment: NeuroCode-UHH/pedlr_zh_v7", message: "offered the .csv file for download" }
context: "when saving results for experiment: NeuroCode-UHH/pedlr_zh_v7"
message: "offered the .csv file for download"
origin: "_save"

XHRDELETE
https://pavlovia.org//api/v2/experiments/421038/sessions/ddabc5f4-6a91-4c76-87fd-3823e61082be
[HTTP/2 404  219ms]

[pavlovia 2022.1.1] finish | _closeSession.response= 
Object { origin: "_closeSession", context: "when closing the session for experiment: NeuroCode-UHH/pedlr_zh_v7", serverData: {…} }
jspsych-7-pavlovia-2022.1.1.js:553:12

I will look into where this comes from a little more but do you have any idea by chance?

Ah, you’re piloting. Piloting always saves locally, it only saves to the server if you use the “run” link.

Oh thank god - this fixed the issue. Funnily enough, also with the jsPsych 6 version. Has this changed in the last years? I seem to remember there being files saved even when piloting but I might be making this up.

Either way - thanks a lot for your help!!