Lists of dictionaries working in Builder but not in Pavlovia

URL of experiment:

Description of the problem:

My experiment has 10 trials. Each trial presents a sound file which is said to have been created by a pair of children playing a game together (a different pair for each trial/sound file). The trials/sounds are presented sequentially (via an Order A/Order B set up) but the pairs of children are randomly assigned to each trial. Each of the 10 pairs of children has a name, picture and other text objects associated with it.

In Builder, I achieved this by using code to created a dictionary for each pair (containing their associated image files and text components etc), then created a list of dictionaries. I shuffled the list so that the pairs are in a different random order for each participant. Then I created another column in my Order A/B conditions file with a number 0-9 to represent the order of the (now shuffled) pairs.

In Builder, I have set the image component for each trial as pairs[$pairNo][‘Slide’] - so it draws on the list name (pairs), the number from the conditions file ($pairNo) and the name of the image I want to present (e.g. ‘Slide’).

Before uploading to Pavlovia I inserted a JS code component at the beginning of the experiment to translate the shuffle function (“shuffle = util.shuffle;”).

When I try to run the experiment via Pavlovia, the image file does not load. I get the following error message instead:

  • when setting the image of ImageStim: TrialPair
  • when getting the value of resource: pairs[$pairNo][‘Slide’]
  • unknown resource

The image files themselves are all there so I wonder if I need to present the dictionaries/list of dictionaries differently in the JS code? If this is the problem, any idea where I can find out how to do this? My googling has drawn a blank!

Thanks in advance for any help you can offer!

PS I have posted this question at the end of an older thread to do with constructing the experiment in the Builder function, but as it is really a question about getting online I thought I should repost here.