// Numbas version: exam_results_page_options {"name": "Placing a point on a number line", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Placing a point on a number line", "statement": "

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

The correct position of the point is shown on the number line below.

\n

{dragpointafter()}

", "parts": [{"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "customMarkingAlgorithm": "", "prompt": "

Place the point \$A=\\var{a}\$ on the number line below by dragging it.

\n

To be marked correct you have to get the point within 0.1 of the correct position (in the horizontal direction, the vertical position doesn't matter).

\n

{dragpoint()}

", "type": "gapfill", "unitTests": [], "sortAnswers": false, "marks": 0, "gaps": [{"showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "minValue": "a-0.1", "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "maxValue": "a+0.1", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "mustBeReduced": false, "type": "numberentry", "unitTests": [], "marks": 1, "correctAnswerStyle": "plain"}]}], "ungrouped_variables": ["a"], "variablesTest": {"condition": "", "maxRuns": 100}, "extensions": ["jsxgraph"], "variables": {"a": {"definition": "random(-10..10#0.1)", "name": "a", "description": "", "group": "Ungrouped variables", "templateType": "randrange"}}, "preamble": {"js": "", "css": ""}, "rulesets": {}, "metadata": {"description": "

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

", "licence": "Creative Commons Attribution 4.0 International"}, "functions": {"dragpoint": {"definition": "// set up the board\nvar div = Numbas.extensions.jsxgraph.makeBoard('500px','150px',{boundingBox:[-11,1.5,11,-1.5],axis:false,showNavigation:false});\nvar board = div.board;\n\nvar ax1 = board.create('line', [[0,0],[1,0]]);\nboard.create('ticks',[ax1, 2], {minorTicks:1, majorHeight:20, minorHeight:10, tickEndings:[0,1], drawZero:true, drawLabels:true, label:{offset:[-4, -20]}});\nax1.setProperty({fixed:true});\n\nvar w = Numbas.jme.unwrapValue(scope.variables.a);\n\nvar a = board.create('point',[0,1],{size:5});\n\na.on('drag',function(){\n Numbas.exam.currentQuestion.parts[0].gaps[0].display.studentAnswer(a.X()); \n});\n\nreturn div;", "parameters": [], "language": "javascript", "type": "html"}, "dragpointafter": {"definition": "// set up the board\nvar div = Numbas.extensions.jsxgraph.makeBoard('500px','75px',{boundingBox:[-11,0.75,11,-1],axis:false,showNavigation:false});\nvar board = div.board;\n\nvar ax1 = board.create('line', [[0,0],[1,0]]);\nboard.create('ticks',[ax1, 2], {minorTicks:1, majorHeight:20, minorHeight:10, tickEndings:[0,1], drawZero:true, drawLabels:true, label:{offset:[-4, -20]}});\nax1.setProperty({fixed:true});\n\nvar w = Numbas.jme.unwrapValue(scope.variables.a);\n\nvar a = board.create('point',[w,0],{size:5});\na.setProperty({fixed:true});\n\nreturn div;", "parameters": [], "language": "javascript", "type": "html"}}, "tags": [], "variable_groups": [], "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/"}]}