// Numbas version: exam_results_page_options {"name": "Placing a point on a number line (21 bars multiple of pi/2)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"scripts": {}, "variableReplacements": [], "showFeedbackIcon": true, "gaps": [{"showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "minValue": "a-0.5", "mustBeReducedPC": 0, "correctAnswerFraction": false, "scripts": {}, "mustBeReduced": false, "correctAnswerStyle": "plain", "allowFractions": false, "marks": 1, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "maxValue": "a+0.5", "showCorrectAnswer": true}], "marks": 0, "type": "gapfill", "prompt": "

Using the approximation $\\pi\\simeq\\dfrac{22}{7}$, place the point $\\displaystyle A=\\var[fractionNumbers]{c}\\pi$ on the number line below by dragging it.

\n

Note that the line starts at the number $\\displaystyle \\var{l}$ and finishes at the number $\\displaystyle \\var{r}$. In addition please disregard the numbers that appear when you drag the point $A$, these refer to an invisible grid that enables the program to calculate where you drag the point to.

\n

The point should finish up on a vertical bar, the vertical position of the point does not matter and your answer will default to the nearest vertical bar.

\n

{dragpoint()}

", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true}], "variablesTest": {"maxRuns": "100", "condition": "c<>-1 and c<>0 and c<>1 and (floor(c*22/7)<>c*22/7 or b>0)"}, "variable_groups": [], "statement": "

This question asks you to place a point on a number line.

", "name": "Placing a point on a number line (21 bars multiple of pi/2)", "advice": "

Since each bar represents $\\displaystyle \\dfrac{\\var{r}-(\\var{l})}{21}=\\var[fractionNumbers]{(r-l)/21}$ and since the number $\\displaystyle A=\\var[fractionNumbers]{c}\\pi\\simeq \\var[fractionNumbers]{c}\\times \\dfrac{22}{7}=\\var[fractionNumbers]{c*22/7}$ lies $\\displaystyle A-(\\var{l})\\simeq\\var[fractionNumbers]{l+a/7}-(\\var{l})=\\var[fractionNumbers]{a*((r-l)/21)}=\\var{a}\\times \\var[fractionNumbers]{(r-l)/21}$ from $\\displaystyle \\var{l}$, the number $\\displaystyle A=\\var[fractionNumbers]{c}\\pi$ lies approximately $\\displaystyle \\var{a}$ bars from the left as shown below.

\n

{dragpointafter()}

", "ungrouped_variables": ["l", "r", "a", "b", "c"], "metadata": {"description": "

This question asks you to place a point on a number line. The number is a multiple of pi.

", "licence": "Creative Commons Attribution 4.0 International"}, "tags": [], "extensions": ["jsxgraph"], "rulesets": {}, "preamble": {"js": "", "css": ""}, "functions": {"dragpointafter": {"parameters": [], "language": "javascript", "type": "html", "definition": "// set up the board\n\nJXG.Options.text.fontSize = 15; \n\nvar div = Numbas.extensions.jsxgraph.makeBoard('500px','150px',{boundingBox:[-1.5,3,22.5,-3],axis:false,showNavigation:false});\nvar board = div.board;\n\nvar l1 = board.create('line',[[0,0],[21,0]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l2 = board.create('line',[[1,-1],[1,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l3 = board.create('line',[[2,-1],[2,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l4 = board.create('line',[[3,-1],[3,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l5 = board.create('line',[[4,-1],[4,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l6 = board.create('line',[[5,-1],[5,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l7 = board.create('line',[[6,-1],[6,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l8 = board.create('line',[[7,-1],[7,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l9 = board.create('line',[[8,-1],[8,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l10 = board.create('line',[[9,-1],[9,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l11 = board.create('line',[[10,-1],[10,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l12 = board.create('line',[[11,-1],[11,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l13 = board.create('line',[[12,-1],[12,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l14 = board.create('line',[[13,-1],[13,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l15 = board.create('line',[[14,-1],[14,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l16 = board.create('line',[[15,-1],[15,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l17 = board.create('line',[[16,-1],[16,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l18 = board.create('line',[[17,-1],[17,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l19 = board.create('line',[[18,-1],[18,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l20 = board.create('line',[[19,-1],[19,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l21 = board.create('line',[[20,-1],[20,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\n\nvar a1 = board.create('line',[[0,0],[0.5,0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar a2 = board.create('line',[[0,0],[0.5,-0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar a3 = board.create('line',[[21,0],[20.5,0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar a4 = board.create('line',[[21,0],[20.5,-0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\n\nvar l = Numbas.jme.unwrapValue(scope.variables.l);\nvar r = Numbas.jme.unwrapValue(scope.variables.r);\n\nvar b = board.create('point',[-1.7,-0.4],{size:-1,name:l});\nb.setProperty({fixed:true});\nvar c = board.create('point',[20.7,-0.4],{size:-1,name:r});\nc.setProperty({fixed:true});\n\n\nvar a = Numbas.jme.unwrapValue(scope.variables.a);\n\nvar a = board.create('point',[a,0],{size:5});\na.setProperty({fixed:true});\n\nreturn div;"}, "dragpoint": {"parameters": [], "language": "javascript", "type": "html", "definition": "// set up the board\n\nJXG.Options.text.fontSize = 15; \n\nvar div = Numbas.extensions.jsxgraph.makeBoard('500px','150px',{boundingBox:[-1.5,3,22.5,-3],axis:false,showNavigation:false});\nvar board = div.board;\n\nvar l1 = board.create('line',[[0,0],[21,0]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l2 = board.create('line',[[1,-1],[1,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l3 = board.create('line',[[2,-1],[2,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l4 = board.create('line',[[3,-1],[3,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l5 = board.create('line',[[4,-1],[4,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l6 = board.create('line',[[5,-1],[5,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l7 = board.create('line',[[6,-1],[6,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l8 = board.create('line',[[7,-1],[7,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l9 = board.create('line',[[8,-1],[8,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l10 = board.create('line',[[9,-1],[9,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l11 = board.create('line',[[10,-1],[10,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l12 = board.create('line',[[11,-1],[11,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l13 = board.create('line',[[12,-1],[12,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l14 = board.create('line',[[13,-1],[13,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l15 = board.create('line',[[14,-1],[14,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l16 = board.create('line',[[15,-1],[15,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l17 = board.create('line',[[16,-1],[16,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l18 = board.create('line',[[17,-1],[17,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l19 = board.create('line',[[18,-1],[18,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l20 = board.create('line',[[19,-1],[19,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar l21 = board.create('line',[[20,-1],[20,1]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\n\nvar a1 = board.create('line',[[0,0],[0.5,0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar a2 = board.create('line',[[0,0],[0.5,-0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar a3 = board.create('line',[[21,0],[20.5,0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\nvar a4 = board.create('line',[[21,0],[20.5,-0.5]], \n {straightFirst:false, straightLast:false, strokeWidth:2,fixed:true});\n\nvar l = Numbas.jme.unwrapValue(scope.variables.l);\nvar r = Numbas.jme.unwrapValue(scope.variables.r);\n\nvar b = board.create('point',[-1.7,-0.4],{size:-1,name:l});\nb.setProperty({fixed:true});\nvar c = board.create('point',[20.7,-0.4],{size:-1,name:r});\nc.setProperty({fixed:true});\n\nvar a = board.create('point',[10.5,2],{size:5});\n\na.on('drag',function(){\n Numbas.exam.currentQuestion.parts[0].gaps[0].display.studentAnswer(a.X()); \n});\n\nreturn div;"}}, "variables": {"r": {"templateType": "anything", "group": "Ungrouped variables", "description": "

This is the right hand endpoint of the numberline.

", "definition": "l+3", "name": "r"}, "l": {"templateType": "anything", "group": "Ungrouped variables", "description": "

This is the left hand endpoint of the numberline.

", "definition": "floor(c*22/7)-b", "name": "l"}, "c": {"templateType": "randrange", "group": "Ungrouped variables", "description": "

This is the multiple of pi.

", "definition": "random(-10..10#0.5)", "name": "c"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "description": "

This is the distance along the number line.

", "definition": "7*b+(c*22/7-floor(c*22/7))*7", "name": "a"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "description": "

This is the integer part of the distance across the number line.

", "definition": "random(0,1,2)", "name": "b"}}, "type": "question", "contributors": [{"name": "Anthony Brown", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/799/"}]}]}], "contributors": [{"name": "Anthony Brown", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/799/"}]}