// Numbas version: exam_results_page_options {"name": "Rounding to 0, 1, 2 or 3 decimal places", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Rounding to 0, 1, 2 or 3 decimal places", "tags": [], "metadata": {"description": "

Round random numbers to the closest whole number, 1, 2 or 3 decimals places.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"trick": {"name": "trick", "group": "Ungrouped variables", "definition": "random(0.04,0.05, 0.06, 0.07, 0.08)", "description": "", "templateType": "anything", "can_override": false}, "number2": {"name": "number2", "group": "Ungrouped variables", "definition": "random(10.001..300#0.0003)", "description": "", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "Ungrouped variables", "definition": "precround(number,ndp)", "description": "", "templateType": "anything", "can_override": false}, "digit_to_the_right": {"name": "digit_to_the_right", "group": "Ungrouped variables", "definition": "mod(floor(10^(ndp+1)*number),10)\n", "description": "", "templateType": "anything", "can_override": false}, "number": {"name": "number", "group": "Ungrouped variables", "definition": "random(10.00001..90#0.00002)", "description": "", "templateType": "anything", "can_override": false}, "n4r": {"name": "n4r", "group": "Ungrouped variables", "definition": "random(0.001..0.999#0.001)", "description": "", "templateType": "anything", "can_override": false}, "seed": {"name": "seed", "group": "Ungrouped variables", "definition": "random(1,0.1,0.01,0.001)", "description": "", "templateType": "anything", "can_override": false}, "ndp": {"name": "ndp", "group": "Ungrouped variables", "definition": "countdp(string(seed))", "description": "", "templateType": "anything", "can_override": false}, "direction": {"name": "direction", "group": "Ungrouped variables", "definition": "if(digit_to_the_right<5,'down', 'up')", "description": "", "templateType": "anything", "can_override": false}, "less_greater": {"name": "less_greater", "group": "Ungrouped variables", "definition": "if(digit_to_the_right<5,'less than', 'greater than or equal to')", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["seed", "ndp", "number", "digit_to_the_right", "ans", "direction", "less_greater", "number2", "trick", "n4r"], "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": "

$\\var{number}$ rounded to the nearest whole number {ndp} decimal place {ndp} decimal places is [[0]].

\n

\n

", "stepsPenalty": "1", "steps": [{"type": "information", "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": "

When we are rounding we look at the first digit that we might discard. If it is $5$ or greater we round up. If it is less than $5$ we round down.

\n

We want to round to the nearest whole number {ndp} decimal place {ndp} decimal places. The digit to the right is $\\var{digit_to_the_right}$, which is {less_greater} $5$ so we round {direction} to $\\var{ans}$ 

"}], "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "ans", "maxValue": "ans", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}