Tool to easily create formative web-based self-assessment quizzes
Core
self-assessment.js
to bypass jquery-history States:
var useHistory = false;
?page=2
) which seems broken and stops page reloads (i.e. on quiz retry)Minor bug fixes
{ "questions": [ ... ], "endPage": [ { "title":"<h4>Quiz Complete</h4>", "textAllCorrect":"<p>Awesome! You've obviously mastered the subject.</p>", "textPass":"<p>Well done! You've passed this quiz.</p>", "failPercentage":75, "textFail":"<p>You didn't do so well and need to go back over the materials again.</p>", "showScore":true, "showRetry":true } ] }
To turn on, set the 'correct' attribute to 'all' i.e.
"correct": "all"
rather than the usual
"correct": "d" or "correct": "b,c,e".
Note that this overrides the showAllFeedbackOnCorrect default from true to false (unless explicitly set in the json file) as it doesn't make sense to show all feedback if all are correct.
Note that this can't work for multiple answer - the option will only be available (activated) if there is only one correct answer for that question. Also, the 'reveal answer' help button doesn't make much sense in this context and is not currently implemented (although it could be added if really necessary).
NB. This is currently implemented on a per question basis (as an attribute of each question's JSON settings). However, it might make more sense for it to be a single setting at the quiz level (in the root 'questions' node of the JSON file). A user would expect an entire quiz to behave in the same way so, currently, all questions need to have that attribute ( "instantsubmit": "true" ) added. Would probably be better to only have to set it once.
{ "questiontype": "mcq", "question": "<h3>Step-wise approach to asthma therapy</h3><p>Here is a plan showing what drugs are recommended for asthmatics based on the severity of their condition (defined by FEV).</p><p><img src=\"images/asthma_steps_0.jpg\" width=\"600\" height=\"400\" /></p><p>Which one of the following should you prescribe for <strong>Step 1</strong>?</p>", "answers":{ "a":"SR theophylline", "b":"Inhaled short acting beta2 agonist", "c":"Inhaled long acting beta2 agonist", "d":"Oral beta2 agonist", "e":"Oral steroid", "f":"Leukotriene receptor antagonist", "g":"Daily i.v. injection of antibodies against TNFa", "h":"Inhaled dose of antibodies against IL-1", "i":"Inhaled low dose of steroid" }, "feedback": { "a":"No way you'd never use...", "b":"<p>Inhaled short acting beta2 agonist is the correct treatment at this stage.</p>", "c":"No way you'd never use...", "d":"No way you'd never use...", "e":"No way you'd never use...", "f":"No way you'd never use...", "g":"No way you'd never use...", "h":"No way you'd never use...", "i":"No way you'd never use..." }, "showAllFeedbackOnCorrect":"false", "correct":"b" },
This is ok and works:
{ "questiontype": "mcq", "question": "<h3>Step-wise approach to asthma therapy</h3><p>Which one of the following should you prescribe for <strong>Step 2</strong> (in addition to the drug prescribed in step 1)?</p><p><img src=\"images/asthma_steps_1.jpg\" width=\"600\" height=\"400\" /></p>", "answers":{ "4":"Leukotriene receptor antagonist", "1":"Inhaled short acting beta2 agonist", "9":"Inhaled dose of antibodies against IL-1", "3":"Inhaled long acting beta2 agonist", "7":"Oral steroid", "5":"SR theophylline", "6":"Oral beta2 agonist", "2":"Inhaled low dose of steroid", "8":"Daily i.v. injection of antibodies against TNFa" }, "correct":"2", "feedbackGeneral": "<p>Inhaled low dose of steroid is the correct treatment at this stage.</p>" },
This breaks, with the error: "Uncaught SyntaxError: Unexpected number --> data.questions[1].feedback.1"
{ "questiontype": "mcq", "question": "<h3>Step-wise approach to asthma therapy</h3><p>Here is a plan showing what drugs are recommended for asthmatics based on the severity of their condition (defined by FEV).</p><p><img src=\"images/asthma_steps_0.jpg\" width=\"600\" height=\"400\" /></p><p>Which one of the following should you prescribe for <strong>Step 1</strong>?</p>", "answers":{ "1":"SR theophylline", "2":"Inhaled short acting beta2 agonist", "3":"Inhaled long acting beta2 agonist", "4":"Oral beta2 agonist", "5":"Oral steroid", "6":"Leukotriene receptor antagonist", "7":"Daily i.v. injection of antibodies against TNFa", "8":"Inhaled dose of antibodies against IL-1", "9":"Inhaled low dose of steroid" }, "feedback": { "1":"No way you'd never use...", "2":"<p>Inhaled short acting beta2 agonist is the correct treatment at this stage.</p>", "3":"No way you'd never use...", "4":"No way you'd never use...", "5":"No way you'd never use...", "6":"No way you'd never use...", "7":"No way you'd never use...", "8":"No way you'd never use...", "9":"No way you'd never use..." }, "correct":"2" },
This is the temp solution (note use of a,b,c instead of 1,2,3):
{ "questiontype": "mcq", "question": "<h3>Step-wise approach to asthma therapy</h3><p>Here is a plan showing what drugs are recommended for asthmatics based on the severity of their condition (defined by FEV).</p><p><img src=\"images/asthma_steps_0.jpg\" width=\"600\" height=\"400\" /></p><p>Which one of the following should you prescribe for <strong>Step 1</strong>?</p>", "answers":{ "a":"SR theophylline", "b":"Inhaled short acting beta2 agonist", "c":"Inhaled long acting beta2 agonist", "d":"Oral beta2 agonist", "e":"Oral steroid", "f":"Leukotriene receptor antagonist", "g":"Daily i.v. injection of antibodies against TNFa", "h":"Inhaled dose of antibodies against IL-1", "i":"Inhaled low dose of steroid" }, "feedback": { "a":"No way you'd never use...", "b":"<p>Inhaled short acting beta2 agonist is the correct treatment at this stage.</p>", "c":"No way you'd never use...", "d":"No way you'd never use...", "e":"No way you'd never use...", "f":"No way you'd never use...", "g":"No way you'd never use...", "h":"No way you'd never use...", "i":"No way you'd never use..." }, "correct":"b" },
Major update