// Numbas version: finer_feedback_settings {"name": "Fady's copy of Drag points to given Cartesian coordinates", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "
Move the points to the required coordinates on the graph.
", "metadata": {"description": "Drag points on a graph to the given Cartesian coordinates. There are points in each of the four quadrants and on each axis.
", "licence": "Creative Commons Attribution 4.0 International"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"e3": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "e3", "definition": "random(-10..10 except 0)"}, "a1": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "a1", "definition": "random(-10..-1)"}, "y": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "y", "definition": "2"}, "f1": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "f1", "definition": "0"}, "b1": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "b1", "definition": "random(1..9)"}, "a2": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "a2", "definition": "random(-10..-1)"}, "b2": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "b2", "definition": "random(1..10)"}, "e1": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "e1", "definition": "random(-10..10 except 0)"}, "e2": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "e2", "definition": "0"}, "f2": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "f2", "definition": "random(-10..10 except 0)"}, "x": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "x", "definition": "1"}, "d2": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "d2", "definition": "random(1..10)"}, "c2": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "c2", "definition": "random(-10..-1)"}, "c1": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "c1", "definition": "random(1..10)"}, "d1": {"group": "Ungrouped variables", "description": "", "templateType": "anything", "name": "d1", "definition": "random(-10..-1)"}}, "functions": {"dragpoints": {"type": "html", "parameters": [], "language": "javascript", "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-11,11,11,-11],grid: true});\nvar board = div.board;\nquestion.board = board;\n\n//var x = Numbas.jme.unwrapValue(scope.variables.x);\n//var y = Numbas.jme.unwrapValue(scope.variables.y);\n\nvar a = board.create('point',[10,10],{name: 'A', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: false});\nvar b = board.create('point',[10,9],{name: 'B', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: false});\nvar c = board.create('point',[10,8],{name: 'C', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: false});\nvar d = board.create('point',[10,7],{name: 'D', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: false});\nvar e = board.create('point',[10,6],{name: 'E', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: false});\nvar f = board.create('point',[10,5],{name: 'F', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: false});\n\nquestion.points = {\n a:a,b:b,c:c,d:d,e:e,f:f\n}\n\na.on('drag',function(){\n Numbas.exam.currentQuestion.parts[0].gaps[0].display.studentAnswer(a.X());\n Numbas.exam.currentQuestion.parts[0].gaps[1].display.studentAnswer(a.Y());\n});\nb.on('drag',function(){\n Numbas.exam.currentQuestion.parts[1].gaps[0].display.studentAnswer(b.X());\n Numbas.exam.currentQuestion.parts[1].gaps[1].display.studentAnswer(b.Y());\n});\nc.on('drag',function(){\n Numbas.exam.currentQuestion.parts[2].gaps[0].display.studentAnswer(c.X());\n Numbas.exam.currentQuestion.parts[2].gaps[1].display.studentAnswer(c.Y());\n});\nd.on('drag',function(){\n Numbas.exam.currentQuestion.parts[3].gaps[0].display.studentAnswer(d.X());\n Numbas.exam.currentQuestion.parts[3].gaps[1].display.studentAnswer(d.Y());\n});\ne.on('drag',function(){\n Numbas.exam.currentQuestion.parts[4].gaps[0].display.studentAnswer(e.X());\n Numbas.exam.currentQuestion.parts[4].gaps[1].display.studentAnswer(e.Y());\n});\nf.on('drag',function(){\n Numbas.exam.currentQuestion.parts[5].gaps[0].display.studentAnswer(f.X());\n Numbas.exam.currentQuestion.parts[5].gaps[1].display.studentAnswer(f.Y());\n});\n\n/*\nquestion.signals.on('HTMLAttached',function(e) {\n ko.computed(function(){ \n var x = parseFloat(question.parts[0].gaps[0].display.studentAnswer());\n var y = parseFloat(question.parts[0].gaps[1].display.studentAnswer());\n if(!(isNaN(x) || isNaN(y)) && board.mode!=board.BOARD_MODE_DRAG) {\n a.moveTo([x,y],100);\n }\n });\n});\n*/\n\nreturn div;\n\n"}, "correctPoints": {"type": "html", "parameters": [], "language": "javascript", "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-11,11,11,-11],grid: true});\nvar board = div.board;\nquestion.board = board;\n\nvar a1 = Numbas.jme.unwrapValue(scope.variables.a1);\nvar a2 = Numbas.jme.unwrapValue(scope.variables.a2);\nvar b1 = Numbas.jme.unwrapValue(scope.variables.b1);\nvar b2 = Numbas.jme.unwrapValue(scope.variables.b2);\nvar c1 = Numbas.jme.unwrapValue(scope.variables.c1);\nvar c2 = Numbas.jme.unwrapValue(scope.variables.c2);\nvar d1 = Numbas.jme.unwrapValue(scope.variables.d1);\nvar d2 = Numbas.jme.unwrapValue(scope.variables.d2);\nvar e1 = Numbas.jme.unwrapValue(scope.variables.e1);\nvar e2 = Numbas.jme.unwrapValue(scope.variables.e2);\nvar f1 = Numbas.jme.unwrapValue(scope.variables.f1);\nvar f2 = Numbas.jme.unwrapValue(scope.variables.f2);\n\n\nvar a = board.create('point',[a1,a2],{name: 'A', size: 7, fillColor: 'limegreen' , strokeColor: 'yellow' , highlightFillColor: 'green', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: true});\nvar b = board.create('point',[b1,b2],{name: 'B', size: 7, fillColor: 'limegreen' , strokeColor: 'yellow' , highlightFillColor: 'green', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: true});\nvar c = board.create('point',[c1,c2],{name: 'C', size: 7, fillColor: 'limegreen' , strokeColor: 'yellow' , highlightFillColor: 'green', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: true});\nvar d = board.create('point',[d1,d2],{name: 'D', size: 7, fillColor: 'limegreen' , strokeColor: 'yellow' , highlightFillColor: 'green', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: true});\nvar e = board.create('point',[e1,e2],{name: 'E', size: 7, fillColor: 'limegreen' , strokeColor: 'yellow' , highlightFillColor: 'green', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: true});\nvar f = board.create('point',[f1,f2],{name: 'F', size: 7, fillColor: 'limegreen' , strokeColor: 'yellow' , highlightFillColor: 'green', highlightStrokeColor: 'yellow', snapToGrid: true, showInfobox: true});\n\n/*\nquestion.signals.on('HTMLAttached',function(e) {\n ko.computed(function(){ \n var x = parseFloat(question.parts[0].gaps[0].display.studentAnswer());\n var y = parseFloat(question.parts[0].gaps[1].display.studentAnswer());\n if(!(isNaN(x) || isNaN(y)) && board.mode!=board.BOARD_MODE_DRAG) {\n a.moveTo([x,y],100);\n }\n });\n});\n*/\n\nreturn div;"}}, "tags": ["cartesian coordinates", "drag points on a graph", "graphs", "taxonomy"], "extensions": ["jsxgraph"], "parts": [{"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "console.log(this.question.points);\nthis.question.points.a.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n", "order": "after"}}, "marks": 0, "type": "gapfill", "gaps": [{"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{a1}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{a1}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{a2}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{a2}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "prompt": "{dragpoints()}
\nMove the points as follows:
\nA to $(\\var{a1},\\var{a2})$.
", "variableReplacements": []}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "console.log(this.question.points);\nthis.question.points.b.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n", "order": "after"}}, "marks": 0, "type": "gapfill", "gaps": [{"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{b1}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{b1}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{b2}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{b2}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "prompt": "B to $(\\var{b1},\\var{b2})$.
\n", "variableReplacements": []}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "console.log(this.question.points);\nthis.question.points.c.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n", "order": "after"}}, "marks": 0, "type": "gapfill", "gaps": [{"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{c1}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{c1}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{c2}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{c2}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "prompt": "C to $(\\var{c1},\\var{c2})$.
\n", "variableReplacements": []}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "console.log(this.question.points);\nthis.question.points.d.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n", "order": "after"}}, "marks": 0, "type": "gapfill", "gaps": [{"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{d1}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{d1}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{d2}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{d2}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "prompt": "D to $(\\var{d1},\\var{d2})$.
\n", "variableReplacements": []}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "console.log(this.question.points);\nthis.question.points.e.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});", "order": "after"}}, "marks": 0, "type": "gapfill", "gaps": [{"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{e1}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{e1}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{e2}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{e2}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "prompt": "E to $(\\var{e1},\\var{e2})$.
", "variableReplacements": []}, {"showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {"mark": {"script": "console.log(this.question.points);\nthis.question.points.f.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});", "order": "after"}}, "marks": 0, "type": "gapfill", "gaps": [{"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{f1}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{f1}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"type": "numberentry", "allowFractions": false, "showFeedbackIcon": true, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "mustBeReduced": false, "minValue": "{f2}", "scripts": {}, "marks": 1, "mustBeReducedPC": 0, "showCorrectAnswer": true, "maxValue": "{f2}", "notationStyles": ["plain", "en", "si-en"], "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "variableReplacementStrategy": "originalfirst", "prompt": "F to $(\\var{f1},\\var{f2})$.
\n", "variableReplacements": []}], "advice": "Coordinates are given as $(x\\text{-coordinate},y\\text{-coordinate})$. So, for example $(2,5)$ has $x$-coordinate $= 2$ and $y$-coordinate$= 5$.
\nPlot the first coordinate ($x$-coordinate) against the horizontal axis and then plot the second coordinate ($y$-coordinate) against the vertical axis.
\n{correctPoints()}
", "name": "Fady's copy of Drag points to given Cartesian coordinates", "rulesets": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["x", "y", "a1", "a2", "b1", "b2", "c1", "c2", "d1", "d2", "e1", "e2", "e3", "f1", "f2"], "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}, {"name": "Fady Ghanem", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2969/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Bradley Bush", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1521/"}, {"name": "Fady Ghanem", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2969/"}]}