// Numbas version: exam_results_page_options {"name": "Katherine's copy of The gradient of an interval between two points", "extensions": ["jsxgraph", "polynomials"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"showCorrectAnswer": true, "variableReplacements": [], "marks": 0, "showFeedbackIcon": true, "type": "gapfill", "scripts": {}, "gaps": [{"variableReplacements": [], "showCorrectAnswer": true, "notallowed": {"partialCredit": 0, "showStrings": false, "strings": ["="], "message": ""}, "showFeedbackIcon": true, "scripts": {}, "marks": "1", "answer": "{y1-y0}/{x1-x0}", "answersimplification": "all", "type": "jme", "showpreview": true, "expectedvariablenames": ["x"], "checkingtype": "absdiff", "vsetrangepoints": 5, "vsetrange": [0, 1], "checkvariablenames": true, "checkingaccuracy": 0.001, "variableReplacementStrategy": "originalfirst"}], "prompt": "

The gradient of the interval between the points ({x0},{y0}) and ({x1},{y1}) is $m=$ [[0]].

\n

\n

", "variableReplacementStrategy": "originalfirst"}], "variables": {"x1": {"templateType": "anything", "definition": "random(-10..10 except [x0,0])", "group": "Ungrouped variables", "name": "x1", "description": ""}, "const": {"templateType": "anything", "definition": "(x1*y0-x0*y1)/(x1-x0)", "group": "Ungrouped variables", "name": "const", "description": ""}, "y1": {"templateType": "anything", "definition": "random(-10..10 except y0)", "group": "Ungrouped variables", "name": "y1", "description": ""}, "m": {"templateType": "anything", "definition": "(y1-y0)/(x1-x0)", "group": "Ungrouped variables", "name": "m", "description": ""}, "y0": {"templateType": "anything", "definition": "random(-10..10 except 0)", "group": "Ungrouped variables", "name": "y0", "description": ""}, "x0": {"templateType": "anything", "definition": "random(-10..10 except 0)", "group": "Ungrouped variables", "name": "x0", "description": ""}}, "advice": "

{line_and_2points()}

\n

\n

Determine the gradient by $m=\\dfrac{\\text{rise}}{\\text{run}}$, or $m=\\dfrac{y_2-y_1}{x_2-x_1}$. 

\n

\n

So in particular, $\\displaystyle m=\\frac{\\simplify[!collectNumbers]{{y1}-{y0}}}{\\simplify[!collectNumbers]{{x1}-{x0}}}$$=\\dfrac{\\simplify{{y1-y0}}}{\\simplify{{x1-x0}}}$$\\displaystyle =\\simplify[basic, fractionNumbers, simplifyFractions]{{(y1-y0)/(x1-x0)}}$.

\n

", "ungrouped_variables": ["x0", "y0", "x1", "y1", "m", "const"], "tags": [], "variable_groups": [], "preamble": {"js": "", "css": ""}, "name": "Katherine's copy of The gradient of an interval between two points", "statement": "

Fill in the blanks.

", "extensions": ["jsxgraph", "polynomials"], "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Identifying y=mx+b given two points

"}, "functions": {"line_and_2points": {"language": "javascript", "definition": "\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',{boundingBox:[-13,13,13,-13],grid:true,axis:false});\nvar board = div.board;\n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\nx0 = Numbas.jme.unwrapValue(scope.variables.x0);\ny0 = Numbas.jme.unwrapValue(scope.variables.y0);\nx1 = Numbas.jme.unwrapValue(scope.variables.x1);\ny1 = Numbas.jme.unwrapValue(scope.variables.y1);\n\nboard.create('point',[x0,y0],{fixed:true,withLabel:false});\nboard.create('point',[x1,y1],{fixed:true,withLabel:false});\n\nvar vline = board.create('line',[[x0,y0],[x0,y1]], {straightFirst:false, straightLast:false, strokeWidth:2, fixed:true});\nvar hline = board.create('line',[[x0,y1],[x1,y1]], {straightFirst:false, straightLast:false, strokeWidth:2, fixed:true});\n\nvar rise = board.create('text',[x0+0.25,(y0+y1)/2,'rise']);\nvar run = board.create('text',[(x0+x1)/2,y1-0.5,'run']);\n\nreturn div;", "type": "html", "parameters": []}}, "type": "question", "contributors": [{"name": "Katherine Tomlinson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1652/"}]}]}], "contributors": [{"name": "Katherine Tomlinson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1652/"}]}