// Numbas version: exam_results_page_options {"name": "Unit 2 - Equation of the line given graphically", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Unit 2 - Equation of the line given graphically", "functions": {"drawgraph": {"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 ", "type": "html", "parameters": [], "language": "javascript"}}, "advice": "", "variables": {"minx": {"name": "minx", "definition": "-5", "group": "Graph parameters", "description": "", "templateType": "anything"}, "gradient": {"name": "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", "description": "", "templateType": "anything"}, "maxy": {"name": "maxy", "definition": "10", "group": "Graph parameters", "description": "", "templateType": "anything"}, "miny": {"name": "miny", "definition": "-5", "group": "Graph parameters", "description": "", "templateType": "anything"}, "intercept": {"name": "intercept", "definition": "random(minx+2..maxx-6 except 0)", "group": "Graph parameters", "description": "", "templateType": "anything"}, "sign": {"name": "sign", "definition": "random([-1,1])", "group": "Graph parameters", "description": "", "templateType": "anything"}, "maxx": {"name": "maxx", "definition": "10", "group": "Graph parameters", "description": "", "templateType": "anything"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"scripts": {}, "type": "gapfill", "gaps": [{"maxValue": "gradient+0.1", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "correctAnswerStyle": "plain", "correctAnswerFraction": true, "allowFractions": true, "minValue": "gradient-0.1"}, {"maxValue": "intercept+0.1", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showFeedbackIcon": false, "scripts": {}, "correctAnswerStyle": "plain", "correctAnswerFraction": false, "allowFractions": false, "minValue": "intercept-0.1"}], "showCorrectAnswer": true, "marks": 0, "variableReplacementStrategy": "originalfirst", "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]]

", "variableReplacements": [], "showFeedbackIcon": true}], "variable_groups": [{"name": "Graph parameters", "variables": ["minx", "maxx", "miny", "maxy", "sign", "gradient", "intercept"]}], "extensions": ["jsxgraph"], "preamble": {"css": "", "js": ""}, "ungrouped_variables": [], "statement": "

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

\n\n\n\n\n\n\n
{drawgraph()}
", "rulesets": {}, "tags": [], "metadata": {"description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "contributors": [{"name": "Richard Miles", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/882/"}]}]}], "contributors": [{"name": "Richard Miles", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/882/"}]}