// Numbas version: exam_results_page_options {"name": "Differentiation: Graphically determine derivative", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Differentiation: Graphically determine derivative", "tags": [], "metadata": {"description": "

A graph is drawn. A student is to identify the derivative of this graph from four other graphs. There are four such questions.

\n

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

See ??.  There are two main ways to think about this:

\n

1) Derivative tells you the gradient of the original function.

\n

2) Imagine the original function is displacement, then derivative tells you the velocity.

", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"q": {"name": "q", "group": "Ungrouped variables", "definition": "[1,3,random(2..3),2]", "description": "", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "[b[0]+random(-2..2 except 0),\n b[1]+random(-2..2 except 0),\n b[2]+random(-2..2 except 0),\n b[3]+random(-2..2 except 0)]", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "shuffle([-2,-1,1,2])", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "shuffle([-2,-1,1,2])", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "shuffle([-2,-1,1,2])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d", "q"], "variable_groups": [], "functions": {"plot": {"parameters": [["q", "number"], ["n", "number"], ["a", "number"], ["b", "number"], ["c", "number"], ["d", "number"]], "type": "html", "language": "javascript", "definition": "//The variable q randomises which style of graph you get: linear, quadratic or piecewise linear\n//The variable n controls whether you are plotting the question, the correct answer or one of three incorrect answers.\n//a,b,c and d are variables that vary parameters in the graphs, e.g. gradient, etc.\n\n\n\n//Maximum and minimum of graph goes here\n\nvar x_min = -5;\nvar x_max = 5;\nvar y_min = -6;\nvar y_max = 6;\n\n\n// Make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: false,\n grid: true\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('axis',[[0,0],[1,0]],\n {name:'x', \n\t\t\t withLabel: false, \n\t\t\t label: {position: 'rt', \n\t\t\t\t\t offset: [-15, 10] // (in pixels)\n\t\t\t\t\t }\n });\n\n// create the y-axis\nvar yaxis = board.create('axis',[[0,0],[0,1]]);\n\n\n\n \n// FUNCTIONS DEFINED HERE\n\n\nswitch(q) {\n case 1:\n var f1 = function(x) {return b*(x-a)+c;}\n var f2 = function(x) {return b;}\n var f3 = function(x) {return -b;}\n var f4 = function(x) {return b+1;}\n var f5 = function(x) {return b*(x-a)+c;}\n break;\n \n case 2:\n var f1 = function(x) {return a*(x+b)*(x+d);}\n var f2 = function(x) {return a*(2*x+b+d);}\n var f3 = function(x) {return -a*(2*x+b+d);}\n var f4 = function(x) {return a*(2*(x-1)+b+d);}\n var f5 = function(x) {return -a*(2*(x-1)+b+d);}\n break;\n \n case 3:\n var f1 = function(x) {\n if ((x-a)<0)\n return b*(x-a)+c;\n else\n return d*(x-a)+c;\n }\n var f2 = function(x) {\n if ((x-a)<0)\n return b;\n else\n return d;\n }\n var f3 = function(x) {\n if ((x-a-1)<0)\n return b;\n else\n return d;\n }\n var f4 = function(x) {\n if ((x-a)<0)\n return d;\n else\n return b;\n }\n var f5 = function(x) {\n if ((x-a)<0)\n return b-1;\n else\n return d-1;\n }\n break;\n \n} \n \n \n \n\n\n// PLOT THE FUNCTION\n\nswitch(n) {\n case 1:\n board.create('functiongraph', [f1], {strokeWidth:3});\n break;\n \n case 2:\n board.create('functiongraph', [f2], {strokeWidth:3});\n break;\n \n case 3:\n board.create('functiongraph', [f3], {strokeWidth:3});\n break;\n \n case 4:\n board.create('functiongraph', [f4], {strokeWidth:3});\n break;\n \n case 5:\n board.create('functiongraph', [f5], {strokeWidth:3});\n break;\n}\n\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The graph below is the graph of $f(x)$.

\n

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

\n

Select the graph that is the graph of $f'(x)$.

\n

              

", "minMarks": "0", "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": "1", "maxAnswers": "1", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["

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

", "

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

", "

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

", "

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

"], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}, {"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The graph below is the graph of $g(x)$.

\n

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

\n

Which graph below is the graph of $\\frac{dg}{dx}$.

\n

              

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": "1", "maxAnswers": "1", "warningType": "none", "showCellAnswerState": true, "choices": ["

{plot(q[1],2,{a[1]},{b[1]},{c[1]},{d[1]})}

", "

{plot(q[1],3,{a[1]},{b[1]},{c[1]},{d[1]})}

", "

{plot(q[1],4,{a[1]},{b[1]},{c[1]},{d[1]})}

", "

{plot(q[1],5,{a[1]},{b[1]},{c[1]},{d[1]})}

"], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}, {"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The graph below is the graph of $h(t)$.

\n

{plot(q[2],1,{a[2]},{b[2]},{c[2]},{d[2]})}

\n

Select the graph that is the derivative of $h$.

\n

              

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": "1", "maxAnswers": "1", "warningType": "none", "showCellAnswerState": true, "choices": ["

{plot(q[2],2,{a[2]},{b[2]},{c[2]},{d[2]})}

", "

{plot(q[2],3,{a[2]},{b[2]},{c[2]},{d[2]})}

", "

{plot(q[2],4,{a[2]},{b[2]},{c[2]},{d[2]})}

", "

{plot(q[2],5,{a[2]},{b[2]},{c[2]},{d[2]})}

"], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}, {"type": "m_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The graph below is the graph of $f(x)$.

\n

{plot(q[3],1,{a[3]},{b[3]},{c[3]},{d[3]})}

\n

Select the graph that is the graph of $f'(x)$.

\n

              

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": "1", "maxAnswers": "1", "warningType": "none", "showCellAnswerState": true, "choices": ["

{plot(q[3],2,{a[3]},{b[3]},{c[3]},{d[3]})}

", "

{plot(q[3],3,{a[3]},{b[3]},{c[3]},{d[3]})}

", "

{plot(q[3],4,{a[3]},{b[3]},{c[3]},{d[3]})}

", "

{plot(q[3],5,{a[3]},{b[3]},{c[3]},{d[3]})}

"], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Doug Satterford", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3185/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}, {"name": "Doug Satterford", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3185/"}]}