// Numbas version: exam_results_page_options {"name": "Algebra: Equation of a line from a graph", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"variables": ["minx", "maxx", "miny", "maxy", "sign", "gradient", "intercept"], "name": "Graph parameters"}], "name": "Algebra: Equation of a line from a graph", "functions": {"drawgraph": {"language": "javascript", "definition": " var miny = Numbas.jme.unwrapValue(scope.variables.miny);\n var maxy = Numbas.jme.unwrapValue(scope.variables.maxy);\n var minx = Numbas.jme.unwrapValue(scope.variables.minx);\n var maxx = Numbas.jme.unwrapValue(scope.variables.maxx);\n var gradient = Numbas.jme.unwrapValue(scope.variables.gradient);\n var intercept = Numbas.jme.unwrapValue(scope.variables.intercept);\n \n var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox:[minx,maxy,maxx,miny],\n axis:false,\n showNavigation:false,\n grid:true});\n JXG.Options.text.useMathJax = true;\n var brd = div.board; \n var xaxis=brd.createElement('axis', [[minx,0],[maxx+1,0]]);\n var yaxis=brd.createElement('axis', [[0,miny],[0,maxy+1]]);\n var xlabel = brd.create('text',[maxx-0.5,0,function(){return '\\\\[x\\\\]';}]);\n var ylabel = brd.create('text',[-0.7,maxy,function(){return '\\\\[y\\\\]';}]);\n var graph = brd.create('functiongraph',[function(x){ return gradient*x+intercept;},minx,maxx]);\n\nreturn div;\n ", "parameters": [], "type": "html"}}, "parts": [{"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "scripts": {}, "prompt": "

The equation of the line is of the form $y=mx+c$, where $m$ and $c$ are constants. Use the graph to determine the constants $m$ and $c$.

\n

Answer: $m=$ [[0]] and $c=$ [[1]]

", "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "correctAnswerFraction": true, "mustBeReducedPC": 0, "mustBeReduced": false, "allowFractions": true, "minValue": "gradient", "scripts": {}, "showFeedbackIcon": true, "maxValue": "gradient", "marks": 1, "type": "numberentry"}, {"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "correctAnswerFraction": true, "mustBeReducedPC": "50", "mustBeReduced": true, "allowFractions": true, "minValue": "intercept", "scripts": {}, "showFeedbackIcon": false, "maxValue": "intercept", "marks": 1, "type": "numberentry"}], "marks": 0, "showFeedbackIcon": true, "type": "gapfill"}], "statement": "

The graph below shows a linear relationship between two variables $x$ and $y$.

\n\n\n\n\n\n\n
{drawgraph()}
", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Tests the ability to find the gradient and intercept of a straight line graph.

"}, "advice": "", "variables": {"miny": {"definition": "-5", "group": "Graph parameters", "name": "miny", "templateType": "anything", "description": ""}, "minx": {"definition": "-5", "group": "Graph parameters", "name": "minx", "templateType": "anything", "description": ""}, "maxy": {"definition": "10", "group": "Graph parameters", "name": "maxy", "templateType": "anything", "description": ""}, "maxx": {"definition": "10", "group": "Graph parameters", "name": "maxx", "templateType": "anything", "description": ""}, "gradient": {"definition": "sign*random([1/5,2/5,3/5,4/5,1/4,3/4,1/3,2/3,1/2,2,3,4,5])", "group": "Graph parameters", "name": "gradient", "templateType": "anything", "description": ""}, "intercept": {"definition": "random(minx+2..maxx-6 except 0)", "group": "Graph parameters", "name": "intercept", "templateType": "anything", "description": ""}, "sign": {"definition": "random([-1,1])", "group": "Graph parameters", "name": "sign", "templateType": "anything", "description": ""}}, "ungrouped_variables": [], "extensions": ["jsxgraph"], "preamble": {"js": "", "css": ""}, "type": "question", "contributors": [{"name": "Adrian Jannetta", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/164/"}, {"name": "Clare Lundon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/492/"}]}]}], "contributors": [{"name": "Adrian Jannetta", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/164/"}, {"name": "Clare Lundon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/492/"}]}