// Numbas version: finer_feedback_settings {"name": "Ricardo'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": {}, "name": "Ricardo's copy of Relationship between Fahrenheit and Celsius", "tags": [], "type": "question", "advice": "", "rulesets": {}, "parts": [{"showcorrectanswer": true, "type": "gapfill", "gaps": [{"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "fahrenheit[0]", "minvalue": "fahrenheit[0]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "fahrenheit[1]", "minvalue": "fahrenheit[1]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "fahrenheit[2]", "minvalue": "fahrenheit[2]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "fahrenheit[3]", "minvalue": "fahrenheit[3]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "celsius[4]", "minvalue": "celsius[4]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "celsius[5]", "minvalue": "celsius[5]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "celsius[6]", "minvalue": "celsius[6]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}, {"precisiontype": "dp", "precisionmessage": "You have not given your answer to the correct precision.", "maxvalue": "celsius[7]", "minvalue": "celsius[7]", "precisionpartialcredit": 0.0, "showcorrectanswer": true, "precision": 1.0, "marks": 1.0, "type": "numberentry", "strictprecision": false, "showPrecisionHint": false}], "prompt": "

Convert the following temperature measurements:

\n

(give your answers to 1 decimal place of precision)

\n
    \n
  1. [[0]]°F = {celsius[0]} °C
  2. \n
  3. [[1]]°F = {celsius[1]} °C
  4. \n
  5. {fahrenheit[4]} °F = [[4]]°C
  6. \n
  7. {fahrenheit[6]} °F = [[6]]°C
  8. \n
\n

", "marks": 0.0}, {"showcorrectanswer": true, "type": "gapfill", "gaps": [{"showcorrectanswer": true, "minvalue": -40.0, "type": "numberentry", "maxvalue": -40.0, "marks": 1.0, "showPrecisionHint": false}], "prompt": "

At what point is the temperature in Fahrenheit the same as the temperature in Celsius?

\n

[[0]] °C

", "marks": 0.0}], "extensions": ["jsxgraph"], "statement": "

The formula for converting from Celsius to Fahrenheit is \\[ F = 1.8 \\times C + 32 \\]

\n
", "variable_groups": [], "progress": "in-progress", "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)", "name": "f0"}, "f1": {"definition": "random(-60..180 except f0)", "name": "f1"}, "f2": {"definition": "random(-60..180 except [f0,f1])", "name": "f2"}, "f3": {"definition": "random(-60..180 except [f0,f1,f2])", "name": "f3"}, "fahrenheit": {"definition": "map(1.8x+32,x,[c0,c1,c2,c3])+[f0,f1,f2,f3]", "name": "fahrenheit"}, "celsius": {"definition": "[c0,c1,c2,c3]+map(precround((x-32)/1.8,1),x,[f0,f1,f2,f3])", "name": "celsius"}, "c3": {"definition": "random(-60..70 except [c0,c1,c2])", "name": "c3"}, "c2": {"definition": "random(-60..70 except [c0,c1])", "name": "c2"}, "c1": {"definition": "random(-60..70 except c0)", "name": "c1"}, "c0": {"definition": "random(-60..70)", "name": "c0"}}, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Ricardo Monge", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/471/"}]}]}], "contributors": [{"name": "Ricardo Monge", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/471/"}]}