// Numbas version: exam_results_page_options {"name": "Linear Relations", "extensions": ["jsxgraph"], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Linear Relations", "tags": [], "metadata": {"description": "

This question asks the student to calculate three points of a given linear function then plot these points in a JSXGraph item and find the x and y intercepts of the line.

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

Complete table

\n

To find the $y$ values, substitute the given $x$ values into the formula. The points will be:

\n

For $x=\\var{start}$

\n

\\begin{align} y &=\\simplify[noLeadingMinus, unitfactor, zeroTerm,  !collectNumbers]{{slope}*{start}+{intercept}}\\\\ &=\\simplify{{slope}*{start}+{intercept}} \\end{align}

\n

For $x=\\var{start+skip}$

\n

\\begin{align} y &=\\simplify[noLeadingMinus, unitFactor, zeroTerm, !collectNumbers]{{slope}*{start+skip}+{intercept}}\\\\ &=\\simplify{{slope}*{start+skip}+{intercept}} \\end{align}

\n

For $x=\\var{start+2*skip}$

\n

\\begin{align} y &=\\simplify[noLeadingMinus, unitFactor, zeroTerm, !collectNumbers]{{slope}*{start+2*skip}+{intercept}}\\\\ &=\\simplify{{slope}*{start+2*skip}+{intercept}} \\end{align}

\n

Plot points

\n

{answer_frame}

\n

$y$ intercept

\n

The line will cross the $y$ axis at the point where $x=0$ in the formula, that is at the point $\\var{intercept}$.

\n

$x$ intercept

\n

The line will cross the $x$ axis at the point where $y=0$, that is \\begin{align} 0 &= \\simplify{{slope}*x+{intercept}}\\\\ \\simplify{-{intercept}}&=\\simplify{{slope}*x}\\\\  x&=\\simplify{-{intercept}/{slope}} \\end{align}

\n

On line?

\n

The given point $\\var{transpose(random_point)}$ will be on the line if the $x$ and $y$ values of the point satisfy the formula. In this case we have \\begin{align} \\var{random_point[1]} &=\\simplify[noLeadingMinus, unitfactor, zeroTerm,  !collectNumbers]{{slope}*{random_point[0]}+{intercept}}\\\\ &=\\simplify{{slope}*{random_point[0]}+{intercept}} \\end{align}

\n

This is clearly false, hence the point is not on the line.

\n

This is clearly true hence the point is on the line.

", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"frame": {"name": "frame", "group": "Plot points", "definition": "jessiecode(800,500,[-8,{maxY}+1,8,-{maxY}-1],\"\"\"\n point({start},0) <>;\n point({start+skip},0) <>;\n point({start+2*skip},0) <>;\n line(A,B) <>;\n line(B,C) <>;\n\"\"\",\n[\n \"axis\": true, \n \"defaultAxes\": [\"y\": [\"scalable\": true, \"name\": '$y$',\n \"label\": [\"position\": \"urt\", \"useMathjax\": true, \"fontSize\": 20], \n \"ticks\": [\"insertTicks\": false, \"minorTicks\": 0, highlight: false], \n \"ticksDelta\": 1, \"withLabel\": true],\n \"x\": [\"scalable\": true, \"name\": '$x$',\n \"label\": [\"position\": \"urt\", \"offset\": [-10,15], \"useMathjax\": true, \"fontSize\": 20], \n \"ticks\": [\"insertTicks\": false, \"minorTicks\": 0, highlight: false], \n \"ticksDelta\": 1, \"withLabel\": true]]\n ])", "description": "", "templateType": "anything", "can_override": false}, "start": {"name": "start", "group": "General", "definition": "random(-3..1)", "description": "

First x value given to studnet

", "templateType": "anything", "can_override": false}, "skip": {"name": "skip", "group": "General", "definition": "random(1..3)", "description": "

Skip between x values

", "templateType": "anything", "can_override": false}, "slope": {"name": "slope", "group": "General", "definition": "random(-2..2 except 0)", "description": "

Slope of linear function

", "templateType": "anything", "can_override": false}, "intercept": {"name": "intercept", "group": "General", "definition": "random(-2..2)", "description": "

y intercept of linear function

", "templateType": "anything", "can_override": false}, "target1": {"name": "target1", "group": "General", "definition": "vector(start,slope*start+intercept)", "description": "", "templateType": "anything", "can_override": false}, "target2": {"name": "target2", "group": "General", "definition": "vector(start+skip,slope*(start+skip)+intercept)", "description": "", "templateType": "anything", "can_override": false}, "target3": {"name": "target3", "group": "General", "definition": "vector(start+2*skip,slope*(start+2*skip)+intercept)", "description": "", "templateType": "anything", "can_override": false}, "maxY": {"name": "maxY", "group": "Plot points", "definition": "max([abs(target1[1]),abs(target2[1]),abs(target3[1])])", "description": "", "templateType": "anything", "can_override": false}, "multiplier": {"name": "multiplier", "group": "Plot points", "definition": "max(1,maxY/4)", "description": "", "templateType": "anything", "can_override": false}, "random_point": {"name": "random_point", "group": "On line", "definition": "vector(random_x, random_y[random(0,1)])", "description": "", "templateType": "anything", "can_override": false}, "answer_frame": {"name": "answer_frame", "group": "Plot points", "definition": "jessiecode(800,500,[-8,{maxY}+1,8,-{maxY}-1],\"\"\"\n point({target1[0]},{target1[1]}) <>;\n point({target2[0]},{target2[1]}) <>;\n point({target3[0]},{target3[1]}) <>;\n line(A,B) <>;\n line(B,C) <>;\n\"\"\",\n[\n \"axis\": true, \n \"defaultAxes\": [\"y\": [\"scalable\": true, \"name\": '$y$',\n \"label\": [\"position\": \"urt\", \"useMathjax\": true, \"fontSize\": 20], \n \"ticks\": [\"insertTicks\": false, \"minorTicks\": 0, highlight: false], \n \"ticksDelta\": 1, \"withLabel\": true],\n \"x\": [\"scalable\": true, \"name\": '$x$',\n \"label\": [\"position\": \"urt\", \"offset\": [-10,15], \"useMathjax\": true, \"fontSize\": 20], \n \"ticks\": [\"insertTicks\": false, \"minorTicks\": 0, highlight: false], \n \"ticksDelta\": 1, \"withLabel\": true]]\n ])", "description": "", "templateType": "anything", "can_override": false}, "random_x": {"name": "random_x", "group": "On line", "definition": "random(-7..7 except [start, start+skip, start+2*skip])", "description": "", "templateType": "anything", "can_override": false}, "random_y": {"name": "random_y", "group": "On line", "definition": "[random(-maxY..maxY),slope*random_x+intercept]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "General", "variables": ["start", "skip", "target1", "target2", "target3", "slope", "intercept"]}, {"name": "Plot points", "variables": ["frame", "maxY", "multiplier", "answer_frame"]}, {"name": "On line", "variables": ["random_point", "random_x", "random_y"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Complete table", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Complete the table below using the formula $y=\\simplify{{slope}*x+{intercept}}$.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$x$$\\var{target1[0]}$$\\var{target2[0]}$$\\var{target3[0]}$
$y$[[0]][[1]][[2]]
\n

\n

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Gap0", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "target1[1]", "maxValue": "target1[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "target2[1]", "maxValue": "target2[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "target3[1]", "maxValue": "target3[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "extension", "useCustomName": true, "customName": "Plot points", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "pos1:\n jxg_position(frame[\"A\"])\n\npos2:\n jxg_position(frame[\"B\"])\n\npos3:\n jxg_position(frame[\"C\"])\n\nmark:\n if(int(pos1[0])=target1[0] and int(pos1[1])=target1[1] and int(pos2[0])=target2[0] and int(pos2[1])=target2[1] and int(pos3[0])=target3[0] and int(pos3[1])=target3[1],\n correct(\"The points are in the correct position.\"),\n incorrect(\"At least one point is not in the correct position. Do the points appear to be in a straight line?\"))\n\ninterpreted_answer:\n pos1 and pos2 and pos3", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

{frame}

\n

Move the points in the number plane above to the points you calculated in the previous part of the question.

"}, {"type": "numberentry", "useCustomName": true, "customName": "$y$ intercept", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

At what $y$ value does the line in the previous part cut the $y$ axis?

", "minValue": "intercept", "maxValue": "intercept", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "$x$ intercept", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

At what $x$ value does the line in the \"Plot points\" part cross the $x$ axis?

", "minValue": "-1*intercept/slope", "maxValue": "-1*intercept/slope", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "yes-no", "useCustomName": true, "customName": "On line?", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Does the point $(\\var{random_point[0]}, \\var{random_point[1]})$ lie on the line in the \"Plot points\" part?

", "settings": {"correct_answer_expr": "random_point[1]=slope*random_point[0]+intercept"}}], "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/"}, {"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}, {"name": "Ulrich G\u00f6rtz", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7603/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}, {"name": "Ulrich G\u00f6rtz", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7603/"}]}