// Numbas version: finer_feedback_settings {"name": "Christian's copy of Widget Sales Question 3", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "", "parts": [{"showFeedbackIcon": true, "marks": 0, "variableReplacementStrategy": "originalfirst", "type": "1_n_2", "displayColumns": 0, "shuffleChoices": true, "minMarks": 0, "maxMarks": 0, "distractors": ["", "", "", "", ""], "choices": ["
{answer}barrels
", "{fakeanswer1}barrels
", "{fakeanswer2}barrels
", "{fakeanswer3}barrels
", "{fakeanswer4}barrels
"], "prompt": "\n
In the following year the number of rejects for this six month period reduced by {percent}%, how many rejects were there in the first half of 1983?
", "scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "displayType": "radiogroup", "matrix": ["1", 0, 0, 0, 0]}], "variable_groups": [], "statement": "", "preamble": {"css": "table#values th {\n background: none;\n text-align: center;\n}", "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 \n var yo01 = scope.variables.yo01.value;\n var yo11 = scope.variables.yo11.value;\n var yo21 = scope.variables.yo21.value;\n var yo31 = scope.variables.yo31.value; \n var yo41 = scope.variables.yo41.value;\n var yo51 = scope.variables.yo51.value;\n \n var maxx = scope.variables.maxx.value;\n var maxy = scope.variables.maxy.value;\n \n var div = Numbas.extensions.jsxgraph.makeBoard('400px','400px',{boundingBox:[-0.4,20,7,-2], axis:false, grid:false, title:{\n text: \"Widget Production Jan - June 1982\"}});\n \n \n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n var xaxis = board.create('axis', [[0, 0], [7, 0]], {withLabel: true, name: \"Month\", label: {offset: [200,-30]}});\n \n xaxis.removeAllTicks();\n \n board.create('axis', [[0, 0], [0, 20]], {hideTicks:false, withLabel: false, name: \"Widgets (10,000s)\", label: {offset: [-110,300]}});\n \n //create stationary points\n \n var op0 = board.create('point',[1,yo0],{name:'',fixed:true,size:3,color:'blue',face:'diamond'});\n var op1 = board.create('point',[2,yo1],{name:'',fixed:true,size:3,color:'blue',face:'diamond'});\n var op2 = board.create('point',[3,yo2],{name:'',fixed:true,size:3,color:'blue',face:'diamond'});\n var op3 = board.create('point',[4,yo3],{name:'',fixed:true,size:3,color:'blue',face:'diamond'});\n var op4 = board.create('point',[5,yo4],{name:'',fixed:true,size:3,color:'blue',face:'diamond'});\n var op5 = board.create('point',[6,yo5],{name:'',fixed:true,size:3,color:'blue',face:'diamond'});\n \n var op01 = board.create('point',[1,yo01],{name:'',fixed:true,size:3,color:'red',face:'diamond'});\n var op11 = board.create('point',[2,yo11],{name:'',fixed:true,size:3,color:'red',face:'diamond'});\n var op21 = board.create('point',[3,yo21],{name:'',fixed:true,size:3,color:'red',face:'diamond'});\n var op31 = board.create('point',[4,yo31],{name:'',fixed:true,size:3,color:'red',face:'diamond'});\n var op41 = board.create('point',[5,yo41],{name:'',fixed:true,size:3,color:'red',face:'diamond'});\n var op51 = board.create('point',[6,yo51],{name:'',fixed:true,size:3,color:'red',face:'diamond'});\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 var pop4 = board.create('point',[5,0],{name:'May',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-10,-8]}});\n var pop5 = board.create('point',[6,0],{name:'June',fixed:true,size:0,color:'black', face:'diamond', label:{offset:[-15,-8]}});\n \n // create the parabola\n var parabool1 = board.create('line',[[x1=1,y1=yo0], [x2=2,y2=yo1]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool2 = board.create('line',[[x1=2,y1=yo1], [x2=3,y2=yo2]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool3 = board.create('line',[[x1=3,y1=yo2], [x2=4,y2=yo3]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool4 = board.create('line',[[x1=4,y1=yo3], [x2=5,y2=yo4]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var parabool5 = board.create('line',[[x1=5,y1=yo4], [x2=6,y2=yo5]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n \n var paraboolleg1 = board.create('line',[[x1=3,y1=2], [x2=4,y2=2]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'blue'});\n var txt1 = board.create('text',[4.1,2, 'standard quality'], {fontColor:'black', fontSize:12, rotate:0});\n \n var paraboolleg2 = board.create('line',[[x1=3,y1=3], [x2=4,y2=3]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'red'});\n var txt2 = board.create('text',[4.1,3, 'Total(standard + rejects)'], {fontColor:'black', fontSize:12, rotate:0});\n \n var txt3 = board.create('text',[-0.2,7, 'Widgets (10,000s)'], {fontColor:'black', fontSize:12, rotate:90});\n \n var parabool11 = board.create('line',[[x1=1,y1=yo01], [x2=2,y2=yo11]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'red'});\n var parabool21 = board.create('line',[[x1=2,y1=yo11], [x2=3,y2=yo21]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'red'});\n var parabool31 = board.create('line',[[x1=3,y1=yo21], [x2=4,y2=yo31]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'red'});\n var parabool41 = board.create('line',[[x1=4,y1=yo31], [x2=5,y2=yo41]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'red'});\n var parabool51 = board.create('line',[[x1=5,y1=yo41], [x2=6,y2=yo51]],{straightFirst:false, straightLast:false,strokeWidth:1,strokeColor:'red'});\n}\n\nquestion.signals.on('HTMLAttached',function() {\n dragpoint_board();\n});"}, "functions": {}, "tags": [], "name": "Christian's copy of Widget Sales Question 3", "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "Widget Sales
"}, "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"], "extensions": ["jsxgraph"], "variablesTest": {"maxRuns": 100, "condition": ""}, "rulesets": {"std": ["all", "fractionNumbers"]}, "variables": {"maxx": {"definition": "max(map(abs(a),a,xn)+5)+1", "description": "", "name": "maxx", "templateType": "anything", "group": "Ungrouped variables"}, "aa": {"definition": "random(0.7..1.3#0.01 except 1)", "description": "", "name": "aa", "templateType": "anything", "group": "Ungrouped variables"}, "vsh": {"definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "description": "vertical shift
", "name": "vsh", "templateType": "anything", "group": "Ungrouped variables"}, "fakeanswer4": {"definition": "precround(dd*answer,2)", "description": "", "name": "fakeanswer4", "templateType": "anything", "group": "Ungrouped variables"}, "b": {"definition": "random(1.1..1.3#0.01 except a)", "description": "", "name": "b", "templateType": "anything", "group": "Ungrouped variables"}, "c": {"definition": "random(1.1..1.3#0.01 except a except b)", "description": "", "name": "c", "templateType": "anything", "group": "Ungrouped variables"}, "xo": {"definition": "list(-2..2)", "description": "original x values
", "name": "xo", "templateType": "anything", "group": "Ungrouped variables"}, "yo31": {"definition": "c*yo3", "description": "", "name": "yo31", "templateType": "anything", "group": "Ungrouped variables"}, "yo11": {"definition": "a*yo1", "description": "", "name": "yo11", "templateType": "anything", "group": "Ungrouped variables"}, "cc": {"definition": "random(0.7..1.3#0.01 except 1 except aa except bb)", "description": "", "name": "cc", "templateType": "anything", "group": "Ungrouped variables"}, "yo21": {"definition": "b*yo2", "description": "", "name": "yo21", "templateType": "anything", "group": "Ungrouped variables"}, "selector": {"definition": "'vsc'", "description": "", "name": "selector", "templateType": "anything", "group": "Ungrouped variables"}, "hsh": {"definition": "if(selector='hsh',random(-3..3 except 0),0)", "description": "horizontal shift
", "name": "hsh", "templateType": "anything", "group": "Ungrouped variables"}, "yo1": {"definition": "random(5..12#0.1 except yo0)", "description": "", "name": "yo1", "templateType": "anything", "group": "Ungrouped variables"}, "yo51": {"definition": "eee*yo5", "description": "", "name": "yo51", "templateType": "anything", "group": "Ungrouped variables"}, "d": {"definition": "random(1.1..1.3#0.01 except a except b except c)", "description": "", "name": "d", "templateType": "anything", "group": "Ungrouped variables"}, "yo2": {"definition": "random(5..12#0.1 except yo0 except yo1)", "description": "", "name": "yo2", "templateType": "anything", "group": "Ungrouped variables"}, "yo41": {"definition": "d*yo4", "description": "", "name": "yo41", "templateType": "anything", "group": "Ungrouped variables"}, "yo": {"definition": "repeat(random(-5..5),5)", "description": "the (random) original y values which relate to the x values
", "name": "yo", "templateType": "anything", "group": "Ungrouped variables"}, "maxy": {"definition": "max(list(maxvector)) + 1", "description": "", "name": "maxy", "templateType": "anything", "group": "Ungrouped variables"}, "dd": {"definition": "random(0.7..1.3#0.01 except 1 except aa except bb except cc)", "description": "", "name": "dd", "templateType": "anything", "group": "Ungrouped variables"}, "eee": {"definition": "random(1.1..1.3#0.01 except a except b except c except d)", "description": "", "name": "eee", "templateType": "anything", "group": "Ungrouped variables"}, "yo3": {"definition": "random(5..12#0.1 except yo0 except yo1 except yo2)", "description": "", "name": "yo3", "templateType": "anything", "group": "Ungrouped variables"}, "fakeanswer2": {"definition": "precround(bb*answer,2)", "description": "", "name": "fakeanswer2", "templateType": "anything", "group": "Ungrouped variables"}, "answer": {"definition": "precround((((yo11-yo1)+(yo21-yo2)+(yo31-yo3)+(yo01-yo0)+(yo41-yo4)+(yo51-yo5))*(1-percent/100)*10000),2)", "description": "", "name": "answer", "templateType": "anything", "group": "Ungrouped variables"}, "yo4": {"definition": "random(5..12#0.1 except yo0 except yo1 except yo2 except yo3)", "description": "", "name": "yo4", "templateType": "anything", "group": "Ungrouped variables"}, "fakeanswer3": {"definition": "precround(cc*answer,2)", "description": "", "name": "fakeanswer3", "templateType": "anything", "group": "Ungrouped variables"}, "a": {"definition": "random(1.1..1.3#0.01)", "description": "", "name": "a", "templateType": "anything", "group": "Ungrouped variables"}, "yo0": {"definition": "random(5..12#0.1)", "description": "", "name": "yo0", "templateType": "anything", "group": "Ungrouped variables"}, "maxvector": {"definition": "vector(yo1, yo2,yo3, yo4, yo5, yo11, yo21,yo31, yo41, yo51)", "description": "", "name": "maxvector", "templateType": "anything", "group": "Ungrouped variables"}, "hsc": {"definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "description": "", "name": "hsc", "templateType": "anything", "group": "Ungrouped variables"}, "yo5": {"definition": "random(4..12#0.1 except yo0 except yo1 except yo2 except yo3 except yo4)", "description": "", "name": "yo5", "templateType": "anything", "group": "Ungrouped variables"}, "yn": {"definition": "map(vsc*y+vsh,y,yo)", "description": "new y values after the transformation
", "name": "yn", "templateType": "anything", "group": "Ungrouped variables"}, "vsc": {"definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "description": "", "name": "vsc", "templateType": "anything", "group": "Ungrouped variables"}, "f": {"definition": "random(1.1..1.3#0.01 except a except b except c except d except e)", "description": "", "name": "f", "templateType": "anything", "group": "Ungrouped variables"}, "fakeanswer1": {"definition": "precround(aa*answer,2)", "description": "", "name": "fakeanswer1", "templateType": "anything", "group": "Ungrouped variables"}, "yo01": {"definition": "f*yo0", "description": "", "name": "yo01", "templateType": "anything", "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)", "description": "", "name": "percent", "templateType": "anything", "group": "Ungrouped variables"}, "bb": {"definition": "random(0.7..1.3#0.01 except 1 except aa)", "description": "", "name": "bb", "templateType": "anything", "group": "Ungrouped variables"}, "xn": {"definition": "map((x-hsh)/hsc,x,xo)", "description": "new transformed x values
", "name": "xn", "templateType": "anything", "group": "Ungrouped variables"}}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}