// Numbas version: finer_feedback_settings {"name": "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": [{"name": "Graph parameters", "variables": ["minx", "maxx", "miny", "maxy", "sign", "gradient", "intercept"]}], "ungrouped_variables": [], "name": "Equation of a line from a graph", "preamble": {"css": "", "js": ""}, "parts": [{"showCorrectAnswer": true, "type": "gapfill", "marks": 0, "customName": "", "gaps": [{"variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "customName": "", "extendBaseMarkingAlgorithm": true, "adaptiveMarkingPenalty": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "scripts": {}, "allowFractions": true, "correctAnswerStyle": "plain", "showFeedbackIcon": true, "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "minValue": "gradient", "maxValue": "gradient", "correctAnswerFraction": true, "notationStyles": ["plain", "en", "si-en"], "showFractionHint": true, "useCustomName": false, "marks": 1, "mustBeReduced": false}, {"variableReplacementStrategy": "originalfirst", "mustBeReducedPC": "50", "customName": "", "extendBaseMarkingAlgorithm": true, "adaptiveMarkingPenalty": 0, "variableReplacements": [], "customMarkingAlgorithm": "", "scripts": {}, "allowFractions": true, "correctAnswerStyle": "plain", "showFeedbackIcon": false, "showCorrectAnswer": true, "type": "numberentry", "unitTests": [], "minValue": "intercept", "maxValue": "intercept", "correctAnswerFraction": true, "notationStyles": ["plain", "en", "si-en"], "showFractionHint": true, "useCustomName": false, "marks": 1, "mustBeReduced": true}], "unitTests": [], "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "customMarkingAlgorithm": "", "sortAnswers": false, "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]]

", "scripts": {}, "adaptiveMarkingPenalty": 0, "useCustomName": false, "showFeedbackIcon": true}], "tags": [], "functions": {"drawgraph": {"type": "html", "language": "javascript", "parameters": [], "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 "}}, "variables": {"maxx": {"templateType": "anything", "definition": "10", "name": "maxx", "group": "Graph parameters", "description": ""}, "minx": {"templateType": "anything", "definition": "-5", "name": "minx", "group": "Graph parameters", "description": ""}, "gradient": {"templateType": "anything", "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]) as \"number\"", "name": "gradient", "group": "Graph parameters", "description": ""}, "miny": {"templateType": "anything", "definition": "-5", "name": "miny", "group": "Graph parameters", "description": ""}, "sign": {"templateType": "anything", "definition": "random([-1,1])", "name": "sign", "group": "Graph parameters", "description": ""}, "intercept": {"templateType": "anything", "definition": "random(minx+2..maxx-6 except 0)", "name": "intercept", "group": "Graph parameters", "description": ""}, "maxy": {"templateType": "anything", "definition": "10", "name": "maxy", "group": "Graph parameters", "description": ""}}, "metadata": {"description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

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

\n\n\n\n\n\n\n
{drawgraph()}
", "extensions": ["jsxgraph"], "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "", "rulesets": {}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Adrian Jannetta", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/164/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Adrian Jannetta", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/164/"}]}