// Numbas version: exam_results_page_options {"name": "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": [{"variable_groups": [], "ungrouped_variables": ["x0", "y0", "x1", "y1", "m", "const"], "statement": "

Fill in the blanks.

", "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

", "functions": {"line_and_2points": {"language": "javascript", "type": "html", "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;", "parameters": []}}, "extensions": ["jsxgraph", "polynomials"], "parts": [{"gaps": [{"variableReplacements": [], "answer": "{y1-y0}/{x1-x0}", "notallowed": {"showStrings": false, "partialCredit": 0, "message": "", "strings": ["="]}, "vsetrange": [0, 1], "showCorrectAnswer": true, "marks": "1", "vsetrangepoints": 5, "checkingtype": "absdiff", "answersimplification": "all", "variableReplacementStrategy": "originalfirst", "checkvariablenames": true, "expectedvariablenames": ["x"], "showFeedbackIcon": true, "scripts": {}, "checkingaccuracy": 0.001, "type": "jme", "showpreview": true}], "marks": 0, "scripts": {}, "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "gapfill", "variableReplacements": [], "prompt": "

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

\n

\n

", "variableReplacementStrategy": "originalfirst"}], "preamble": {"css": "", "js": ""}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"x1": {"name": "x1", "group": "Ungrouped variables", "definition": "random(-10..10 except [x0,0])", "description": "", "templateType": "anything"}, "x0": {"name": "x0", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything"}, "y1": {"name": "y1", "group": "Ungrouped variables", "definition": "random(-10..10 except y0)", "description": "", "templateType": "anything"}, "y0": {"name": "y0", "group": "Ungrouped variables", "definition": "random(-10..10 except 0)", "description": "", "templateType": "anything"}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "(y1-y0)/(x1-x0)", "description": "", "templateType": "anything"}, "const": {"name": "const", "group": "Ungrouped variables", "definition": "(x1*y0-x0*y1)/(x1-x0)", "description": "", "templateType": "anything"}}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Identifying y=mx+b given two points

"}, "rulesets": {}, "name": "The gradient of an interval between two points", "tags": [], "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/"}]}