// Numbas version: exam_results_page_options {"name": "Gradient positive or negative.", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"description": "

A quartic is given and the student is asked whether the gradient is positive or negative at various values of x.

", "licence": "Creative Commons Attribution 4.0 International"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variable_groups": [], "name": "Gradient positive or negative.", "statement": "

When is the gradient positive and when is it negative?

", "advice": "

See Lectures from first week of differentiation for background on gradients of curved graphs and connection with differentiation.

", "ungrouped_variables": ["a", "r1", "r2", "r3", "r4", "grad1", "grad2", "grad3", "grad4"], "variables": {"grad3": {"name": "grad3", "definition": "if(a<0, 'Negative', 'Positive')", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "a": {"name": "a", "definition": "random(-1..1 except 0)/10", "templateType": "anything", "description": "

y-intercept of the line

", "group": "Ungrouped variables"}, "grad4": {"name": "grad4", "definition": "if(a>0, 'Negative', 'Positive')", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "r4": {"name": "r4", "definition": "r3-random(2..3)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "r1": {"name": "r1", "definition": "random(3..5)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "r3": {"name": "r3", "definition": "r2-random(2..3)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "grad1": {"name": "grad1", "definition": "if(a<0, 'Negative', 'Positive')", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "grad2": {"name": "grad2", "definition": "if(a>0, 'Negative', 'Positive')", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "r2": {"name": "r2", "definition": "r1-random(2..3)", "templateType": "anything", "description": "", "group": "Ungrouped variables"}}, "rulesets": {}, "tags": [], "functions": {"plotgraph": {"type": "html", "definition": "// This functions plots a quartic graph\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 board.create('functiongraph',\n [function(x){ return a*(x-r1)*(x-r2)*(x-r3)*(x-r4);},x_min,x_max]);\n\n\n\n\nreturn div;", "language": "javascript", "parameters": [["a", "number"], ["r1", "number"], ["r2", "number"], ["r3", "number"], ["r4", "number"]]}}, "parts": [{"showCorrectAnswer": true, "scripts": {}, "variableReplacements": [], "marks": 0, "prompt": "

{plotgraph(a,r1,r2,r3,r4)}

\n

Above is the graph of some function $f$.

\n

The answers to the following questoins are either 'Negative' or 'Positive'.

\n

When $x=\\var{r2}$, is the gradient negative or positive? [[0]]

\n

When $x=\\var{r4}$, is the gradient negative or positive? [[1]]

\n

When $x=\\var{r3}$, is the gradient negative or positive? [[2]]

\n

Is $f'(\\var{r2})$ negative or positive? [[3]]

\n

Is $f'(\\var{r1})$ negative or positive? [[4]]

", "type": "gapfill", "variableReplacementStrategy": "originalfirst", "gaps": [{"showCorrectAnswer": true, "scripts": {}, "answer": "{grad2}", "variableReplacements": [], "marks": "0.5", "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{grad2}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true}, {"showCorrectAnswer": true, "scripts": {}, "answer": "{grad4}", "variableReplacements": [], "marks": "0.5", "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{grad4}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true}, {"showCorrectAnswer": true, "scripts": {}, "answer": "{grad3}", "variableReplacements": [], "marks": "0.5", "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{grad3}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true}, {"showCorrectAnswer": true, "scripts": {}, "answer": "{grad2}", "variableReplacements": [], "marks": "0.5", "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{grad2}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true}, {"showCorrectAnswer": true, "scripts": {}, "answer": "{grad1}", "variableReplacements": [], "marks": "0.5", "type": "patternmatch", "matchMode": "regex", "displayAnswer": "{grad1}", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true}], "showFeedbackIcon": true}], "extensions": ["geogebra", "jsxgraph"], "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}