// Numbas version: exam_results_page_options {"showQuestionGroupNames": true, "metadata": {"description": "

Some questions demonstrating new features in Numbas v4.0: pattern-matching, inference of variable types in mathematical expression parts, and marking equations.

", "licence": "Creative Commons Attribution 4.0 International"}, "navigation": {"allowregen": true, "preventleave": true, "showresultspage": "oncompletion", "startpassword": "sesame", "onleave": {"action": "none", "message": ""}, "reverse": true, "browse": true, "showfrontpage": true}, "type": "exam", "timing": {"timedwarning": {"action": "none", "message": ""}, "allowPause": true, "timeout": {"action": "none", "message": ""}}, "name": "Josh's copy of Numbas v4.0", "showstudentname": true, "feedback": {"allowrevealanswer": true, "showanswerstate": true, "advicethreshold": 0, "showactualmark": true, "showtotalmark": true, "intro": "

This exam demonstrates the new features in Numbas v4.0.

\n

The password to begin this exam is SESAME. (That's a new feature!)

", "feedbackmessages": []}, "duration": 0, "percentPass": 0, "question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Pattern-matching", "questions": [{"name": "Demo of \"pattern to match\" restriction", "extensions": ["eukleides", "quantities", "random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"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/"}], "variable_groups": [{"name": "Part a - write as sum of two integers", "variables": ["n"]}, {"name": "Part b - expand brackets", "variables": ["a", "b"]}, {"name": "Part c - modulus argument form", "variables": ["modulus", "sr", "si", "theta"]}, {"name": "Part d - cartesian form", "variables": ["z1", "z2"]}, {"name": "Part f - index notation", "variables": ["p"]}, {"name": "Part g - polynomial", "variables": ["cA", "cB"]}, {"name": "Part h - common denominator", "variables": ["n1", "d1", "n2", "d2"]}, {"name": "Part j - don't use decimals", "variables": ["jn", "jd"]}, {"name": "Part k - rationalise denominator", "variables": ["ka", "kb", "kc", "kn"]}, {"name": "Part l - partial fractions", "variables": ["la", "lb"]}], "parts": [{"unitTests": [], "sortAnswers": false, "marks": 0, "showCorrectAnswer": true, "variableReplacements": [], "adaptiveMarkingPenalty": 0, "prompt": "

$\\simplify{{jn}x = {jd}y}$

\n

Find $y$. Don't use decimals. You'll get a penalty if you use a decimal in your answer.

\n

$y =$ [[0]]

", "extendBaseMarkingAlgorithm": true, "gaps": [{"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{jn}/{jd}x", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "! m_anywhere(decimal:$n)", "partialCredit": 0, "message": "You must use fractions or integers, not decimals."}, "showCorrectAnswer": true, "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}], "type": "gapfill", "scripts": {}, "customName": "", "useCustomName": false, "customMarkingAlgorithm": "", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "2^{p}", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "2^$n", "partialCredit": 0, "message": "Your answer must be in the form $2^n$, where $n \\in \\mathbb{R}$."}, "showCorrectAnswer": true, "prompt": "

Write $\\var{2^p}$ in the form $2^n$.

", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{n1*d2/gcd(d1,d2)}/{d1*d2/gcd(d1,d2)} + {n2*d1/gcd(d1,d2)}/{d1*d2/gcd(d1,d2)}", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "(+-($n/$n;=d))* + $z", "partialCredit": 0, "message": "All your fractions must be over the same denominator."}, "showCorrectAnswer": true, "prompt": " Put$\\simplify[]{ {n1}/{d1} + {n2}/{d2}}$over a common denominator. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "x^2+{a+b}x+{a*b}", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "! m_anywhere(?*(? + ?+))", "partialCredit": 0, "message": "You must expand all brackets."}, "showCorrectAnswer": true, "prompt": " Expand$\\simplify{(x+{a})(x+{b})}$", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{coeffs[0]}+{coeffs[1]}*x+{coeffs[2]}*x^2+{coeffs[3]}*x^3", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "!(+- (??*(x^??);=base) + +- (??*(x^??);=base) + ?*)\n&\n! m_anywhere(?*(? + ?+))", "partialCredit": 0, "message": "You have not expanded and collected all terms."}, "showCorrectAnswer": true, "prompt": " Expand$\\simplify[basic]{ (x+{bits[0]})*(x+{bits[1]})*(x+{bits[2]})}$and collect all terms. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{floor(n/2)}+{ceil(n/2)}", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "answerSimplification": "basic", "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "positive:$n + positive:$n", "partialCredit": 0, "message": "You must write your answer as the sum of two positive numbers."}, "showCorrectAnswer": true, "prompt": " Write$\\var{n}$as the sum of two positive integers. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "(x+{a})(x+{b})", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "m_nogather(?;factors*?+;factors where all(map(not numerical_compare(x,expression(\"1\")),x,factors)))", "partialCredit": 0, "message": "Your expression is not factorised."}, "showCorrectAnswer": true, "prompt": " Factorise$\\simplify{x^2+{a+b}x+{a*b}}$", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "(x+{a+b}/2)^2+{4*a*b-((a+b))^2}/4", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "answerSimplification": "all", "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "(?+?)^2+??", "partialCredit": 0, "message": "Your answer should be in the form$(x+a)^2+b$."}, "showCorrectAnswer": true, "prompt": " Complete the square:$\\simplify{x^2+{a+b}x+{a*b}}$. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{modulus}*e^({theta} * pi*i)", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "answerSimplification": "basic,fractionnumbers", "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "($n? : 1)*e^(((*/ +- $n)*;x)*i)", "partialCredit": 0, "message": "Your answer is not in the form$re^{i\\theta}$, with$r \\geq 0$."}, "showCorrectAnswer": true, "prompt": " Write$\\simplify{{sr*modulus}/sqrt(2) + {si*modulus}/sqrt(2) i}$in modulus-argument form,$re^{\\theta i}$. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "{z1+z2}", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "answerSimplification": "basic", "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "((+-integer:$n)? : 0);re + (+-(i*real:$n?)? : 0);im", "partialCredit": 0, "message": "Your answer must be in the form$a+ib$."}, "showCorrectAnswer": true, "prompt": "$z_1 = \\var{z1}$\n$z_2 = \\var{z2}$\n Write$z_1+z_2$in the form$a+bi$", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "q: type(studentExpr)", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "1+{cA}x - {cb^2}/2x^2-{ca^3}/6x^3+{cb^4}/24x^4", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "(+-$n* / $n* * ($v);=base^?? | $n/$n?)* + $z", "partialCredit": 0, "message": "Your answer must be a polynomial of the form$a_nx^n + \\ldots + a_1x + x_0$."}, "showCorrectAnswer": true, "prompt": " Write the Maclaurin expansion of$\\simplify{sin({cA}x) + cos({cB}x)}$up to the$x^4$term. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "({ka*kb}-{ka*kc}*sqrt({kn}))/({kb^2-kc^2*kn})", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "answerSimplification": "!basic", "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "m_strictinverse(+-?/(!m_anywhere(sqrt(?) | ?^(! +-integer:$n))))", "partialCredit": 0, "message": "Your answer must not have a square root on the bottom."}, "showCorrectAnswer": true, "prompt": "

Rationalise the denominator: $\\simplify{{ka}/({kb}+{kc}sqrt({kn}))}$

", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}, {"valuegenerators": [{"name": "x", "value": ""}], "vsetRange": [0, 1], "unitTests": [], "checkingAccuracy": 0.001, "marks": 1, "vsetRangePoints": 5, "answer": "1/(x+{lb})-1/(x+{la})", "variableReplacements": [], "adaptiveMarkingPenalty": 0, "type": "jme", "customName": "", "useCustomName": false, "checkVariableNames": false, "showFeedbackIcon": true, "mustmatchpattern": {"nameToCompare": "", "pattern": "m_nogather(m_gather(+- (?;tops/?;bottoms));fractions*+$z) where len(fractions)>1 and all(map(not numerical_compare(x,expression(\"1\")),x,bottoms)) and all(map(not numerical_compare(x,expression(\"0\")),x,tops))", "partialCredit": 0, "message": "Your answer must be the sum of two or more fractions, with no denominators equivalent to 1 and no numerators equivalent to 0."}, "showCorrectAnswer": true, "prompt": " Write the partial fraction decomposition of$\\simplify{{la-lb}/((x+{la})(x+{lb}))}$. ", "failureRate": 1, "checkingType": "absdiff", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showPreview": true, "variableReplacementStrategy": "originalfirst"}], "tags": [], "ungrouped_variables": ["bits", "coeffs"], "statement": " In this question, each part has a pattern restriction, checking the student has given their answer in the required form. ", "preamble": {"js": "", "css": ""}, "metadata": {"description": "This question contains many examples of mathematical expression parts which require the student to enter their in a certain form, which is marked by applying a \"pattern to match\" restriction. ", "licence": "Creative Commons Attribution 4.0 International"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "", "functions": {}, "variables": {"theta": {"name": "theta", "description": "", "templateType": "anything", "definition": "arctan(si/sr)/pi+if(sr<0,si,0)", "group": "Part c - modulus argument form"}, "jn": {"name": "jn", "description": "", "templateType": "anything", "definition": "random(1..jd-1)", "group": "Part j - don't use decimals"}, "kc": {"name": "kc", "description": "", "templateType": "randrange", "definition": "random(1 .. 5#1)", "group": "Part k - rationalise denominator"}, "d2": {"name": "d2", "description": "", "templateType": "anything", "definition": "random(2..9 except d1)", "group": "Part h - common denominator"}, "ka": {"name": "ka", "description": "", "templateType": "randrange", "definition": "random(1 .. 9#1)", "group": "Part k - rationalise denominator"}, "cB": {"name": "cB", "description": "", "templateType": "anything", "definition": "random(1,2,3)", "group": "Part g - polynomial"}, "n2": {"name": "n2", "description": "", "templateType": "anything", "definition": "random(-1,1)*random(1..9 except map(n*d2,n,0..ceil(9/d1)))", "group": "Part h - common denominator"}, "sr": {"name": "sr", "description": "", "templateType": "anything", "definition": "random(-1,1)", "group": "Part c - modulus argument form"}, "kn": {"name": "kn", "description": "", "templateType": "anything", "definition": "random(2,3,5,6,7,8)", "group": "Part k - rationalise denominator"}, "d1": {"name": "d1", "description": "", "templateType": "anything", "definition": "random(2..9)", "group": "Part h - common denominator"}, "si": {"name": "si", "description": "", "templateType": "anything", "definition": "random(-1,1)", "group": "Part c - modulus argument form"}, "modulus": {"name": "modulus", "description": "", "templateType": "randrange", "definition": "random(1 .. 10#1)", "group": "Part c - modulus argument form"}, "jd": {"name": "jd", "description": "", "templateType": "anything", "definition": "2^random(0..3)*5^random(0,1)", "group": "Part j - don't use decimals"}, "a": {"name": "a", "description": "", "templateType": "randrange", "definition": "random(-5 .. 5#1)", "group": "Part b - expand brackets"}, "bits": {"name": "bits", "description": "", "templateType": "anything", "definition": "repeat(random(-3..3),3)", "group": "Ungrouped variables"}, "lb": {"name": "lb", "description": "", "templateType": "anything", "definition": "random(-5..5 except [0,la])", "group": "Part l - partial fractions"}, "b": {"name": "b", "description": "", "templateType": "anything", "definition": "random(-5..5 except -a)", "group": "Part b - expand brackets"}, "cA": {"name": "cA", "description": "", "templateType": "anything", "definition": "random(1,2,3)", "group": "Part g - polynomial"}, "la": {"name": "la", "description": "", "templateType": "anything", "definition": "random(-5..5 except 0)", "group": "Part l - partial fractions"}, "n1": {"name": "n1", "description": "", "templateType": "anything", "definition": "random(1..9 except map(n*d1,n,0..ceil(9/d1)))", "group": "Part h - common denominator"}, "n": {"name": "n", "description": "", "templateType": "randrange", "definition": "random(4 .. 10#1)", "group": "Part a - write as sum of two integers"}, "p": {"name": "p", "description": "", "templateType": "randrange", "definition": "random(0 .. 10#1)", "group": "Part f - index notation"}, "coeffs": {"name": "coeffs", "description": "", "templateType": "anything", "definition": "[\n bits[0]*bits[1]*bits[2],\n bits[0]*bits[1] + bits[0]*bits[2] + bits[2]*bits[1],\n bits[0] + bits[1] + bits[2],\n 1\n]", "group": "Ungrouped variables"}, "kb": {"name": "kb", "description": "", "templateType": "anything", "definition": "random(ceil(sqrt(kc^2*kn))..15)", "group": "Part k - rationalise denominator"}, "z1": {"name": "z1", "description": "", "templateType": "anything", "definition": "random(-10..10 except 0) + random(-10..10 except 0)*i", "group": "Part d - cartesian form"}, "z2": {"name": "z2", "description": "", "templateType": "anything", "definition": "random(-10..10 except 0) + random(-2..2 except 0)*i", "group": "Part d - cartesian form"}}, "rulesets": {}}, {"name": "Mark only a captured subexpression of student's answer", "extensions": ["eukleides", "quantities", "random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "parts": [{"type": "jme", "checkingAccuracy": 0.001, "customName": "", "scripts": {}, "checkVariableNames": false, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "vsetRange": [0, 1], "failureRate": 1, "variableReplacements": [], "answer": "y=x^2", "checkingType": "absdiff", "showPreview": true, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "unitTests": [], "prompt": " Rearrange$x=\\sqrt{y}$to obtain a formula for$y$. ", "showFeedbackIcon": true, "useCustomName": false, "marks": 1, "mustmatchpattern": {"partialCredit": 0, "pattern": "y=?;rhs", "nameToCompare": "rhs", "message": "Your answer must be an equation of the form$y = \\ldots$."}, "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}], "vsetRangePoints": 5}, {"type": "jme", "checkingAccuracy": 0.001, "customName": "", "scripts": {}, "checkVariableNames": false, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "vsetRange": [0, 1], "failureRate": 1, "variableReplacements": [], "answer": "f(x)=x^2", "checkingType": "absdiff", "showPreview": true, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "unitTests": [], "prompt": " Here's the definition of a function which negates$x$: \n \$f(x) = -x \$ \n Write the definition of a function which squares$x$. ", "showFeedbackIcon": true, "useCustomName": false, "marks": 1, "mustmatchpattern": {"partialCredit": 0, "pattern": "m_func(?,[x]) = ?;def", "nameToCompare": "def", "message": "Your answer must be in the form$f(x) = \\ldots$"}, "valuegenerators": [{"name": "x", "value": ""}], "vsetRangePoints": 5}, {"type": "jme", "checkingAccuracy": 0.001, "customName": "", "scripts": {}, "checkVariableNames": false, "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "vsetRange": [0, 1], "failureRate": 1, "variableReplacements": [], "answer": "x>4", "checkingType": "absdiff", "showPreview": true, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "unitTests": [], "prompt": " Rearrange$2x+4>8+x$to obtain an inequality for$x$. ", "showFeedbackIcon": true, "useCustomName": false, "marks": 1, "mustmatchpattern": {"partialCredit": 0, "pattern": "x>?;r", "nameToCompare": "r", "message": "Your answer must be of the form$x>\\ldots$."}, "valuegenerators": [{"name": "x", "value": ""}], "vsetRangePoints": 5}], "advice": "", "functions": {}, "variable_groups": [], "statement": "", "ungrouped_variables": ["ex", "m", "q"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "This question contains several mathematical expression parts which only compare part of the student's answer with the corresponding part of the expected answer, because the expression can't be evaluated as a whole. "}, "rulesets": {}, "variables": {"ex": {"definition": "expression(\"x+2\")", "templateType": "anything", "name": "ex", "group": "Ungrouped variables", "description": ""}, "q": {"definition": "m[\"groups\"][\"y\"]", "templateType": "anything", "name": "q", "group": "Ungrouped variables", "description": ""}, "m": {"definition": "match(ex,\"?;x+?;y\")", "templateType": "anything", "name": "m", "group": "Ungrouped variables", "description": ""}}, "preamble": {"js": "", "css": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question"}, {"name": "Infer types for variables in mathematical expression parts", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "showresultspage": "never"}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "rulesets": {}, "advice": "", "variable_groups": [], "variables": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": " In this question, the correct answers can't be evaluated by substituting numbers for each of the variables. \n Numbas can now infer the types of variables in the answers to mathematical expression parts, so questions like this can be marked. ", "ungrouped_variables": [], "parts": [{"showPreview": true, "failureRate": 1, "showFeedbackIcon": true, "checkingType": "absdiff", "marks": 1, "answer": "k det(A)", "type": "jme", "variableReplacementStrategy": "originalfirst", "customName": "", "prompt": " In this part,$A$must be a matrix. \n The correct answer is$k \\det(A)$", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "useCustomName": false, "valuegenerators": [{"name": "a", "value": ""}, {"name": "k", "value": ""}], "unitTests": [], "vsetRangePoints": 5, "scripts": {}, "showCorrectAnswer": true, "checkingAccuracy": 0.001, "vsetRange": [0, 1], "customMarkingAlgorithm": "", "checkVariableNames": false}, {"showPreview": true, "failureRate": 1, "showFeedbackIcon": true, "checkingType": "absdiff", "marks": 1, "answer": "a and b", "type": "jme", "variableReplacementStrategy": "originalfirst", "customName": "", "prompt": "$a$and$b$are booleans. \n The correct answer is$a \\wedge b$, entered as a and b. ", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "useCustomName": false, "valuegenerators": [{"name": "a", "value": ""}, {"name": "b", "value": ""}], "unitTests": [], "vsetRangePoints": 5, "scripts": {}, "showCorrectAnswer": true, "checkingAccuracy": 0.001, "vsetRange": [0, 1], "customMarkingAlgorithm": "", "checkVariableNames": false}, {"showPreview": true, "failureRate": 1, "showFeedbackIcon": true, "checkingType": "absdiff", "marks": 1, "answer": "dot(vector(1,2,3),a)", "type": "jme", "variableReplacementStrategy": "originalfirst", "customName": "", "prompt": "$a$must be a vector \n The correct answer is$\\begin{pmatrix}1\\\\2\\\\3\\end{pmatrix} \\cdot a$, entered as dot(vector(1,2,3),a). ", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "useCustomName": false, "valuegenerators": [{"name": "a", "value": ""}], "unitTests": [], "vsetRangePoints": 5, "scripts": {}, "showCorrectAnswer": true, "checkingAccuracy": 0.001, "vsetRange": [0, 1], "customMarkingAlgorithm": "", "checkVariableNames": false}], "functions": {}, "preamble": {"css": "", "js": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": " In this question, the correct answers can't be evaluated by substituting numbers for each of the variables. Numbas\n can now infer the types of variables in the answers to mathematical \nexpression parts, so questions like this can be marked. "}, "type": "exam"}, {"name": "Mark equations", "extensions": ["eukleides", "quantities", "random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"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": [], "statement": " All the answers in this question are equations. In order to mark each equation, Numbas needs to pick some values that satisfy the equation and some that don't, and check that the student's answer agrees with the expected answer. \n Any equation with the same solution set as the expected answer will be marked correct. ", "variables": {"factor": {"name": "factor", "group": "Ungrouped variables", "description": "", "definition": "random(2 .. 8#1)", "templateType": "randrange"}, "a": {"name": "a", "group": "Ungrouped variables", "description": "", "definition": "1", "templateType": "anything"}}, "ungrouped_variables": ["a", "factor"], "variable_groups": [], "parts": [{"customName": "", "scripts": {}, "type": "jme", "checkingType": "absdiff", "valuegenerators": [{"name": "p", "value": ""}, {"name": "s", "value": "random(random(vRange),factor*p)"}], "marks": 1, "checkVariableNames": false, "vsetRangePoints": "10", "unitTests": [], "checkingAccuracy": 0.001, "variableReplacements": [], "showFeedbackIcon": true, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "failureRate": 1, "showCorrectAnswer": true, "prompt": "$s = \\simplify[]{{factor}p}$\n Also try$s-\\var{factor}p=0$and$p=s/\\var{factor}$. ", "customMarkingAlgorithm": "", "answer": "s={factor}p", "showPreview": true, "useCustomName": false}, {"mustmatchpattern": {"message": "Your answer must be in the form$s = f(p)$.", "nameToCompare": "", "pattern": "s=?", "partialCredit": 0}, "customName": "", "scripts": {}, "type": "jme", "checkingType": "absdiff", "valuegenerators": [{"name": "p", "value": ""}, {"name": "s", "value": "random(random(vRange),factor*p)"}], "marks": 1, "checkVariableNames": false, "vsetRangePoints": "10", "unitTests": [], "checkingAccuracy": 0.001, "variableReplacements": [], "showFeedbackIcon": true, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "failureRate": 1, "showCorrectAnswer": true, "prompt": "$s = \\simplify[]{{factor}p}$\n But this time there's a pattern-match restriction that your answer must be of the form$s = \\ldots$. ", "customMarkingAlgorithm": "", "answer": "s={factor}p", "showPreview": true, "useCustomName": false}, {"customName": "", "scripts": {}, "type": "jme", "checkingType": "absdiff", "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": "random(random(vRange),sqrt(1-x^2))"}], "marks": 1, "checkVariableNames": false, "vsetRangePoints": "10", "unitTests": [], "checkingAccuracy": 0.001, "variableReplacements": [], "showFeedbackIcon": true, "vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "failureRate": 1, "showCorrectAnswer": true, "prompt": "$x^2+y^2=1$\n Also try$1-x^2-y^2=0$and$y=\\sqrt{1-x^2}$. ", "customMarkingAlgorithm": "", "answer": "x^2+y^2=1", "showPreview": true, "useCustomName": false}, {"customName": "", "scripts": {}, "type": "jme", "checkingType": "absdiff", "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": ""}, {"name": "z", "value": "random(random(vRange),sqrt(1-x^2-y^2))"}], "marks": 1, "checkVariableNames": false, "vsetRangePoints": "10", "unitTests": [], "checkingAccuracy": 0.001, "variableReplacements": [], "showFeedbackIcon": true, "vsetRange": [0, "0.5"], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "failureRate": 1, "showCorrectAnswer": true, "prompt": "$x^2 + y^2 + z^2=1$", "customMarkingAlgorithm": "", "answer": "x^2+y^2+z^2=1", "showPreview": true, "useCustomName": false}, {"customName": "", "scripts": {}, "type": "jme", "checkingType": "absdiff", "valuegenerators": [{"name": "x", "value": ""}, {"name": "y", "value": "sqrt(1-x^2)+random(0,random(-0.001..0.001#0))"}], "marks": 1, "checkVariableNames": false, "vsetRangePoints": "10", "unitTests": [], "checkingAccuracy": 0.001, "variableReplacements": [], "showFeedbackIcon": true, "vsetRange": ["-1", 1], "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "failureRate": 1, "showCorrectAnswer": true, "prompt": "$x^2+y^2>1$\n Because this is an inequality, we need to randomly pick values either side of the critical curve, and some exactly on it. ", "customMarkingAlgorithm": "", "answer": "x^2+y^2>1", "showPreview": true, "useCustomName": false}], "rulesets": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "", "preamble": {"js": "", "css": ""}, "functions": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": " All the answers in this question are equations. In order to mark each\n equation, Numbas needs to pick some values that satisfy the equation \nand some that don't, and check that the student's answer agrees with the\n expected answer. Any equation with the same solution set as the expected answer will be marked correct. "}}]}, {"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "High-precision numbers", "questions": [{"name": "Approximate sqrt(n) to a lot of decimal places", "extensions": ["eukleides", "quantities", "random_person"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "tags": [], "metadata": {"description": " The student is asked to enter an approximation to$\\sqrt{n}$, where$n$is not a square number, to 20 decimal places. This question is a demonstration of the high precision arithmetic in Numbas v4. ", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "variables": {"root": {"name": "root", "group": "Ungrouped variables", "definition": "sqrt(n)", "description": " The square root of n. ", "templateType": "anything"}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "dec(random(2..10 except [4,9]))", "description": " The number to take the square root of ", "templateType": "anything"}, "dp": {"name": "dp", "group": "Ungrouped variables", "definition": "20", "description": " The number of decimal places the student must compute. ", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "root", "dp"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": " Approximate$\\sqrt{\\var{n}}\$ to {dp} decimal places.

The student enters a quantity with units. Their answer is marked correct if they give both the right amount and the right units.

", "short_name": "quantity", "marking_notes": [{"description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "apply(student_quantity);\napply(has_units);\napply(compatible);\ntry(\n correctif(close_enough),\n x,\n apply(student_quantity)\n);\napply(same_units)", "name": "mark"}, {"description": "A value representing the student's answer to this part.", "definition": "student_quantity", "name": "interpreted_answer"}, {"description": "", "definition": "[\"plain\",\"en\"]", "name": "allowed_notation_styles"}, {"description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)", "name": "match_student_number"}, {"description": "", "definition": "match_student_number[1]", "name": "student_number"}, {"description": "", "definition": "try(\n quantity(studentAnswer[len(match_student_number[0])..len(studentAnswer)]),\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)", "name": "student_units"}, {"description": "

The student's answer, interpreted as a quantity.

\n

Marking fails if the student does not enter a valid quantity.

", "definition": "apply(student_units);\ntry(\n student_number * student_units,\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)", "name": "student_quantity"}, {"description": "", "definition": "settings[\"correctAnswer\"]", "name": "correct_quantity"}, {"description": "

Are the units of the student's quantity compatible with the units of the expected quantity?

", "definition": "if(student_quantity<>false and compatible(student_quantity,correct_quantity),\n true\n,\n incorrect(\"Your answer does not have the correct dimensions.\");\n end();\n false\n)", "name": "compatible"}, {"description": "", "definition": "units(correct_quantity)", "name": "correct_units"}, {"description": "

Are the student's quantity and the expected quantity in exactly the same units?

\n
\n
• \"Convert\" - silently convert the student's answer to the units used in the correct answer.
• \n
• \"Warn and convert\" - show a warning to the student, but convert.
• \n
• \"Prevent submission\" - don't allow the student to submit, and show a warning that they must use the same units.
• \n
• \"Mark incorrect\" - the student's answer is marked as incorrect.
• \n
", "label": "What to do if different units used", "default_value": "convert", "input_type": "dropdown", "help_url": "", "choices": [{"label": "Convert", "value": "convert"}, {"label": "Warn and convert", "value": "warn"}, {"label": "Prevent submission", "value": "Prevent"}, {"label": "Mark incorrect", "value": "incorrect"}], "name": "different_units_action"}, {"hint": "This penalty is applied if the student gives their answer in different units to the expected answer. The selected percentage of the student's score is retained.", "label": "Penalty if different units used", "input_type": "percent", "help_url": "", "default_value": "100", "name": "different_units_penalty"}, {"hint": "The student's answer is marked correct if the difference between it and the correct answer is at most this value, measured in the same units as the correct answer.", "label": "Margin of error", "subvars": true, "input_type": "mathematical_expression", "help_url": "", "default_value": "10^-12", "name": "wiggle"}], "name": "Quantity", "input_widget": "string"}], "resources": [], "navigation": {"preventleave": false, "allowregen": true, "showfrontpage": false, "showresultspage": "never"}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "variables": {"moles": {"group": "Ungrouped variables", "description": "

Moles of carbon

", "templateType": "anything", "definition": "qty(random(0.25..2#0.25 except 1),\"mol\")", "name": "moles"}, "avogadro": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "qty(dec(\"6.02214076e+23\"),\"1/mol\")", "name": "avogadro"}, "grams": {"group": "Ungrouped variables", "description": "

Number of grams of carbon

", "templateType": "anything", "definition": "c_mass*moles", "name": "grams"}, "c_mass": {"group": "Ungrouped variables", "description": "

Atomic mass of Carbon

", "templateType": "anything", "definition": "qty(12,\"g/mol\")", "name": "c_mass"}, "molecules": {"group": "Ungrouped variables", "description": "

Number of molecules of carbon

", "templateType": "anything", "definition": "avogadro*moles", "name": "molecules"}}, "variable_groups": [], "functions": {}, "parts": [{"customName": "", "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "precisionType": "sigfig", "useCustomName": false, "customMarkingAlgorithm": "q: settings[\"maxvalue\"]", "showPrecisionHint": true, "correctAnswerStyle": "scientific", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en", "scientific"], "maxValue": "scalar(avogadro)", "precision": "3", "type": "numberentry", "minValue": "scalar(avogadro)", "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "precisionPartialCredit": 0, "scripts": {}, "prompt": "

How many molecules are there in one mole of substance?

\n

Give your answer in scientific notation in the form NeP.

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "mustBeReduced": false, "marks": 1, "unitTests": [], "allowFractions": false, "strictPrecision": true, "variableReplacements": []}, {"customName": "", "showFeedbackIcon": true, "scripts": {}, "prompt": "

The atomic mass of carbon is 12. What is the mass of {moles} of carbon, in grams?

", "variableReplacementStrategy": "originalfirst", "useCustomName": false, "customMarkingAlgorithm": "", "unitTests": [], "settings": {"hint": "remind units", "allow_unitless": true, "wiggle": "10^-12", "correctAnswer": "grams", "different_units_action": "convert", "different_units_penalty": "100"}, "marks": 1, "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "type": "quantity", "variableReplacements": []}, {"customName": "", "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "precisionType": "sigfig", "useCustomName": false, "customMarkingAlgorithm": "", "showPrecisionHint": true, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en", "scientific"], "maxValue": "scalar(molecules)", "precision": "3", "type": "numberentry", "minValue": "scalar(molecules)", "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "precisionPartialCredit": 0, "scripts": {}, "prompt": "

How many molecules are there in {moles} of carbon?

\n

Give your answer in scientific notation in the form NeP.

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "mustBeReduced": false, "marks": 1, "unitTests": [], "allowFractions": false, "strictPrecision": true, "variableReplacements": []}], "advice": "", "ungrouped_variables": ["avogadro", "c_mass", "moles", "grams", "molecules"], "rulesets": {}, "preamble": {"js": "", "css": ""}, "tags": [], "statement": "", "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"description": "

The student is asked to give the Avogadro constant in scientific form, calculate the mass of a number of moles of carbon, in grams, and then calculate the number of molecules in that mass.

This is a demonstration of the high-precision decimal arithmetic in Numbas v4.0.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "exam"}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Josh Lim", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2990/"}], "extensions": ["eukleides", "quantities", "random_person"], "custom_part_types": [{"source": {"pk": 7, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/7/edit"}, "name": "Quantity with units", "short_name": "quantity", "description": "

The student enters a quantity with units.

The scalar part of the student's quantity

", "definition": "match_student_number[1]"}, {"name": "raw_student_units", "description": "

The units of the student's quantity, before converting.

The units of the student's quantity.

\n

If the student used units incompatible with the units in the expected answer, and the \"what to do if incompatible units used\" option is set to \"mark as if correct units used\", the student's units are ignored and the expected units are used instead.

", "definition": "if(compatible(raw_student_units,correct_units) or settings[\"incompatible_units_action\"]<>\"convert\",\n raw_student_units,\n correct_units\n)"}, {"name": "student_quantity", "description": "

The student's answer, interpreted as a quantity.

\n

Marking fails if the student does not enter a valid quantity.

", "definition": "apply(student_units);\ntry(\n student_number * student_units,\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]"}, {"name": "compatible", "description": "

Are the units of the student's quantity compatible with the units of the expected quantity?

", "definition": "if(compatible(raw_student_units,correct_quantity),\n true\n,\n let(message,\"Your answer does not have the correct dimensions.\",\n if(settings[\"incompatible_units_action\"]=\"prevent\",\n warn(message);\n fail(message)\n ,\n if(settings[\"incompatible_units_action\"]=\"convert\",\n incorrect(\"Your answer does not have the correct dimensions. It will be marked as if the correct dimensions were used, and then a penalty will be applied.\")\n ,\n incorrect(\"Your answer does not have the correct dimensions.\");\n end()\n )\n );\n false\n )\n)"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)"}, {"name": "same_units", "description": "

/Are the student's quantity and the expected quantity in exactly the same units?

", "definition": "assert(raw_student_units=correct_units,\n let(\n message,if(settings[\"hint\"]=\"show units\",\"You did not give your answer in \"+units_string(correct_units)+\".\", \"Your answer is not in the expected units.\"),\n switch(\n settings[\"different_units_action\"]=\"prevent\",\n warn(message);\n fail(message)\n ,\n settings[\"different_units_action\"]=\"incorrect\",\n incorrect(message); \n warn(message);\n end()\n ,\n settings[\"different_units_action\"]=\"warn\",\n warn(message);\n multiply_credit(1-settings[\"different_units_penalty\"],message)\n ,\n settings[\"different_units_penalty\"]<1,\n multiply_credit(1-settings[\"different_units_penalty\"],message)\n ,\n false\n )\n );\n false\n)"}, {"name": "has_units", "description": "", "definition": "assert(not unitless(student_quantity),\n assert(settings[\"allow_unitless\"],\n warn(\"You must include the units in your answer.\");\n fail(\"You did not include units in your answer.\")\n )\n)"}, {"name": "can_compare", "description": "

Can the student's answer be compared with the correct answer? True if compatible units used, or \"mark as if correct units used\" selected.

", "definition": "compatible or settings[\"incompatible_units_action\"]=\"convert\""}, {"name": "close_enough", "description": "

Is the student's quantity within the allowed tolerance of the expected answer?

", "definition": "if(can_compare,\n student_quantity>=correct_quantity - wiggle \n and \n student_quantity<=correct_quantity + wiggle \n,\n false\n)"}, {"name": "wiggle", "description": "", "definition": "units(correct_quantity)*abs(eval(settings[\"wiggle\"]))"}, {"name": "valid_number", "description": "

Is the scalar part of the student's answer a valid number?

", "definition": "if(isNaN(student_number),\n warn(translate(\"part.numberentry.answer invalid\"));\n fail(translate(\"part.numberentry.answer invalid\"))\n,\n true\n )\n"}], "settings": [{"name": "correctAnswer", "label": "Correct answer", "help_url": "", "hint": "The expected quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "hint", "label": "Input hint", "help_url": "", "hint": "", "input_type": "dropdown", "default_value": "remind units", "choices": [{"value": "none", "label": "None"}, {"value": "remind units", "label": "Remind to include units"}, {"value": "show units", "label": "Show required units"}]}, {"name": "allow_unitless", "label": "Allow unitless answer?", "help_url": "", "hint": "If not ticked, the student is prevented from submitting an answer without specifying units.", "input_type": "checkbox", "default_value": true}, {"name": "incompatible_units_action", "label": "What to do if incompatible units used", "help_url": "", "hint": "If the student's answer is given in units incompatible with the correct answer's units:
\n
\n
• \"Prevent submission\": Prevent the student from submitting until they use compatible units
• \n
• \"Mark as incorrect\": Mark the student's answer as incorrect.
• \n
• \"Mark as if correct units used\": Mark the student's answer as if they used the correct units, and apply the \"different units used\" penalty.
• \n
", "input_type": "dropdown", "default_value": "incorrect", "choices": [{"value": "incorrect", "label": "Mark as incorrect"}, {"value": "prevent", "label": "Prevent submission"}, {"value": "convert", "label": "Mark as if correct units used"}]}, {"name": "different_units_action", "label": "What to do if different units used", "help_url": "", "hint": "If the student's answer is given in different units to the expected answer:
\n
\n
• \"Convert\" - silently convert the student's answer to the units used in the correct answer.
• \n
• \"Warn and convert\" - show a warning to the student, but convert.
• \n
• \"Prevent submission\" - don't allow the student to submit, and show a warning that they must use the same units.
• \n
• \"Mark incorrect\" - the student's answer is marked as incorrect.
• \n
", "input_type": "dropdown", "default_value": "convert", "choices": [{"value": "convert", "label": "Convert"}, {"value": "warn", "label": "Warn and convert"}, {"value": "prevent", "label": "Prevent submission"}, {"value": "incorrect", "label": "Mark incorrect"}]}, {"name": "different_units_penalty", "label": "Penalty if different units used", "help_url": "", "hint": "This penalty is applied if the student gives their answer in different units to the expected answer. The selected percentage of the student's score is taken away.", "input_type": "percent", "default_value": "100"}, {"name": "wiggle", "label": "Margin of error", "help_url": "", "hint": "The student's answer is marked correct if the difference between it and the correct answer is at most this value, measured in the same units as the correct answer.", "input_type": "mathematical_expression", "default_value": "10^-12", "subvars": true}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": []}