jsPsych/examples/add-to-end-of-timeline.html
2021-02-18 17:37:28 -05:00

33 lines
794 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-html-keyboard-response.js"></script>
<script src="../plugins/jspsych-image-keyboard-response.js"></script>
<link rel="stylesheet" href="../css/jspsych.css">
</head>
<body></body>
<script>
var first = {
type: 'html-keyboard-response',
stimulus: 'first trial; new trial added when on_finish is called',
on_finish: function(){
jsPsych.addNodeToEndOfTimeline({
timeline: [{
type: 'image-keyboard-response',
stimulus: 'img/happy_face_4.jpg',
stimulus_width: 300
}]
})
}
}
jsPsych.init({
timeline: [first],
on_finish: function(){jsPsych.data.displayData(); }
});
</script>
</html>