// 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": [{"name": "Straight lines: given the graph find the equation", "tags": ["graph", "JSXgraph", "jsxgraph", "Jsxgraph", "linear", "linear equation", "straight line", "Straight Line", "y=mx+b"], "metadata": {"description": "

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

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"bb": {"name": "bb", "group": "Ungrouped variables", "definition": "random(-5..12 except 0)", "description": "", "templateType": "anything", "can_override": false}, "run": {"name": "run", "group": "Ungrouped variables", "definition": "random(2,3,5,7)", "description": "", "templateType": "anything", "can_override": false}, "point_y": {"name": "point_y", "group": "Ungrouped variables", "definition": "b+rise", "description": "", "templateType": "anything", "can_override": false}, "bpoint_y": {"name": "bpoint_y", "group": "Ungrouped variables", "definition": "bb+brise", "description": "", "templateType": "anything", "can_override": false}, "brun": {"name": "brun", "group": "Ungrouped variables", "definition": "random(2,3,5,7)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-12..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "rise": {"name": "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),'er'))))", "description": "", "templateType": "anything", "can_override": false}, "brise": {"name": "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),'er'))))", "description": "", "templateType": "anything", "can_override": false}, "point_x": {"name": "point_x", "group": "Ungrouped variables", "definition": "run", "description": "", "templateType": "anything", "can_override": false}, "bpoint_x": {"name": "bpoint_x", "group": "Ungrouped variables", "definition": "brun", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["b", "run", "rise", "point_y", "point_x", "bb", "brun", "brise", "bpoint_y", "bpoint_x"], "variable_groups": [], "functions": {"linea": {"parameters": [], "type": "html", "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\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;"}, "lineb": {"parameters": [], "type": "html", "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\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;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

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

\n

{linea()}

", "stepsPenalty": "1", "steps": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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

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

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

\n

{lineb()}

", "stepsPenalty": "1", "steps": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "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

"}], "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{brise}/{brun}*x+{bb}", "answerSimplification": "all", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notallowed": {"strings": ["="], "showStrings": false, "partialCredit": 0, "message": ""}, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}