add example with custom button and page labels#

This commit is contained in:
Becky Gilbert 2020-12-08 15:13:36 -08:00
parent f795f29cc9
commit e9d632cfc2

View File

@ -8,17 +8,28 @@
<body></body>
<script>
var trial = {
var trial_1 = {
type: 'instructions',
pages: ['Welcome to the experiment. Click next to begin.',
'This is the second page of instructions.',
'This is the final page.'],
pages: ['<p>Welcome to the experiment.</p><p>This is the first set of instructions.</p><p>Click next to begin.</p>',
'<p>This is the second page of instructions.</p>',
'<p>This is the final page.</p>'],
show_clickable_nav: true
}
var trial_2 = {
type: 'instructions',
pages: ['<p>This is a new set of instructions.</p><p>Custom "Page X/Y" and next/previous button labels provide support for different languages.</p>',
'<p>This is the second page of instructions.</p>',
'<p>This is the final page.</p>'],
show_clickable_nav: true,
show_page_number: true
show_page_number: true,
button_label_previous: 'Anterior',
button_label_next: 'Próxima',
page_label: 'Página',
}
jsPsych.init({
timeline: [trial],
timeline: [trial_1, trial_2],
on_finish: function(){ jsPsych.data.displayData(); }
});