Managing resources


I am preparing an exp with many images (~ 1500), of which each participant only needs about 200.
Hence, the need to manage resource downloading.
I understand how to define a dict with {name, path} pairs for psychoJS.start, but have two questions :

  1. Is there a way to specify a whole folder of files globally (rather than having to code one line for each image file) ? i.e., something like
    {name : 'Group1_imgs/*', path : ../Group1_imgs/*'}

  2. I did some trials by adding psychoJS.start code in a code component to be run before the experiment. I see in the .js script that there are now two psychoJS.start blocks. Is that safe or is there another better way to proceed ?

Thanks much !

Actually, yes, you can download further resources during an experiment:
psychojs/ServerManager.js at master · psychopy/psychojs · GitHub
we just haven’t started doing that yet from Builder-output code

1 Like

Thanks. Made some progress but I am stuck…
I succeeded to download list files with psychoJS.start, and to download specific images with psychoJS.downloadResources at the beginning of the routine.
I can see in the Console that images are indeed downloaded. However, it seems that they are not registered correctly, as I get the following error msg :

and this is the error in the console :

The error does not occur if the images are downloaded before the exp, with psychoJS.start.