// Numbas version: finer_feedback_settings {"name": "Harry's copy of Bar Charts", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"percentage": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(3..6#0.1)", "name": "percentage", "description": ""}, "xo": {"group": "Ungrouped variables", "templateType": "anything", "definition": "list(-2..2)", "name": "xo", "description": "
original x values
"}, "maxy": {"group": "Ungrouped variables", "templateType": "anything", "definition": "max(list(maxvector)) + 1", "name": "maxy", "description": ""}, "vsh": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "name": "vsh", "description": "vertical shift
"}, "yn": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map(vsc*y+vsh,y,yo)", "name": "yn", "description": "new y values after the transformation
"}, "selector": {"group": "Ungrouped variables", "templateType": "anything", "definition": "'vsc'", "name": "selector", "description": ""}, "vsc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "name": "vsc", "description": ""}, "year": {"group": "Ungrouped variables", "templateType": "anything", "definition": "yearvector[ii]", "name": "year", "description": ""}, "yo21": {"group": "Ungrouped variables", "templateType": "anything", "definition": "b*yo2", "name": "yo21", "description": ""}, "hsh": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(selector='hsh',random(-3..3 except 0),0)", "name": "hsh", "description": "horizontal shift
"}, "yo11": {"group": "Ungrouped variables", "templateType": "anything", "definition": "a*yo1", "name": "yo11", "description": ""}, "fakeanswer1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "siground(aa*answer,2)", "name": "fakeanswer1", "description": ""}, "percent": {"group": "Ungrouped variables", "templateType": "anything", "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", "description": ""}, "yo31": {"group": "Ungrouped variables", "templateType": "anything", "definition": "c*yo3", "name": "yo31", "description": ""}, "fakeanswer4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "siground(dd*answer,2)", "name": "fakeanswer4", "description": ""}, "hsc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "name": "hsc", "description": ""}, "increase": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..40#5)", "name": "increase", "description": ""}, "fakeanswer3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "siground(cc*answer,2)", "name": "fakeanswer3", "description": ""}, "yo4": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(10..30#1 except yo1 except yo0 except yo2 except yo3)", "name": "yo4", "description": ""}, "yo1": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10#0.5 except yo0)", "name": "yo1", "description": ""}, "gradevector": {"group": "Ungrouped variables", "templateType": "anything", "definition": "vector(yo0, yo1,yo2,yo3, yo4, yo5, yo6)", "name": "gradevector", "description": ""}, "f": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b except c except d except e)", "name": "f", "description": ""}, "answer": {"group": "Ungrouped variables", "templateType": "anything", "definition": "siground((students+ii*increase)*gradevector[ii]/100,3)", "name": "answer", "description": ""}, "yo6": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(25..45#1 except yo1 except yo0 except yo2 except yo3 except yo4 except yo5)", "name": "yo6", "description": ""}, "yo": {"group": "Ungrouped variables", "templateType": "anything", "definition": "repeat(random(-5..5),5)", "name": "yo", "description": "the (random) original y values which relate to the x values
"}, "cc": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb)", "name": "cc", "description": ""}, "yo51": {"group": "Ungrouped variables", "templateType": "anything", "definition": "eee*yo5", "name": "yo51", "description": ""}, "students": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(120..320#1)", "name": "students", "description": ""}, "d": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b except c)", "name": "d", "description": ""}, "bb": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1 except aa)", "name": "bb", "description": ""}, "fakeanswer2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "siground(bb*answer,2)", "name": "fakeanswer2", "description": ""}, "yo2": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10#0.5 except yo1 except yo0)", "name": "yo2", "description": ""}, "maxvector": {"group": "Ungrouped variables", "templateType": "anything", "definition": "vector(yo1, yo2,yo3, yo4, yo5, yo11, yo21,yo31, yo41, yo51)", "name": "maxvector", "description": ""}, "maxx": {"group": "Ungrouped variables", "templateType": "anything", "definition": "max(map(abs(a),a,xn)+5)+1", "name": "maxx", "description": ""}, "xn": {"group": "Ungrouped variables", "templateType": "anything", "definition": "map((x-hsh)/hsc,x,xo)", "name": "xn", "description": "new transformed x values
"}, "aa": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1)", "name": "aa", "description": ""}, "ii": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(3..6#1)", "name": "ii", "description": ""}, "yo41": {"group": "Ungrouped variables", "templateType": "anything", "definition": "d*yo4", "name": "yo41", "description": ""}, "yo0": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10#0.5)", "name": "yo0", "description": ""}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a)", "name": "b", "description": ""}, "dd": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb except cc)", "name": "dd", "description": ""}, "c": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b)", "name": "c", "description": ""}, "yo5": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(15..45#1 except yo1 except yo0 except yo2 except yo3 except yo4)", "name": "yo5", "description": ""}, "eee": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b except c except d)", "name": "eee", "description": ""}, "yo01": {"group": "Ungrouped variables", "templateType": "anything", "definition": "f*yo0", "name": "yo01", "description": ""}, "yearvector": {"group": "Ungrouped variables", "templateType": "anything", "definition": "vector(2007,2008,2009,2010,2011,2012,2013)", "name": "yearvector", "description": ""}, "yo3": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1..10#0.5 except yo1 except yo0 except yo2)", "name": "yo3", "description": ""}, "a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "random(1.1..1.3#0.01)", "name": "a", "description": ""}}, "variable_groups": [], "parts": [{"showFeedbackIcon": true, "scripts": {}, "displayColumns": 0, "prompt": "\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}?
", "displayType": "radiogroup", "showCorrectAnswer": true, "shuffleChoices": true, "minMarks": 0, "choices": ["{answer} students
", "{fakeanswer1} students
", "{fakeanswer2} students
", "{fakeanswer3} students
", "{fakeanswer4} students
"], "distractors": ["", "", "", "", ""], "variableReplacementStrategy": "originalfirst", "matrix": ["1", 0, 0, 0, 0], "type": "1_n_2", "marks": 0, "maxMarks": 0, "variableReplacements": []}], "preamble": {"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('600px','440px',{boundingBox:[-1.2,10,5,-1], axis:false, grid:true });\n \n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n//board.suspendUpdate(); \n\n \n var dataArr = [yo0,yo1,yo2,yo3]; \n \n var xaxis = board.create('axis', [[0, 0], [5, 0]], {withLabel: true, name: \"This Year\", label: {offset: [335,-27]}});\n \n xaxis.removeAllTicks(); \n \n \nyAxis.setAutoRanging(false);\nyAxis.setLowerBound(10);\nyAxis.setUpperBound(50);\nyAxis.setTickUnit(5);\nyAxis.setMinorTickVisible(false);\n \n \n \n \n \n \n board.create('axis', [[0, 0], [0, 10]], {hideTicks:true, withLabel: true, name: \"Sales (millions)\", label: {offset: [-110,300]}});\n \n var pop0 = board.create('point', [1,0],{name:'January',fixed:true,size:0,color:'black',face:'diamond', label:{offset:[-20,-8]}});\n var pop1 = board.create('point',[2,0],{name:'February',fixed:true,size:0,color:'black',face:'diamond', label:{offset:[-20,-8]}});\n var pop2 = board.create('point',[3,0],{name:'March',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-15,-8]}});\n var pop3 = board.create('point',[4,0],{name:'April',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-15,-8]}});\n \n var chart = board.createElement('chart', dataArr, \n {chartStyle:'bar', fillOpacity:1, width:0.8, \n colorArray:['#8E1B77','#BE1679','#DC1765','#DA2130'], shadow:false});\n\n \n \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}"}, "tags": [], "extensions": ["jsxgraph"], "functions": {}, "rulesets": {"std": ["all", "fractionNumbers"]}, "name": "Harry's copy of Bar Charts", "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "If there is an increase of {percentage}% in sales in January and February next year and a {percentage-1.3}% increase in March and April what will be the expected value of sales in the first four months of next year?
", "advice": "", "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", "percentage"], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "Sales Bar Chart
"}, "type": "question", "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}]}], "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}