jsPsych/examples/jspsych-survey-multi-select.html
2017-07-23 13:04:39 -04:00

34 lines
963 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="../jspsych.js" ></script>
<script src="../plugins/jspsych-survey-multi-select.js" ></script>
<link rel="stylesheet" href="../css/jspsych.css"></link>
</head>
<body>
</body>
<script>
var choices1 = ["Red", "Yellow", "Green", "Blue", "Black"];
var choices2 = ["Apples", "Bananas", "Carrots", "Donuts", "Eggplant"];
var multi_choice_block = {
type: 'survey-multi-select',
nested: [{question: "Which of these colors do you like?", options: choices1, horizontal: true}, {question: "Which of these foods do you like?", options: choices2, horizontal: true}],
required: true,
on_finish: function(data) {
console.log("i'm data", data)
}
};
jsPsych.init({
timeline: [multi_choice_block],
on_finish: function(data) {
jsPsych.data.displayData();
},
});
</script>
</html>