// Numbas version: exam_results_page_options {"name": "Tom'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": [{"name": "Tom's copy of Straight lines: given the graph find the equation", "metadata": {"description": "

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

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "rulesets": {}, "preamble": {"js": "", "css": ""}, "functions": {"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;", "parameters": [], "language": "javascript"}, "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;", "parameters": [], "language": "javascript"}}, "variable_groups": [], "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "", "parts": [{"stepsPenalty": "1", "prompt": "

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

\n

{linea()}

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

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

\n

{lineb()}

", "customName": "", "steps": [{"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": "", "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": [], "type": "information", "useCustomName": false}], "sortAnswers": false, "scripts": {}, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "marks": 0, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "unitTests": [], "type": "gapfill", "useCustomName": false, "gaps": [{"answerSimplification": "all", "vsetRange": [0, 1], "answer": "{brise}/{brun}*x+{bb}", "showPreview": true, "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "marks": "2", "valuegenerators": [{"name": "x", "value": ""}], "vsetRangePoints": 5, "checkingType": "absdiff", "variableReplacements": [], "unitTests": [], "type": "jme", "checkingAccuracy": 0.001, "notallowed": {"message": "", "showStrings": false, "strings": ["="], "partialCredit": 0}, "scripts": {}, "showFeedbackIcon": true, "checkVariableNames": true, "useCustomName": false, "variableReplacementStrategy": "originalfirst", "customName": "", "failureRate": 1}]}], "ungrouped_variables": ["b", "run", "rise", "point_y", "point_x", "bb", "brun", "brise", "bpoint_y", "bpoint_x"], "variables": {"run": {"description": "", "name": "run", "definition": "random(2,3,5,7)", "templateType": "anything", "group": "Ungrouped variables"}, "bb": {"description": "", "name": "bb", "definition": "random(-5..12 except 0)", "templateType": "anything", "group": "Ungrouped variables"}, "point_x": {"description": "", "name": "point_x", "definition": "run", "templateType": "anything", "group": "Ungrouped variables"}, "bpoint_x": {"description": "", "name": "bpoint_x", "definition": "brun", "templateType": "anything", "group": "Ungrouped variables"}, "brise": {"description": "", "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)))))", "templateType": "anything", "group": "Ungrouped variables"}, "rise": {"description": "", "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)))))", "templateType": "anything", "group": "Ungrouped variables"}, "brun": {"description": "", "name": "brun", "definition": "random(2,3,5,7)", "templateType": "anything", "group": "Ungrouped variables"}, "point_y": {"description": "", "name": "point_y", "definition": "b+rise", "templateType": "anything", "group": "Ungrouped variables"}, "bpoint_y": {"description": "", "name": "bpoint_y", "definition": "bb+brise", "templateType": "anything", "group": "Ungrouped variables"}, "b": {"description": "", "name": "b", "definition": "random(-12..5 except 0)", "templateType": "anything", "group": "Ungrouped variables"}}, "extensions": ["jsxgraph"], "statement": "", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Tom Bold", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3477/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Tom Bold", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3477/"}]}