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

Referring to the triangle below.

\n

{plotgraph(units,a,b,c)}

", "preamble": {"css": "", "js": ""}, "tags": [], "rulesets": {}, "extensions": ["jsxgraph"], "parts": [{"showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "matrix": "marks16", "prompt": "

16. What is the size of the angle $\\theta$?

", "minMarks": 0, "choices": ["

$\\simplify{{shuffledchoices16[0]}}^\\circ$

", "

$\\simplify{{shuffledchoices16[1]}}^\\circ$

", "

$\\simplify{{shuffledchoices16[2]}}^\\circ$

", "

$\\simplify{{shuffledchoices16[3]}}^\\circ$

", "

None of these.

"], "type": "1_n_2", "displayColumns": 0, "maxMarks": 0, "marks": 0, "shuffleChoices": false, "scripts": {}, "displayType": "radiogroup"}, {"showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCorrectAnswer": true, "matrix": "marks17", "prompt": "

17. What is the value of $cos \\theta$?

", "minMarks": 0, "choices": ["

$\\simplify{{shuffledchoices17[0]}}$

", "

$\\simplify{{shuffledchoices17[1]}}$

", "

$\\simplify{{shuffledchoices17[2]}}$

", "

$\\simplify{{shuffledchoices17[3]}}$

", "

None of these.

"], "type": "1_n_2", "displayColumns": 0, "maxMarks": 0, "marks": 0, "shuffleChoices": false, "scripts": {}, "displayType": "radiogroup"}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": ""}, "advice": "", "name": "Q16/17", "ungrouped_variables": ["unitList", "units", "a", "max_angle", "min_angle", "c_min", "c_max", "c", "b", "correctAnswer16", "Choice1_16", "Choice2_16", "Choice3_16", "choices16", "noneofthesemarks", "marks16", "choicemarks", "shuffledchoices16", "order16", "correctAnswer17", "Choice1_17", "Choice2_17", "Choice3_17", "choices17", "marks17", "shuffledchoices17", "order17"], "functions": {"plotgraph": {"type": "html", "language": "javascript", "definition": "// This functions plots a right angled triangle based on two lengths\n\n//Set text and graph offsets to appear uniform\nvar yOffset = Math.ceil(a/10);\nvar xOffset = Math.ceil(a+2*yOffset-c/2)\n//Consider removing scale once all adjusted correctly\nvar offset = 1;\nvar textHeight =15;\nvar scale = yOffset/2;\nvar scaleOffset = offset*scale;\nvar scaleText = textHeight*scale;\n// This functions plots two dimensioned lines \n// Max and min x and y values for the axis.\nvar x_min = 0;\nvar x_max = 2*(a+2*yOffset);\nvar y_min = 0;\nvar y_max = a+2*yOffset;\n\n//Browser compatibility\nJXG.Options.text.display = 'internal';\n//Use MathJax for LaTeX display\nJXG.Options.text.useMathJax = true;\n\n// Make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '800px',\n '400px',\n {\n boundingBox: [0,y_max,x_max,0],\n//Change to false after testing\n axis: false,\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//Draw three points \nvar A = board.create('point', [xOffset, yOffset], \n {size:0, fixed:true,\n label:{offset: [-10,-10]}});\nvar B = board.create('point', [xOffset, (a+yOffset)],\n {size:0, fixed:true,\n label:{offset: [0,10]}});\nvar C = board.create('point', [(c+xOffset), yOffset],\n {size:0, fixed:true,\n label:{offset: [10,0]}});\n\n//Draw a line between them\nvar AB = board.create('line',[A,B],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar BC = board.create('line',[B,C],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar AC = board.create('line',[A,C],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\n\nvar CAB = board.create('nonreflexangle', [C,A,B], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;} \n});\nvar CABLabel = CAB.label.setText(function () {\n var angle = 180.0 * CAB.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(1) + '\\u00B0';\n } else {\n return '';\n }\n});\nCABLabel.setAttribute({anchorX:'middle'});\n\nvar BCA = board.create('nonreflexangle', [B,C,A], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;} \n});\nvar BCALabel = BCA.label.setText(function () {\n var angle = 180.0 * BCA.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return '\\u03B8';\n } else {\n return '';\n }\n});\nBCALabel.setAttribute({anchorX:'middle'});\n\n/*Dummy text for testing variables, remove after testing\ntempText = board.create('text',[(2*a),(a+yOffset),\n// function () {return 'ABC = ' +(180.0*ABC.Value()/Math.PI).toFixed(2)+ ' degreeSymbol'}]);\nfunction () {return 'yOffset is ' + yOffset}]);\n*/\n\n//Set up dimension labels to be properly aligned\ntextAB = board.create('text', \n [function () {return (A.X() + B.X())/2},\n function () {return ((A.Y() + B.Y())/2)+(scaleOffset/2)},\n function () {return +A.Dist(B).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\n/*\ntextBC = board.create('text', \n [function () {return (B.X() + C.X())/2},\n function () {return ((B.Y() + C.Y())/2)+(scaleOffset/2)},\n function () {return +B.Dist(C).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n*/\n\ntextAC = board.create('text', \n [function () {return (A.X() + C.X())/2},\n function () {return ((A.Y() + C.Y())/2)-scaleOffset},\n function () {return +A.Dist(C).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\nvar tABRot = board.create('transform', \n [function () {return AB.getAngle()}, \n function () {return (A.X() + B.X())/2}, \n function () {return (A.Y() + B.Y())/2}],\n {type:'rotate'});\n\nvar tACRot = board.create('transform', \n [function () {return AC.getAngle()}, \n function () {return (A.X() + C.X())/2}, \n function () {return (A.Y() + C.Y())/2}],\n {type:'rotate'});\n\n//Perform text rotations and update\ntABRot.bindTo(textAB);\ntACRot.bindTo(textAC); \nboard.update();\n\nreturn div;", "parameters": [["units", "string"], ["a", "number"], ["b", "number"], ["c", "number"]]}}, "variables": {"Choice2_17": {"name": "Choice2_17", "templateType": "anything", "group": "Ungrouped variables", "definition": "expression(c + '/' + (a^2+c^2))", "description": ""}, "a": {"name": "a", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(5..50)", "description": ""}, "unitList": {"name": "unitList", "templateType": "list of strings", "group": "Ungrouped variables", "definition": "[ \"mm\", \"cm\", \"m\", \"km\" ]", "description": ""}, "correctAnswer17": {"name": "correctAnswer17", "templateType": "anything", "group": "Ungrouped variables", "definition": "expression(c + '/sqrt(' + (a^2+c^2) + ')')", "description": ""}, "units": {"name": "units", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(unitList)", "description": ""}, "Choice3_16": {"name": "Choice3_16", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(a>c,precround(degrees(arcsin(c/a)),2),precround(degrees(arcsin(a/c)),2))\n", "description": ""}, "order17": {"name": "order17", "templateType": "anything", "group": "Ungrouped variables", "definition": "//the order in which to display the choices - pick a random permutation of [0,1,2,3]\n deal(4)", "description": ""}, "c": {"name": "c", "templateType": "anything", "group": "Ungrouped variables", "definition": "random(c_min..c_max)", "description": ""}, "marks17": {"name": "marks17", "templateType": "anything", "group": "Ungrouped variables", "definition": "//marks to award for each choice, then append the marks for \"none of the above\"\n map(choicemarks[j],j,order17)+noneofthesemarks", "description": ""}, "marks16": {"name": "marks16", "templateType": "anything", "group": "Ungrouped variables", "definition": "//marks to award for each choice, then append the marks for \"none of the above\"\n map(choicemarks[j],j,order16)+noneofthesemarks", "description": ""}, "min_angle": {"name": "min_angle", "templateType": "anything", "group": "Ungrouped variables", "definition": "29", "description": ""}, "noneofthesemarks": {"name": "noneofthesemarks", "templateType": "anything", "group": "Ungrouped variables", "definition": "//marks to award for selecting \"none of these\"\n 0", "description": ""}, "c_min": {"name": "c_min", "templateType": "anything", "group": "Ungrouped variables", "definition": "floor(a/(tan(radians(min_angle))))", "description": ""}, "correctAnswer16": {"name": "correctAnswer16", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(degrees(arctan(a/c)),2)", "description": ""}, "order16": {"name": "order16", "templateType": "anything", "group": "Ungrouped variables", "definition": "//the order in which to display the choices - pick a random permutation of [0,1,2,3]\n deal(4)", "description": ""}, "choices16": {"name": "choices16", "templateType": "anything", "group": "Ungrouped variables", "definition": "//choices, apart from \"none of the above\"\n [correctAnswer16,Choice1_16,Choice2_16,Choice3_16]", "description": ""}, "shuffledchoices16": {"name": "shuffledchoices16", "templateType": "anything", "group": "Ungrouped variables", "definition": "//the choice texts, in the shuffled order\n map(choices16[j],j,order16)", "description": ""}, "Choice1_16": {"name": "Choice1_16", "templateType": "anything", "group": "Ungrouped variables", "definition": "90-correctAnswer16", "description": ""}, "choices17": {"name": "choices17", "templateType": "anything", "group": "Ungrouped variables", "definition": "//choices, apart from \"none of the above\"\n [correctAnswer17,Choice1_17,Choice2_17,Choice3_17]", "description": ""}, "shuffledchoices17": {"name": "shuffledchoices17", "templateType": "anything", "group": "Ungrouped variables", "definition": "//the choice texts, in the shuffled order\n map(choices17[j],j,order17)", "description": ""}, "Choice2_16": {"name": "Choice2_16", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(arctan(a/c),2)", "description": ""}, "c_max": {"name": "c_max", "templateType": "anything", "group": "Ungrouped variables", "definition": "ceil(a/(tan(radians(max_angle))))", "description": ""}, "b": {"name": "b", "templateType": "anything", "group": "Ungrouped variables", "definition": "precround(sqrt(c^2+a^2),2)", "description": ""}, "max_angle": {"name": "max_angle", "templateType": "anything", "group": "Ungrouped variables", "definition": "61", "description": "

-

"}, "Choice3_17": {"name": "Choice3_17", "templateType": "anything", "group": "Ungrouped variables", "definition": "if(c>a,expression(a + '/' + c),expression(c + '/' + a))", "description": ""}, "Choice1_17": {"name": "Choice1_17", "templateType": "anything", "group": "Ungrouped variables", "definition": "expression(a + '/sqrt(' + (a^2+c^2) + ')')", "description": ""}, "choicemarks": {"name": "choicemarks", "templateType": "anything", "group": "Ungrouped variables", "definition": "//marks to award for each of the above choices\n [1,0,0,0]", "description": ""}}, "variablesTest": {"condition": "a-c<>0\n", "maxRuns": 100}, "variable_groups": [], "type": "question", "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}]}]}], "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}]}