// Numbas version: exam_results_page_options {"name": "Solid phase change + power", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Solid phase change + power", "tags": [], "metadata": {"description": "

A random heating question, that randomly picks a material, and then heats it through either one or two phase changes, provides an example graph of the heating with scaled temperature ranges (though not with scaled latent and specific heats), and a table with the suitable constants.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

\n

A {container_string} holds {mass_string} of solid {Mat_string} at {start_temp} °C, the fusion temperature of {mat_string}.  The {mat_string} is heated until it entirely melts.

\n

\n\n\n\n\n\n\n\n\n\n\n\n
Latent Heat of fusion
{Mat_string}{phase1_latentheat} Jkg<sup>-1</sup>
\n

", "advice": "

{advice1}

\n

{advice2}

\n

{advice3}

\n

{advice4}

\n

\n

\n

{advice5}

\n

{advice6}

\n

{advice7}

", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"phase1_latentheat": {"name": "phase1_latentheat", "group": "Material values", "definition": "fusion_lh_list[wat_mat]", "description": "", "templateType": "anything"}, "tt": {"name": "tt", "group": "Energy", "definition": "fh_kj*1000/(power*60*60)", "description": "", "templateType": "anything"}, "wat_mat": {"name": "wat_mat", "group": "Random variables", "definition": "random(0..3)", "description": "", "templateType": "anything"}, "mass_string": {"name": "mass_string", "group": "kg or g", "definition": "if(mass<1,dpformat(mass*1000,0)+' g',dpformat(mass,2)+' kg')", "description": "", "templateType": "anything"}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything"}, "fh_kj": {"name": "fh_kj", "group": "Energy", "definition": "fusionheat/1000", "description": "", "templateType": "anything"}, "answer": {"name": "answer", "group": "Ungrouped variables", "definition": "if(switcharoo=0,pp,tt)", "description": "", "templateType": "anything"}, "material_list": {"name": "material_list", "group": "Lists of values", "definition": "['H2O','Mercury','Copper','Gold','Iron','Silver','Aluminium']", "description": "", "templateType": "anything"}, "phase1_temp": {"name": "phase1_temp", "group": "Material values", "definition": "fusion_temp_list[wat_mat]", "description": "", "templateType": "anything"}, "container_string": {"name": "container_string", "group": "Material values", "definition": "if (wat_mat < 1.5,'flask','crucible')", "description": "", "templateType": "anything"}, "fusionheat": {"name": "fusionheat", "group": "Energy", "definition": "mass*phase1_latentheat", "description": "", "templateType": "anything"}, "question_string": {"name": "question_string", "group": "Ungrouped variables", "definition": "if(switcharoo=0,' for {time} hours, calculate the power of the heater in W, to three significant figures',' with a power of {power} W, calculate how long the {mat_string} took to melt in hours, to three significant figures')", "description": "", "templateType": "anything"}, "mat_string": {"name": "mat_string", "group": "Material values", "definition": "material_list[wat_mat]", "description": "", "templateType": "anything"}, "mass": {"name": "mass", "group": "Random variables", "definition": "if(random(0,1)=0,random(0.01..0.99#0.01),random(1.00..10.00#0.01))", "description": "", "templateType": "anything"}, "pp": {"name": "pp", "group": "Energy", "definition": "fusionheat/(time*60*60)", "description": "", "templateType": "anything"}, "start_temp": {"name": "start_temp", "group": "Random variables", "definition": "phase1_temp-273.15", "description": "", "templateType": "anything"}, "fusion_temp_list": {"name": "fusion_temp_list", "group": "Lists of values", "definition": "[273.15,234.15,1357.15,1337.15,1811,1235,933]", "description": "", "templateType": "anything"}, "power": {"name": "power", "group": "Energy", "definition": "siground((fh_kj*1000)/(time*60*60),3)", "description": "", "templateType": "anything"}, "timemin": {"name": "timemin", "group": "Energy", "definition": "1.1*60*60", "description": "", "templateType": "anything"}, "time": {"name": "time", "group": "Energy", "definition": "random(1.1..9.1)", "description": "", "templateType": "anything"}, "fusion_lh_list": {"name": "fusion_lh_list", "group": "Lists of values", "definition": "[336000,11300,207000,63000,272000,111000,398000]", "description": "", "templateType": "anything"}, "advice1": {"name": "advice1", "group": "Advice", "definition": "\"a) Melting the solid: $Q = m \\\\times L_H$\"", "description": "", "templateType": "anything"}, "advice2": {"name": "advice2", "group": "Advice", "definition": "\"So: $Q = \"+siground(mass,3)+\" \\\\times \"+phase1_latentheat+\" = $\"+siground(fusionheat,5)", "description": "", "templateType": "anything"}, "advice3": {"name": "advice3", "group": "Advice", "definition": "\"So the energy absorbed by the \"+mat_string+\" is \"+siground(fh_kj,3)+\" kj.\"", "description": "", "templateType": "anything"}, "advice4": {"name": "advice4", "group": "Advice", "definition": "\"b) Power $P = \\\\frac \\{E\\}\\{t\\}$\"", "description": "", "templateType": "anything"}, "advice5": {"name": "advice5", "group": "Advice", "definition": "if (switcharoo =0,\" \",\n \"So time $t = \\\\frac \\{E\\}\\{P\\}$\"\n )", "description": "", "templateType": "anything"}, "advice6": {"name": "advice6", "group": "Advice", "definition": "if (switcharoo =0,\"$P = \\\\frac \\{\"+siground(fusionheat,5)+\"\\}\\{\"+time+\" \\\\times 60 \\\\times 60\\} = $\"+siground(pp,5),\n \"$t = \\\\frac \\{\"+siground(fusionheat,5)+\"\\}\\{\"+power+\"\\} / (60 \\\\times 60)= $\"+siground(tt,5)\n )", "description": "", "templateType": "anything"}, "advice7": {"name": "advice7", "group": "Advice", "definition": "if (switcharoo =0,\"So the power is \"+siground(pp,3)+\" Watts.\",\n \"So the time is \"+siground(tt,3)+\" hours.\"\n )", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "power > 0.1", "maxRuns": 100}, "ungrouped_variables": ["switcharoo", "answer", "question_string"], "variable_groups": [{"name": "switcharoo values", "variables": []}, {"name": "kg or g", "variables": ["mass_string"]}, {"name": "Material values", "variables": ["mat_string", "container_string", "phase1_temp", "phase1_latentheat"]}, {"name": "Energy", "variables": ["fusionheat", "fh_kj", "timemin", "time", "power", "tt", "pp"]}, {"name": "Lists of values", "variables": ["material_list", "fusion_lh_list", "fusion_temp_list"]}, {"name": "Random variables", "variables": ["wat_mat", "start_temp", "mass"]}, {"name": "Advice", "variables": ["advice1", "advice2", "advice3", "advice4", "advice5", "advice6", "advice7"]}], "functions": {"onestep": {"parameters": [], "type": "html", "language": "javascript", "definition": "// Takes variables\n\n// showing K or C?\nk_c = Numbas.jme.unwrapValue(scope.variables.k_c_switch);\n\nif (k_c = 0) {\n var k_c_corr =0;\n var k_c_str=\"K\";\n} else {\n var k_c_corr =-273;\n var k_c_str=\"\u00b0C\";\n}\n\n//Set values\nst = Numbas.jme.unwrapValue(scope.variables.start_temp)+k_c_corr;\net = Numbas.jme.unwrapValue(scope.variables.end_temp)+k_c_corr;\npt = Numbas.jme.unwrapValue(scope.variables.phase_temp)+k_c_corr;\n\n\n// The function provided by the JSXGraph extension wraps the board up in\n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('500px','300px',\n {boundingBox: [-4,et+10,20,st-10],\n axis: false,\n showNavigation: false,\n grid: false\n });\n\n// div.board is the object created by JSXGraph, which you use to\n// manipulate elements\nvar board = div.board;\n\n\n\n// create the x-axis.\n//var xaxis = board.create('line',[[0,0],[1,0]], {strokeColor: 'black', fixed: true});\n//var xticks = board.create('ticks',[xaxis,20],{\n// drawLabels: true,\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,parseInt((et-st)/50.)*10],{\ndrawZero:true,\ndrawLabels: true,\nlabel: {offset: [20, 0]},\nminorTicks: 0\n});\n\n//\n//slope 1\nvar slope1 = board.create('line',[[4,st],[((pt-st)/((pt-st)+(et-pt))*8)+4,pt]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope2 = board.create('line',[[((pt-st)/((pt-st)+(et-pt))*8)+4,pt],[16-((et-pt)/((pt-st)+(et-pt))*8),pt]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope3 = board.create('line',[[16-((et-pt)/((pt-st)+(et-pt))*8),pt],[16,et]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\nvar dash1 = board.create('line',[[((pt-st)/((pt-st)+(et-pt))*8)+4,st-5],[((pt-st)/((pt-st)+(et-pt))*8)+4,et+5]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar dash2 = board.create('line',[[16-((et-pt)/((pt-st)+(et-pt))*8),st-5],[16-((et-pt)/((pt-st)+(et-pt))*8),et+5]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n\n//label the y-axis\n var label = board.create('text',[-2,(et+st)/2,k_c_str]);\n\n\n// and return the container div\nreturn div;"}, "twostep": {"parameters": [], "type": "html", "language": "javascript", "definition": "// Takes variables\n\n// showing K or C?\nk_c = Numbas.jme.unwrapValue(scope.variables.k_c_switch);\n\nif (k_c = 0) {\n var k_c_corr =0;\n var k_c_str=\"K\";\n} else {\n var k_c_corr =-273;\n var k_c_str=\"\u00b0C\";\n}\n\n//Set values\nst = Numbas.jme.unwrapValue(scope.variables.start_temp)+k_c_corr;\net = Numbas.jme.unwrapValue(scope.variables.end_temp)+k_c_corr;\npt1 = Numbas.jme.unwrapValue(scope.variables.phase1_temp)+k_c_corr;\npt2 = Numbas.jme.unwrapValue(scope.variables.phase2_temp)+k_c_corr;\n\n\n// The function provided by the JSXGraph extension wraps the board up in\n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('500px','300px',\n {boundingBox: [-5,et+(et-st)/10.,28,st-(et-st)/10.],\n axis: false,\n showNavigation: false,\n grid: false\n });\n\n// div.board is the object created by JSXGraph, which you use to\n// manipulate elements\nvar board = div.board;\n\n\n\n// create the x-axis.\n//var xaxis = board.create('line',[[0,0],[1,0]], {strokeColor: 'black', fixed: true});\n//var xticks = board.create('ticks',[xaxis,20],{\n// drawLabels: true,\n// minorTicks: 0\n//});\n\n// create the y-axis\n\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,parseInt((et-st)/50.)*10],{\ndrawZero:true,\ndrawLabels: true,\nlabel: {offset: [20, 0]},\nminorTicks: 0\n});\n\n\n// full size of the five slopes\nvar allslope=(et-st);\nvar s1sz=(8*(pt1-st)/allslope);\nvar s3sz=(8*(pt2-pt1)/allslope);\nvar s5sz=(8*(et-pt2)/allslope);\n\n\n//\n//slope 1\nvar slope1 = board.create('line',[[4,st],[s1sz+4,pt1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope2 = board.create('line',[[s1sz+4,pt1],[s1sz+8,pt1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope3 = board.create('line',[[s1sz+8,pt1],[s1sz+s3sz+8,pt2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope4 = board.create('line',[[s1sz+s3sz+8,pt2],[s1sz+s3sz+12,pt2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope5 = board.create('line',[[s1sz+s3sz+12,pt2],[s1sz+s3sz+s5sz+12,et]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n//var slope6 = board.create('line',[[4,pt1],[20,pt2]], {dash:2,straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\nvar dash1 = board.create('line',[[s1sz+4,st-10],[s1sz+4,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar dash2 = board.create('line',[[s1sz+8,st-10],[s1sz+8,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar dash3 = board.create('line',[[s1sz+s3sz+8,st-10],[s1sz+s3sz+8,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar dash4 = board.create('line',[[s1sz+s3sz+12,st-10],[s1sz+s3sz+12,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n\n//label the y-axis\n var label = board.create('text',[-2,(et+st)/2,k_c_str]);\n\n\n// and return the container div\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate the total heat absorbed by the {Mat_string} as it melts in kJ, to three significant figures.

", "minValue": "siground(fh_kj,3)-siground(abs(fh_kj/100),3)", "maxValue": "siground(fh_kj,3)+siground(abs(fh_kj/100),3)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "fh_kj", "part": "p0", "must_go_first": true}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The {container_string} was heated by a heater{question_string}. Assume all the energy from the heater goes directly into the {mat_string}.

", "minValue": "siground(answer,3)-siground(abs(answer/100),3)", "maxValue": "siground(answer,3)+siground(abs(answer/100),3)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}]}]}], "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}]}