// Numbas version: exam_results_page_options {"name": "Stacked Bar Charts - Theme Park Numbers - Question 1", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Stacked Bar Charts - Theme Park Numbers - Question 1", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "", "rulesets": {"std": ["all", "fractionNumbers"]}, "extensions": ["jsxgraph"], "variables": {"yo3": {"name": "yo3", "group": "Ungrouped variables", "definition": "random(850..1400#50 except yo1)", "description": "", "templateType": "anything"}, "fakeanswer2": {"name": "fakeanswer2", "group": "Ungrouped variables", "definition": "precround(bb*answervector[ii],2)", "description": "", "templateType": "anything"}, "yo4": {"name": "yo4", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo1)", "description": "", "templateType": "anything"}, "yo5": {"name": "yo5", "group": "Ungrouped variables", "definition": "100-yo3-yo4", "description": "", "templateType": "anything"}, "yo9": {"name": "yo9", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo0 except yo3 except yo6)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a)", "description": "", "templateType": "anything"}, "year": {"name": "year", "group": "Ungrouped variables", "definition": "yearvector[ii]", "description": "", "templateType": "anything"}, "bb": {"name": "bb", "group": "Ungrouped variables", "definition": "random(0.6..1.15#0.01 except 1 except aa)", "description": "", "templateType": "anything"}, "hsh": {"name": "hsh", "group": "Ungrouped variables", "definition": "if(selector='hsh',random(-3..3 except 0),0)", "description": "

horizontal shift

", "templateType": "anything"}, "selector": {"name": "selector", "group": "Ungrouped variables", "definition": "'vsc'", "description": "", "templateType": "anything"}, "yo1": {"name": "yo1", "group": "Ungrouped variables", "definition": "random(200..700#50 except yo0)", "description": "", "templateType": "anything"}, "vsc": {"name": "vsc", "group": "Ungrouped variables", "definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "description": "", "templateType": "anything"}, "ii": {"name": "ii", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything"}, "yn": {"name": "yn", "group": "Ungrouped variables", "definition": "map(vsc*y+vsh,y,yo)", "description": "

new y values after the transformation

", "templateType": "anything"}, "yo0": {"name": "yo0", "group": "Ungrouped variables", "definition": "random(200..700#50)", "description": "", "templateType": "anything"}, "yo6": {"name": "yo6", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo0 except yo3)", "description": "", "templateType": "anything"}, "xo": {"name": "xo", "group": "Ungrouped variables", "definition": "list(-2..2)", "description": "

original x values

", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01)", "description": "", "templateType": "anything"}, "yo10": {"name": "yo10", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo1 except yo4 except yo7)", "description": "", "templateType": "anything"}, "cc": {"name": "cc", "group": "Ungrouped variables", "definition": "random(0.6..1.15#0.01 except 1 except aa except bb)", "description": "", "templateType": "anything"}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "precround(answervector[ii],2)", "description": "", "templateType": "anything"}, "maxx": {"name": "maxx", "group": "Ungrouped variables", "definition": "max(map(abs(a),a,xn)+5)+1", "description": "", "templateType": "anything"}, "vsh": {"name": "vsh", "group": "Ungrouped variables", "definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "description": "

vertical shift

", "templateType": "anything"}, "fakeanswer4": {"name": "fakeanswer4", "group": "Ungrouped variables", "definition": "precround(dd*answervector[ii],2)", "description": "", "templateType": "anything"}, "dd": {"name": "dd", "group": "Ungrouped variables", "definition": "random(0.6..1.15#0.01 except 1 except aa except bb except cc)", "description": "", "templateType": "anything"}, "yo": {"name": "yo", "group": "Ungrouped variables", "definition": "repeat(random(-5..5),5)", "description": "

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

", "templateType": "anything"}, "yo11": {"name": "yo11", "group": "Ungrouped variables", "definition": "100-yo10-yo9", "description": "", "templateType": "anything"}, "yearvector": {"name": "yearvector", "group": "Ungrouped variables", "definition": "vector(2015,2016)", "description": "", "templateType": "anything"}, "yo2": {"name": "yo2", "group": "Ungrouped variables", "definition": "random(850..1400#50)", "description": "", "templateType": "anything"}, "yo7": {"name": "yo7", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo1 except yo4)", "description": "", "templateType": "anything"}, "xn": {"name": "xn", "group": "Ungrouped variables", "definition": "map((x-hsh)/hsc,x,xo)", "description": "

new transformed x values

", "templateType": "anything"}, "aa": {"name": "aa", "group": "Ungrouped variables", "definition": "random(0.6..1.15#0.01 except 1)", "description": "", "templateType": "anything"}, "fakeanswer3": {"name": "fakeanswer3", "group": "Ungrouped variables", "definition": "precround(cc*answervector[ii],2)", "description": "", "templateType": "anything"}, "f": {"name": "f", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a except b except c except d except e)", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a except b)", "description": "", "templateType": "anything"}, "increase": {"name": "increase", "group": "Ungrouped variables", "definition": "random(10..40#5)", "description": "", "templateType": "anything"}, "fakeanswer1": {"name": "fakeanswer1", "group": "Ungrouped variables", "definition": "precround(aa*answervector[ii],2)", "description": "", "templateType": "anything"}, "number": {"name": "number", "group": "Ungrouped variables", "definition": "random(1000..5000#200)", "description": "", "templateType": "anything"}, "yo8": {"name": "yo8", "group": "Ungrouped variables", "definition": "100-yo7-yo6", "description": "", "templateType": "anything"}, "answervector": {"name": "answervector", "group": "Ungrouped variables", "definition": "vector((yo2-yo0)/yo2*100,(yo3-yo1)/yo3*100)", "description": "", "templateType": "anything"}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a except b except c)", "description": "", "templateType": "anything"}, "percent": {"name": "percent", "group": "Ungrouped variables", "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)", "description": "", "templateType": "anything"}, "hsc": {"name": "hsc", "group": "Ungrouped variables", "definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "description": "", "templateType": "anything"}, "eee": {"name": "eee", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a except b except c except d)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "fakeanswer1<100", "maxRuns": "1000"}, "ungrouped_variables": ["selector", "vsh", "hsh", "vsc", "hsc", "yo", "yn", "xo", "xn", "yo0", "yo1", "yo2", "yo3", "yo4", "maxx", "yo6", "yo7", "yo8", "yo9", "yo10", "yo5", "yo11", "a", "b", "c", "d", "eee", "f", "answer", "fakeanswer1", "fakeanswer2", "fakeanswer3", "fakeanswer4", "aa", "bb", "cc", "dd", "percent", "number", "yearvector", "ii", "year", "answervector", "increase"], "variable_groups": [], "functions": {}, "preamble": {"js": "function dragpoint_board() {\n var scope = question.scope;\n\n JXG.Options.text.display = 'internal';\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 var yo4 = scope.variables.yo4.value;\n var yo5 = scope.variables.yo5.value;\n var yo6 = scope.variables.yo6.value;\n var yo7 = scope.variables.yo7.value; \n var yo8 = scope.variables.yo8.value;\n var yo9 = scope.variables.yo9.value; \n var yo10 = scope.variables.yo10.value;\n var yo11 = scope.variables.yo11.value; \n \n var div = Numbas.extensions.jsxgraph.makeBoard('450px','450px',{boundingBox:[-0.2,1450,4,-80], axis:false, grid:false});\n \n $(question.getPart('p0').display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n var xaxis = board.create('axis', [[0, 0], [3, 0]], {withLabel: false, name: \"Bank\", label: {offset: [250,-30]}});\n \n xaxis.removeAllTicks(); \n \n board.create('axis', [[0, 0], [0, 1400]], {hideTicks:true, withLabel: false, name: \"\", label: {offset: [-110,300]}});\n \n var pop0 = board.create('point', [1,-40],{name:'2015',fixed:true,size:0,color:'white',face:'diamond', label:{offset:[-20,-8]}});\n var pop1 = board.create('point',[3,-40],{name:'2016',fixed:true,size:0,color:'white',face:'diamond', label:{offset:[-20,-8]}});\n\n var leg1 = board.create('point',[1.8,600],{name:'Children',fixed:true,size:8,color:'#8F1D5E', face:'square', label:{offset:[11,0]}});\n var leg2 = board.create('point',[1.8,700],{name:'Adult',fixed:true,size:8,color:'#9999CC', face:'square', label:{offset:[11,0]}});\n \n var a = board.create('chart', [[1,1,3,3],[yo0,yo2,yo1,yo3]], {chartStyle:'bar',colors:['#DA2228','#6F1B75','#DA2228','#6F1B75'],width:1,fillOpacity:0.5});\n \n var txt1 = board.create('text',[-0.1,500, 'Number of Visitors'], {fontColor:'black', fontSize:14, rotate:90});\n\n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});", "css": "table#values th {\n background: white;\n text-align: center;\n}"}, "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": "
Number of visitors to Lakesville Theme Park
\n

\n

What percentage of visitors to the theme park in {year} were adults? 

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["

{answer}%     

", "

{fakeanswer1}%        

", "

{fakeanswer2}%        

", "

{fakeanswer3}%          

", "

{fakeanswer4}%         

"], "matrix": ["1", 0, 0, 0, 0], "distractors": ["", "", "", "", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}