// Numbas version: exam_results_page_options {"name": "Katherine's copy of Midpoint", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["l", "xa1", "xa2", "ya1", "ya2", "xa", "ya"], "extensions": ["jsxgraph"], "variables": {"l": {"definition": "shuffle(-12..12)[0..4]", "templateType": "anything", "description": "

l

", "name": "l", "group": "Ungrouped variables"}, "ya": {"definition": "(ya1+ya2)/2", "templateType": "anything", "description": "", "name": "ya", "group": "Ungrouped variables"}, "ya1": {"definition": "l[2]", "templateType": "anything", "description": "", "name": "ya1", "group": "Ungrouped variables"}, "xa": {"definition": "(xa1+xa2)/2", "templateType": "anything", "description": "", "name": "xa", "group": "Ungrouped variables"}, "xa1": {"definition": "l[0]", "templateType": "anything", "description": "", "name": "xa1", "group": "Ungrouped variables"}, "xa2": {"definition": "l[1]", "templateType": "anything", "description": "

xa

", "name": "xa2", "group": "Ungrouped variables"}, "ya2": {"definition": "l[3]", "templateType": "anything", "description": "", "name": "ya2", "group": "Ungrouped variables"}}, "rulesets": {}, "preamble": {"js": "", "css": ""}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Calculate the midpoint of two points.

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {"line_and_2points": {"parameters": [], "definition": "\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',{boundingBox:[-13,13,13,-13],grid:true,axis:false});\nvar board = div.board;\n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\nx0 = Numbas.jme.unwrapValue(scope.variables.xa1);\ny0 = Numbas.jme.unwrapValue(scope.variables.ya1);\nx1 = Numbas.jme.unwrapValue(scope.variables.xa2);\ny1 = Numbas.jme.unwrapValue(scope.variables.ya2);\n\nboard.create('point',[x0,y0],{fixed:true,withLabel:false});\nboard.create('point',[x1,y1],{fixed:true,withLabel:false});\nboard.create('point',[(x0+x1)/2,(y0+y1)/2],{fixed:true,withLabel:false});\n\n\nboard.create('text',[(x0+x1)/2+0.5,(y0+y1)/2,'The midpoint']);\n\n\nreturn div;", "language": "javascript", "type": "html"}}, "advice": "

{line_and_2points()}

\n

\n

The midpoint of two points is simply the point whose $x$ coordinate is the average of the other $x$ coordinates, and whose $y$ coordinate is the average of the other $y$ coordinates. That is, the midpoint of $(\\var{xa1},\\var{ya1})$ and $(\\var{xa2},\\var{ya2})$ is the point $\\left(\\simplify[basic]{({xa1}+{xa2})/2},\\simplify[basic]{({ya1}+{ya2})/2}\\right)=\\left(\\simplify{({xa1}+{xa2})/2},\\simplify{({ya1}+{ya2})/2}\\right)=\\left(\\simplify{{(xa1+xa2)/2}},\\simplify{{(ya1+ya2)/2}}\\right)$.

\n

\n

", "variable_groups": [], "name": "Katherine's copy of Midpoint", "statement": "

Fill in the blanks.

", "parts": [{"type": "gapfill", "gaps": [{"showCorrectAnswer": true, "mustBeReduced": false, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "xa", "allowFractions": true, "type": "numberentry", "mustBeReducedPC": 0, "correctAnswerFraction": true, "minValue": "xa", "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": []}, {"showCorrectAnswer": true, "mustBeReduced": false, "showFeedbackIcon": true, "correctAnswerStyle": "plain", "maxValue": "ya", "allowFractions": true, "type": "numberentry", "mustBeReducedPC": 0, "correctAnswerFraction": true, "minValue": "ya", "scripts": {}, "notationStyles": ["plain", "en", "si-en"], "marks": 1, "variableReplacementStrategy": "originalfirst", "variableReplacements": []}], "showCorrectAnswer": true, "prompt": "

The midpoint of $(\\var{xa1},\\var{ya1})$ and $(\\var{xa2},\\var{ya2})$ is $\\large($[[0]], [[1]]$\\large)$.

", "scripts": {}, "marks": 0, "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showFeedbackIcon": true}], "tags": [], "type": "question", "contributors": [{"name": "Katherine Tomlinson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1652/"}]}]}], "contributors": [{"name": "Katherine Tomlinson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1652/"}]}