// Numbas version: exam_results_page_options {"name": "Simon's copy of Terry's copy of 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": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

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

"}, "variables": {"rise": {"group": "Ungrouped variables", "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)))))", "templateType": "anything", "name": "rise", "description": ""}, "brun": {"group": "Ungrouped variables", "definition": "random(2,3,5,7)", "templateType": "anything", "name": "brun", "description": ""}, "b": {"group": "Ungrouped variables", "definition": "random(-12..5 except 0)", "templateType": "anything", "name": "b", "description": ""}, "bpoint_y": {"group": "Ungrouped variables", "definition": "bb+brise", "templateType": "anything", "name": "bpoint_y", "description": ""}, "bpoint_x": {"group": "Ungrouped variables", "definition": "brun", "templateType": "anything", "name": "bpoint_x", "description": ""}, "point_x": {"group": "Ungrouped variables", "definition": "run", "templateType": "anything", "name": "point_x", "description": ""}, "bb": {"group": "Ungrouped variables", "definition": "random(-5..12 except 0)", "templateType": "anything", "name": "bb", "description": ""}, "point_y": {"group": "Ungrouped variables", "definition": "b+rise", "templateType": "anything", "name": "point_y", "description": ""}, "brise": {"group": "Ungrouped variables", "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)))))", "templateType": "anything", "name": "brise", "description": ""}, "run": {"group": "Ungrouped variables", "definition": "random(2,3,5,7)", "templateType": "anything", "name": "run", "description": ""}}, "tags": [], "extensions": ["jsxgraph"], "functions": {"lineb": {"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\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;", "parameters": []}, "linea": {"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\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;", "parameters": []}}, "preamble": {"css": "", "js": ""}, "advice": "", "statement": "", "parts": [{"showCorrectAnswer": true, "steps": [{"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "unitTests": [], "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

", "customName": "", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "useCustomName": false, "type": "information", "scripts": {}}], "marks": 0, "stepsPenalty": "1", "customMarkingAlgorithm": "", "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "gaps": [{"valuegenerators": [{"value": "", "name": "x"}], "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "unitTests": [], "checkVariableNames": true, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "showPreview": true, "type": "jme", "scripts": {}, "showCorrectAnswer": true, "vsetRange": [0, 1], "marks": "2", "customMarkingAlgorithm": "", "answer": "{rise}/{run}*x+{b}", "failureRate": 1, "answerSimplification": "all", "customName": "", "variableReplacements": [], "showFeedbackIcon": true, "useCustomName": false, "vsetRangePoints": 5, "notallowed": {"strings": ["="], "showStrings": false, "message": "", "partialCredit": 0}}], "prompt": "

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

\n

{linea()}

", "customName": "", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "useCustomName": false, "type": "gapfill", "scripts": {}}, {"showCorrectAnswer": true, "steps": [{"showCorrectAnswer": true, "marks": 0, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "unitTests": [], "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

", "customName": "", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "useCustomName": false, "type": "information", "scripts": {}}], "marks": 0, "stepsPenalty": "1", "customMarkingAlgorithm": "", "sortAnswers": false, "variableReplacementStrategy": "originalfirst", "unitTests": [], "gaps": [{"valuegenerators": [{"value": "", "name": "x"}], "checkingType": "absdiff", "variableReplacementStrategy": "originalfirst", "unitTests": [], "checkVariableNames": true, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "showPreview": true, "type": "jme", "scripts": {}, "showCorrectAnswer": true, "vsetRange": [0, 1], "marks": "2", "customMarkingAlgorithm": "", "answer": "{brise}/{brun}*x+{bb}", "failureRate": 1, "answerSimplification": "all", "customName": "", "variableReplacements": [], "showFeedbackIcon": true, "useCustomName": false, "vsetRangePoints": 5, "notallowed": {"strings": ["="], "showStrings": false, "message": "", "partialCredit": 0}}], "prompt": "

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

\n

{lineb()}

", "customName": "", "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true, "useCustomName": false, "type": "gapfill", "scripts": {}}], "name": "Simon's copy of Terry's copy of Straight lines: given the graph find the equation", "ungrouped_variables": ["b", "run", "rise", "point_y", "point_x", "bb", "brun", "brise", "bpoint_y", "bpoint_x"], "rulesets": {}, "variable_groups": [], "variablesTest": {"condition": "", "maxRuns": 100}, "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/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "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/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}