// Numbas version: exam_results_page_options {"feedback": {"feedbackmessages": [], "allowrevealanswer": true, "showtotalmark": true, "showanswerstate": true, "intro": "", "showactualmark": true, "advicethreshold": 0}, "duration": 0, "showQuestionGroupNames": false, "navigation": {"preventleave": false, "showresultspage": "oncompletion", "allowregen": true, "onleave": {"message": "", "action": "none"}, "reverse": true, "showfrontpage": false, "browse": true}, "question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Group", "questions": [{"name": "Custom marking - answer is a set", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "tags": ["custom marking", "demo"], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"odds": {"name": "odds", "group": "Ungrouped variables", "definition": "mod(im(qb+det),2)+mod(re(qb+det),2)", "description": "", "templateType": "anything", "can_override": false}, "eb": {"name": "eb", "group": "Ungrouped variables", "definition": "-f*(x0+x1)", "description": "", "templateType": "anything", "can_override": false}, "roots": {"name": "roots", "group": "Ungrouped variables", "definition": "if(im(det)<>0,[],if(det=0,[x0],[x0,x1]))", "description": "", "templateType": "anything", "can_override": false}, "x1": {"name": "x1", "group": "Ungrouped variables", "definition": "(-qb-det)/2", "description": "", "templateType": "anything", "can_override": false}, "x0": {"name": "x0", "group": "Ungrouped variables", "definition": "(-qb+det)/2", "description": "", "templateType": "anything", "can_override": false}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "if(odds=0,1,4)", "description": "", "templateType": "anything", "can_override": false}, "ea": {"name": "ea", "group": "Ungrouped variables", "definition": "f", "description": "", "templateType": "anything", "can_override": false}, "det": {"name": "det", "group": "Ungrouped variables", "definition": "random(0..3)*random(1,i)", "description": "", "templateType": "anything", "can_override": false}, "ec": {"name": "ec", "group": "Ungrouped variables", "definition": "x0*x1*f", "description": "", "templateType": "anything", "can_override": false}, "qb": {"name": "qb", "group": "Ungrouped variables", "definition": "random(-3..3)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["f", "ea", "odds", "det", "ec", "eb", "qb", "x0", "x1", "roots"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 2, "scripts": {"mark": {"script": "// evaluate the student's answer\ntry {\n var list = Numbas.jme.evaluate(this.studentAnswer,this.question.scope);\n}\ncatch(e)\n{\n this.setCredit(0,R('part.jme.answer invalid',e.message));\n return;\n}\n\n// check the answer is a list\nthis.notAList = list.type!='list';\nif(this.notAList) {\n this.setCredit(0,'Your answer is not a list of numbers.');\n return;\n}\n\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\n\n// get the roots of the equation\nvar roots = variables.roots.value.map(v => unwrap(Numbas.jme.castToType(v,'number')));\n\n// unwrap the student's list to a Javascript array of numbers\nvar list = list.value.map(v => unwrap(Numbas.jme.castToType(v,'number')));\n\n// get the coefficients of the equation\nvar ea = unwrap(Numbas.jme.castToType(variables.ea,'number'));\nvar eb = unwrap(Numbas.jme.castToType(variables.eb,'number'));\nvar ec = unwrap(Numbas.jme.castToType(variables.ec,'number'));\n\n// check each root the student gave, keeping track of how many they got right\nvar got = 0;\nvar wrong = [];\nfor(var i=0;iroots.length) {\n this.setCredit(0,\"This equation does not have \"+(list.length)+\" real-valued \"+Numbas.util.pluralise(list.length,'root','roots')+\".\");\n} else if(got[1,2].');\n return false;\n}\nreturn true;", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Give the set of real-valued roots of the equation 

\n

\\[ \\simplify[all,fractionnumbers]{{ea}x^2+{eb}x+{ec}}=0 \\]

\n

Enter your answer as a list of numbers separated by commas and enclosed by square brackets, e.g. [1,2].

\n

If the equation has no roots, enter []

", "answer": "{roots}", "answerSimplification": "fractionNumbers", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Custom marking - differentiate student's answer", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": ["custom marking", "demo"], "metadata": {"description": "

The student is asked to integrate a given function. The marking algorithm differentiates the student's answer, and checks that it is equivalent to the original function.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1..10)", "description": "", "templateType": "anything", "can_override": false}, "expr": {"name": "expr", "group": "Ungrouped variables", "definition": "simplify(substitute([\"a\":a,\"b\":b], expression(\"cos(a*x) + e^(x/b)\")),\"all\")", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "expr"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

This part is marked by calculating the derivative of your answer and comparing it to the original expression.

\n

$\\displaystyle{\\int \\var{expr} \\,\\mathrm{d}x = }$ [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 2, "scripts": {}, "customMarkingAlgorithm": "studentCompare: diff(studentexpr,\"x\")\n\ncorrectCompare: diff(base_correctCompare, \"x\")", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "1/{a}*sin({a}*x) + {b}*e^(x/{b})", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Custom marking - error carried forward", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "", "notes": ""}, "advice": "", "variable_groups": [], "type": "question", "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": ""}, {"name": "Pattern matching - factorise an equation", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "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/"}], "tags": ["custom marking", "demo"], "metadata": {"description": "

The student is asked to factorise a quadratic $x^2 + ax + b$. A custom marking script uses pattern matching to ensure that the student's answer is of the form $(x+a)(x+b)$, $(x+a)^2$, or $x(x+a)$.

\n

To find the script, look in the Scripts tab of part a.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {"b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-5..5)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "1", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Factorise $\\simplify{x^2+{a+b}x+{a*b}}$

", "answer": "(x+{a})(x+{b})", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "mustmatchpattern": {"pattern": "((`+-($n`?*x) + `+- $n`?)^$n`?)`* * $z", "partialCredit": 0, "message": "You have not factorised the expression.", "nameToCompare": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "percentPass": 0, "showstudentname": true, "name": "Leeds innovative e-assessment demo", "timing": {"timedwarning": {"message": "", "action": "none"}, "allowPause": true, "timeout": {"message": "", "action": "none"}}, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "exam", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "extensions": [], "custom_part_types": [], "resources": []}