// Numbas version: exam_results_page_options {"name": "4.1 Graphing trigonometric functions Q1", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "4.1 Graphing trigonometric functions Q1", "tags": [], "metadata": {"description": "

Choose one from a list to identify the function shown in a graph. The function is a randomly selected sin, cos, or tan graph with random scale factor.

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

{app}

", "advice": "

This is a {['sin','cos','tan'][ratio_selector]} graph.

\n

The peak value of the graph is $\\var{a}$, and so the function is $\\var{answer}$

\n", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "coeffs[0]", "description": "", "templateType": "anything", "can_override": false}, "ratio": {"name": "ratio", "group": "Ungrouped variables", "definition": "if (a<>1,\nif(ratio_selector=0,['$f(\\\\var{angle})=\\\\var{a}\\\\sin(\\\\var{angle})$',0],\n if(ratio_selector=1,['$f(\\\\var{angle})=\\\\var{a}\\\\cos(\\\\var{angle})$',1],\n if(ratio_selector=2,['$f(\\\\var{angle})=\\\\var{a}\\\\tan(\\\\var{angle})$',2],-1))),\nif(ratio_selector=0,['$f(\\\\var{angle})=\\\\sin(\\\\var{angle})$',0],\n if(ratio_selector=1,['$f(\\\\var{angle})=\\\\cos(\\\\var{angle})$',1],\n if(ratio_selector=2,['$f(\\\\var{angle})=\\\\tan(\\\\var{angle})$',2],-1))))", "description": "", "templateType": "anything", "can_override": false}, "anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "['$\\\\theta$',3]", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "anglelist[0]", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "ratio[0]", "description": "", "templateType": "anything", "can_override": false}, "ratio_selector": {"name": "ratio_selector", "group": "Ungrouped variables", "definition": "random([0,1,2])", "description": "", "templateType": "anything", "can_override": false}, "coeffs": {"name": "coeffs", "group": "Ungrouped variables", "definition": "shuffle([1,2,3,4])", "description": "", "templateType": "anything", "can_override": false}, "dis3": {"name": "dis3", "group": "Ungrouped variables", "definition": "if (coeffs[3]<>1,\nif(dis_ratio_selectors[2]=0,['$f(\\\\var{angle})=\\\\var{coeffs[3]}\\\\sin(\\\\var{angle})$',0],\n if(dis_ratio_selectors[2]=1,['$f(\\\\var{angle})=\\\\var{coeffs[3]}\\\\cos(\\\\var{angle})$',1],\n if(dis_ratio_selectors[2]=2,['$f(\\\\var{angle})=\\\\var{coeffs[3]}\\\\tan(\\\\var{angle})$',2],-1))),\nif(dis_ratio_selectors[2]=0,['$f(\\\\var{angle})=\\\\sin(\\\\var{angle})$',0],\n if(dis_ratio_selectors[2]=1,['$f(\\\\var{angle})=\\\\cos(\\\\var{angle})$',1],\n if(dis_ratio_selectors[2]=2,['$f(\\\\var{angle})=\\\\tan(\\\\var{angle})$',2],-1))))", "description": "", "templateType": "anything", "can_override": false}, "dis1": {"name": "dis1", "group": "Ungrouped variables", "definition": "if (coeffs[1]<>1,\nif(dis_ratio_selectors[0]=0,['$f(\\\\var{angle})=\\\\var{coeffs[1]}\\\\sin(\\\\var{angle})$',0],\n if(dis_ratio_selectors[0]=1,['$f(\\\\var{angle})=\\\\var{coeffs[1]}\\\\cos(\\\\var{angle})$',1],\n if(dis_ratio_selectors[0]=2,['$f(\\\\var{angle})=\\\\var{coeffs[1]}\\\\tan(\\\\var{angle})$',2],-1))),\nif(dis_ratio_selectors[0]=0,['$f(\\\\var{angle})=\\\\sin(\\\\var{angle})$',0],\n if(dis_ratio_selectors[0]=1,['$f(\\\\var{angle})=\\\\cos(\\\\var{angle})$',1],\n if(dis_ratio_selectors[0]=2,['$f(\\\\var{angle})=\\\\tan(\\\\var{angle})$',2],-1))))", "description": "", "templateType": "anything", "can_override": false}, "dis2": {"name": "dis2", "group": "Ungrouped variables", "definition": "if (coeffs[2]<>1,\nif(dis_ratio_selectors[1]=0,['$f(\\\\var{angle})=\\\\var{coeffs[2]}\\\\sin(\\\\var{angle})$',0],\n if(dis_ratio_selectors[1]=1,['$f(\\\\var{angle})=\\\\var{coeffs[2]}\\\\cos(\\\\var{angle})$',1],\n if(dis_ratio_selectors[1]=2,['$f(\\\\var{angle})=\\\\var{coeffs[2]}\\\\tan(\\\\var{angle})$',2],-1))),\nif(dis_ratio_selectors[1]=0,['$f(\\\\var{angle})=\\\\sin(\\\\var{angle})$',0],\n if(dis_ratio_selectors[1]=1,['$f(\\\\var{angle})=\\\\cos(\\\\var{angle})$',1],\n if(dis_ratio_selectors[1]=2,['$f(\\\\var{angle})=\\\\tan(\\\\var{angle})$',2],-1))))", "description": "", "templateType": "anything", "can_override": false}, "dis_ratio_selectors": {"name": "dis_ratio_selectors", "group": "Ungrouped variables", "definition": "shuffle([random(0,1),random(0,1),random(0,1)])", "description": "", "templateType": "anything", "can_override": false}, "app": {"name": "app", "group": "Ungrouped variables", "definition": "jessiecode(800,500,[-450,{a}+0.5,450,-{a}-0.5],\"\"\"\nyaxis = axis( [0,0],[0,1] ) <<\n ticks: <<\n ticksdistance: 0.5,\n insertticks: false\n >>,\n withLabel: true,\n name: '$f(\\\\\\\\theta)$',\n useMathjax: true,\n label: <>\n>>;\n \nxaxis = axis( [0,0],[1,0] ) <<\n ticks: <<\n ticksdistance: 90,\n insertticks: false\n >>,\n withLabel: true,\n name: '$\\\\\\\\theta$',\n useMathjax: true,\n label: <>\n>>;\n\nfunctiongraph('{function}', -450, 450) <>;\n \"\"\",\n[\n \"axis\": false\n])", "description": "

This jsxgraph frame has user defined axes (lines 3 - 19). The y axis is defined by lines 3 and 4, LaTeX is used for the axis name and is rendered by setting \"useMathjax\" to true. The label position, 'urt' signifies upper right. Default ticks are removed at line 5 and custom tick marks define in lines 6 and 7.

\n

Lines 8 and 9 define the x axis in a similar way to the y, the use of drawZero: false stops the 0 tick being repeated and clashin with the y axis one. The axis is scaled in units of pi and tick marks are drawn only at the points indicated in line 11. These tick marks are set to display in degrees as per the labels attribute in line 18, thus underlying geometry is in radians but graph appears as though this was degrees.

\n

Line 21 draws the graph of the required function specified by the variable \"function\". Note that this needs to be in the form of a string with single quotes at beginning and end. See definition of \"function\" to see how this is achieved.

\n

Axis: false at line 24 suppressed the default frame axes.

", "templateType": "anything", "can_override": false}, "function": {"name": "function", "group": "Ungrouped variables", "definition": "let(fn,['sin','cos','tan'][ratio_selector],\n '{a}*{fn}(x*PI/180)'\n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "ratio_selector", "anglelist", "angle", "ratio", "answer", "coeffs", "dis1", "dis2", "dis3", "dis_ratio_selectors", "app", "function"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Which of the following functions matches the graph above?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["{answer}", "{dis1[0]}", "{dis2[0]}", "{dis3[0]}"], "matrix": ["1", 0, 0, 0], "distractors": ["", "", "", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}