mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 19:20:55 +00:00
37 lines
935 B
HTML
37 lines
935 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 questions=["Which of these colors do you like?", "Which of these foods do you like?"]
|
|
var choices = [
|
|
["Red", "Yellow", "Green", "Blue", "Black"],
|
|
["Apples", "Bananas", "Carrots", "Donuts", "Eggplant"]
|
|
]
|
|
var multi_choice_block = {
|
|
type: 'survey-multi-select',
|
|
questions: questions,
|
|
options: choices,
|
|
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>
|