Unable to download all resources in Pavlovia

URL of experiment: https://gitlab.pavlovia.org/yzengaeKU/pwi_session_1/blob/master/Session_1.js

Description of the problem: By default, all available resources should be download automatically. However, my experiment fails to do so. I would like to know:

  • What is the code for automatic resource downloading? Is removing code for specifying resources sufficient? My current code is as follows:
psychoJS.start({
  expName: expName,
  expInfo: expInfo
});
  • How to set the folder for automatically download resources? According to https://pavlovia.org/docs/experiments/resources, all resources are assumed to be local to the index.html file of the experiment. Below is the folder structure of my experiment. My PC did not generate the “resources” sub-directory automatically, so I manually created it and upload the files. Still, my experiments did not load the resources.

Many thanks for your help!

Hi There,

Before moving forward, please can I check if you have tried manually adding resources using the online tab in experiment settings? (docs recently updated here as a few people were encountering this question https://www.psychopy.org/online/fromBuilder.html)

Thanks :slight_smile:
Becca

Hi Becca,

Thank you for your interest in this question!

Yes. I tried manually adding resources online by editing the JS script. Hope this helps.

Best,

Hi There,

I didn’t mean by editing the JS script - I meant by using Experiment settings > Online > +/- icon to select resources. Please can you confirm if you have tried that?

Thanks,
Becca

I know this is super old, but has anyone figured this out? My resources folder is not downloading automatically and I can’t figure out what’s wrong. When I first synced to Pavlovia, it automatically created the ‘resources’ folder in the html folder, and then I added the files to that resources folder in the next sync. I tried adding them all manually using Experiment settings > Online > +/- icon, as well as with the code found here, but neither worked. This happened to me once before, and I fixed it by making about a million different PsychoPy/Pavlovia experiments, copy/pasting all routines into new PsychoPy experiment files, using different folders, redoing everything many times, and one of the syncs finally downloaded resources as it was supposed to. But that took forever and I had so many different files, so I have no idea what the actual problem was. I really don’t want to have to do all of that again, so if anyone knows why this happens, that would be super helpful!

Hi Sal,

What version of PsychoPy are you using? in general if you are using a more recent release (recommended) we recommend that you leave the “output” path in the Experiment settings > online tab blank (i.e. no need for “html”) - this is because it avoids duplication of resources and also can avoid these types of resource errors.

Thanks,
Becca

1 Like

Originally I didn’t have anything in that box, but when I switched to 2021.2.3, that was another weird thing that started. If I don’t put “html” there, it won’t export the .js and .html files into the html folder (they will instead be put in the same folder as the psychopy experiment) and then it won’t run on Pavlovia. So then I started adding “html” there and it fixed that problem. Is that why the resources aren’t downloading automatically? That might make sense for the new experiments, but that doesn’t explain the two experiments that have been working on Pavlovia for months and randomly stopped downloading files automatically two days ago without me touching anything.

P.S. I made this its own thread yesterday with more details, if you want to help me there instead. Thank you!

We want the JS files in the same folder as the psyexp file as of September 2020.

But then it wouldn’t run.

An experiment that has never been exported to the html folder should be fine. I do still have some experiments running from /html but (as I’ve mentioned elsewhere) recently deleted and recreated one of them to get it working without.