// Numbas version: finer_feedback_settings {"name": "Julie's copy of Relationship between Fahrenheit and Celsius", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["f0", "f1", "f2", "f3", "fahrenheit", "celsius", "c3", "c2", "c1", "c0"], "name": "Julie's copy of Relationship between Fahrenheit and Celsius", "tags": [], "advice": "", "rulesets": {}, "parts": [{"prompt": "
Convert the following temperature measurements:
\n(give your answers to 1 decimal place of precision)
\nAt what point is the temperature in Fahrenheit the same as the temperature in Celsius?
\n[[0]] °C
", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "-40", "minValue": "-40", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "statement": "The formula for converting from Celsius to Fahrenheit is \\[ F = \\frac{9}{5} C + 32 \\]
\n", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": "function makeTempGraph() {\n function getMouseCoords(e, i) {\n var cPos = board.getCoordsTopLeftCorner(e, i);\n var absPos = JXG.getPosition(e, i);\n var dx = absPos[0]-cPos[0];\n var dy = absPos[1]-cPos[1];\n \n return new JXG.Coords(JXG.COORDS_BY_SCREEN, [dx, dy], board);\n }\n \n\n var div = Numbas.extensions.jsxgraph.makeBoard('600px','400px',{\n boundingBox: [-80,240,100,-100],\n axis: true,\n showNavigation: false,\n grid: false\n });\n $('#tempgraph').append(div);\n var board = div.board;\n \n var fahrenheit_point = board.create('point',[0,50],{name:'',fixed:true,visible:false});\n var fahrenheit_text = board.create('text',[-14,function(){var y = fahrenheit_point.Y(); return y<32 ? y+8 : y;},function(){return Numbas.math.niceNumber(fahrenheit_point.Y(),{precisionType:'dp',precision:1})+'\\u00B0F'}]);\n var celsius_point = board.create('point',[10,0],{name:'',fixed:true,visible:false});\n var celsius_text = board.create('text',[function(){return celsius_point.X()+2},8,function(){return Numbas.math.niceNumber(celsius_point.X(),{precisionType:'dp',precision:1})+'\\u00B0C'}]);\n var line_point = board.create('point',[10,50],{name:'',fixed:true,visible:false});\n \n var line = board.create('line',[[0,32],[10,50]],{fixed:true,highlight:false,strokeColor:'gray'});\n \n var horizontal_line = board.create(\n 'segment',\n [fahrenheit_point,line_point],\n {dash:1,highlight:false,strokeColor:'gray'}\n );\n\n var vertical_line = board.create(\n 'segment',\n [celsius_point,line_point],\n {dash:1,highlight:false,strokeColor:'gray'}\n );\n\n JXG.addEvent(div,'mousemove',function(e) {\n var coords = getMouseCoords(e).usrCoords;\n var x = Math.round(coords[1]);\n var y = Math.round(coords[2]);\n if(y>0 ? y<1.8*x+32 : y>1.8*x+32) {\n y = 1.8*x + 32;\n } else {\n x = (y-32)/1.8;\n }\n \n fahrenheit_point.setPosition(JXG.COORDS_BY_USER,[0,y]);\n celsius_point.setPosition(JXG.COORDS_BY_USER,[x,0]);\n line_point.setPosition(JXG.COORDS_BY_USER,[x,y]);\n \n board.update();\n },board);\n \n \n board.update();\n}\n\nquestion.signals.on('HTMLAttached',function() {\n makeTempGraph();\n \n});"}, "variables": {"f0": {"definition": "random(-60..180)", "templateType": "anything", "group": "Ungrouped variables", "name": "f0", "description": ""}, "f1": {"definition": "random(-60..180 except f0)", "templateType": "anything", "group": "Ungrouped variables", "name": "f1", "description": ""}, "f2": {"definition": "random(-60..180 except [f0,f1])", "templateType": "anything", "group": "Ungrouped variables", "name": "f2", "description": ""}, "f3": {"definition": "random(-60..180 except [f0,f1,f2])", "templateType": "anything", "group": "Ungrouped variables", "name": "f3", "description": ""}, "fahrenheit": {"definition": "map(1.8x+32,x,[c0,c1,c2,c3])+[f0,f1,f2,f3]", "templateType": "anything", "group": "Ungrouped variables", "name": "fahrenheit", "description": ""}, "celsius": {"definition": "[c0,c1,c2,c3]+map(precround((x-32)/1.8,1),x,[f0,f1,f2,f3])", "templateType": "anything", "group": "Ungrouped variables", "name": "celsius", "description": ""}, "c3": {"definition": "random(-60..70 except [c0,c1,c2])", "templateType": "anything", "group": "Ungrouped variables", "name": "c3", "description": ""}, "c2": {"definition": "random(-60..70 except [c0,c1])", "templateType": "anything", "group": "Ungrouped variables", "name": "c2", "description": ""}, "c1": {"definition": "random(-60..70 except c0)", "templateType": "anything", "group": "Ungrouped variables", "name": "c1", "description": ""}, "c0": {"definition": "random(-60..70)", "templateType": "anything", "group": "Ungrouped variables", "name": "c0", "description": ""}}, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}