// Numbas version: exam_results_page_options {"name": "Pie Charts", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"rulesets": {"std": ["all", "fractionNumbers"]}, "parts": [{"showFeedbackIcon": true, "distractors": ["", "", "", "", ""], "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "matrix": ["1", 0, 0, 0, 0], "displayColumns": 0, "displayType": "radiogroup", "variableReplacements": [], "type": "1_n_2", "choices": ["

{answer} students         

", "

{fakeanswer1} students          

", "

{fakeanswer2} students          

", "

{fakeanswer3} students          

", "

{fakeanswer4} students          

"], "scripts": {}, "prompt": "
Student Pass Rate for Module Z
\n

\n

If there were {students} students on Module Z in 2007 and the numbers went up every year by {increase}, how many students passed the module in {year}?

", "marks": 0, "minMarks": 0, "shuffleChoices": true, "showCorrectAnswer": true}], "functions": {}, "tags": [], "preamble": {"css": "table#values th {\n background: none;\n text-align: center;\n}", "js": "function dragpoint_board() {\n var scope = question.scope;\n\n var yo0 = scope.variables.yo0.value;\n var yo1 = scope.variables.yo1.value;\n var yo2 = scope.variables.yo2.value;\n var yo3 = scope.variables.yo3.value; \n \n var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-5,5,5,-5], axis:false, grid:false});\n \n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n var dataArr = [yo0,yo1,yo2,yo3];\n\n board.containerObj.style.backgroundColor = 'white';\n board.options.label.strokeColor = 'black';\n //board.suspendUpdate();\n\n var a = board.createElement('chart', dataArr, \n {\n chartStyle:'pie', \n colors:['#0F408D','#6F1B75','#CA147A','#DA2228'],\n fillOpacity:1, center:[0,0], strokeColor:'black', highlightStrokeColor:'black', strokeWidth:1,\n labels:[yo0,yo1,yo2,yo3],\n highlightColors:['#E46F6A','#F9DF82','#F7FA7B','#B0D990'],\n highlightOnSector:true, \n highlightBySize:true,\n } \n \n var b = board.createElement('chart', dataArr, \n {\n chartStyle:'pie', \n colors:['#0F408D','#6F1B75','#CA147A','#DA2228'],\n fillOpacity:1, center:[10,2], strokeColor:'black', highlightStrokeColor:'black', strokeWidth:1,\n labels:[yo0,yo1,yo2,yo3],\n highlightColors:['#E46F6A','#F9DF82','#F7FA7B','#B0D990'],\n highlightOnSector:true, \n highlightBySize:true,\n }\n \n \n );\n //board.unsuspendUpdate();\n\n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});"}, "ungrouped_variables": ["selector", "vsh", "hsh", "vsc", "hsc", "yo", "yn", "xo", "xn", "yo0", "yo1", "yo2", "yo3", "yo4", "maxx", "maxy", "yo01", "yo11", "yo21", "yo31", "yo41", "yo5", "yo51", "maxvector", "a", "b", "c", "d", "eee", "f", "answer", "fakeanswer1", "fakeanswer2", "fakeanswer3", "fakeanswer4", "aa", "bb", "cc", "dd", "percent", "students", "yo6", "yearvector", "ii", "year", "gradevector", "increase"], "variables": {"c": {"definition": "random(1.1..1.3#0.01 except a except b)", "name": "c", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo6": {"definition": "random(25..45#1 except yo1 except yo0 except yo2 except yo3 except yo4 except yo5)", "name": "yo6", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yn": {"definition": "map(vsc*y+vsh,y,yo)", "name": "yn", "templateType": "anything", "description": "

new y values after the transformation

", "group": "Ungrouped variables"}, "yo3": {"definition": "random(50..70#1 except yo1 except yo0 except yo2)", "name": "yo3", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "dd": {"definition": "random(0.7..1.3#0.01 except 1 except aa except bb except cc)", "name": "dd", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "students": {"definition": "random(120..320#1)", "name": "students", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "xo": {"definition": "list(-2..2)", "name": "xo", "templateType": "anything", "description": "

original x values

", "group": "Ungrouped variables"}, "bb": {"definition": "random(0.7..1.3#0.01 except 1 except aa)", "name": "bb", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo0": {"definition": "random(20..40#1)", "name": "yo0", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo11": {"definition": "a*yo1", "name": "yo11", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "hsc": {"definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "name": "hsc", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yearvector": {"definition": "vector(2007,2008,2009,2010,2011,2012,2013)", "name": "yearvector", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo5": {"definition": "random(15..45#1 except yo1 except yo0 except yo2 except yo3 except yo4)", "name": "yo5", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo21": {"definition": "b*yo2", "name": "yo21", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "a": {"definition": "random(1.1..1.3#0.01)", "name": "a", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "aa": {"definition": "random(0.7..1.3#0.01 except 1)", "name": "aa", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "maxx": {"definition": "max(map(abs(a),a,xn)+5)+1", "name": "maxx", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "d": {"definition": "random(1.1..1.3#0.01 except a except b except c)", "name": "d", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "increase": {"definition": "random(10..40#5)", "name": "increase", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo1": {"definition": "random(30..50#1 except yo0)", "name": "yo1", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "maxvector": {"definition": "vector(yo1, yo2,yo3, yo4, yo5, yo11, yo21,yo31, yo41, yo51)", "name": "maxvector", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "cc": {"definition": "random(0.7..1.3#0.01 except 1 except aa except bb)", "name": "cc", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo41": {"definition": "d*yo4", "name": "yo41", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "eee": {"definition": "random(1.1..1.3#0.01 except a except b except c except d)", "name": "eee", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo4": {"definition": "random(10..30#1 except yo1 except yo0 except yo2 except yo3)", "name": "yo4", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "xn": {"definition": "map((x-hsh)/hsc,x,xo)", "name": "xn", "templateType": "anything", "description": "

new transformed x values

", "group": "Ungrouped variables"}, "vsc": {"definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "name": "vsc", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo51": {"definition": "eee*yo5", "name": "yo51", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "f": {"definition": "random(1.1..1.3#0.01 except a except b except c except d except e)", "name": "f", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "hsh": {"definition": "if(selector='hsh',random(-3..3 except 0),0)", "name": "hsh", "templateType": "anything", "description": "

horizontal shift

", "group": "Ungrouped variables"}, "yo2": {"definition": "random(40..60#1 except yo1 except yo0)", "name": "yo2", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "percent": {"definition": "random(5..20#0.1 except 5 except 6 except 7 except 8 except 9 except 10 except 11 except 12 except 13 except 14 except 15 except 16 except 17 except 18 except 19 except 20)", "name": "percent", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "gradevector": {"definition": "vector(yo0, yo1,yo2,yo3, yo4, yo5, yo6)", "name": "gradevector", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo": {"definition": "repeat(random(-5..5),5)", "name": "yo", "templateType": "anything", "description": "

the (random) original y values which relate to the x values

", "group": "Ungrouped variables"}, "vsh": {"definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "name": "vsh", "templateType": "anything", "description": "

vertical shift

", "group": "Ungrouped variables"}, "fakeanswer3": {"definition": "siground(cc*answer,2)", "name": "fakeanswer3", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "fakeanswer2": {"definition": "siground(bb*answer,2)", "name": "fakeanswer2", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "answer": {"definition": "siground((students+ii*increase)*gradevector[ii]/100,3)", "name": "answer", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "fakeanswer1": {"definition": "siground(aa*answer,2)", "name": "fakeanswer1", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo01": {"definition": "f*yo0", "name": "yo01", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "b": {"definition": "random(1.1..1.3#0.01 except a)", "name": "b", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "yo31": {"definition": "c*yo3", "name": "yo31", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "ii": {"definition": "random(3..6#1)", "name": "ii", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "maxy": {"definition": "max(list(maxvector)) + 1", "name": "maxy", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "year": {"definition": "yearvector[ii]", "name": "year", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "fakeanswer4": {"definition": "siground(dd*answer,2)", "name": "fakeanswer4", "templateType": "anything", "description": "", "group": "Ungrouped variables"}, "selector": {"definition": "'vsc'", "name": "selector", "templateType": "anything", "description": "", "group": "Ungrouped variables"}}, "extensions": ["jsxgraph"], "variable_groups": [], "advice": "", "name": "Pie Charts", "statement": "", "variablesTest": {"maxRuns": 100, "condition": ""}, "metadata": {"description": "

Widget Sales

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "type": "question", "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}]}]}], "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}]}