// Numbas version: finer_feedback_settings {"name": " Multiple Pie Charts Question 2", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"yo4": {"description": "", "templateType": "anything", "definition": "random(20..40#1 except yo1 except yo0 except yo2 except yo3)", "name": "yo4", "group": "Ungrouped variables"}, "xo": {"description": "

original x values

", "templateType": "anything", "definition": "list(-2..2)", "name": "xo", "group": "Ungrouped variables"}, "wages": {"description": "", "templateType": "anything", "definition": "random(5000..20000#1000)", "name": "wages", "group": "Ungrouped variables"}, "yo3": {"description": "", "templateType": "anything", "definition": "100-yo1-yo2-yo0", "name": "yo3", "group": "Ungrouped variables"}, "yo8": {"description": "", "templateType": "anything", "definition": "100-yo5-yo6-yo7", "name": "yo8", "group": "Ungrouped variables"}, "a": {"description": "", "templateType": "anything", "definition": "random(1.1..1.3#0.01)", "name": "a", "group": "Ungrouped variables"}, "selector": {"description": "", "templateType": "anything", "definition": "'vsc'", "name": "selector", "group": "Ungrouped variables"}, "year": {"description": "", "templateType": "anything", "definition": "yearvector[ii]", "name": "year", "group": "Ungrouped variables"}, "yo": {"description": "

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

", "templateType": "anything", "definition": "repeat(random(-5..5),5)", "name": "yo", "group": "Ungrouped variables"}, "bb": {"description": "", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1 except aa)", "name": "bb", "group": "Ungrouped variables"}, "fakeanswer2": {"description": "", "templateType": "anything", "definition": "precround(bb*answer,2)", "name": "fakeanswer2", "group": "Ungrouped variables"}, "yo0": {"description": "", "templateType": "anything", "definition": "random(4..10#1)", "name": "yo0", "group": "Ungrouped variables"}, "cc": {"description": "", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb)", "name": "cc", "group": "Ungrouped variables"}, "answer": {"description": "", "templateType": "anything", "definition": "precround(sales/yo5*yo7 * 2 /yo3 *yo1,2)", "name": "answer", "group": "Ungrouped variables"}, "fakeanswer1": {"description": "", "templateType": "anything", "definition": "precround(aa*answer,2)", "name": "fakeanswer1", "group": "Ungrouped variables"}, "yo2": {"description": "", "templateType": "anything", "definition": "random(10..20#1)", "name": "yo2", "group": "Ungrouped variables"}, "fakeanswer4": {"description": "", "templateType": "anything", "definition": "precround(dd*answer,2)", "name": "fakeanswer4", "group": "Ungrouped variables"}, "xn": {"description": "

new transformed x values

", "templateType": "anything", "definition": "map((x-hsh)/hsc,x,xo)", "name": "xn", "group": "Ungrouped variables"}, "percent": {"description": "", "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", "group": "Ungrouped variables"}, "students": {"description": "", "templateType": "anything", "definition": "random(120..320#1)", "name": "students", "group": "Ungrouped variables"}, "yo6": {"description": "", "templateType": "anything", "definition": "random(4..10#1 except yo5)", "name": "yo6", "group": "Ungrouped variables"}, "yo41": {"description": "", "templateType": "anything", "definition": "d*yo4", "name": "yo41", "group": "Ungrouped variables"}, "fakeanswer3": {"description": "", "templateType": "anything", "definition": "precround(cc*answer,2)", "name": "fakeanswer3", "group": "Ungrouped variables"}, "yo1": {"description": "", "templateType": "anything", "definition": "random(4..10#1 except yo0)", "name": "yo1", "group": "Ungrouped variables"}, "c": {"description": "", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b)", "name": "c", "group": "Ungrouped variables"}, "yo51": {"description": "", "templateType": "anything", "definition": "eee*yo5", "name": "yo51", "group": "Ungrouped variables"}, "hsc": {"description": "", "templateType": "anything", "definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "name": "hsc", "group": "Ungrouped variables"}, "answervector": {"description": "", "templateType": "anything", "definition": "vector((yo5-yo0)/yo0*100, (yo6-yo1)/yo1*100,(yo7-yo2)/yo2*100,(yo8-yo3)/yo3*100, (yo9-yo4)/yo4*100)", "name": "answervector", "group": "Ungrouped variables"}, "vsc": {"description": "", "templateType": "anything", "definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "name": "vsc", "group": "Ungrouped variables"}, "vsh": {"description": "

vertical shift

", "templateType": "anything", "definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "name": "vsh", "group": "Ungrouped variables"}, "aa": {"description": "", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1)", "name": "aa", "group": "Ungrouped variables"}, "f": {"description": "", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b except c except d except e)", "name": "f", "group": "Ungrouped variables"}, "increase": {"description": "", "templateType": "anything", "definition": "random(10..40#5)", "name": "increase", "group": "Ungrouped variables"}, "yearvector": {"description": "", "templateType": "anything", "definition": "vector(2007,2008,2009,2010,2011,2012,2013)", "name": "yearvector", "group": "Ungrouped variables"}, "sales": {"description": "", "templateType": "anything", "definition": "random(15000..40000#1000)", "name": "sales", "group": "Ungrouped variables"}, "yn": {"description": "

new y values after the transformation

", "templateType": "anything", "definition": "map(vsc*y+vsh,y,yo)", "name": "yn", "group": "Ungrouped variables"}, "d": {"description": "", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b except c)", "name": "d", "group": "Ungrouped variables"}, "maxx": {"description": "", "templateType": "anything", "definition": "max(map(abs(a),a,xn)+5)+1", "name": "maxx", "group": "Ungrouped variables"}, "hsh": {"description": "

horizontal shift

", "templateType": "anything", "definition": "if(selector='hsh',random(-3..3 except 0),0)", "name": "hsh", "group": "Ungrouped variables"}, "yo7": {"description": "", "templateType": "anything", "definition": "random(10..20#1)", "name": "yo7", "group": "Ungrouped variables"}, "yo5": {"description": "", "templateType": "anything", "definition": "random(4..10#1)", "name": "yo5", "group": "Ungrouped variables"}, "ii": {"description": "", "templateType": "anything", "definition": "random(3..6#1)", "name": "ii", "group": "Ungrouped variables"}, "b": {"description": "", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a)", "name": "b", "group": "Ungrouped variables"}, "eee": {"description": "", "templateType": "anything", "definition": "random(1.1..1.3#0.01 except a except b except c except d)", "name": "eee", "group": "Ungrouped variables"}, "dd": {"description": "", "templateType": "anything", "definition": "random(0.7..1.3#0.01 except 1 except aa except bb except cc)", "name": "dd", "group": "Ungrouped variables"}, "yo9": {"description": "", "templateType": "anything", "definition": "random(41..70#1 except yo5 except yo6 except yo7 except yo8)", "name": "yo9", "group": "Ungrouped variables"}}, "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", "sales", "wages"], "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 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('400px','400px',{boundingBox:[-10.5,10.5,10.5,-10.5], axis:false, grid:false});\n \n $(question.display.html).find('#dragpoint').append(div);\n \n var yo0string = yo0.toString();\n var yo1string = yo1.toString();\n var yo2string = yo2.toString();\n var yo3string = yo3.toString();\n var yo4string = yo4.toString();\n var yo5string = yo5.toString();\n var yo6string = yo6.toString();\n var yo7string = yo7.toString();\n var yo8string = yo8.toString();\n var yo9string = yo9.toString();\n \n var board = div.board;\n \n board.suspendUpdate();\n\n var leg1 = board.create('point',[-0.5,-4.5],{name:'tax',fixed:true,size:6,color:'#0F408D', face:'square', label:{offset:[9,6]}});\n var leg2 = board.create('point',[-0.5,-5.5],{name:'marketing',fixed:true,size:6,color:'#6F1B75', face:'square', label:{offset:[9,6]}});\n var leg3 = board.create('point',[-0.5,-6.5],{name:'wages',fixed:true,size:6,color:'#CA147A', face:'square', label:{offset:[9,6]}});\n var leg4 = board.create('point',[-0.5,-7.5],{name:'sales',fixed:true,size:6,color:'#DA2228', face:'square', label:{offset:[9,6]}});\n \n \n var a = board.create('chart', [[1,2,3,4],[yo0,yo1,yo2,yo3]], {chartStyle:'pie',labels:[yo0string,yo1string,yo2string,yo3string],label: {offset: [-4,-4]},colors:['#0F408D','#6F1B75','#CA147A','#DA2228'], width:1,fillOpacity:1,center:[-5,0],strokeColor:'black',strokeWidth:1, highlightOnSector:true, \n highlightBySize:true});\n var b = board.create('chart', [[1,2,3,4],[yo5,yo6,yo7,yo8]], {chartStyle:'pie',labels:[yo5string,yo6string,yo7string,yo8string],label: {offset: [-4,-4]},colors:['#0F408D','#6F1B75','#CA147A','#DA2228'], width:1,fillOpacity:1,center:[5,0], strokeColor:'black', strokeWidth:1, highlightOnSector:true, \n highlightBySize:true});\n\n \n var txt = board.create('text',[-6.5,7, 'Last Year'], {fontSize:18});\n \n var txt1 = board.create('text',[3.5,7, 'This Year'], {fontSize:18});\n \n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});", "css": "table#values th {\n background: none;\n text-align: center;\n}"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "rulesets": {"std": ["all", "fractionNumbers"]}, "functions": {}, "statement": "", "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Widget Sales

"}, "name": " Multiple Pie Charts Question 2", "extensions": ["jsxgraph"], "advice": "", "parts": [{"scripts": {}, "minMarks": 0, "shuffleChoices": true, "choices": ["

£{answer}     

", "

£{fakeanswer1}        

", "

£{fakeanswer2}        

", "

£{fakeanswer3}          

", "

£{fakeanswer4}         

"], "distractors": ["", "", "", "", ""], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showFeedbackIcon": true, "displayType": "radiogroup", "matrix": ["1", 0, 0, 0, 0], "prompt": "
Breakdown of spending in Jennings Inc. (in percent).
\n

\n

If last year's sales figures were worth double this year's wages bill and the tax bill for this year is £{sales}, approximately how much was spent on marketing last year?

", "marks": 0, "type": "1_n_2", "displayColumns": 0, "maxMarks": 0}], "variable_groups": [], "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/"}]}