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

Reading a value from a simple bar chart.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "

The bar heights give the values of the spend.

Each company has two bars, the left one for last year (in red) and the right one for this year (in purple).
Isolate last years spend by looking at the the bars on the right side, and choose the tallest bar, corresponding to the highest value.

", "rulesets": {"std": ["all", "fractionNumbers"]}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"answervector": {"name": "answervector", "group": "Ungrouped variables", "definition": "vector((yo5-yo0)/yo0*100, (yo6-yo1)/yo1*100,(yo7-yo2)/yo2*100,(yo8-yo3)/yo3*100, (yo9-yo4)/yo4*100)", "description": "", "templateType": "anything", "can_override": false}, "cc": {"name": "cc", "group": "Ungrouped variables", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb)", "description": "", "templateType": "anything", "can_override": false}, "aa": {"name": "aa", "group": "Ungrouped variables", "definition": "random(0.7..1.3#0.01 except 1)", "description": "", "templateType": "anything", "can_override": false}, "year": {"name": "year", "group": "Ungrouped variables", "definition": "yearvector[ii]", "description": "", "templateType": "anything", "can_override": false}, "yn": {"name": "yn", "group": "Ungrouped variables", "definition": "map(vsc*y+vsh,y,yo)", "description": "

new y values after the transformation

", "templateType": "anything", "can_override": false}, "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", "can_override": false}, "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", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a except b except c)", "description": "", "templateType": "anything", "can_override": false}, "yo9": {"name": "yo9", "group": "Ungrouped variables", "definition": "random(41..70#1 except yo5 except yo6 except yo7 except yo8)", "description": "", "templateType": "anything", "can_override": false}, "vsh": {"name": "vsh", "group": "Ungrouped variables", "definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "description": "

vertical shift

", "templateType": "anything", "can_override": false}, "vsc": {"name": "vsc", "group": "Ungrouped variables", "definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a except b)", "description": "", "templateType": "anything", "can_override": false}, "bb": {"name": "bb", "group": "Ungrouped variables", "definition": "random(0.7..1.3#0.01 except 1 except aa)", "description": "", "templateType": "anything", "can_override": false}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "max([yo1,yo0,yo2,yo3,yo4])", "description": "", "templateType": "anything", "can_override": false}, "students": {"name": "students", "group": "Ungrouped variables", "definition": "random(120..320#1)", "description": "", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01)", "description": "", "templateType": "anything", "can_override": false}, "yo2": {"name": "yo2", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo1 except yo0)", "description": "", "templateType": "anything", "can_override": false}, "yo5": {"name": "yo5", "group": "Ungrouped variables", "definition": "random(41..70#1)", "description": "", "templateType": "anything", "can_override": false}, "yo8": {"name": "yo8", "group": "Ungrouped variables", "definition": "random(41..70#1 except yo5 except yo6 except yo7)", "description": "", "templateType": "anything", "can_override": false}, "yo1": {"name": "yo1", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo0)", "description": "", "templateType": "anything", "can_override": false}, "yo7": {"name": "yo7", "group": "Ungrouped variables", "definition": "random(41..70#1 except yo5 except yo6)", "description": "", "templateType": "anything", "can_override": false}, "maxx": {"name": "maxx", "group": "Ungrouped variables", "definition": "max(map(abs(a),a,xn)+5)+1", "description": "", "templateType": "anything", "can_override": false}, "yearvector": {"name": "yearvector", "group": "Ungrouped variables", "definition": "vector(2007,2008,2009,2010,2011,2012,2013)", "description": "", "templateType": "anything", "can_override": false}, "ii": {"name": "ii", "group": "Ungrouped variables", "definition": "random(3..6#1)", "description": "", "templateType": "anything", "can_override": false}, "yo3": {"name": "yo3", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo1 except yo0 except yo2)", "description": "", "templateType": "anything", "can_override": false}, "selector": {"name": "selector", "group": "Ungrouped variables", "definition": "'vsc'", "description": "", "templateType": "anything", "can_override": false}, "fakeanswer1": {"name": "fakeanswer1", "group": "Ungrouped variables", "definition": "random([yo1,yo0,yo2,yo3,yo4] except answer)", "description": "", "templateType": "anything", "can_override": false}, "hsh": {"name": "hsh", "group": "Ungrouped variables", "definition": "if(selector='hsh',random(-3..3 except 0),0)", "description": "

horizontal shift

", "templateType": "anything", "can_override": false}, "fakeanswer4": {"name": "fakeanswer4", "group": "Ungrouped variables", "definition": "random([yo9,yo7,yo8] except fakeanswer3)", "description": "", "templateType": "anything", "can_override": false}, "dd": {"name": "dd", "group": "Ungrouped variables", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb except cc)", "description": "", "templateType": "anything", "can_override": false}, "percent": {"name": "percent", "group": "Ungrouped variables", "definition": "random(5..15#0.1 except 5 except 6 except 7 except 8 except 9 except 10 except 11 except 12 except 13 except 14 except 15)", "description": "", "templateType": "anything", "can_override": false}, "yo0": {"name": "yo0", "group": "Ungrouped variables", "definition": "random(20..40#1)", "description": "", "templateType": "anything", "can_override": false}, "xn": {"name": "xn", "group": "Ungrouped variables", "definition": "map((x-hsh)/hsc,x,xo)", "description": "

new transformed x values

", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(1.1..1.3#0.01 except a)", "description": "", "templateType": "anything", "can_override": false}, "xo": {"name": "xo", "group": "Ungrouped variables", "definition": "list(-2..2)", "description": "

original x values

", "templateType": "anything", "can_override": false}, "yo4": {"name": "yo4", "group": "Ungrouped variables", "definition": "random(20..40#1 except yo1 except yo0 except yo2 except yo3)", "description": "", "templateType": "anything", "can_override": false}, "fakeanswer2": {"name": "fakeanswer2", "group": "Ungrouped variables", "definition": "random([yo1,yo0,yo2,yo3,yo4] except answer except fakeanswer1)", "description": "", "templateType": "anything", "can_override": false}, "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", "can_override": false}, "yo51": {"name": "yo51", "group": "Ungrouped variables", "definition": "eee*yo5", "description": "", "templateType": "anything", "can_override": false}, "fakeanswer3": {"name": "fakeanswer3", "group": "Ungrouped variables", "definition": "random([yo6,yo7,yo8])", "description": "", "templateType": "anything", "can_override": false}, "increase": {"name": "increase", "group": "Ungrouped variables", "definition": "random(10..40#5)", "description": "", "templateType": "anything", "can_override": false}, "yo6": {"name": "yo6", "group": "Ungrouped variables", "definition": "random(41..70#1 except yo5)", "description": "", "templateType": "anything", "can_override": false}, "hsc": {"name": "hsc", "group": "Ungrouped variables", "definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "description": "", "templateType": "anything", "can_override": false}, "yo41": {"name": "yo41", "group": "Ungrouped variables", "definition": "d*yo4", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["selector", "vsh", "hsh", "vsc", "hsc", "yo", "yn", "xo", "xn", "yo0", "yo1", "yo2", "yo3", "yo4", "maxx", "yo6", "yo7", "yo8", "yo9", "yo41", "yo5", "yo51", "a", "b", "c", "d", "eee", "f", "answer", "fakeanswer1", "fakeanswer2", "fakeanswer3", "fakeanswer4", "aa", "bb", "cc", "dd", "percent", "students", "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 \n var div = Numbas.extensions.jsxgraph.makeBoard('550px','550px',{boundingBox:[-0.8,82,16,-8], axis:false, grid:true});\n \n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \nboard.suspendUpdate(); \n\n \n var dataArr = [yo0,yo5,0,yo1,yo6,0,yo2,yo7,0,yo3,yo8,0,yo4,yo9]; \n \n var xaxis = board.create('axis', [[0, 0], [12, 0]], {withLabel: true, name: \"Bank\", label: {offset: [250,-30]}});\n \n xaxis.removeAllTicks(); \n \n board.create('axis', [[0, 0], [0, 10]], {hideTicks:true, withLabel: false, name: \"\", label: {offset: [-110,300]}});\n \n var pop0 = board.create('point', [1.5,0],{name:'Morgan',fixed:true,size:0,color:'black',face:'diamond', label:{offset:[-20,-8]}});\n var pop1 = board.create('point',[4.5,0],{name:'Strome',fixed:true,size:0,color:'black',face:'diamond', label:{offset:[-20,-8]}});\n var pop2 = board.create('point',[7.5,0],{name:'Bentley',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-15,-8]}});\n var pop3 = board.create('point',[10.5,0],{name:'Sand',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-15,-8]}});\n var pop4 = board.create('point',[13.5,0],{name:'Karchen',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-15,-8]}});\n\n var leg1 = board.create('point',[12,75],{name:'last year',fixed:true,size:6,color:'#DA2228', face:'square', label:{offset:[9,0]}});\n var leg2 = board.create('point',[12,72],{name:'this year',fixed:true,size:6,color:'#6F1B75', face:'square', label:{offset:[9,0]}});\n \n \n// var chart = board.createElement('chart', dataArr, \n // {chartStyle:'bar', fillOpacity:1, width:1,\n // colorArray:['#8E1B77','#8E1B77','Red','Red','blue','red','blue','red','red','blue', 'red','blue','red','red'], shadow:false});\n \n//var chart = board.createElement('chart', dataArr, \n // {chartStyle:'bar', width:1,fillOpacity:1, fillColor:'red', shadow:false}); \n \n \n var a = board.create('chart', [[1,2,3],[yo0,yo5,0]], {chartStyle:'bar',colors:['#DA2228','#6F1B75','#6F1B75'],width:1,fillOpacity:1});\n var b = board.create('chart', [[4,5,6],[yo1,yo6,0]], {chartStyle:'bar',width:1,colors:['#DA2228','#6F1B75','#6F1B75'],fillOpacity:1});\n var c = board.create('chart', [[7,8,9],[yo2,yo7,0]], {chartStyle:'bar',width:1,colors:['#DA2228','#6F1B75','#6F1B75'],fillOpacity:1});\n var d = board.create('chart', [[10,11,12],[yo3,yo8,0]], {chartStyle:'bar',width:1,colors:['#DA2228','#6F1B75','#6F1B75'],fillOpacity:1});\n var e = board.create('chart', [[13,14],[yo4,yo9]], {chartStyle:'bar',width:1,colors:['#DA2228','#6F1B75'],fillOpacity:1});\n \n board.unsuspendUpdate();\n \n var txt1 = board.create('text',[-0.3,30, 'Investment \u00a3(m)'], {fontColor:'black', fontSize:14, rotate:90});\n \n // var txt = board.create('text',[0.5,75, 'Investment (m)'], {fontSize:14, rotate:90});\n \n // var txt1 = board.create('text',[8,76, 'red bars represent 2010'], {fontColor:'red', fontSize:14, rotate:90});\n \n // var txt2 = board.create('text',[8,73, 'blue bars represents 2011'], {fontSize:14, rotate:90});\n\n // var myColors = new Array('red', 'blue', 'white','red', 'blue', 'white','red', 'blue', 'white','red', 'blue', 'white','red', 'blue');\n \n \n \n //board.unsuspendUpdate();\n\n // Rotate text around the lower left corner (-2,-1) by 30 degrees.\n // var tRot = board.create('transform', [90.0*Math.PI/180.0, -1,40], {type:'rotate'}); \n // tRot.bindTo(txt);\n // board.update();\n\n \n//var chart2 = board.createElement('chart', dataArr, {chartStyle:'line,point'});\n//chart2[0].setProperty('strokeColor:black','strokeWidth:2','shadow:true');\n//for(var i=0; i<11;i++) {\n // chart2[1][i].setProperty({strokeColor:'black',fillColor:'white',face:'[]', size:4, strokeWidth:2});\n//}\n//board.unsuspendUpdate(); \n \n //board.unsuspendUpdate();\n\n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});", "css": "table#values th {\n background: none;\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": "
Banking Sector: IT Infrastructure Spending
\n

\n

What was the maximum spend by a single company last year?

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

£{answer} m

", "

£{fakeanswer1} m    

", "

£{fakeanswer2} m       

", "

£{fakeanswer3} m         

", "

£{fakeanswer4} m   

"], "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/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}]}]}], "contributors": [{"name": "Gareth Woods", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/978/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}]}