// Numbas version: finer_feedback_settings {"name": "2. Dosage check", "extensions": ["random_person"], "custom_part_types": [{"source": {"pk": 1, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/1/edit"}, "name": "Yes/no", "short_name": "yes-no", "description": "

The student is shown two radio choices: \"Yes\" and \"No\". One of them is correct.

", "help_url": "", "input_widget": "radios", "input_options": {"correctAnswer": "if(eval(settings[\"correct_answer_expr\"]), 0, 1)", "hint": {"static": true, "value": ""}, "choices": {"static": true, "value": ["Yes", "No"]}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nif(studentanswer=correct_answer,\n correct(),\n incorrect()\n)\n\ninterpreted_answer:\nstudentAnswer=0\n\ncorrect_answer:\nif(eval(settings[\"correct_answer_expr\"]),0,1)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=correct_answer,\n correct(),\n incorrect()\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "studentAnswer=0"}, {"name": "correct_answer", "description": "", "definition": "if(eval(settings[\"correct_answer_expr\"]),0,1)"}], "settings": [{"name": "correct_answer_expr", "label": "Is the answer \"Yes\"?", "help_url": "", "hint": "An expression which evaluates to true or false.", "input_type": "mathematical_expression", "default_value": "true", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "2. Dosage check", "tags": [], "metadata": {"description": "", "licence": "None specified"}, "statement": "", "advice": "", "rulesets": {}, "extensions": ["random_person"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"staff": {"name": "staff", "group": "Ungrouped variables", "definition": "random_people(2)", "description": "", "templateType": "anything", "can_override": false}, "doctor_name": {"name": "doctor_name", "group": "Ungrouped variables", "definition": "staff[0]['name']", "description": "", "templateType": "anything", "can_override": false}, "nurse_name": {"name": "nurse_name", "group": "Ungrouped variables", "definition": "staff[1]['name']", "description": "", "templateType": "anything", "can_override": false}, "dose": {"name": "dose", "group": "Ungrouped variables", "definition": "random(25..100 #5)", "description": "", "templateType": "anything", "can_override": false}, "stock_strength": {"name": "stock_strength", "group": "Ungrouped variables", "definition": "random(30..100 #5 except dose)", "description": "", "templateType": "anything", "can_override": false}, "stock_volume": {"name": "stock_volume", "group": "Ungrouped variables", "definition": "random(2,5,10,20)", "description": "", "templateType": "anything", "can_override": false}, "correct_volume": {"name": "correct_volume", "group": "Ungrouped variables", "definition": "precround(dose/stock_strength*stock_volume,1)", "description": "", "templateType": "anything", "can_override": false}, "distractor1": {"name": "distractor1", "group": "Ungrouped variables", "definition": "precround(stock_strength/dose*stock_volume,1)", "description": "", "templateType": "anything", "can_override": false}, "distractor2": {"name": "distractor2", "group": "Ungrouped variables", "definition": "precround(10*correct_volume,1)", "description": "", "templateType": "anything", "can_override": false}, "distractor3": {"name": "distractor3", "group": "Ungrouped variables", "definition": "precround(correct_volume/10,1)", "description": "", "templateType": "anything", "can_override": false}, "calculation": {"name": "calculation", "group": "Ungrouped variables", "definition": "if(probability<0.4,correct_volume,\n if(probability<0.6,distractor1,\n if(probability<0.8,distractor2,distractor3)))", "description": "", "templateType": "anything", "can_override": false}, "probability": {"name": "probability", "group": "Ungrouped variables", "definition": "random(0..1 #0.01)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["staff", "doctor_name", "nurse_name", "dose", "stock_strength", "stock_volume", "correct_volume", "distractor1", "distractor2", "distractor3", "calculation", "probability"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "yes-no", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Dr {doctor_name} has ordered Largactil $\\var{dose}$ mg for a patient. Stock syrup contains $\\var{stock_strength}$ mg per $\\var{stock_volume}$ mL. Your colleague {nurse_name} has calculated the volume required as $\\var{calculation}$ mL.

\n

Is this calculation correct?

", "settings": {"correct_answer_expr": "calculation=correct_volume"}}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "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/"}]}