// Numbas version: finer_feedback_settings {"name": "Constant acceleration: displacement-time to velocity-time graphs, slopes and areas", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "feedback": {"showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "allowrevealanswer": true, "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview"}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Constant acceleration: displacement-time to velocity-time graphs, slopes and areas", "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": "None specified"}, "statement": "

An object is moving under constant acceleration.  We measure the motion at two times, t1 = {t1}s and t2 = {t2}s.

\n

The graph below is the displacement-time graph of a body.

\n

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

", "advice": "

If the displacement-time graph is a straight line, then the velocity can be calculated via the gradient.

\n

If the displacement-time graph is curvy, then the correct graph can be found by considering the following: when is the velocity positive, when is the velocity negative and when is the velocity zero.

", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-2,-1,1,2)", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-2,-1,1,2)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(-2,-1,1,2)", "description": "", "templateType": "anything", "can_override": false}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "b+random(-2..2 except 0)", "description": "", "templateType": "anything", "can_override": false}, "t1": {"name": "t1", "group": "Ungrouped variables", "definition": "random(-1,0)", "description": "", "templateType": "anything", "can_override": false}, "t2": {"name": "t2", "group": "Ungrouped variables", "definition": "random(1,2)", "description": "", "templateType": "anything", "can_override": false}, "distance": {"name": "distance", "group": "Ungrouped variables", "definition": "(t2+t1)*((v2+v1)/2)", "description": "

 t1{t1} t2{t2} v1{v1} v2{v2} d{distance} a{acceleration}

", "templateType": "anything", "can_override": false}, "v2": {"name": "v2", "group": "Ungrouped variables", "definition": "a*(2*t2+b+d)", "description": "", "templateType": "anything", "can_override": false}, "v1": {"name": "v1", "group": "Ungrouped variables", "definition": "a*(2*t1+b+d)", "description": "", "templateType": "anything", "can_override": false}, "acceleration": {"name": "acceleration", "group": "Ungrouped variables", "definition": "(v2-v1)/(t2-t1)", "description": "", "templateType": "anything", "can_override": false}, "correct": {"name": "correct", "group": "Ungrouped variables", "definition": "2", "description": "", "templateType": "anything", "can_override": false}, "order": {"name": "order", "group": "Ungrouped variables", "definition": "shuffle([2,3,4,5])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "b", "c", "d", "q", "t1", "t2", "v2", "v1", "distance", "acceleration", "correct", "order"], "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 = -15;\nvar y_max = 15;\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:'t', \n\t\t\t withLabel: true, \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, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Select the graph that shows the corresponding velocity-time graph.

\n

Graph A: {plot(q,order[0],a,b,c,d)}
Graph B: {plot(q,order[1],a,b,c,d)}
Graph C: {plot(q,order[2],a,b,c,d)}
Graph D: {plot(q,order[3],a,b,c,d)}

\n

              

", "minMarks": 0, "maxMarks": "1", "shuffleChoices": false, "displayType": "checkbox", "displayColumns": 0, "minAnswers": "1", "maxAnswers": "1", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "interpretedAnswerForm": "list of list of boolean", "choices": "[\"A\",\"B\",\"C\",\"D\"]", "matrix": "map(if(order[i]=correct,1,0), i, [0,1,2,3])"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Calculate the area under the velocity vs time diagram to calculate displacement between t1 and t2.

", "minValue": "siground(distance,3)-(siground(abs(distance),3)*0.01)", "maxValue": "siground(distance,3)+(siground(abs(distance),3)*0.01)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

Calculate the slope of the velocity vs time diagram to calculate the acceleration.

", "minValue": "siground(acceleration,3)-(siground(abs(acceleration),3)*0.01)", "maxValue": "siground(acceleration,3)+(siground(abs(acceleration),3)*0.01)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "showAllParts": false, "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}, {"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}], "resources": []}]}], "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}, {"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}