// Numbas version: exam_results_page_options {"name": "Midpoint", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Midpoint", "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Calculate the midpoint of two points.

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

xa

", "group": "Ungrouped variables"}, "l": {"definition": "shuffle(-12..12)[0..4]", "name": "l", "templateType": "anything", "description": "

l

", "group": "Ungrouped variables"}, "ya1": {"definition": "l[2]", "name": "ya1", "templateType": "anything", "description": "", "group": "Ungrouped variables"}}, "functions": {"line_and_2points": {"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;", "parameters": [], "language": "javascript", "type": "html"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"js": "", "css": ""}, "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

", "extensions": ["jsxgraph"], "ungrouped_variables": ["l", "xa1", "xa2", "ya1", "ya2", "xa", "ya"], "statement": "

Fill in the blanks.

", "parts": [{"prompt": "

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

", "showFeedbackIcon": true, "marks": 0, "variableReplacements": [], "type": "gapfill", "showCorrectAnswer": true, "gaps": [{"correctAnswerStyle": "plain", "marks": 1, "correctAnswerFraction": true, "mustBeReduced": false, "allowFractions": true, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "minValue": "xa", "maxValue": "xa", "scripts": {}, "showFeedbackIcon": true, "type": "numberentry", "variableReplacements": [], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"correctAnswerStyle": "plain", "marks": 1, "correctAnswerFraction": true, "mustBeReduced": false, "allowFractions": true, "notationStyles": ["plain", "en", "si-en"], "mustBeReducedPC": 0, "minValue": "ya", "maxValue": "ya", "scripts": {}, "showFeedbackIcon": true, "type": "numberentry", "variableReplacements": [], "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "scripts": {}, "variableReplacementStrategy": "originalfirst"}], "variable_groups": [], "tags": [], "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}