URL of experiment:
Sign in · GitLab
Experiment works properly in PsychoPy v2021.1.4 on local machine but not online - need help fixing JS code.
Description of experiment:
- study phase of a long-term memory experiment
- presentation of one image at a time, participants decide if indoor or outdoor
- 6 image sets comprising 192 images each (participants randomly assigned to one set), arranged within 6 different image folders (Set1, Set2,…, Set6)
- the 192 images are arranged in 96 pairs (001a.jpg, 001b.jpg, 002a.jp, 002b.jpg,…)
- Code element (“pickItems”) draws individual lists (of image paths) for each participant
- stimlistA contains paths of all “a” items, stimlistB contains paths of all “b” items
- stimlistA and stimlistB are then zipped to a table, shuffled, and split again, resulting in stimlistA_shuffled (e.g., 023a.jpg, 124a.jpg,…) and stimlistB_shuffled (e.g., 023b.jpg, 124b.jpg,…).
- “enclist” (final, shuffled list at encoding) consists of first 64 item paths of stimlistA_shuffled and paths 65-128 of stimlistB_shuffled:
if (((Setname === 1) && (VPcode < 150000))) {
enclist = [(stimlistA_shuffled.slice(0, 64)) + (stimlistB_shuffled.slice(64, 128))];
} else {
if (((Setname === 1) && (VPcode >= 150000))) {
enclist = [(stimlistB_shuffled.slice(0, 64)) + (stimlistA_shuffled.slice(64, 128))];
} else {…
…
Description of the problem:
error: “unknown resource”; it seems that the whole enclist is called when the image object shall be set - according to firefox browser console:
FATAL unknown | {“origin”:“ImageStim.setImage”,“context”:“when setting the image of ImageStim: image_enc_MST”,“error”:{“origin”:“ServerManager.getResource”,“context”:"when getting the value of resource: allitems/Set2/001a.jpg,allitems/Set2/002a.jpg,allitems/Set2/003a.jpg,allitems/Set2/004a.jpg,allitems/Set2/005a.jpg,…
After printing “enclist” it became clear to me that there has already been a problem with list creation as all paths are between the same two quotation marks - a further issue I could not solve so far:
What I tried so far (and didn´t help):
I replaced enclist by a simple list (stimlistA). This resulted in the following message:
Unfortunately we encountered the following error:
when setting the image of ImageStim: image_enc_MST when getting the value of resource: allitems/Set5/001a.jpg unknown resource
Try to run the experiment again. If the error persists, contact the experiment designer.
Does anybody have an idea how I could get the program to draw the actual images?
This would be of great help - many THANKS in advance!