// Numbas version: exam_results_page_options {"name": "MovableSyringe20mL (for PPE1 sample test)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/20mLSyringeImage_no_plunger_end.svg", "/srv/numbas/media/question-resources/20mLSyringeImage_no_plunger_end.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "MovableSyringe20mL (for PPE1 sample test)", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"diagram": {"name": "diagram", "group": "Ungrouped variables", "definition": "jessiecode(\n1000,220,\n[-8,0.5,55,-0.5],//[l,t,r,b]\n\"initialVol = {initialVol};\"+safe(\"\"\"\n\nwStroke1 = 0.028;\nwStroke2 = 0.028;\n// JSXGraph stroke widths\nwStroke3 = 1;\nwStroke4 = 1.5;\n \nwTip = 1.4;\nwBarrel = 7.728;\nwEnd = 0.14;\nwAll = wTip+wBarrel+wEnd;\nwLeftBarrelToEnd = wAll-(wTip+wStroke2/2);\nwPlungerOut = 4;\nwPlungerEnd = 0.35;\nwScale = 7.0-wTip;\nwCalibration = 20;\n \nhEnd = 3.388;\nhBarrel = 1.988;\nhPlungerEndLine = 0.4;\nhPlungerLeft = 0.32;\nhPlungerRight = 0.28;\nhScale = 0.5;\n \nimageXCoord = -(wTip+wStroke2/2)/(wScale/wCalibration);\nimageYCoord = -(hEnd/2)/((hBarrel-wStroke1)/hScale);\nimageWidth = wAll/(wScale/wCalibration);\nimageHeight = hEnd/((hBarrel-wStroke1)/hScale);\n\nplungerCentreLineLeftXCoord = (wLeftBarrelToEnd-wStroke1/2)/(wScale/wCalibration)+wPlungerOut;\nplungerCentreLineLeftYCoord = 0;\nplungerCentreLineRightXCoord = (wLeftBarrelToEnd-wStroke1/2)/(wScale/wCalibration)+wPlungerOut+wCalibration;\nplungerCentreLineRightYCoord = 0;\n \npOutLineLowerLeftXCoord = wLeftBarrelToEnd/(wScale/wCalibration);\npOutLineLowerLeftYCoord = -hPlungerLeft/2;\npOutLineLowerRightYCoord = -hPlungerRight/2;\npOutLineUpperLeftXCoord = pOutLineLowerLeftXCoord;\npOutLineUpperLeftYCoord = hPlungerLeft/2;\npOutLineUpperRightYCoord = hPlungerRight/2;\n \npOutLineLowerLeftXCoordStraightSection = wLeftBarrelToEnd/(wScale/wCalibration);\npOutLineLowerLeftYCoordStraightSection = -hPlungerLeft/2;\n\npOutLineUpperLeftXCoordStraightSection = pOutLineLowerLeftXCoordStraightSection;\npOutLineUpperLeftYCoordStraightSection = hPlungerLeft/2;\n\npOutLineLowerRightYCoordStraightSection = pOutLineLowerLeftYCoordStraightSection;\npOutLineUpperRightYCoordStraightSection = pOutLineUpperLeftYCoordStraightSection; \n \npOutLineLowerLeftYCoordSlopedSection = -hPlungerLeft/2;\npOutLineLowerRightYCoordSlopedSection = -hPlungerRight/2;\n \npOutLineUpperLeftYCoordSlopedSection = hPlungerLeft/2;\npOutLineUpperRightYCoordSlopedSection = hPlungerRight/2; \n \npOutMiddleLineLeftXCoord = wLeftBarrelToEnd/(wScale/wCalibration);\npOutMiddleLineLeftYCoord = 0;\n\npOutMiddleLineRightYCoord = pOutMiddleLineLeftYCoord; \n \npInLineLowerLeftXCoord = (wLeftBarrelToEnd-wStroke1/2)/(wScale/wCalibration)+wPlungerOut;\npInLineLowerYCoord = -hPlungerLeft/2;\npInLineLowerRightXCoord = (wLeftBarrelToEnd-wEnd)/(wScale/wCalibration);\npInLineUpperLeftXCoord = pInLineLowerLeftXCoord;\npInLineUpperRightXCoord = pInLineLowerRightXCoord;\npInLineUpperYCoord = hPlungerLeft/2;\n \npInMiddleLineLeftXCoord = pInLineLowerLeftXCoord;\npInMiddleLineLeftYCoord = 0;\n\npInMiddleLineRightXCoord = pInLineLowerRightXCoord;\npInMiddleLineRightYCoord = 0;\n \nim = image('resources/question-resources/20mLSyringeImage_no_plunger_end.svg', \n [imageXCoord,imageYCoord],[imageWidth,imageHeight])\n << highlight: false, fixed: true >>;\n \nplungerCentreLine = segment([plungerCentreLineLeftXCoord,plungerCentreLineLeftYCoord],[plungerCentreLineRightXCoord,plungerCentreLineRightYCoord]) << visible: false, fixed: true >>;\n\nmovingPoint = glider(initialVol+plungerCentreLineLeftXCoord,0,plungerCentreLine)\n << id: 'mp', snapToGrid: true, snapSizeX: 0.5, withLabel: false, showInfobox: false,\n size: 4, fillColor: '#00F', strokeWidth: 1, strokeColor: '#00F', highlight: true, highlightStrokeColor: '#c3d9ff'\n >>;\n\nphantom_point = point(plungerCentreLineLeftXCoord,0)\n << id: 'phantom_point', fixed: true, visible: false >>;\n \nplungerEndLine = segment([function(){ return mp.X()-plungerCentreLineLeftXCoord;},-hScale/2],[function(){ return mp.X()-plungerCentreLineLeftXCoord;},hScale/2]) \n << strokeColor: '#000', strokeWidth: 0.5, highlight: false >>;\n \n// Rectangular region of syringe containing fluid\nrp1 = point(0,-hScale/2) << visible: false, fixed: true >>;\nrp2 = point(function(){ return mp.X()-plungerCentreLineLeftXCoord;},-hScale/2) << visible: false, fixed: true >>;\nrp3 = point(function(){ return mp.X()-plungerCentreLineLeftXCoord;},hScale/2) << visible: false, fixed: true >>;\nrp4 = point(0,hScale/2) << visible: false, fixed: true >>;\nrrect = polygon(rp1,rp2,rp3,rp4) \n << fillColor: '#ff99ff', fillOpacity: 0.25, highlight: false,\n borders: << highlight: false, strokeWidth: 0 >> \n >>;\n \n// Rectangular region at 'open' end of plunger\nrepp1 = point(function(){ return mp.X()-wPlungerEnd/2;},-hPlungerEndLine/2) << visible: false, fixed: true >>;\nrepp2 = point(function(){ return mp.X()+wPlungerEnd/2;},-hPlungerEndLine/2) << visible: false, fixed: true >>;\nrepp3 = point(function(){ return mp.X()+wPlungerEnd/2;},hPlungerEndLine/2) << visible: false, fixed: true >>;\nrepp4 = point(function(){ return mp.X()-wPlungerEnd/2;},hPlungerEndLine/2) << visible: false, fixed: true >>;\neprect = polygon(repp1,repp2,repp3,repp4) \n <> >>;\n \npOutLineLowerStraightSection = segment([pOutLineLowerLeftXCoordStraightSection,pOutLineLowerLeftYCoordStraightSection],[function(){return mp.X()-wPlungerOut;},pOutLineLowerRightYCoordStraightSection]) \n << strokeColor: '#000', strokeWidth: wStroke4, highlight: false >>;\npOutLineUpperStraightSection = segment([pOutLineUpperLeftXCoordStraightSection,pOutLineUpperLeftYCoordStraightSection],[function(){return mp.X()-wPlungerOut;},pOutLineUpperRightYCoordStraightSection]) \n << strokeColor: '#000', strokeWidth: wStroke4, highlight: false >>; \n \npOutLineLowerSlopedSection = segment([function(){return mp.X()-wPlungerOut;},pOutLineLowerLeftYCoordSlopedSection],[function(){return mp.X()-wPlungerEnd/2;},pOutLineLowerRightYCoordSlopedSection]) \n << strokeColor: '#000', strokeWidth: wStroke4, highlight: false >>;\npOutLineUpperSlopedtSection = segment([function(){return mp.X()-wPlungerOut;},pOutLineUpperLeftYCoordSlopedSection],[function(){return mp.X()-wPlungerEnd/2;},pOutLineUpperRightYCoordSlopedSection]) \n << strokeColor: '#000', strokeWidth: wStroke4, highlight: false >>; \n\npOutMiddleLine = segment([pOutMiddleLineLeftXCoord,pOutMiddleLineLeftYCoord],[function(){return mp.X()-wPlungerEnd/2;},pOutMiddleLineRightYCoord]) \n << strokeColor: '#000', strokeWidth: wStroke4, highlight: false >>; \n \npInLineLower = segment([function(){ return mp.X()-pInLineLowerLeftXCoord;},pInLineLowerYCoord],[pInLineLowerRightXCoord,pInLineLowerYCoord]) \n << strokeColor: '#000', strokeWidth: wStroke4, strokeOpacity: 0.15, highlight: false >>;\npInLineUpper = segment([function(){ return mp.X()-pInLineUpperLeftXCoord;},pInLineUpperYCoord],[pInLineUpperRightXCoord,pInLineUpperYCoord])\n << strokeColor: '#000', strokeWidth: wStroke4, strokeOpacity: 0.15, highlight: false >>; \n\npInMiddleLine = segment([function(){ return mp.X()-pInMiddleLineLeftXCoord;},pInMiddleLineLeftYCoord],[pInMiddleLineRightXCoord,pInMiddleLineRightYCoord])\n << strokeColor: '#000', strokeWidth: wStroke4, strokeOpacity: 0.15, highlight: false >>; \n \n\"\"\"),\n [\n \"axis\": false,\n \"grid\": false,\n \"showNavigation\": false\n ]\n)", "description": "", "templateType": "anything", "can_override": false}, "initialVol": {"name": "initialVol", "group": "Ungrouped variables", "definition": "16", "description": "", "templateType": "anything", "can_override": false}, "answerVol": {"name": "answerVol", "group": "Ungrouped variables", "definition": "random(0..20 #1 except [0,10,initialVol])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["diagram", "initialVol", "answerVol"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "extension", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "student_pos: jxg_position(diagram[\"mp\"])[0]\n\nstudentVol: student_pos-jxg_position(diagram[\"phantom_point\"])[0]\n\nstudentVolRounded: precround(studentVol,2)\n\nmark:\n //feedback(\"studentVol = \" + studentVol);\n feedback(\"Your syringe is at {studentVolRounded} mL\");\n correctif(isclose(studentVol,answerVol,0.0001,0.005))\n\ninterpreted_answer: studentVol", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Use the syringe shown below to draw up a volume of \\(\\var{answerVol}\\) mL. Drag the blue point to move the syringe plunger.

\n

{diagram}

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}]}