Randomly pair two sets of stimuli #2618
-
Hi! I'm running an artificial language experiment where each word of the artificial language should be randomly paired with an image, consistently for each participant but randomized across participants. So I have a set of 30 images and 30 audio files to pair up at the beginning of the experiment. What's the easiest way of doing this? I was thinking of making an array of images, an array of sound files, shuffling one of them with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @OllieSayeed I think your approach sounds reasonable. You could create a joint array out of the two arrays in order to take advantage of timeline variables. Something like this: let arr_images = jsPsych.randomization.shuffle([...]);
let arr_audio = jsPsych.randomization.shuffle([...]);
let trials = [];
for(let i = 0; i<arr_images.length; i++){
trials.push({image: arr_images[i], audio: arr_audio[i]});
} |
Beta Was this translation helpful? Give feedback.
Hi @OllieSayeed
I think your approach sounds reasonable. You could create a joint array out of the two arrays in order to take advantage of timeline variables. Something like this: