// Numbas version: exam_results_page_options {"name": "Absolute values", "feedback": {"showtotalmark": true, "advicethreshold": 0, "showanswerstate": true, "showactualmark": true, "allowrevealanswer": true}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "allQuestions": true, "shuffleQuestions": false, "percentPass": 0, "duration": 0, "pickQuestions": 0, "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "allowregen": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "showfrontpage": true}, "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "exam", "questions": [], "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "The absolute value of a number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "functions": {}, "ungrouped_variables": ["neg", "pos", "num", "ans1", "n", "m", "ans2", "p", "ans3"], "tags": ["abs", "absolute value", "modulus", "norm"], "advice": "", "rulesets": {}, "parts": [{"stepsPenalty": "1", "prompt": "

$\\vert \\var{num[0]} \\vert$ = [[0]]

\n

$\\vert \\var{num[1]} \\vert$ = [[1]]

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "{ans1[0]}", "minValue": "{ans1[0]}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}, {"allowFractions": false, "variableReplacements": [], "maxValue": "{ans1[1]}", "minValue": "{ans1[1]}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

The vertical bars are taking the absolute value of the number inside them.

\n

The absolute value is the distance a number is from 0 on the number line.

\n

For example $\\vert -10 \\vert = 10$ and $\\vert 10 \\vert = 10$.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}, {"stepsPenalty": "1", "prompt": "

$\\vert \\var{n} - \\var{m} \\vert$ = [[0]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "{ans2}", "minValue": "{ans2}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

First determine the value inside the absolute value signs (the vertical bars). Then apply the absolute value.

\n

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}, {"stepsPenalty": "1", "prompt": "

$\\var{p}-\\vert \\var{n} - 2\\times\\var{m} \\vert$ = [[0]]

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "{ans3}", "minValue": "{ans3}", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

Work using the order of operations. In this case, basically from the inside out:

\n

$\\var{p}-\\vert \\var{n} - 2\\times\\var{m} \\vert$

\n

$=\\var{p}-\\vert \\var{n} - \\var{2*m} \\vert$

\n

$=\\var{p}-\\vert \\var{n-2*m} \\vert$

\n

$=\\var{p}-\\var{abs(n-2*m)}$

\n

$=\\var{p-abs(n-2*m)}$

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "gapfill"}], "statement": "", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"neg": {"definition": "random(-99..-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "neg", "description": ""}, "ans2": {"definition": "abs(n-m)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans2", "description": ""}, "ans3": {"definition": "p-abs(n-2*m)", "templateType": "anything", "group": "Ungrouped variables", "name": "ans3", "description": ""}, "m": {"definition": "random(20..40)", "templateType": "anything", "group": "Ungrouped variables", "name": "m", "description": ""}, "pos": {"definition": "random(1..99)", "templateType": "anything", "group": "Ungrouped variables", "name": "pos", "description": ""}, "n": {"definition": "random(2..21)", "templateType": "anything", "group": "Ungrouped variables", "name": "n", "description": ""}, "p": {"definition": "random(10..50)", "templateType": "anything", "group": "Ungrouped variables", "name": "p", "description": ""}, "num": {"definition": "shuffle([neg,pos])", "templateType": "anything", "group": "Ungrouped variables", "name": "num", "description": ""}, "ans1": {"definition": "[abs(num[0]),abs(num[1])]", "templateType": "anything", "group": "Ungrouped variables", "name": "ans1", "description": ""}}, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "extensions": [], "custom_part_types": [], "resources": []}