// Numbas version: exam_results_page_options {"name": "Decimals: rounding", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"preamble": {"js": "", "css": ""}, "parts": [{"stepsPenalty": 0, "steps": [{"prompt": "

If it is 5 or more, round up, otherwise round down.

\n

\n
\n

\n

To round to a whole number you look at the first decimal place to determine whether you round up or down. If the first decimal place is a 5 or more then you round up (increase the units column by 1) and discard the decimals. If the first decimal 4 or less then you round down (leave the units column as it is) and discard the decimals.

\n

\n
\n

\n

For example:

\n\n

\n
\n

\n

Note we only look at the first decimal place when rounding to whole numbers, the others are irrelevant, that is 123.4998 should still be rounded to 123.  

", "type": "information", "extendBaseMarkingAlgorithm": true, "marks": 0, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": []}], "showCorrectAnswer": true, "prompt": "

Round the following decimals to the nearest whole number ($0$ decimal places):

\n

$\\var{wholelist[0]}=$ [[0]]

\n

$\\var{wholelist[1]}=$ [[1]]

\n

$\\var{wholelist[2]}=$ [[2]]

", "sortAnswers": false, "type": "gapfill", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "gaps": [{"mustBeReduced": false, "correctAnswerFraction": false, "minValue": "precround(wholelist[0],0)", "showCorrectAnswer": true, "allowFractions": false, "mustBeReducedPC": 0, "maxValue": "precround(wholelist[0],0)", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": [], "showFeedbackIcon": true}, {"mustBeReduced": false, "correctAnswerFraction": false, "minValue": "precround(wholelist[1],0)", "showCorrectAnswer": true, "allowFractions": false, "mustBeReducedPC": 0, "maxValue": "precround(wholelist[1],0)", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": [], "showFeedbackIcon": true}, {"mustBeReduced": false, "correctAnswerFraction": false, "minValue": "precround(wholelist[2],0)", "showCorrectAnswer": true, "allowFractions": false, "mustBeReducedPC": 0, "maxValue": "precround(wholelist[2],0)", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": [], "showFeedbackIcon": true}], "unitTests": [], "showFeedbackIcon": true}, {"stepsPenalty": 0, "steps": [{"prompt": "

If it is 5 or more, round up, otherwise round down.

\n

\n
\n

\n

Since we are told to round to two decimal places we look at the third decimal place to determine if we round up or down. If the third decimal place is a 5 or more then you round up (increase the second decimal place by 1) and discard the digits to the right. If the third decimal place is 4 or less then you round down (leave the second decimal place as it is) and discard the digits to the right.

\n

\n
\n

\n

For example:

\n", "type": "information", "extendBaseMarkingAlgorithm": true, "marks": 0, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": []}], "showCorrectAnswer": true, "prompt": "

Round the following decimals to $2$ decimal places:

\n

$\\var{twolist[0]}=$ [[0]]

\n

$\\var{twolist[1]}=$ [[1]]

\n

$\\var{twolist[2]}=$ [[2]]

\n

Note: Suppose your answer was $123.4$, you need to enter your answer as $123.40$ since the question asks for $2$ decimal places.

", "sortAnswers": false, "type": "gapfill", "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "gaps": [{"correctAnswerFraction": false, "precision": "2", "mustBeReducedPC": 0, "precisionPartialCredit": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "marks": 1, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "minValue": "precround(twolist[0],2)", "strictPrecision": true, "unitTests": [], "showPrecisionHint": false, "mustBeReduced": false, "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "precisionType": "dp", "maxValue": "precround(twolist[0],2)", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "correctAnswerStyle": "plain", "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision."}, {"correctAnswerFraction": false, "precision": "2", "mustBeReducedPC": 0, "precisionPartialCredit": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "marks": 1, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "minValue": "precround(twolist[1],2)", "strictPrecision": true, "unitTests": [], "showPrecisionHint": false, "mustBeReduced": false, "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "precisionType": "dp", "maxValue": "precround(twolist[1],2)", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "correctAnswerStyle": "plain", "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision."}, {"correctAnswerFraction": false, "precision": "2", "mustBeReducedPC": 0, "precisionPartialCredit": 0, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "marks": 1, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "minValue": "precround(twolist[2],2)", "strictPrecision": true, "unitTests": [], "showPrecisionHint": false, "mustBeReduced": false, "variableReplacements": [], "showCorrectAnswer": true, "allowFractions": false, "precisionType": "dp", "maxValue": "precround(twolist[2],2)", "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "correctAnswerStyle": "plain", "scripts": {}, "precisionMessage": "You have not given your answer to the correct precision."}], "unitTests": [], "showFeedbackIcon": true}], "tags": ["decimals", "Decimals", "rounding"], "name": "Decimals: rounding", "variables": {"wholelist": {"name": "wholelist", "group": "Ungrouped variables", "templateType": "anything", "definition": "shuffle([whole1, whole2, whole3])", "description": ""}, "whole1": {"name": "whole1", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..187)+random(list(0.0..0.4#0.1))+random(list(0.05..0.09#0.01))", "description": ""}, "whole3": {"name": "whole3", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..187)+0.5", "description": ""}, "twolist": {"name": "twolist", "group": "Ungrouped variables", "templateType": "anything", "definition": "shuffle([two1,two2,two3])", "description": ""}, "two3": {"name": "two3", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..187)+random(list(0.0..0.9#0.1))+random(list(0.00..0.04#0.01))+0.005+random(list(0.00001..0.00009#0.00001))", "description": ""}, "whole2": {"name": "whole2", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..187)+random(list(0.5..0.9#0.1))+random(list(0.01..0.04#0.01))", "description": ""}, "two2": {"name": "two2", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..187)+random(list(0.0..0.9#0.1))+random(list(0.05..0.09#0.01))+random(list(0.001..0.004#0.001))+random(list(0.0001..0.0009#0.0001))", "description": ""}, "two1": {"name": "two1", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(2..187)+random(list(0.0..0.9#0.1))+random(list(0.00..0.04#0.01))+random(list(0.005..0.009#0.001))+random(list(0.0001..0.0009#0.0001))", "description": ""}}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

I think I prefer the other question I made called \"Rounding to 0, 1, 2 and 3 decimal places\"

"}, "extensions": [], "ungrouped_variables": ["whole1", "whole2", "whole3", "wholelist", "two1", "two2", "two3", "twolist"], "functions": {}, "statement": "", "rulesets": {}, "advice": "", "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "type": "question", "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/"}]}