// Numbas version: exam_results_page_options {"name": "Maria's copy of Laura's copy of Sketching graphs: quadratics", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"plot": {"type": "html", "definition": "// This functions plots a cubic with a certain number of\n// stationary points and roots.\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 = -10;\nvar x_max = 10;\nvar y_min = -15;\nvar y_max = 15;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '300px',\n '300px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: false,\n grid: false,\n axis:false,\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 and y-axis\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\n//var 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 });\n\n\n\n\n// Plot the function.\n// board.create('functiongraph',\n// [function(x){ return (x-a)*(x-a)+b},x_min,x_max]);\n\n//Define function depending on value of n.\nswitch(n) {\n case 0:\n var f = function(x) {return a*x*x+b*x+c; }\n break;\n \n case 1:\n var f = function(x) {return Math.log(x+a); }\n break;\n \n case 2:\n var f = function(x) {return a*x+b;}\n break;\n \n case 3:\n var f = function(x) {return Math.pow(2,x)*-a;}\n break;\n \n case 4:\n var f = function(x) {return a*x*(x-b)*(x-c);}\n break;\n \n}\n\n board.create('functiongraph', [f], {strokeWidth:3,strokeColor:'black'});\n\nreturn div;\n\n\n\n// Plot coordinates.\n// board.create('circle',[[x0,y0],0.1],{color:'red'});\n// board.create('text',[x0,y0+0.3,'A']);\n// board.create('circle',[[x1,y1],0.1],{color:'red'});\n// board.create('text',[x1,y1+0.3,'B']);\n// board.create('circle',[[x2,y2],0.1],{color:'red'});\n// board.create('text',[x2,y2+0.3,'C']);\n\nreturn div;", "parameters": [["n", "number"], ["a", "number"], ["b", "number"], ["c", "number"]], "language": "javascript"}}, "extensions": ["jsxgraph"], "variable_groups": [{"name": "part a", "variables": ["a", "b", "c", "rand"]}], "advice": "

See 4.1 and 4.2 for background and examples.

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

A quadratic function $ax^2+bs+c$ is given. Six parabolas are sketched. Question is to select the correct parabola.  Need to consider the y-intercept, the coefficient of x^2, and the x-coordinate of the minimum/maximum point.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "variables": {"c": {"templateType": "anything", "description": "", "name": "c", "group": "part a", "definition": "[random(2..9)*rand[0][1],\n random(2..9)*rand[1][1],\n random(2..9)*rand[2][1]]"}, "a": {"templateType": "anything", "description": "", "name": "a", "group": "part a", "definition": "[random(1..3)*rand[0][0],\n random(1..3)*rand[1][0],\n random(1..3)*rand[2][0]]"}, "rand": {"templateType": "anything", "description": "", "name": "rand", "group": "part a", "definition": "shuffle([[1,1],[1,-1],[-1,1],[-1,-1]])"}, "b": {"templateType": "anything", "description": "", "name": "b", "group": "part a", "definition": "[random(-5..5 except [-1,0,1]),\n random(-5..5 except [-1,0,1]),\n random(-5..5 except [-1,0,1])]"}}, "rulesets": {}, "preamble": {"css": "", "js": ""}, "tags": [], "name": "Maria's copy of Laura's copy of Sketching graphs: quadratics", "parts": [{"displayColumns": 0, "unitTests": [], "maxAnswers": 0, "warningType": "none", "prompt": "

Sketch a graph of the quadratic $\\simplify[basic,unitFactor]{y = {a[0]}x^2+{b[0]}x+{c[0]}}$.  Hence, which of the following is the graph of this quadratic?

\n

\n

", "minAnswers": "0", "variableReplacements": [], "distractors": ["", "", "", "", "", ""], "showCorrectAnswer": true, "shuffleChoices": true, "choices": ["

{plot(0,a[0],b[0],c[0])}

", "

{plot(0,-a[0],b[0],c[0])}

", "

{plot(0,a[0],-b[0],c[0])}

", "

{plot(0,a[0],b[0],-c[0])}

", "{plot(0,-a[0],b[0],-c[0])}", "{plot(0,-a[0],-b[0],c[0])}"], "showFeedbackIcon": true, "type": "m_n_2", "marks": 0, "scripts": {}, "displayType": "checkbox", "matrix": ["3", 0, 0, 0, 0, 0], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "customMarkingAlgorithm": "", "minMarks": 0}, {"displayColumns": 0, "unitTests": [], "maxAnswers": 0, "warningType": "none", "prompt": "

Sketch a graph of the quadratic $\\simplify[basic,unitFactor]{y = {a[1]}x^2+{b[1]}x+{c[1]}}$.  Hence, which of the following is the graph of this quadratic?

\n

\n

", "minAnswers": "0", "variableReplacements": [], "distractors": ["", "", "", "", "", ""], "showCorrectAnswer": true, "shuffleChoices": true, "choices": ["

{plot(0,a[1],b[1],c[1])}

", "

{plot(0,-a[1],b[1],c[1])}

", "

{plot(0,a[1],-b[1],c[1])}

", "

{plot(0,a[1],b[1],-c[1])}

", "{plot(0,-a[1],b[1],-c[1])}", "{plot(0,-a[1],-b[1],c[1])}"], "showFeedbackIcon": true, "type": "m_n_2", "marks": 0, "scripts": {}, "displayType": "checkbox", "matrix": ["3", 0, 0, 0, 0, 0], "extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "maxMarks": 0, "customMarkingAlgorithm": "", "minMarks": 0}], "statement": "", "ungrouped_variables": [], "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Laura Horton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3124/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Laura Horton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3124/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}