I’m working on online experiment. I created this function to let the participants choose one picture out of two pictures, but it’s not working. Any ideas why?
I’m using jsPsych plugins.
function make_choice_trial(target, foil) {
var target_path = "img/" + target + ".png";
var foil_path = "img/" + foil + ".png";
trial = {
type: jsPsychImageButtonResponse,
stimulus: target_path, foil_path,
choices: ['1', '2'],
}
return trial;
}
var choice_trials_candy = [
make_choice_trial("candy_cat","Rebecca_rabbit"), ]
var choice_trials_Rebecca = [
make_choice_trial("Rebecca_rabbit","candy_cat"),
]
var choice_trials = jsPsych.randomization.repeat(
[choice_trials_candy, choice_trials_Rebecca],
[3, 2]
);