-
-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60a1ace
commit 12b13d5
Showing
1 changed file
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ | |
<script src="docs-demo-timeline.js"></script> | ||
<script src="https://unpkg.com/[email protected]"></script> | ||
<script src="https://unpkg.com/@jspsych/[email protected]"></script> | ||
<script src="https://unpkg.com/@jspsych/plugin-survey@0.2.2"></script> | ||
<script src="../../packages/plugin-survey/dist/index.browser.js"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/@jspsych/plugin-survey@0.2.2/css/survey.css"> | ||
<link rel="stylesheet" href="../../packages/plugin-survey/css/survey.css"> | ||
<link rel="stylesheet" href="docs-demo.css" type="text/css"> | ||
</head> | ||
<body></body> | ||
|
@@ -17,17 +17,38 @@ | |
|
||
const trial = { | ||
type: jsPsychSurvey, | ||
pages: [ | ||
[ | ||
{ | ||
type: 'multi-choice', | ||
prompt: 'During the experiment, are allowed to write things down on paper to help you?', | ||
options: ["Yes", "No"], | ||
correct_response: "No", | ||
required: true | ||
}, | ||
] | ||
], | ||
survey_json: JSON.stringify({ | ||
showQuestionNumbers: false, | ||
title: 'Multiple choice question with a correct answer.', | ||
pages: [{ | ||
name: 'question', | ||
elements: [ | ||
{ | ||
type: 'radiogroup', | ||
title: 'During the experiment, are you allowed to write things down on paper to help you?', | ||
choices: ["Yes", "No"], | ||
correctAnswer: "No", | ||
isRequired: true | ||
} | ||
], | ||
}, { | ||
name: 'score', | ||
elements: [ | ||
{ | ||
type: 'html', | ||
name: 'incorrect', | ||
visibleIf: '{correctAnswers} < {questionCount}', | ||
html: '<h4>That response was incorrect.</h4>' | ||
}, | ||
{ | ||
type: 'html', | ||
name: 'correct', | ||
visibleIf: '{correctAnswers} == {questionCount}', | ||
html: '<h4>Congratulations!</h4>' | ||
} | ||
] | ||
}] | ||
}) | ||
}; | ||
|
||
const timeline = [trial]; | ||
|