// Numbas version: exam_results_page_options {"name": "Reveal answer to a single part after submitting", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {}, "extensions": [], "functions": {}, "advice": "

.

", "tags": [], "type": "question", "statement": "

A couple of different ways of showing the correct answer to a single part as soon as the student submits an answer. One way allows the student to change their answer, while the other locks the part.

\n

The third part includes a \"reveal answers to this part\" button, which allows the student to choose to reveal the answer to the part.

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

A couple of different ways of showing the correct answer to a single part as soon as the student submits an answer. One way allows the student to change their answer, while the other locks the part.

\n

A third part includes a \"reveal answers to this part\" button, which allows the student to choose to reveal the answer to the part.

\n

Think very carefully before using this: by revealing the answer, you are removing the opportunity for the student to later on realise they've got that step wrong, as a consequence of some further work. It's often possible to use adaptive marking to use the student's answer in place of the correct answer in later parts.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "parts": [{"mustBeReducedPC": 0, "showCorrectAnswer": true, "variableReplacements": [], "maxValue": "2", "allowFractions": false, "marks": 1, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "minValue": "2", "prompt": "

The expected answer to this part is shown as soon as you submit an answer.

\n

What is 1+1?

", "scripts": {"constructor": {"script": "var part = this;\n\n// override the \"show the correct answer\" flag to make it also show the correct answer if the part has just been answered\n// the default behaviour still applies as well - the correct answer is shown if the exam is over or the student chooses to reveal answers\nvar old_showCorrectAnswer = this.display.showCorrectAnswer;\npart.display.showCorrectAnswer = ko.computed(function() {\n return old_showCorrectAnswer() || part.display.answered();\n});", "order": "after"}}, "mustBeReduced": false, "showFeedbackIcon": true}, {"mustBeReducedPC": 0, "showCorrectAnswer": true, "variableReplacements": [], "maxValue": "2", "allowFractions": false, "marks": 1, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "minValue": "2", "prompt": "

The expected answer to this part is shown as soon as you submit an answer. This is achieved by calling revealAnswer, so you can't change your answer later.

\n

What is 1+1?

", "scripts": {"mark": {"script": "this.revealAnswer();", "order": "after"}}, "mustBeReduced": false, "showFeedbackIcon": true}, {"mustBeReducedPC": 0, "showCorrectAnswer": true, "variableReplacements": [], "maxValue": "2", "allowFractions": false, "marks": 1, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "minValue": "2", "prompt": "

The expected answer to this part is shown as soon as you submit an answer. This is achieved by calling revealAnswer, so you can't change your answer later.

\n

What is 1+1?

\n

", "scripts": {"constructor": {"script": "var part = this;\nthis.display.confirmRevealAnswer = function() {\n Numbas.display.showConfirm(\n \"Would you like to reveal the answer to this question? Any marks you have received so far will be locked and you will not be able to answer this question later.\",\n function() {\n part.revealAnswer();\n }\n );\n}", "order": "after"}}, "mustBeReduced": false, "showFeedbackIcon": true}], "rulesets": {}, "preamble": {"js": "", "css": ""}, "name": "Reveal answer to a single part after submitting", "variable_groups": [], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}