jsPsych/examples/jspsych-survey-likert.html
2020-05-26 20:20:03 -05:00

43 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../jspsych.js"></script>
<script src="../plugins/jspsych-survey-likert.js"></script>
<link rel="stylesheet" href="../css/jspsych.css">
</head>
<body></body>
<script>
var scale = ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"];
var likert_trial = {
type: 'survey-likert',
questions: [
{prompt: "I like vegetables.", name: 'Vegetables', labels: scale, required: true},
{prompt: "I like fruit.", name: 'Fruit', labels: scale, required: true}
],
};
var likert_trial_random_order = {
type: 'survey-likert',
questions: [
{prompt: "Question 1", labels: scale},
{prompt: "Question 2", labels: scale},
{prompt: "Question 3", labels: scale},
{prompt: "Question 4", labels: scale},
{prompt: "Question 5", labels: scale}
],
randomize_question_order: true,
scale_width: 500
};
jsPsych.init({
timeline: [likert_trial, likert_trial_random_order],
on_finish: function() { jsPsych.data.displayData(); }
});
</script>
</html>