From 12b13d50f9634e152c78a52e1dd614c2f6ca7de9 Mon Sep 17 00:00:00 2001 From: Becky Gilbert Date: Fri, 5 Jan 2024 14:13:10 -0800 Subject: [PATCH] update survey demo 4 --- docs/demos/jspsych-survey-demo4.html | 47 ++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/docs/demos/jspsych-survey-demo4.html b/docs/demos/jspsych-survey-demo4.html index 9a4e004d8f..f612e69dea 100644 --- a/docs/demos/jspsych-survey-demo4.html +++ b/docs/demos/jspsych-survey-demo4.html @@ -5,9 +5,9 @@ - + - + @@ -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: '

That response was incorrect.

' + }, + { + type: 'html', + name: 'correct', + visibleIf: '{correctAnswers} == {questionCount}', + html: '

Congratulations!

' + } + ] + }] + }) }; const timeline = [trial];