// Numbas version: exam_results_page_options {"name": "Straight lines: given the graph find the equation", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/exampleline.png", "/srv/numbas/media/question-resources/exampleline.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "

Given the graph of the line determine the equation of the line.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "preamble": {"css": "", "js": ""}, "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "name": "Straight lines: given the graph find the equation", "ungrouped_variables": ["b", "run", "rise", "point_y", "point_x", "bb", "brun", "brise", "bpoint_y", "bpoint_x"], "functions": {"linea": {"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\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 = 0;\ny0 = Numbas.jme.unwrapValue(scope.variables.b);\nx1 = Numbas.jme.unwrapValue(scope.variables.point_x);\ny1 = Numbas.jme.unwrapValue(scope.variables.point_y);\n\n//board.create('point',[x0,y0],{fixed:true});\n//board.create('point',[x1,y1],{fixed:true});\nboard.create('line',[[x0,y0],[x1,y1]],{strokeColor:'#00ff00',strokeWidth:2,fixed:true});\n\n\n\nreturn div;", "language": "javascript", "parameters": []}, "lineb": {"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\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 = 0;\ny0 = Numbas.jme.unwrapValue(scope.variables.bb);\nx1 = Numbas.jme.unwrapValue(scope.variables.bpoint_x);\ny1 = Numbas.jme.unwrapValue(scope.variables.bpoint_y);\n\n//board.create('point',[x0,y0],{fixed:true});\n//board.create('point',[x1,y1],{fixed:true});\nboard.create('line',[[x0,y0],[x1,y1]],{strokeColor:'#00ff00',strokeWidth:2,fixed:true});\n\n\n\nreturn div;", "language": "javascript", "parameters": []}}, "tags": ["graph", "Jsxgraph", "jsxgraph", "JSXgraph", "linear", "linear equation", "Straight Line", "straight line", "y=mx+b"], "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "variables": {"b": {"name": "b", "definition": "random(-12..5 except 0)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "bpoint_y": {"name": "bpoint_y", "definition": "bb+brise", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "bb": {"name": "bb", "definition": "random(-5..12 except 0)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "brun": {"name": "brun", "definition": "random(2,3,5,7)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "brise": {"name": "brise", "definition": "-if(brun=2,random(1,3,5,7),if(brun=3,random(1,2,4,5,7),if(brun=5,random(1,2,3,4,6,7),if(brun=7,random(1,2,3,4,5,6)))))", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "point_y": {"name": "point_y", "definition": "b+rise", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "run": {"name": "run", "definition": "random(2,3,5,7)", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "point_x": {"name": "point_x", "definition": "run", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "rise": {"name": "rise", "definition": "if(run=2,random(1,3,5,7),if(run=3,random(1,2,4,5,7),if(run=5,random(1,2,3,4,6,7),if(run=7,random(1,2,3,4,5,6)))))", "group": "Ungrouped variables", "description": "", "templateType": "anything"}, "bpoint_x": {"name": "bpoint_x", "definition": "brun", "group": "Ungrouped variables", "description": "", "templateType": "anything"}}, "statement": "", "parts": [{"type": "gapfill", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "stepsPenalty": "1", "showFeedbackIcon": true, "showCorrectAnswer": true, "gaps": [{"type": "jme", "checkingaccuracy": 0.001, "checkvariablenames": true, "answer": "{rise}/{run}*x+{b}", "marks": "2", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "expectedvariablenames": ["x"], "checkingtype": "absdiff", "scripts": {}, "answersimplification": "all", "notallowed": {"showStrings": false, "message": "", "strings": ["="], "partialCredit": 0}, "vsetrange": [0, 1], "showCorrectAnswer": true, "showpreview": true, "variableReplacements": []}], "prompt": "

The gradient intercept form of the line shown below is $y=$ [[0]].

\n

{linea()}

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

Read the $y$-intercept off the graph (this is denoted $b$), find a 'nice point' with whole number coordinates, use this to determine the gradient (this is denoted $m$). Express as $y=mx+b$.

\n

Recall the gradient is $\\frac{\\text{rise}}{\\text{run}}$, determine the rise and run by looking at getting from the $y$-intercept to the next nice (whole number) point.

\n

\n
\n

\n

For example, suppose we had the following graph

\n


\n

We see that the $y$-intercept is $-3$, that is $b=-3$. We can find a 'nice point' with whole number coordinates at the point $(-2,2)$. To get from the $y$-intercept to this point requires we rise up 1 unit and run across 2 units. So our gradient is $\\frac{1}{2}$, that is $m=\\frac{1}{2}$. We now can write our equation, $y=\\frac{1}{2}x-3$.

\n

Note we could have chosen other points to be our 'nice point', for example $(-1,4)$ or $(6,0)$.

\n

\n

", "variableReplacements": []}]}, {"type": "gapfill", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "stepsPenalty": "1", "showFeedbackIcon": true, "showCorrectAnswer": true, "gaps": [{"type": "jme", "checkingaccuracy": 0.001, "checkvariablenames": true, "answer": "{brise}/{brun}*x+{bb}", "marks": "2", "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "expectedvariablenames": ["x"], "checkingtype": "absdiff", "scripts": {}, "answersimplification": "all", "notallowed": {"showStrings": false, "message": "", "strings": ["="], "partialCredit": 0}, "vsetrange": [0, 1], "showCorrectAnswer": true, "showpreview": true, "variableReplacements": []}], "prompt": "

The gradient intercept form of the line shown below is $y=$ [[0]].

\n

{lineb()}

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

Read the $y$-intercept off the graph (this is denoted $b$), find a 'nice point' with whole number coordinates, use this to determine the gradient (this is denoted $m$). Express as $y=mx+b$.

\n

Recall the gradient is $\\frac{\\text{rise}}{\\text{run}}$, determine the rise and run by looking at getting from the $y$-intercept to the next nice (whole number) point.

\n

\n
\n

\n

For example, suppose we had the following graph

\n


\n

We see that the $y$-intercept is $-3$, that is $b=-3$. We can find a 'nice point' with whole number coordinates at the point $(-2,2)$. To get from the $y$-intercept to this point requires we rise up 1 unit and run across 2 units. So our gradient is $\\frac{1}{2}$, that is $m=\\frac{1}{2}$. We now can write our equation, $y=\\frac{1}{2}x-3$.

\n

Note we could have chosen other points to be our 'nice point', for example $(-1,4)$ or $(6,0)$.

\n

\n

", "variableReplacements": []}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}]}