// Numbas version: exam_results_page_options {"name": "Maria's copy of Terry's copy of Julie's copy of Plot the graph of a quadratic function", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"showQuestionGroupNames": false, "functions": {}, "statement": "
You are given the quadratic function $y=\\simplify[std]{{a}x^2+{c}}$
", "variables": {"a": {"name": "a", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-2,-1,-0.5,0.5,1,2)"}, "c": {"name": "c", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "random(-4..4 except 0)"}, "values": {"name": "values", "templateType": "anything", "description": "", "group": "Ungrouped variables", "definition": "map(a*x^2+c,x,-3..3)"}}, "parts": [{"matrix": ["if(a>0,1,0)", "if(a>0,0,1)"], "showCorrectAnswer": true, "distractors": ["", ""], "variableReplacementStrategy": "originalfirst", "prompt": "The graph of this function is:
", "marks": 0, "choices": ["An upwards-opening parabola
", "A downwards-opening parabola
"], "type": "1_n_2", "displayType": "radiogroup", "scripts": {}, "variableReplacements": [], "maxMarks": 1, "shuffleChoices": false, "minMarks": 0, "displayColumns": 0}, {"prompt": "Fill in the table of values for $y=\\simplify[std]{{a}x^2+{c}}$:
\n$x$ | $-3$ | $-2$ | $-1$ | $0$ | $1$ | $2$ | $3$ |
---|---|---|---|---|---|---|---|
$y$ | \n[[0]] | \n[[1]] | \n[[2]] | \n[[3]] | \n[[4]] | \n[[5]] | \n[[6]] | \n
Slide the points to the correct $y$ values.
\n", "marks": 0, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[0]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[0]}", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[1]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[1]}", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[2]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[2]}", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[3]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[3]}", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[4]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[4]}", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[5]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[5]}", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": "0.5", "showCorrectAnswer": false, "correctAnswerFraction": false, "minValue": "{values[6]}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{values[6]}", "showPrecisionHint": false, "type": "numberentry"}], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "scripts": {}, "type": "gapfill"}, {"prompt": "Give the coordinates of the turning point of the parabola: $\\bigg($[[0]]$, $ [[1]]$\\bigg)$
", "marks": 0, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "marks": 0.5, "showCorrectAnswer": true, "correctAnswerFraction": false, "minValue": "0", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "0", "showPrecisionHint": false, "type": "numberentry"}, {"scripts": {}, "marks": 0.5, "showCorrectAnswer": true, "correctAnswerFraction": false, "minValue": "{c}", "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "allowFractions": false, "maxValue": "{c}", "showPrecisionHint": false, "type": "numberentry"}], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "scripts": {}, "type": "gapfill"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["a", "c", "values"], "preamble": {"js": "\nfunction dragpoint_board() {\n\n var scope = question.scope; \n var a = scope.variables.a.value;\n\n var c = scope.variables.c.value;\n var maxy = Math.max(Math.abs(a*9+c),Math.abs(c));\n \n var div = Numbas.extensions.jsxgraph.makeBoard('250px','400px',{boundingBox:[-5,maxy+3,5,-maxy-3],grid:true});\n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n //shorthand to evaluate a mathematical expression to a number\n function evaluate(expression) {\n try {\n var val = Numbas.jme.evaluate(expression,question.scope);\n return Numbas.jme.unwrapValue(val);\n }\n catch(e) {\n // if there's an error, return no number\n return NaN;\n }\n }\n \n // set up points array\n var num_points = 7;\n var points = [];\n \n \n // this function sets up the i^th point\n function make_point(i) {\n \n // calculate initial coordinates\n var x = i-(num_points-1)/2;\n \n // create an invisible vertical line for the point to slide along\n var line = board.create('line',[[x,0],[x,1]],{visible: false});\n \n // create the point\n var point = points[i] = board.create(\n 'glider',\n [i-(num_points-1)/2,0,line],\n {\n name:'',\n size:2,\n snapSizeY: 0.1, // the point will snap to y-coordinates which are multiples of 0.1\n snapToGrid: true\n }\n );\n \n // the contents of the input box for this point\n var studentAnswer = question.parts[2].gaps[i].display.studentAnswer;\n \n //Here I have commented out the functions which connect the student input to the graph and the filling in of the answer fields\n //when the student drags the points on the graph.\n \n // watch the student's input and reposition the point when it changes. \n // ko.computed(function() {\n // y = evaluate(studentAnswer());\n //if(!(isNaN(y)) && board.mode!=board.BOARD_MODE_DRAG) {\n // point.moveTo([x,y],100);\n // }\n // });\n \n // when the student drags the point, update the gapfill input\n point.on('drag',function(){\n var y = Numbas.math.niceNumber(point.Y());\n studentAnswer(y);\n });\n \n }\n \n // create each point\n for(var i=0;iAdapted from a question written in Dutch by Carolijn Tacken.
\nDisconnected the graph from the answer fields.
"}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Terry Young", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3130/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Terry Young", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3130/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}