// Numbas version: exam_results_page_options {"name": "Terry'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": [{"metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Calculate the midpoint of two points.

"}, "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"}}, "ungrouped_variables": ["l", "xa1", "xa2", "ya1", "ya2", "xa", "ya"], "rulesets": {}, "variables": {"l": {"group": "Ungrouped variables", "definition": "shuffle(-12..12)[0..4]", "name": "l", "templateType": "anything", "description": "

l

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

xa

"}, "ya2": {"group": "Ungrouped variables", "definition": "l[3]", "name": "ya2", "templateType": "anything", "description": ""}, "ya1": {"group": "Ungrouped variables", "definition": "l[2]", "name": "ya1", "templateType": "anything", "description": ""}, "ya": {"group": "Ungrouped variables", "definition": "(ya1+ya2)/2", "name": "ya", "templateType": "anything", "description": ""}}, "extensions": ["jsxgraph"], "variable_groups": [], "statement": "

Fill in the blanks.

", "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "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

", "name": "Terry's copy of Midpoint", "parts": [{"prompt": "

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

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