// Numbas version: finer_feedback_settings {"name": "Plotting straight line graph", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Plotting straight line graph", "tags": [], "metadata": {"description": "

Drag points on an axis to plot a linear graph (integer gradient and intercept only)

", "licence": "None specified"}, "statement": "

Move the two points to make the line
 $\\simplify[!canonicalOrder]{y={m}x+{c}}$

", "advice": "

There are two ways to think about this, either by considering two points, or by considering gradient ${m}$ and intercept ${c}$.

\n

First let's consider choosing any two points:

\n

Choose any value of ${x}$ for your first point.

\n

We will take ${x}=1$ for this example.

\n

Calculate the corresponding ${y}$-value by substituting into the equation $\\simplify[!canonicalOrder]{y={m}x+{c}}$:

\n

\\[y=(\\var{m}\\times 1)\\simplify{{+c}}\\]

\n

\\[y=\\var{m}\\simplify{{+c}}\\]

therefore the first point is $(1,\\simplify{{m}+{c}})$.

\n

We repeat the process for $x=2$ (or any other value of $x$ that you choose):

\n

\\[y=(\\var{m}\\times 2)\\simplify{{+c}}\\]

\n

\\[y=\\simplify{2{m}}\\simplify{{+c}}\\]

\n

therefore the second point is $(2,\\simplify{2{m}+{c}})$.

\n

The alternative method is to use the gradient and intercept:

\n

 $\\simplify[!canonicalOrder]{y={m}x+{c}}$

\n

Therefore $\\simplify{m={m}}$ and $\\simplify{c={c}}$.

\n

The intercept tells us where the line intercepts the $y$-axis, so we can move one of the points to $(0,\\simplify{{c}})$ straight away.

\n

The gradient is a measure of 'how many units up for each unit across' (or 'units down' if the gradient is negative). In this case we want to go {uod} {abs(m)} for each unit across, so to place the second point we move across 1 unit on the $x$-axis and {uod} {abs(m)} on the $y$-axis, which takes us to $(1,\\simplify{{c+m}})$.

\n

", "rulesets": {}, "extensions": ["geogebra"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"app": {"name": "app", "group": "Ungrouped variables", "definition": "geogebra_applet(\n 800,500,\n [\n A: [\n definition: p1,\n label_visible: false\n ],\n B: [\n definition: p2,\n label_visible: false\n ],\n line: [\n definition: \"Line(A,B)\",\n label_visible: false\n ]\n \n \n ]\n \n \n)", "description": "", "templateType": "anything", "can_override": false}, "p1": {"name": "p1", "group": "Ungrouped variables", "definition": "vector(0,0)", "description": "", "templateType": "anything", "can_override": false}, "p2": {"name": "p2", "group": "Ungrouped variables", "definition": "vector(1,1)", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "random(-4,-3,-2,2,3,4,5)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-5..5 except 0)", "description": "", "templateType": "anything", "can_override": false}, "uod": {"name": "uod", "group": "Ungrouped variables", "definition": "if(m=abs(m),'up','down')", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["app", "p1", "p2", "m", "c", "uod"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "extension", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "l:\n value(app,\"line\")\n\nax:\n x(app,\"A\")\n\nay:\n y(app,\"A\")\n\nbx:\n x(app,\"B\")\n\nby:\n y(app,\"B\")\n\nmans:\n (ay-by)/(ax-bx)\n\ncans:\n ay - mans*ax\n\nmark:\n feedback(\"Your line is $\\\\var{value(app,'line')}$.\");\n correctif(mans=m AND cans=c)\n\ninterpreted_answer:\n mans", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

You can zoom and pan this image.

{app}

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Alice Batchelor", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21932/"}]}]}], "contributors": [{"name": "Alice Batchelor", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/21932/"}]}