// Numbas version: exam_results_page_options {"name": "Custom marking - error carried forward", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "", "notes": ""}, "advice": "", "variable_groups": [], "type": "question", "name": "Custom marking - error carried forward", "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "root_b", "root_a", "b"], "parts": [{"prompt": "

\\begin{align} a &= \\var{a}, \\\\ b &= \\var{b} \\end{align}

\n

$\\sqrt{a} =$ [[0]] (give your answer to two decimal places)

\n

$\\sqrt{b} =$ [[1]] (give your answer to two decimal places)

\n

Using the answers you gave above, calculate $\\sqrt{a} + \\sqrt{b} = $ [[2]] (give your answer to two decimal places)

\n

If you enter incorrect values for either of $\\sqrt{a}$ and $\\sqrt{b}$ but do the addition correctly, you will only lose mark(s) for the initial error.

", "type": "gapfill", "gaps": [{"correctAnswerFraction": false, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionPartialCredit": 0, "showCorrectAnswer": true, "maxValue": "root_a", "strictPrecision": true, "showPrecisionHint": false, "precision": 2, "precisionType": "dp", "scripts": {}, "minValue": "root_a", "allowFractions": false, "marks": 1}, {"correctAnswerFraction": false, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionPartialCredit": 0, "showCorrectAnswer": true, "maxValue": "root_b", "strictPrecision": true, "showPrecisionHint": false, "precision": 2, "precisionType": "dp", "scripts": {}, "minValue": "root_b", "allowFractions": false, "marks": 1}, {"correctAnswerFraction": false, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "precisionPartialCredit": 0, "showCorrectAnswer": true, "maxValue": "root_a+root_b", "strictPrecision": true, "showPrecisionHint": false, "precision": 2, "precisionType": "dp", "scripts": {"mark": {"order": "instead", "script": "// get the student's answers to the first two steps\nvar gap0 = this.parentPart.gaps[0];\nvar gap1 = this.parentPart.gaps[1];\n\n// if either of them was wrong, tell the student we're carrying the error forward\nif(gap0.credit<1) {\n this.markingComment('Error carried forward from $\\\\sqrt{a}$. The value you gave will be used to mark the sum.');\n}\nif(gap1.credit<1) {\n this.markingComment('Error carried forward from $\\\\sqrt{b}$. The value you gave will be used to mark the sum');\n}\n\nvar ecf = gap0.credit<1 || gap1.credit<1;\n\n// re-set the correct answer to gap 2 based on the answers to gaps 0 and 1\nvar student_a = parseFloat(gap0.studentAnswer);\nvar student_b = parseFloat(gap1.studentAnswer);\nthis.settings.minvalue = this.settings.maxvalue = Numbas.math.precround(student_a+student_b,2);\n\n// mark this gap\nNumberEntryPart.prototype.mark.apply(this);"}}, "minValue": "root_a+root_b", "allowFractions": false, "marks": 1}], "showCorrectAnswer": true, "scripts": {}, "marks": 0}], "preamble": {"css": "", "js": ""}, "rulesets": {}, "tags": ["custom marking", "demo"], "showQuestionGroupNames": false, "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [], "name": ""}], "functions": {}, "variables": {"root_b": {"group": "Ungrouped variables", "name": "root_b", "templateType": "anything", "description": "", "definition": "precround(sqrt(b),2)"}, "a": {"group": "Ungrouped variables", "name": "a", "templateType": "anything", "description": "", "definition": "random(100..200#0.0001)"}, "b": {"group": "Ungrouped variables", "name": "b", "templateType": "anything", "description": "", "definition": "random(50..100#0.0001)"}, "root_a": {"group": "Ungrouped variables", "name": "root_a", "templateType": "anything", "description": "", "definition": "precround(sqrt(a),2)"}}, "statement": "", "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/"}]}