// Numbas version: exam_results_page_options {"name": "nuExam09 - sine and cosine", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"plot": {"parameters": [["n", "number"], ["a", "number"], ["b", "number"], ["c", "number"]], "language": "javascript", "type": "html", "definition": "// Max and min x and y values for the axis.\nvar x_min = -7;\nvar x_max = 10;\nvar y_min = -1.5;\nvar y_max = 1.5;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '300px',\n '300px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: false,\n grid: false,\n axis:false,\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 and y-axis\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\n//var 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 });\n\n\n\n\n// Plot the function.\n\n\n//Define function depending on value of n.\nswitch(n) {\n case 1:\n var f = function(x) {return Math.sin(x); }\n break;\n \n case 2:\n var f = function(x) {return Math.sin(x+3.141*0.5); }\n break;\n \n case 3:\n var f = function(x) {return Math.sin(x+3.141*1.0);}\n break;\n \n case 4:\n var f = function(x) {return Math.sin(x+3.141*1.5);}\n break;\n \n \n}\n\n board.create('functiongraph', [f], {strokeWidth:3,strokeColor:'black'});\n\nreturn div;\n\n\n\n// Plot coordinates.\n// board.create('circle',[[x0,y0],0.1],{color:'red'});\n// board.create('text',[x0,y0+0.3,'A']);\n// board.create('circle',[[x1,y1],0.1],{color:'red'});\n// board.create('text',[x1,y1+0.3,'B']);\n// board.create('circle',[[x2,y2],0.1],{color:'red'});\n// board.create('text',[x2,y2+0.3,'C']);\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "name": "nuExam09 - sine and cosine", "ungrouped_variables": [], "rulesets": {}, "extensions": ["jsxgraph"], "metadata": {"description": "

Four sinusoidal graphs are given. Student should select the one which is sine and cosine.

", "licence": "Creative Commons Attribution 4.0 International"}, "advice": "

See Lecture 6.3 for sketches of sine and cosine graph.

", "statement": "", "variable_groups": [{"name": "part a", "variables": []}], "variables": {}, "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "parts": [{"prompt": "

Match the graph with its function.

", "matrix": [["0.5", "-2", "-2"], ["-2", "0.5", "-2"], ["-2", "-2", "0.5"], ["-2", "-2", "0.5"]], "variableReplacements": [], "warningType": "none", "showCorrectAnswer": true, "showCellAnswerState": true, "answers": ["

$y=\\sin(x)$

", "

$y=\\cos(x)$

", "

Neither

"], "customMarkingAlgorithm": "", "type": "m_n_x", "marks": 0, "shuffleAnswers": false, "minAnswers": "4", "extendBaseMarkingAlgorithm": true, "customName": "", "useCustomName": false, "displayType": "radiogroup", "shuffleChoices": true, "minMarks": 0, "unitTests": [], "choices": ["

{plot(1,1,1,1)}

", "

{plot(2,1,1,1)}

", "

{plot(3,1,1,1)}

", "

{plot(4,1,1,1)}

"], "variableReplacementStrategy": "originalfirst", "layout": {"expression": "", "type": "all"}, "scripts": {}, "maxMarks": 0, "maxAnswers": 0, "showFeedbackIcon": true}], "type": "question", "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}]}], "contributors": [{"name": "Michael Proudman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/269/"}, {"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}