// Numbas version: finer_feedback_settings {"name": "Simon's copy of Q2 Rectangle problems", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "
(a)
\nArea = width $\\times$ length
\nwidth = $\\frac{\\text{area}}{\\text{length} } =\\frac{\\var{area1}}{\\var{h1} } = \\var{w1}$
\nPerimeter = $2 \\times$ width $+ 2 \\times$ length$ =2 \\times \\var{w1} + 2 \\times \\var{h1} = \\var{p1}$m
\n(b)
\nPerimeter = $2 \\times$ width $+ 2 \\times$ length
\nTherefore;
\nwidth = $\\frac{\\text{perimeter} - 2 \\times \\text{length}}{2}$
\nwidth = $\\frac{(\\var{p} - 2 \\times \\var{h})}{2} = \\var{w}$m
\n\nFormula for area of rectangle:
\nArea = width $\\times$ length = $\\var{w} \\times \\var{h} = \\var{a}$m$^2$
\n\n\n\n", "variables": {"h1": {"name": "h1", "definition": "random(20..26 except h)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "p1": {"name": "p1", "definition": "2*h1+2*w1", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "x": {"name": "x", "definition": "\"x\"", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "w1": {"name": "w1", "definition": "random(5..h-6#0.1)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "p": {"name": "p", "definition": "2*h+2*w", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "h": {"name": "h", "definition": "random(15..34)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "area1": {"name": "area1", "definition": "h1*w1", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "a": {"name": "a", "definition": "h*w", "description": "", "group": "Ungrouped variables", "templateType": "anything"}, "w": {"name": "w", "definition": "random(5..h-6#0.1)", "description": "", "group": "Ungrouped variables", "templateType": "anything"}}, "variable_groups": [], "ungrouped_variables": ["p", "w", "h", "x", "a", "p1", "w1", "h1", "area1"], "preamble": {"css": "", "js": ""}, "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "name": "Simon's copy of Q2 Rectangle problems", "statement": "Give answers correct to 2 decimal places
", "metadata": {"description": "Area and Perimeter of Rectangles
\nrebelmaths
", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"rectangle": {"parameters": [["h", "number"], ["w", "number"]], "language": "javascript", "type": "html", "definition": "\n\n var c = document.createElement('canvas');\n $(c).attr('width',w+400).attr('height',h+400);\n var context = c.getContext('2d');\n \n //fill in rectangle with a light shade\n context.fillStyle = '#eee';\n context.fillRect(50,50,w*10,h*10);\n \n //draw outline\n context.strokeStyle = '#000';\n context.lineWidth = 3;\n context.strokeRect(50,50,w*10,h*10);\n \n //draw labels\n context.fillStyle = '#000';\n context.font = '20px sans-serif';\n var wstring = 'x'+'m';\n var tw = context.measureText(wstring).width;\n// console.log(tw);\n context.fillText(wstring,60,38);\n \n var hstring = h+'m';\n var hw = context.measureText(hstring).width;\n context.save();\n context.translate(30,200);\n context.rotate(-Math.PI/2);\n context.fillText(hstring,0,0);\n \n return c;\n "}}, "extensions": [], "parts": [{"showCorrectAnswer": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "type": "gapfill", "variableReplacements": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "sortAnswers": false, "prompt": "{rectangle(h1,w1)}
\nA rectangle has an area of $\\var{area1}$m$^2$ and a length of $\\var{h1}$m. Calculate its width and then its perimeter.
\nWidth = [[0]]m
\nPerimeter = [[1]]m
\n", "marks": 0, "gaps": [{"mustBeReduced": false, "unitTests": [], "minValue": "{w1}", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{w1}", "marks": 1, "showPrecisionHint": false, "allowFractions": false, "showCorrectAnswer": true, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "mustBeReducedPC": 0, "type": "numberentry", "variableReplacements": [], "correctAnswerFraction": false, "scripts": {}, "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "precision": "2", "precisionType": "dp", "precisionPartialCredit": 0}, {"mustBeReduced": false, "unitTests": [], "minValue": "{p1}", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{p1}", "marks": 1, "showPrecisionHint": false, "allowFractions": false, "showCorrectAnswer": true, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "mustBeReducedPC": 0, "type": "numberentry", "variableReplacements": [], "correctAnswerFraction": false, "scripts": {}, "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "precision": "2", "precisionType": "dp", "precisionPartialCredit": 0}]}, {"showCorrectAnswer": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "stepsPenalty": 0, "type": "gapfill", "variableReplacements": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "sortAnswers": false, "prompt": "{rectangle(h,w)}
\nA rectangle has a perimeter of $\\var{p}$m. If the length is $\\var{h}$m, first calculate its width and then its area.
\nWidth = [[0]]m
\nArea = [[1]]m$^2$
", "steps": [{"showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "prompt": "Write down a formula for the perimeter. Now rearrange this to solve for the width.
\nThen calculate the area.
", "showFeedbackIcon": true, "variableReplacements": [], "type": "information", "marks": 0, "unitTests": [], "scripts": {}}], "marks": 0, "gaps": [{"mustBeReduced": false, "unitTests": [], "minValue": "{w}", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{w}", "marks": 1, "showPrecisionHint": false, "allowFractions": false, "showCorrectAnswer": true, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "mustBeReducedPC": 0, "type": "numberentry", "variableReplacements": [], "correctAnswerFraction": false, "scripts": {}, "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "precision": "2", "precisionType": "dp", "precisionPartialCredit": 0}, {"mustBeReduced": false, "unitTests": [], "minValue": "{a}", "customMarkingAlgorithm": "", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{a}", "marks": 1, "showPrecisionHint": false, "allowFractions": false, "showCorrectAnswer": true, "strictPrecision": false, "variableReplacementStrategy": "originalfirst", "precisionMessage": "You have not given your answer to the correct precision.", "showFeedbackIcon": true, "mustBeReducedPC": 0, "type": "numberentry", "variableReplacements": [], "correctAnswerFraction": false, "scripts": {}, "correctAnswerStyle": "plain", "extendBaseMarkingAlgorithm": true, "precision": "2", "precisionType": "dp", "precisionPartialCredit": 0}]}], "type": "question", "contributors": [{"name": "TEAME CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/591/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "TEAME CIT", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/591/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}