Randomization across blocks #2623
-
Hi! 😊 tia, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @alberteseeberg, One approach would be to create an array of the 90 sound files and shuffle the order: const sounds = ['sound1.mp3', 'sound2.mp3', ... ];
const randomized_sounds = jsPsych.randomization.shuffle(sounds); Then you can take the first set of const block_1 = {
timeline: []
}
// here I'm assuming 23 trials in the first block
for(let i=0; i<23; i++){
block_1.timeline.push({
type: jsPsychAudioKeyboardResponse,
stimulus: randomized_sounds[i]
});
} ... and so on for the other blocks. Then you can add There are other ways you could do this as well, so feel free to share more of your current implementation if you'd like a suggestion that more closely matches what you currently are working with. |
Beta Was this translation helpful? Give feedback.
Hi @alberteseeberg,
One approach would be to create an array of the 90 sound files and shuffle the order:
Then you can take the first set of
randomized_sounds
to create the first block.... and so on for the other blocks.
Then you can add
block_1
,block_2
, etc. to your main timeline.There are other ways you could do this as well, so feel free to share more o…