// Numbas version: finer_feedback_settings {"name": "Terry'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": [{"statement": "
Fill in the blanks.
", "variable_groups": [], "functions": {"line_and_2points": {"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;", "language": "javascript", "type": "html", "parameters": []}}, "rulesets": {}, "parts": [{"marks": 0, "scripts": {}, "variableReplacementStrategy": "originalfirst", "prompt": "The gradient of the interval between the points ({x0},{y0}) and ({x1},{y1}) is $m=$ [[0]].
{line_and_2points()}
\n\nDetermine the gradient by $m=\\dfrac{\\text{rise}}{\\text{run}}$, or $m=\\dfrac{y_2-y_1}{x_2-x_1}$.
\n\nSo 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", "metadata": {"description": "Identifying y=mx+b given two points
", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "ungrouped_variables": ["x0", "y0", "x1", "y1", "m", "const"], "tags": [], "name": "Terry's copy of The gradient of an interval between two points", "variablesTest": {"maxRuns": 100, "condition": ""}, "extensions": ["jsxgraph", "polynomials"], "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Terry Young", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3130/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Terry Young", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3130/"}]}