// Numbas version: finer_feedback_settings {"name": "A1: Block has friction (static or kinetic)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [{"name": "Random Variables", "variables": ["r_mass", "r_friction", "r_force", "r_gravity", "r_normal_force", "g_normal_force", "distance"]}, {"name": "switches", "variables": ["sk_switch", "fcmg_switch"]}, {"name": "Random answers", "variables": ["force", "coeff", "gravity", "mass"]}, {"name": "strings", "variables": ["a_string", "f_string", "c_string", "m_string", "g_string", "sk_string", "sk_text", "g_text", "f2_string"]}], "preamble": {"css": "", "js": ""}, "statement": "

{if(sk_switch = 1, draw_block_kinetic(), draw_block_static())}

\n

{g_text} {sk_text} {f_string} {c_string} {m_string} {g_string}

", "advice": "", "rulesets": {}, "ungrouped_variables": ["answer", "advice1", "mu", "advice2", "advice3", "advice4"], "extensions": ["jsxgraph"], "variables": {"answer": {"name": "answer", "description": "", "group": "Ungrouped variables", "definition": "switch(\n fcmg_switch=0,\n force\n ,fcmg_switch=1,\n coeff\n ,fcmg_switch=2,\n mass\n ,gravity\n)", "templateType": "anything"}, "r_gravity": {"name": "r_gravity", "description": "", "group": "Random Variables", "definition": "9.81", "templateType": "anything"}, "advice4": {"name": "advice4", "description": "", "group": "Ungrouped variables", "definition": "switch(\n fcmg_switch=0,\n \"So the force on the block is \"+sigformat(answer,3)+\" N.\"\n ,fcmg_switch=1,\n \"So the co-efficient of \"+sk_string+\" friction ($\"+mu+\"$) is \"+sigformat(answer,3)+\".\"\n ,fcmg_switch=2,\n \"So the mass of the block is \"+sigformat(answer,3)+\" kg.\"\n ,fcmg_switch=3,\n \"So the gravitational accerlation of the planet is \"+sigformat(answer,3)+\" ms$^\\{-2\\}$.\"\n)", "templateType": "anything"}, "sk_string": {"name": "sk_string", "description": "", "group": "strings", "definition": "if(sk_switch=0,'static','kinetic')", "templateType": "anything"}, "mass": {"name": "mass", "description": "", "group": "Random answers", "definition": "g_normal_force/r_gravity", "templateType": "anything"}, "distance": {"name": "distance", "description": "", "group": "Random Variables", "definition": "random(5..20)", "templateType": "anything"}, "r_friction": {"name": "r_friction", "description": "

r_

", "group": "Random Variables", "definition": "random(30..90)*0.01", "templateType": "anything"}, "g_string": {"name": "g_string", "description": "", "group": "strings", "definition": "if(fcmg_switch<>3,'The acceleration due to gravity is g='+r_gravity+' ms$^\\{-2\\}$.','')", "templateType": "anything"}, "a_string": {"name": "a_string", "description": "", "group": "strings", "definition": "switch(\n fcmg_switch=0,\n \"force on the block, in Newtons, \"\n ,fcmg_switch=1,\n \"co-efficient of \" +sk_string+\" friction, \"\n ,fcmg_switch=2,\n \"mass of the block, in kilograms, \"\n ,fcmg_switch=3,\n \"gravitational acceleration of the planet, in ms $^\\{-2\\}$, \"\n)", "templateType": "anything"}, "sk_switch": {"name": "sk_switch", "description": "", "group": "switches", "definition": "random(0,1)", "templateType": "anything"}, "advice3": {"name": "advice3", "description": "", "group": "Ungrouped variables", "definition": "switch(\n fcmg_switch=0,\n \"$F = \" + dpformat(r_friction,1) + \" * \" + dpformat(r_mass,1) + \" * \" + dpformat(r_gravity,2)+\"$\"\n ,fcmg_switch=1,\n \"$\"+mu+\" = \\\\frac\\{\" + dpformat(r_force,0) + \"\\}\\{\" + dpformat(r_mass,1) + \" * \" + dpformat(r_gravity,2) + \"\\}$\"\n ,fcmg_switch=2,\n \"$m = \\\\frac\\{\" + dpformat(r_force,0) + \"\\}\\{\"+dpformat(r_friction,1)+\" * \" + dpformat(r_gravity,2)+\"\\}$\"\n ,fcmg_switch=3,\n \"$g = \\\\frac\\{\" + dpformat(r_force,0) + \"\\}\\{\"+dpformat(r_friction,1)+\" * \" + dpformat(r_mass,1)+\"\\}$\"\n)", "templateType": "anything"}, "r_force": {"name": "r_force", "description": "

if gravity is random

", "group": "Random Variables", "definition": "random(11..49)", "templateType": "anything"}, "c_string": {"name": "c_string", "description": "", "group": "strings", "definition": "if(fcmg_switch<>1,'The block and plane have a co-efficient of '+sk_string+' friction of '+dpformat(r_friction,2)+'.','')", "templateType": "anything"}, "sk_text": {"name": "sk_text", "description": "", "group": "strings", "definition": "if(\nsk_switch=0,\n'A block sits on a rough horizontal plane.',\n'A block is moving with a constant velocity along a rough horizontal plane.'\n)", "templateType": "anything"}, "g_normal_force": {"name": "g_normal_force", "description": "", "group": "Random Variables", "definition": "r_force/r_friction", "templateType": "anything"}, "r_mass": {"name": "r_mass", "description": "

The mass of the block.

", "group": "Random Variables", "definition": "random(11..150)*0.1", "templateType": "anything"}, "mu": {"name": "mu", "description": "", "group": "Ungrouped variables", "definition": "if(sk_switch=0,\"\\\\mu_S\",\"\\\\mu_K\")", "templateType": "anything"}, "m_string": {"name": "m_string", "description": "

m_string

", "group": "strings", "definition": "if(fcmg_switch<>2,'The block has a mass of '+dpformat(r_mass,1)+' kg.','')", "templateType": "anything"}, "advice1": {"name": "advice1", "description": "", "group": "Ungrouped variables", "definition": "\"Remember that $F_F = \"+mu+\" F_N$, and that the normal force $F_N = mg$, and that since the block has a constant velocity, with no acceration, the frictional force $F_F$ is exactly balanced by the force pushing the block $F$, $F_F = F$\"", "templateType": "anything"}, "f2_string": {"name": "f2_string", "description": "", "group": "strings", "definition": "if(\nsk_switch=0,\n', just enough to start the block moving.',\n'.'\n)", "templateType": "anything"}, "coeff": {"name": "coeff", "description": "

coeff

", "group": "Random answers", "definition": "r_force/r_normal_force", "templateType": "anything"}, "f_string": {"name": "f_string", "description": "", "group": "strings", "definition": "if(fcmg_switch<>0,'The block is pushed with a force of '+r_force+' N'+f2_string,'')", "templateType": "anything"}, "gravity": {"name": "gravity", "description": "", "group": "Random answers", "definition": "g_normal_force/r_mass", "templateType": "anything"}, "fcmg_switch": {"name": "fcmg_switch", "description": "

Calculate the force, or the co-eff, or mass, or gravity?

", "group": "switches", "definition": "random(0..3)", "templateType": "anything"}, "g_text": {"name": "g_text", "description": "", "group": "strings", "definition": "if(fcmg_switch=3,'You are on a distant planet.','')", "templateType": "anything"}, "force": {"name": "force", "description": "", "group": "Random answers", "definition": "r_normal_force*r_friction", "templateType": "anything"}, "r_normal_force": {"name": "r_normal_force", "description": "", "group": "Random Variables", "definition": "r_mass*r_gravity", "templateType": "anything"}, "advice2": {"name": "advice2", "description": "", "group": "Ungrouped variables", "definition": "switch(\n fcmg_switch=0,\n \"$F = \"+mu+\" m g$\"\n ,fcmg_switch=1,\n \"$\"+mu+\" = \\\\frac\\{F\\}\\{m g\\}$\"\n ,fcmg_switch=2,\n \"$m = \\\\frac\\{F\\}\\{\"+mu+\" g\\}$\"\n ,fcmg_switch=3,\n \"$g = \\\\frac\\{F\\}\\{\"+mu+\" m\\}$\"\n)", "templateType": "anything"}}, "functions": {"draw_block_static": {"parameters": [], "type": "html", "language": "javascript", "definition": "//Set values\ndistance = Numbas.jme.unwrapValue(scope.variables.distance);\nmass = Numbas.jme.unwrapValue(scope.variables.r_mass);\nforce = Numbas.jme.unwrapValue(scope.variables.r_force);\ncoeff = Numbas.jme.unwrapValue(scope.variables.r_friction);\ngravity = Numbas.jme.unwrapValue(scope.variables.r_gravity);\nfcmg_switch = Numbas.jme.unwrapValue(scope.variables.fcmg_switch);\n\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('600px','260px',\n//{boundingBox: [-0.1,-0.1,1.,1.],\n {boundingBox: [-0.1,0.8,2,-0.1],\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\nif (fcmg_switch == 0){force_txt='? N'} else{force_txt=force.toFixed(0)+'N'}\nif (fcmg_switch == 1){coeff_txt='\\u03BCS = ?'} else{coeff_txt='\\u03BCS = '+coeff.toFixed(2)}\nif (fcmg_switch == 2){mass_txt='? kg'} else{mass_txt=mass.toFixed(1)+'kg'}\nif (fcmg_switch == 3){gravity_txt='? ms-2'} else{gravity_txt=gravity.toFixed(1)+'ms-2'}\n\n// centre of the boxes\n\nvar b_x=0.3\nvar b_y=0.1\n\nvar b2_x=b_x+1.4\nvar b2_y=b_y\n\n\n\n//draw stuff\n\n\nvar ground = board.create('line',[[b_x-0.15,b_y-0.1],[b_x+0.15,b_y-0.1]], {straightFirst:true, straightLast:true, strokeColor: 'saddlebrown', fixed: true });\n\nvar box1_1 = board.create('line',[[b_x-0.15,b_y-0.1],[b_x-0.15,b_y+0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//\nvar box1_2 = board.create('line',[[b_x-0.15,b_y+0.1],[b_x+0.15,b_y+0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//\nvar box1_2 = board.create('line',[[b_x+0.15,b_y+0.1],[b_x+0.15,b_y-0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//\n\n//label the mass\n\nvar label_mass = board.create('text',[b_x-0.1,0.1,mass_txt],{fontSize:20});\nvar label_coeff = board.create('text',[1,-0.05,coeff_txt],{fontSize:20,Color:'saddlebrown'});\nvar label_force = board.create('text',[1,0.1,force_txt],{fontSize:20,Color:'blue'});\nvar label_gravity = board.create('text',[1.7,0.7,gravity_txt],{fontSize:20,Color:'green'});\n\n\n//label the distance\n\n\nvar dist1 = board.create('arrow',[[b_x,b_y],[0.9,b_y]], {straightFirst:false, straightLast:false, strokeColor: 'blue', fixed: true, strokeWidth:1,strokeColorOpacity:0.5 });\nvar dist2 = board.create('arrow',[[1.8,0.65],[1.8,0.55]], {straightFirst:false, straightLast:false, strokeColor: 'green', fixed: true, strokeWidth:1,strokeColorOpacity:0.5 });\n\n// and return the container div\nreturn div;"}, "draw_block_kinetic": {"parameters": [], "type": "html", "language": "javascript", "definition": "//Set values\ndistance = Numbas.jme.unwrapValue(scope.variables.distance);\nmass = Numbas.jme.unwrapValue(scope.variables.r_mass);\nforce = Numbas.jme.unwrapValue(scope.variables.r_force);\ncoeff = Numbas.jme.unwrapValue(scope.variables.r_friction);\ngravity = Numbas.jme.unwrapValue(scope.variables.r_gravity);\nfcmg_switch = Numbas.jme.unwrapValue(scope.variables.fcmg_switch);\n\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('600px','260px',\n//{boundingBox: [-0.1,-0.1,1.,1.],\n {boundingBox: [-0.1,0.8,2,-0.1],\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\nif (fcmg_switch == 0){force_txt='? N'} else{force_txt=force.toFixed(0)+'N'}\nif (fcmg_switch == 1){coeff_txt='\\u03BCK = ?'} else{coeff_txt='\\u03BCK = '+coeff.toFixed(2)}\nif (fcmg_switch == 2){mass_txt='? kg'} else{mass_txt=mass.toFixed(1)+'kg'}\nif (fcmg_switch == 3){gravity_txt='? ms-2'} else{gravity_txt=gravity.toFixed(1)+'ms-2'}\n\n// centre of the boxes\n\nvar b_x=0.3\nvar b_y=0.1\n\nvar b2_x=b_x+1.4\nvar b2_y=b_y\n\n\n\n//draw stuff\n\n\nvar ground = board.create('line',[[b_x-0.15,b_y-0.1],[b_x+0.15,b_y-0.1]], {straightFirst:true, straightLast:true, strokeColor: 'saddlebrown', fixed: true });\n\nvar box1_1 = board.create('line',[[b_x-0.15,b_y-0.1],[b_x-0.15,b_y+0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//\nvar box1_2 = board.create('line',[[b_x-0.15,b_y+0.1],[b_x+0.15,b_y+0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//\nvar box1_2 = board.create('line',[[b_x+0.15,b_y+0.1],[b_x+0.15,b_y-0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//\n//\nvar box1_1 = board.create('line',[[b2_x-0.15,b2_y-0.1],[b2_x-0.15,b2_y+0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true , dash:1});\n//\nvar box1_2 = board.create('line',[[b2_x-0.15,b2_y+0.1],[b2_x+0.15,b2_y+0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true, dash:1 });\n//\nvar box1_2 = board.create('line',[[b2_x+0.15,b2_y+0.1],[b2_x+0.15,b2_y-0.1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true, dash:1 });\n\n//label the mass\n\nvar label_mass = board.create('text',[b_x-0.1,0.1,mass_txt],{fontSize:20});\nvar label_coeff = board.create('text',[1,-0.05,coeff_txt],{fontSize:20,Color:'saddlebrown'});\nvar label_force = board.create('text',[1,0.1,force_txt],{fontSize:20,Color:'blue'});\nvar label_gravity = board.create('text',[1.7,0.7,gravity_txt],{fontSize:20,Color:'green'});\n\n\n//label the distance\n\nvar dist3 = board.create('line',[[0.05,b2_y],[b2_x,b2_y]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true, strokeWidth:1,strokeColorOpacity:0.2, lastarrow:1 , dash:1});\n\nvar dist1 = board.create('arrow',[[b_x,b_y],[0.9,b_y]], {straightFirst:false, straightLast:false, strokeColor: 'blue', fixed: true, strokeWidth:1,strokeColorOpacity:0.5 });\nvar dist2 = board.create('arrow',[[1.8,0.65],[1.8,0.55]], {straightFirst:false, straightLast:false, strokeColor: 'green', fixed: true, strokeWidth:1,strokeColorOpacity:0.5 });\n\n// and return the container div\nreturn div;"}}, "parts": [{"prompt": "

Calculate the {a_string} to three significant figures.

", "variableReplacementStrategy": "originalfirst", "maxValue": "siground(answer,3)+(siground(abs(answer),3)*0.01)", "correctAnswerStyle": "plain", "mustBeReduced": false, "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to three significant figures.", "mustBeReducedPC": 0, "showCorrectAnswer": false, "precisionType": "sigfig", "showPrecisionHint": false, "unitTests": [], "precisionPartialCredit": "50", "allowFractions": false, "minValue": "siground(answer,3)-(siground(abs(answer),3)*0.01)", "showFeedbackIcon": true, "precision": "3", "extendBaseMarkingAlgorithm": true, "marks": "2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "strictPrecision": true, "scripts": {}, "customMarkingAlgorithm": ""}], "name": "A1: Block has friction (static or kinetic)", "variablesTest": {"maxRuns": 100, "condition": "coeff<0.95"}, "tags": [], "metadata": {"description": "

A block of given mass is sits on a flat plane with defined static and kinetic friction values. Randomly, it does one of two things, it is either:

\n

1) pushed with enough force to start it moving - calculate the force on the block or the static friction.

\n

2) moving over a distance - calculate the work done or the kinetic friction

\n

(are these uneven calculations)

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "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/"}]}