// Numbas version: exam_results_page_options {"name": "George's copy of Equation of a Quadratic Graph", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

Give the equation of a quadratic graph.

", "parts": [{"gaps": [{"checkvariablenames": false, "type": "jme", "marks": "4", "checkingaccuracy": 0.001, "scripts": {}, "variableReplacementStrategy": "originalfirst", "vsetrangepoints": 5, "expectedvariablenames": [], "answer": "{a}(x-{r1})(x-{r2})", "showpreview": true, "checkingtype": "absdiff", "variableReplacements": [], "answersimplification": "all", "showCorrectAnswer": true, "vsetrange": [0, 1], "showFeedbackIcon": true}], "prompt": "

{plotgraph(r1,r2,a)}

\n

Write the equation of the quadratic graph.

\n

$y(x)=\\;$[[0]]

", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "marks": 0, "scripts": {}, "variableReplacements": [], "showFeedbackIcon": true, "type": "gapfill"}], "extensions": ["jsxgraph", "geogebra"], "name": "George's copy of Equation of a Quadratic Graph", "preamble": {"js": "", "css": ""}, "ungrouped_variables": ["r1", "r2", "a"], "tags": [], "variables": {"r2": {"name": "r2", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "r1+random(-4..4 except [1,-1])"}, "r1": {"name": "r1", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-2..-2 except 0)"}, "a": {"name": "a", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-3..3 except 0)"}}, "rulesets": {}, "variable_groups": [], "advice": "

The graph crosses the $x$-axis in two places, namely at $(\\var{r1},0)$ and $(\\var{r2},0)$. Therefore, our quadratic can be written as $a(x-\\var{r1})(x-\\var{r2})$, but we still need to determine $a$.  To find $a$, you need to pick a value of $x$ (which is not $\\var{r1}$ or $\\var{r2}$) and use the graph to determine what $f(x)$ is.  Then you plug in these numbers into the equation and solve for $a$. Unfortunately, there is no fixed choice for $x$ so feedback on this exact question is not available.  However, we present an example from a different question:

\n

\n

Imagine after the first step you reached $f(x) = a(x-3)(x+2)$.  By looking at the graph we saw that $f(4) = 12$.  Plugging $x=4$ into our equation we get:

\n

$12 = f(4) = a(4-3)(4+2) = a \\cdot 1 \\cdot 6 = 6a$, so $a = 2$.

\n

Then the final answer in this example would be $f(x) = 2(x-3)(x+2)$.  (Depending on the wording of the question, you may have to expand the brackets too.  In this example, expanding the brackets gives $f(x) = 2x^2 - 2x - 12$.)

", "variablesTest": {"condition": "r1<>r2", "maxRuns": 100}, "metadata": {"description": "

Given a graph, the student is asked to determine the quadratic function.

", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"plotgraph": {"parameters": [["r1", "number"], ["r2", "number"], ["a", "number"]], "type": "html", "definition": "// This functions plots a graph of y = a(x-r1)(x-r2)\n// It creates the board, sets it up, then returns an\n// HTML div tag containing the board.\n\n\n// Max and min x and y values for the axis.\nvar x_min = -8;\nvar x_max = 8;\nvar y_min = -10;\nvar y_max = 10;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '500px',\n '600px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: true,\n grid: true\n }\n);\n\n\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \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,1],{\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,1],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\n\n\n// Plot the function\n\nboard.create('functiongraph',\n [function(x){ return a*(x-r1)*(x-r2);},x_min,x_max]);\n\n\n\nreturn div;", "language": "javascript"}}, "type": "question", "contributors": [{"name": "George Loughlin", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1619/"}]}]}], "contributors": [{"name": "George Loughlin", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1619/"}]}