// Numbas version: exam_results_page_options {"name": "Morten's copy of Mark points crossing the axes", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "extensions": ["jsxgraph"], "advice": "

.

", "name": "Morten's copy of Mark points crossing the axes", "parts": [{"prompt": "

{dragpoint()}

\n

Move point $X$ to the point where the line intercepts the $x$-axis.

\n

Move point $Y$ to the point where the line intercepts the $y$-axis.

\n

", "variableReplacements": [], "scripts": {}, "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "gaps": [{"showFeedbackIcon": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "minValue": "x_intercept", "marks": 1, "correctAnswerStyle": "plain", "variableReplacements": [], "maxValue": "x_intercept", "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"]}, {"showFeedbackIcon": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "minValue": "0", "marks": 1, "correctAnswerStyle": "plain", "variableReplacements": [], "maxValue": "0", "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"]}, {"showFeedbackIcon": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "minValue": "0", "marks": 1, "correctAnswerStyle": "plain", "variableReplacements": [], "maxValue": "0", "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"]}, {"showFeedbackIcon": true, "correctAnswerFraction": false, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst", "allowFractions": false, "minValue": "y_intercept", "marks": 1, "correctAnswerStyle": "plain", "variableReplacements": [], "maxValue": "y_intercept", "scripts": {}, "type": "numberentry", "notationStyles": ["plain", "en", "si-en"]}], "marks": 0, "type": "gapfill"}], "metadata": {"description": "

A line with random $x$- and $y$- intercepts is plotted, and you have to drag two dots over the points where the line crosses the $x$ and $y$ axes.

", "licence": "Creative Commons Attribution 4.0 International"}, "tags": [], "variable_groups": [], "variables": {"x_intercept": {"description": "", "definition": "random(-2..2#0.1 except 0)", "name": "x_intercept", "group": "Ungrouped variables", "templateType": "anything"}, "slope": {"description": "", "definition": "-x_intercept/y_intercept", "name": "slope", "group": "Ungrouped variables", "templateType": "anything"}, "y_intercept": {"description": "", "definition": "random(-2..2#0.1 except 0)", "name": "y_intercept", "group": "Ungrouped variables", "templateType": "anything"}}, "functions": {"dragpoint": {"definition": "var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px',{boundingBox:[-4.5,4.5,3,-3],grid:false});\nvar board = div.board;\n\nvar x_intercept = Numbas.jme.unwrapValue(scope.variables['x_intercept']);\nvar y_intercept = Numbas.jme.unwrapValue(scope.variables['y_intercept']);\n\nboard.create('line',[[0,y_intercept],[x_intercept,0]]);\n\nvar a = board.create('point',[0,0],{name:'X', snapSizeX: 0.1, snapSizeY: 0.1, snapToGrid: true});\na.on('drag',function(){\n var x = Numbas.math.niceNumber(a.X());\n var y = Numbas.math.niceNumber(a.Y());\n Numbas.exam.currentQuestion.getPart('p0g0').display.studentAnswer(x);\n Numbas.exam.currentQuestion.getPart('p0g1').display.studentAnswer(y);\n});\n\nvar b = board.create('point',[1,0],{name:'Y', snapSizeX: 0.1, snapSizeY: 0.1, snapToGrid: true});\nb.on('drag',function(){\n var x = Numbas.math.niceNumber(b.X());\n var y = Numbas.math.niceNumber(b.Y());\n Numbas.exam.currentQuestion.getPart('p0g2').display.studentAnswer(x);\n Numbas.exam.currentQuestion.getPart('p0g3').display.studentAnswer(y);\n});\n\nreturn div;\n\n", "language": "javascript", "parameters": [], "type": "html"}}, "preamble": {"css": "", "js": ""}, "ungrouped_variables": ["x_intercept", "y_intercept", "slope"], "statement": "

The graph below shows the line with equation $y = \\simplify[fractionnumbers,all,!noleadingminus]{{slope}x + {y_intercept}}$.

", "type": "question", "contributors": [{"name": "Morten Brekke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/478/"}]}]}], "contributors": [{"name": "Morten Brekke", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/478/"}]}