// Numbas version: exam_results_page_options {"name": "a jsxgraph question", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "a jsxgraph question", "tags": [], "metadata": {"description": "

The student is shown a diagram with a line between two points. They must make the line cross the axes at $x=1$ and $y=2$. They can drag the points around, or type a gradient in to move the points accordingly.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

{diagram}

", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"diagram": {"name": "diagram", "group": "Ungrouped variables", "definition": "jsxgraph(\n 600,400,[-6,4,6,-4],\n [\n ['point', [0,0], [\"id\": \"A\", \"snapToGrid\": true, \"snapSizeX\": 0.25, \"snapSizeY\": 0.25]],\n ['point', [1,1], [\"id\": \"B\", \"snapToGrid\": true, \"snapSizeX\": 0.25, \"snapSizeY\": 0.25]],\n ['line', [\"A\",\"B\"], [\"id\": \"line\"]]\n ]\n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["diagram"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "a_pos (The position of point A): jxg_position(diagram[\"A\"])\n\nb_pos (The position of point B): jxg_position(diagram[\"B\"])\n\ndx (The horizontal distance between the points): b_pos[0] - a_pos[0]\n\nmy (The vertical midpoint of A and B): (a_pos[1] + b_pos[1])/2\n\njxg_input (Update the diagram after the student types a number):\n if(isnan(studentnumber),\n [],\n [ jxg_set_position(diagram[\"A\"], vector(a_pos[0],my - studentnumber*dx/2)),\n jxg_set_position(diagram[\"B\"], vector(b_pos[0],my + studentnumber*dx/2))\n ]\n )\n\nslope: jxg_slope(diagram[\"line\"])\n\njxg_output (Fill in the number input after the diagram changes):\n dpformat(slope,2)\n\ncorrect_rise:\n if(rise=2,\n add_credit(0.5,\"Your line crosses the vertical axis at the right point.\")\n ,\n negative_feedback(\"Your line crosses the vertical axis at {rise}.\")\n )\n\nrise: jxg_rise(diagram[\"line\"])\n\nx_intercept:\n -rise/slope\n\ncorrect_x_intercept:\n if(x_intercept,\n add_credit(0.5,\"Your line crosses the horizontal axis at the right point.\")\n ,\n negative_feedback(\"Your line crosses the horizontal axis at {x_intercept}.\")\n )\n\nmark: \n apply(correct_rise);\n apply(correct_x_intercept)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Make the line between $A$ and $B$ cross the vertical axis at $y=2$ and cross the horizontal axis at $x=1$. You can move the points around, or type a gradient in the box below.

", "minValue": "-2", "maxValue": "-2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "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/"}]}