jsPsych/packages/plugin-survey/example.html

39 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych/dist/index.browser.js"></script>
<script src="./dist/index.browser.js"></script>
<link rel="stylesheet" href="../jspsych/css/jspsych.css"></script>
</head>
<body></body>
<script type="text/javascript">
var jsPsych = initJsPsych({
on_finish: function() {
jsPsych.data.displayData();
}
});
var survey_trial = {
type: jsPsychSurvey,
pages: [
[
{type: 'html', prompt: '<p>Here is some arbitrary text via an "html" question type.<br>Similar to preamble but can be inserted anywhere in the question set.</p>'},
{type: 'text', prompt: 'Page 1, question 1.'},
{type: 'text', prompt: 'Page 1, question 2.'},
],
[
{type: 'text', prompt: 'Page 2, question 1.'},
{type: 'html', prompt: '<p>Don&#39;t forget to answer the next question!</p>'},
{type: 'text', prompt: 'Page 2, question 2.'},
]
],
button_label_next: "Next >",
button_label_back: "< Back",
button_label_finish: "Finish!",
};
jsPsych.run([survey_trial]);
</script>
</html>