// Numbas version: exam_results_page_options {"name": "Slope: Increasing/decreasing from graph", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Slope: Increasing/decreasing from graph", "tags": ["easy"], "metadata": {"description": "

State if a function is increasing at given points or on given intervals

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

Slope:

\n

Consider the following graph of a function (plotted in blue)

\n

{plot_curve(a,b,c,s)}

", "advice": "

For your information this is the graph of \\[f(x)=\\simplify{{f}}\\]

", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-4..4)", "description": "

One turning point

", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-4..4 except [a-1,a,a+1])", "description": "

Another turning point

", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-1..1)", "description": "

Vertical intercept

", "templateType": "anything", "can_override": false}, "s": {"name": "s", "group": "Ungrouped variables", "definition": "random([-1,1])", "description": "

Sign of $x^3$

", "templateType": "anything", "can_override": false}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "substitute([\"a\":a,\"b\":b,\"c\":c,\"s\":s],expression(\"(s/3)*x^3-(s*(a+b)/2)*x^2+s*a*b*x+c\"))", "description": "

The actual function plotted

", "templateType": "anything", "can_override": false}, "df": {"name": "df", "group": "Ungrouped variables", "definition": "substitute([\"a\":a,\"b\":b,\"c\":c,\"s\":s],expression(\"s*(x-a)*(x-b)\"))", "description": "

First derivative of function

", "templateType": "anything", "can_override": false}, "minab": {"name": "minab", "group": "Ungrouped variables", "definition": "min(a,b)", "description": "", "templateType": "anything", "can_override": false}, "maxab": {"name": "maxab", "group": "Ungrouped variables", "definition": "max(a,b)", "description": "", "templateType": "anything", "can_override": false}, "midab": {"name": "midab", "group": "Ungrouped variables", "definition": "(a+b)/2", "description": "", "templateType": "anything", "can_override": false}, "marking_matrix": {"name": "marking_matrix", "group": "Ungrouped variables", "definition": "[if(fp(a,b,s,minab-0.5)>0,1,0), if(fp(a,b,s,maxab)>0,1,0),if(fp(a,b,s,midab)>0,1,0),if(s>0,1,0), if(s<0,1,0)]", "description": "", "templateType": "anything", "can_override": false}, "aux": {"name": "aux", "group": "Ungrouped variables", "definition": "fp(2,2,2,2)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "s", "f", "df", "minab", "maxab", "midab", "marking_matrix", "aux"], "variable_groups": [], "functions": {"plot_curve": {"parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["s", "number"]], "type": "html", "language": "javascript", "definition": "// Set functions and define variables for range\nfunction fp(x) {return s*(x-a)*(x-b);}\nfunction f(x) {return s*((x*x*x)/3-((a+b)*x*x)/2+a*b*x)+c;}\n\nvar ddx = Math.abs(a-b)\nvar ddy = Math.abs(f(a)-f(b))\n\nvar x_lower = Math.min(a,b) - ddx\nvar x_upper = Math.max(a,b) + ddx\nvar y_lower = Math.min(f(a),f(b)) - ddy\nvar y_upper = Math.max(f(a),f(b)) + ddy\n\n// Board with axes\nvar div = Numbas.extensions.jsxgraph.makeBoard('400px','400px', { \n boundingbox: [x_lower, y_upper, x_upper, y_lower], axis:true, defaultAxes: {\n x : {\n name: 'x',\n withLabel: true,\n label: {\n position: 'rt',\n offset: [-10, -15], strokeColor: \"red\", fontsize: 15\n }\n },\n y : {\n withLabel:true,\n name: 'f(x)',\n label: {\n position: 'rt',\n offset: [-20, -10], strokeColor: \"red\", fontsize: 15\n }\n }\n }\n});\n\nvar board = div.board\n\n// Add the curve plots\nfig = board.create('functiongraph', [f]);\n\n// And some additional stuff\nboard.create(\"line\",[[a,0],[a,f(a)]], {straightFirst:false, straightLast:false, strokeWidth:2, dash:2})\nboard.create(\"line\",[[b,0],[b,f(b)]], {straightFirst:false, straightLast:false, strokeWidth:2, dash:2})\nboard.create('glider',[a,f(a),fig], {name: \"\"});\nboard.create('glider',[b,f(b),fig], {name: \"\"});\n\nreturn div"}, "fp": {"parameters": [["a", "number"], ["b", "number"], ["s", "number"], ["x", "number"]], "type": "number", "language": "javascript", "definition": "return s*(x-a)*(x-b);"}}, "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": "

Based on the graph, at which of the following points or intervals in the domain of the plot is the function increasing? Select all correct answers.

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "checkbox", "displayColumns": 0, "minAnswers": 0, "maxAnswers": 0, "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": ["$x=\\simplify{{minab-0.5}}$", "$x=\\simplify{{maxab}}$", "$x=\\simplify{{midab}}$", "$x<\\simplify{{minab}}$ or $x>\\simplify{{maxab}}$", "$x>\\simplify{{minab}}$ and $x<\\simplify{{maxab}}$"], "matrix": "marking_matrix"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Emil Kostadinov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/10391/"}, {"name": "Ben Newey", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/11618/"}]}]}], "contributors": [{"name": "Emil Kostadinov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/10391/"}, {"name": "Ben Newey", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/11618/"}]}