Image File Paths and Randomization #1350
-
Hello! I'm very new to jspsych and am designing an experiment in which I need to randomly sample 5 images from a set of 40 and then display those images in a table on the screen. I'm able to sample the 5 images just fine using sampleWithoutReplacement and then I put those images into their own array. My problem is this: Of course any and all help is appreciated and if you need more info I'm happy to oblige. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @MTuttle6! Do you mind sharing a little more about how you're setting up your trials, for instance by posting your code (simplified/reproducible, if possible)? But in general, if you're storing your 5 randomly-sampled images in an array, then one option is to use dynamic parameters to access the elements of the array for each trial (if you're adding trials individually to your timeline). Another option is to add the sampled image files into an array of objects that can be used as your timeline variables array (if you're using the timeline variables method). If you don't mind posting some example code then we can offer more guidance 😃 |
Beta Was this translation helpful? Give feedback.
Hi @MTuttle6! Do you mind sharing a little more about how you're setting up your trials, for instance by posting your code (simplified/reproducible, if possible)?
But in general, if you're storing your 5 randomly-sampled images in an array, then one option is to use dynamic parameters to access the elements of the array for each trial (if you're adding trials individually to your timeline). Another option is to add the sampled image files into an array of objects that can be used as your timeline variables array (if you're using the timeline variables method). If you don't mind posting some example code then we can offer more guidance 😃