// Numbas version: exam_results_page_options {"name": "Argand Diagram", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

\n

Plot the following complex numbers on the Argand diagram below.

\n

{dragpoints()}

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Drag points on a graph to the given Cartesian coordinates. There are points in each of the four quadrants and on each axis.

"}, "functions": {"dragpoints": {"type": "html", "language": "javascript", "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-11,11,11,-11],grid: true, fillColor: 'white'});\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: true});\nvar b = board.create('point',[10,9],{name: 'B', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: true});\nvar c = board.create('point',[10,8],{name: 'C', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: true});\nvar d = board.create('point',[10,7],{name: 'D', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: true});\nvar e = board.create('point',[10,6],{name: 'E', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: true});\nvar f = board.create('point',[10,5],{name: 'F', size: 7, fillColor: 'blue' , strokeColor: 'lightblue' , highlightFillColor: 'lightblue', highlightStrokeColor: 'yellow',snapToGrid: true, showInfobox: true});\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", "parameters": []}, "correctPoints": {"type": "html", "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;", "parameters": []}}, "tags": [], "rulesets": {}, "extensions": ["jsxgraph"], "name": "Argand Diagram", "preamble": {"js": "", "css": ""}, "variables": {"f2": {"name": "f2", "description": "", "templateType": "anything", "definition": "random(-10..10 except 0)", "group": "Ungrouped variables"}, "c1": {"name": "c1", "description": "", "templateType": "anything", "definition": "random(1..10)", "group": "Ungrouped variables"}, "c2": {"name": "c2", "description": "", "templateType": "anything", "definition": "random(-10..-1)", "group": "Ungrouped variables"}, "d1": {"name": "d1", "description": "", "templateType": "anything", "definition": "random(-10..-1)", "group": "Ungrouped variables"}, "b2": {"name": "b2", "description": "", "templateType": "anything", "definition": "random(1..10)", "group": "Ungrouped variables"}, "d2": {"name": "d2", "description": "", "templateType": "anything", "definition": "random(1..10)", "group": "Ungrouped variables"}, "a2": {"name": "a2", "description": "", "templateType": "anything", "definition": "random(-10..-1)", "group": "Ungrouped variables"}, "y": {"name": "y", "description": "", "templateType": "anything", "definition": "2", "group": "Ungrouped variables"}, "a1": {"name": "a1", "description": "", "templateType": "anything", "definition": "random(-10..-1)", "group": "Ungrouped variables"}, "b1": {"name": "b1", "description": "", "templateType": "anything", "definition": "random(1..9)", "group": "Ungrouped variables"}, "f1": {"name": "f1", "description": "", "templateType": "anything", "definition": "0", "group": "Ungrouped variables"}, "e2": {"name": "e2", "description": "", "templateType": "anything", "definition": "0", "group": "Ungrouped variables"}, "e3": {"name": "e3", "description": "", "templateType": "anything", "definition": "random(-10..10 except 0)", "group": "Ungrouped variables"}, "x": {"name": "x", "description": "", "templateType": "anything", "definition": "1", "group": "Ungrouped variables"}, "e1": {"name": "e1", "description": "", "templateType": "anything", "definition": "random(-10..10 except 0)", "group": "Ungrouped variables"}}, "parts": [{"type": "gapfill", "scripts": {"mark": {"order": "after", "script": "console.log(this.question.points);\nthis.question.points.a.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n"}}, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{a1}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{a1}", "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{a2}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{a2}", "variableReplacementStrategy": "originalfirst"}], "prompt": "

\n

$A=\\var{a1}+\\var{a2}i$.

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "scripts": {"mark": {"order": "after", "script": "console.log(this.question.points);\nthis.question.points.b.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n"}}, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{b1}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{b1}", "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{b2}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{b2}", "variableReplacementStrategy": "originalfirst"}], "prompt": "

$B = \\var{b1}+\\var{b2}i$.

\n

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "scripts": {"mark": {"order": "after", "script": "console.log(this.question.points);\nthis.question.points.c.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n"}}, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{c1}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{c1}", "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{c2}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{c2}", "variableReplacementStrategy": "originalfirst"}], "prompt": "

$C =\\var{c1}+\\var{c2}i$.

\n

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "scripts": {"mark": {"order": "after", "script": "console.log(this.question.points);\nthis.question.points.d.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});\n"}}, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{d1}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{d1}", "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{d2}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{d2}", "variableReplacementStrategy": "originalfirst"}], "prompt": "

$D=\\var{d1}+\\var{d2}i$.

\n

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "scripts": {"mark": {"order": "after", "script": "console.log(this.question.points);\nthis.question.points.e.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});"}}, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{e1}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{e1}", "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{e2}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{e2}", "variableReplacementStrategy": "originalfirst"}], "prompt": "

$E=\\var{e1}+\\var{e2}i$.

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst"}, {"type": "gapfill", "scripts": {"mark": {"order": "after", "script": "console.log(this.question.points);\nthis.question.points.f.setAttribute({fillColor: this.credit==1 ? 'green' : 'red'});"}}, "showCorrectAnswer": true, "gaps": [{"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{f1}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{f1}", "variableReplacementStrategy": "originalfirst"}, {"scripts": {}, "showCorrectAnswer": true, "mustBeReduced": false, "mustBeReducedPC": 0, "correctAnswerFraction": false, "marks": 1, "variableReplacements": [], "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{f2}", "correctAnswerStyle": "plain", "allowFractions": false, "showFeedbackIcon": true, "minValue": "{f2}", "variableReplacementStrategy": "originalfirst"}], "prompt": "

$F=\\var{f1}+\\var{f2}i$.

\n

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "variableReplacementStrategy": "originalfirst"}], "advice": "", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["x", "y", "a1", "a2", "b1", "b2", "c1", "c2", "d1", "d2", "e1", "e2", "e3", "f1", "f2"], "type": "question", "contributors": [{"name": "Matthew Mears", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1688/"}]}]}], "contributors": [{"name": "Matthew Mears", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1688/"}]}