URL of experiment:
Unfortunately I don’t have permission to make the code public
Description of the problem:
I’ve created a project in PsychoPy Builder. It runs fine locally. I’ve done “Export HTML” in the builder view and uploaded everything to GitLab. When I Pilot the project in Pavlovia, I get this error:
Hey @kierad, sorry to hear you are having problems getting your experiment to work as expected.
It might be that you need to manually queue up images and other resources for downloading as the experiment boots up. Could you try amending the psychoJS.start() call in your script as follows?
psychoJS.start({
expName: expName,
expInfo: expInfo,
// Manually populate the resources array, `name` should match
// the `image` prop in your ImageStim
resources: [
{
path: 'resources/stims/banana.png',
name: 'resources/stims/banana.png'
}
]
});
I hope that helps some, please feel free to follow up if not.
Follow-up question:
I’ve solved this issue by manually changing the Javascript (as described in the solution), but this is overwritten each time I export to HTML/sync to Pavlovia. Is there a way of doing this in the Builder so that this overwrite doesn’t happen?
I have tried adding a JS custom code component like this:
OK with reference to the following figure, if a file path for a given stimulus is statically specified, PsychoPy is smart enough to populate the resources array in JS for you.
As shown below, for anything extra or if dynamically sourcing file paths, e.g. from a spreadsheet, you can go into experiment settings and add those in manually (Thanks @Becca). You can avoid having to worry about psychoJS.downloadResources() playing tricks then.
Correction: as it turns out the latest version of PsychoPy should be automatically populating the resources array in JS from the Builder even if your file names are spreadsheet sourced, but provided their total is within reason