The automatic bar seems to progress by block: intro block, practice block, test block, debrief block.
What if I want it to display only during the test block, and progress by each few test trials. Say, I have 300 test trials, and i want the bar to progress a little every 3 trials, something like that.
I also read from the above tutorial that you can do some manual control, like the following:
var trial = {
type: 'html-keyboard-response',
stimulus: 'Almost done...',
on_finish: function(){
jsPsych.setProgressBar(0.85); // set progress bar to 85% full.
}
}However, my code for the test block is written like this (i'm using a 10-trial simplified version as an example):
var test_stimuli = [
{stimulus: 'img/02-03.png'},
{stimulus: 'img/02-04.png'},
{stimulus: 'img/02-07.png'},
{stimulus: 'img/02-08.png'},
{stimulus: 'img/02-09.png'},
{stimulus: 'img/02-12.png'},
{stimulus: 'img/02-13.png'},
{stimulus: 'img/02-14.png'},
{stimulus: 'img/02-17.png'},
{stimulus: 'img/02-18.png'},
{stimulus: 'img/02-19.png'},
];
var test = {
type: 'image-keyboard-response',
stimulus: jsPsych.timelineVariable('stimulus'),
choices: ['f', 'j'],
prompt: "<p><b>Which one is a better red?</b></p>",
};
In this case, how should i write the code to achieve what i want? Thank you very much!