// Numbas version: exam_results_page_options {"name": "Only mark a gap depending on the answer to a previous gap.", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"root_2": {"name": "root_2", "group": "Ungrouped variables", "definition": "(-b-sqrt(discriminant))/(2*a)", "templateType": "anything", "description": ""}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-10..10)", "templateType": "anything", "description": "

Constant term

"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "templateType": "anything", "description": "

Coefficient of $x^2$

"}, "discriminant": {"name": "discriminant", "group": "Ungrouped variables", "definition": "b^2-4*a*c", "templateType": "anything", "description": ""}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-10..10)", "templateType": "anything", "description": "

Coefficient of $x$

"}, "root_1": {"name": "root_1", "group": "Ungrouped variables", "definition": "(-b+sqrt(discriminant))/(2*a)", "templateType": "anything", "description": ""}}, "variable_groups": [], "name": "Only mark a gap depending on the answer to a previous gap.", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Student is asked whether a quadratic equation can be factorised. If they say \"yes\", they're asked to give the factorisation.

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"sortAnswers": false, "extendBaseMarkingAlgorithm": true, "scripts": {"constructor": {"script": "// override the default 'submit' method for the part\n// we only want to submit gap 2 if the answer to gap 1 is \"yes\"\nthis.submit = Numbas.util.extend(function() {\n this.gaps[0].submit();\n this.gaps[1].submit();\n if(this.gaps[1].yes) {\n this.gaps[2].submit();\n } else {\n this.gaps[2].answered = true;\n }\n},Part.prototype.submit);", "order": "after"}, "mark": {"script": "var gaps = this.gaps;\n// if the student said \"yes\" to gap 1, then mark their factorisation\nif(gaps[1].yes) {\n this.__proto__.mark.apply(this);\n// otherwise, work out the credit based on the amounts awarded for the first two gaps\n} else {\n this.setCredit((gaps[0].credit*gaps[0].marks+gaps[1].credit*gaps[1].marks)/(gaps[0].marks+gaps[1].marks));\n}", "order": "instead"}}, "variableReplacementStrategy": "originalfirst", "useCustomName": false, "type": "gapfill", "showCorrectAnswer": true, "prompt": "

Consider \\[ \\simplify[basic]{{a}x^2 + {b}x + {c}} = 0 \\]

\n

What is the discriminant of this equation? [[0]]

\n

Does this equation have a factorisation? [[1]]

\n
\n

What is it?

\n

[[2]] $ = 0$

\n
", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "unitTests": [], "customName": "", "variableReplacements": [], "gaps": [{"unitTests": [], "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "useCustomName": false, "showCorrectAnswer": true, "type": "numberentry", "mustBeReduced": false, "maxValue": "discriminant", "showFractionHint": true, "correctAnswerStyle": "plain", "customMarkingAlgorithm": "", "marks": 1, "notationStyles": ["plain", "en", "si-en"], "minValue": "discriminant", "customName": "", "variableReplacements": [], "correctAnswerFraction": false, "allowFractions": false, "showFeedbackIcon": true}, {"unitTests": [], "customName": "", "extendBaseMarkingAlgorithm": true, "scripts": {"mark": {"script": "// store whether the student said \"yes\" in an attribute that's easier to access\nthis.yes = this.ticks[0][0];", "order": "after"}}, "variableReplacementStrategy": "originalfirst", "showCellAnswerState": true, "useCustomName": false, "type": "1_n_2", "showCorrectAnswer": true, "minMarks": 0, "matrix": "if(discriminant<0,[0,1],[1,0])", "choices": ["

Yes

", "

No

"], "shuffleChoices": false, "customMarkingAlgorithm": "", "marks": 0, "maxMarks": 0, "displayColumns": 0, "variableReplacements": [], "displayType": "radiogroup", "showFeedbackIcon": true}, {"answer": "(x-{root_1})(x-{root_2})", "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacementStrategy": "originalfirst", "valuegenerators": [{"name": "x", "value": ""}], "showCorrectAnswer": true, "answerSimplification": "basic", "showPreview": true, "failureRate": 1, "customMarkingAlgorithm": "", "variableReplacements": [], "checkVariableNames": false, "showFeedbackIcon": true, "checkingType": "absdiff", "customName": "", "useCustomName": false, "type": "jme", "checkingAccuracy": 0.001, "vsetRangePoints": 5, "marks": 1, "vsetRange": [0, 1], "unitTests": []}], "marks": 0}], "preamble": {"css": "", "js": ""}, "tags": ["demo"], "extensions": [], "functions": {}, "ungrouped_variables": ["a", "c", "b", "discriminant", "root_2", "root_1"], "statement": "", "advice": "", "rulesets": {}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Chris Graham", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/369/"}]}