// Numbas version: finer_feedback_settings {"name": "CLP's Christmas Adventure", "extensions": ["jsxgraph", "written-number", "random_person", "quantities"], "custom_part_types": [{"source": {"pk": 7, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/7/edit"}, "name": "Quantity with units", "short_name": "quantity", "description": "

The student enters a quantity with units.

", "help_url": "https://github.com/numbas/numbas-extension-quantities", "input_widget": "string", "input_options": {"correctAnswer": "plain_string(settings[\"correctAnswer\"])", "hint": {"static": false, "value": "switch(\n settings[\"hint\"]=\"remind units\",\n \"Include units in your answer.\",\n settings[\"hint\"]=\"show units\",\n \"Give your answer in \"+units_string(settings[\"correctAnswer\"])\n ,\n \"\"\n)"}, "allowEmpty": {"static": true, "value": false}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\napply(valid_number);\napply(student_quantity);\napply(has_units);\napply(compatible);\ntry(\n correctif(close_enough),\n x,\n apply(student_quantity)\n);\napply(same_units)\n\ninterpreted_answer:\nstudent_quantity\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_number:\nmatch_student_number[1]\n\nraw_student_units:\ntry(\n quantity(studentAnswer[len(match_student_number[0])..len(studentAnswer)]),\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)\n\nstudent_units:\nif(compatible(raw_student_units,correct_units) or settings[\"incompatible_units_action\"]<>\"convert\",\n raw_student_units,\n correct_units\n)\n\nstudent_quantity:\napply(student_units);\ntry(\n student_number * student_units,\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\ncompatible:\nif(compatible(raw_student_units,correct_quantity),\n true\n,\n let(message,\"Your answer does not have the correct dimensions.\",\n if(settings[\"incompatible_units_action\"]=\"prevent\",\n warn(message);\n fail(message)\n ,\n if(settings[\"incompatible_units_action\"]=\"convert\",\n incorrect(\"Your answer does not have the correct dimensions. It will be marked as if the correct dimensions were used, and then a penalty will be applied.\")\n ,\n incorrect(\"Your answer does not have the correct dimensions.\");\n end()\n )\n );\n false\n )\n)\n\ncorrect_units:\nunits(correct_quantity)\n\nsame_units:\nassert(raw_student_units=correct_units,\n let(\n message,if(settings[\"hint\"]=\"show units\",\"You did not give your answer in \"+units_string(correct_units)+\".\", \"Your answer is not in the expected units.\"),\n switch(\n settings[\"different_units_action\"]=\"prevent\",\n warn(message);\n fail(message)\n ,\n settings[\"different_units_action\"]=\"incorrect\",\n incorrect(message); \n warn(message);\n end()\n ,\n settings[\"different_units_action\"]=\"warn\",\n warn(message);\n multiply_credit(1-settings[\"different_units_penalty\"],message)\n ,\n settings[\"different_units_penalty\"]<1,\n multiply_credit(1-settings[\"different_units_penalty\"],message)\n ,\n false\n )\n );\n false\n)\n\nhas_units:\nassert(not unitless(student_quantity),\n assert(settings[\"allow_unitless\"],\n warn(\"You must include the units in your answer.\");\n fail(\"You did not include units in your answer.\")\n )\n)\n\ncan_compare:\ncompatible or settings[\"incompatible_units_action\"]=\"convert\"\n\nclose_enough:\nif(can_compare,\n student_quantity>=correct_quantity - wiggle \n and \n student_quantity<=correct_quantity + wiggle \n,\n false\n)\n\nwiggle:\nunits(correct_quantity)*abs(eval(settings[\"wiggle\"]))\n\nvalid_number:\nif(isNaN(student_number),\n warn(translate(\"part.numberentry.answer invalid\"));\n fail(translate(\"part.numberentry.answer invalid\"))\n,\n true\n )", "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": "apply(valid_number);\napply(student_quantity);\napply(has_units);\napply(compatible);\ntry(\n correctif(close_enough),\n x,\n apply(student_quantity)\n);\napply(same_units)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "student_quantity"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_number", "description": "

The scalar part of the student's quantity

", "definition": "match_student_number[1]"}, {"name": "raw_student_units", "description": "

The units of the student's quantity, before converting.

", "definition": "try(\n quantity(studentAnswer[len(match_student_number[0])..len(studentAnswer)]),\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)"}, {"name": "student_units", "description": "

The units of the student's quantity.

\n

If the student used units incompatible with the units in the expected answer, and the \"what to do if incompatible units used\" option is set to \"mark as if correct units used\", the student's units are ignored and the expected units are used instead.

", "definition": "if(compatible(raw_student_units,correct_units) or settings[\"incompatible_units_action\"]<>\"convert\",\n raw_student_units,\n correct_units\n)"}, {"name": "student_quantity", "description": "

The student's answer, interpreted as a quantity.

\n

Marking fails if the student does not enter a valid quantity.

", "definition": "apply(student_units);\ntry(\n student_number * student_units,\n message,\n warn(\"Your answer is not a valid quantity.\");\n fail(\"Your answer is not a valid quantity.\")\n)"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]"}, {"name": "compatible", "description": "

Are the units of the student's quantity compatible with the units of the expected quantity?

", "definition": "if(compatible(raw_student_units,correct_quantity),\n true\n,\n let(message,\"Your answer does not have the correct dimensions.\",\n if(settings[\"incompatible_units_action\"]=\"prevent\",\n warn(message);\n fail(message)\n ,\n if(settings[\"incompatible_units_action\"]=\"convert\",\n incorrect(\"Your answer does not have the correct dimensions. It will be marked as if the correct dimensions were used, and then a penalty will be applied.\")\n ,\n incorrect(\"Your answer does not have the correct dimensions.\");\n end()\n )\n );\n false\n )\n)"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)"}, {"name": "same_units", "description": "

/Are the student's quantity and the expected quantity in exactly the same units?

", "definition": "assert(raw_student_units=correct_units,\n let(\n message,if(settings[\"hint\"]=\"show units\",\"You did not give your answer in \"+units_string(correct_units)+\".\", \"Your answer is not in the expected units.\"),\n switch(\n settings[\"different_units_action\"]=\"prevent\",\n warn(message);\n fail(message)\n ,\n settings[\"different_units_action\"]=\"incorrect\",\n incorrect(message); \n warn(message);\n end()\n ,\n settings[\"different_units_action\"]=\"warn\",\n warn(message);\n multiply_credit(1-settings[\"different_units_penalty\"],message)\n ,\n settings[\"different_units_penalty\"]<1,\n multiply_credit(1-settings[\"different_units_penalty\"],message)\n ,\n false\n )\n );\n false\n)"}, {"name": "has_units", "description": "", "definition": "assert(not unitless(student_quantity),\n assert(settings[\"allow_unitless\"],\n warn(\"You must include the units in your answer.\");\n fail(\"You did not include units in your answer.\")\n )\n)"}, {"name": "can_compare", "description": "

Can the student's answer be compared with the correct answer? True if compatible units used, or \"mark as if correct units used\" selected.

", "definition": "compatible or settings[\"incompatible_units_action\"]=\"convert\""}, {"name": "close_enough", "description": "

Is the student's quantity within the allowed tolerance of the expected answer?

", "definition": "if(can_compare,\n student_quantity>=correct_quantity - wiggle \n and \n student_quantity<=correct_quantity + wiggle \n,\n false\n)"}, {"name": "wiggle", "description": "", "definition": "units(correct_quantity)*abs(eval(settings[\"wiggle\"]))"}, {"name": "valid_number", "description": "

Is the scalar part of the student's answer a valid number?

", "definition": "if(isNaN(student_number),\n warn(translate(\"part.numberentry.answer invalid\"));\n fail(translate(\"part.numberentry.answer invalid\"))\n,\n true\n )\n"}], "settings": [{"name": "correctAnswer", "label": "Correct answer", "help_url": "", "hint": "The expected quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "hint", "label": "Input hint", "help_url": "", "hint": "", "input_type": "dropdown", "default_value": "remind units", "choices": [{"value": "none", "label": "None"}, {"value": "remind units", "label": "Remind to include units"}, {"value": "show units", "label": "Show required units"}]}, {"name": "allow_unitless", "label": "Allow unitless answer?", "help_url": "", "hint": "If not ticked, the student is prevented from submitting an answer without specifying units.", "input_type": "checkbox", "default_value": true}, {"name": "incompatible_units_action", "label": "What to do if incompatible units used", "help_url": "", "hint": "If the student's answer is given in units incompatible with the correct answer's units:
\n", "input_type": "dropdown", "default_value": "incorrect", "choices": [{"value": "incorrect", "label": "Mark as incorrect"}, {"value": "prevent", "label": "Prevent submission"}, {"value": "convert", "label": "Mark as if correct units used"}]}, {"name": "different_units_action", "label": "What to do if different units used", "help_url": "", "hint": "If the student's answer is given in different units to the expected answer:
\n", "input_type": "dropdown", "default_value": "convert", "choices": [{"value": "convert", "label": "Convert"}, {"value": "warn", "label": "Warn and convert"}, {"value": "prevent", "label": "Prevent submission"}, {"value": "incorrect", "label": "Mark incorrect"}]}, {"name": "different_units_penalty", "label": "Penalty if different units used", "help_url": "", "hint": "This penalty is applied if the student gives their answer in different units to the expected answer. The selected percentage of the student's score is taken away.", "input_type": "percent", "default_value": "100"}, {"name": "wiggle", "label": "Margin of error", "help_url": "", "hint": "The student's answer is marked correct if the difference between it and the correct answer is at most this value, measured in the same units as the correct answer.", "input_type": "mathematical_expression", "default_value": "10^-12", "subvars": true}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/sleigh_mpgHNaI.svg", "/srv/numbas/media/question-resources/sleigh_mpgHNaI.svg"], ["question-resources/merry-christmas.png", "/srv/numbas/media/question-resources/merry-christmas.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "CLP's Christmas Adventure", "tags": [], "metadata": {"description": "

A question made for the FYiMaths December meeting, to show off some of the more adventurous things you can do with Numbas.

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

You are Santa's most important helper.

\n

It's the night before the night before Christmas, and there are lots of jobs left to do. Help Santa and the elves get ready, and collect a present for each job done. When you've got all {written_number(total_jobs)}, Santa is ready to fly!

", "advice": "", "rulesets": {}, "extensions": ["jsxgraph", "quantities", "random_person", "written-number"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"jobs_done": {"name": "jobs_done", "group": "Presents", "definition": "sum(map(award(1,x), x, tasks_done))", "description": "

The number of tasks you've completed.

", "templateType": "anything", "can_override": false}, "status_display_collecting": {"name": "status_display_collecting", "group": "Presents", "definition": "safe(\"

{sleigh(jobs_done)}

\\n

You\\'ve completed {jobs_done} of {total_jobs} jobs so far.

\")", "description": "", "templateType": "long string", "can_override": false}, "total_jobs": {"name": "total_jobs", "group": "Presents", "definition": "len(tasks_done)", "description": "

The total number of tasks to do.

", "templateType": "anything", "can_override": false}, "status_display": {"name": "status_display", "group": "Presents", "definition": "if(done_all_jobs, status_display_finished, status_display_collecting)", "description": "", "templateType": "anything", "can_override": false}, "status_display_finished": {"name": "status_display_finished", "group": "Presents", "definition": "safe(\"

{sleigh(total_jobs)}

\\n

You\\'ve got all {total_jobs} presents!

\")", "description": "", "templateType": "long string", "can_override": false}, "done_all_jobs": {"name": "done_all_jobs", "group": "Presents", "definition": "jobs_done >= total_jobs", "description": "", "templateType": "anything", "can_override": false}, "nice_threshold": {"name": "nice_threshold", "group": "Naughty and nice lists", "definition": "50", "description": "

The minimum niceness score that a child must obtain to go on the 'nice' list.

", "templateType": "anything", "can_override": false}, "num_children": {"name": "num_children", "group": "Naughty and nice lists", "definition": "5", "description": "

The number of children to classify

", "templateType": "number", "can_override": false}, "children_names": {"name": "children_names", "group": "Naughty and nice lists", "definition": "sort(map(p[\"name\"],p,random_people(num_children)))", "description": "", "templateType": "anything", "can_override": false}, "children_scores": {"name": "children_scores", "group": "Naughty and nice lists", "definition": "repeat(random(0..100),num_children)", "description": "", "templateType": "anything", "can_override": false}, "naughty_nice_marking": {"name": "naughty_nice_marking", "group": "Naughty and nice lists", "definition": "map(if(score>=nice_threshold, [0,1], [1,0]), score, children_scores)", "description": "", "templateType": "anything", "can_override": false}, "list_done": {"name": "list_done", "group": "Presents", "definition": "false", "description": "

Has the list of naughty and nice children been made?

", "templateType": "anything", "can_override": false}, "tasks_done": {"name": "tasks_done", "group": "Presents", "definition": "[list_done, sleigh_weight_done, box_done]", "description": "

For each task, whether it has been done yet.

", "templateType": "anything", "can_override": false}, "present_weight": {"name": "present_weight", "group": "Balancing the load", "definition": "qty(1,\"kg\")", "description": "

The estimate of the weight of one present

", "templateType": "anything", "can_override": false}, "world_num_children": {"name": "world_num_children", "group": "Balancing the load", "definition": "2*10^9", "description": "

The estimate of the number of children in the world

", "templateType": "anything", "can_override": false}, "total_sleigh_weight": {"name": "total_sleigh_weight", "group": "Balancing the load", "definition": "world_num_children * present_weight", "description": "", "templateType": "anything", "can_override": false}, "sleigh_weight_done": {"name": "sleigh_weight_done", "group": "Presents", "definition": "false", "description": "

Has the weight of the sleigh been estimated?

", "templateType": "anything", "can_override": false}, "diagram": {"name": "diagram", "group": "Designing the box", "definition": "jessiecode(400,400,[-50,250,250,-50],safe(\"\"\"\n\n A = point(0,0) <>;\n polygon([0,0],function() { return [A.X(),0]; }, A, function() { return [0,A.Y()]; }) <>; \n\"\"\"))", "description": "", "templateType": "anything", "can_override": false}, "box_done": {"name": "box_done", "group": "Presents", "definition": "false", "description": "

Has the box size been decided upon?

", "templateType": "anything", "can_override": false}, "min_target_area": {"name": "min_target_area", "group": "Designing the box", "definition": "1.1", "description": "", "templateType": "anything", "can_override": false}, "max_target_area": {"name": "max_target_area", "group": "Designing the box", "definition": "1.5", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Presents", "variables": ["list_done", "sleigh_weight_done", "box_done", "tasks_done", "total_jobs", "jobs_done", "done_all_jobs", "status_display_collecting", "status_display_finished", "status_display"]}, {"name": "Naughty and nice lists", "variables": ["nice_threshold", "num_children", "children_names", "children_scores", "naughty_nice_marking"]}, {"name": "Balancing the load", "variables": ["world_num_children", "present_weight", "total_sleigh_weight"]}, {"name": "Designing the box", "variables": ["diagram", "min_target_area", "max_target_area"]}], "functions": {"sleigh": {"parameters": [["jobs_done", "number"]], "type": "anything", "language": "jme", "definition": "let(\n presents_text, pluralise(jobs_done, \"one present\", \"{written_number(jobs_done)} presents\"),\n max_height(5,html(\"\"\"\"\"\"))\n)"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": true, "customName": "The sleigh", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Deliver the presents!", "rawLabel": "Deliver the presents!", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "done_all_jobs", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Make the 'naughty' and 'nice' lists", "rawLabel": "Make the 'naughty' and 'nice' lists", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "not list_done", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Balance the load on the sleigh", "rawLabel": "Balance the load on the sleigh", "otherPart": 4, "variableReplacements": [], "availabilityCondition": "not sleigh_weight_done", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Pack the presents", "rawLabel": "Pack the presents", "otherPart": 6, "variableReplacements": [], "availabilityCondition": "not box_done", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

{html(status_display)}

"}, {"type": "information", "useCustomName": true, "customName": "It's Christmas!", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

{html(status_display)}

\n

\"Merry

"}, {"type": "numberentry", "useCustomName": true, "customName": "Decide what is naughty and what is nice", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Make the naughty and nice list", "rawLabel": "", "otherPart": 3, "variableReplacements": [{"variable": "nice_threshold", "definition": "interpreted_answer"}], "availabilityCondition": "answered", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Santa's most important job is to make a list of who is naughty or nice.

\n

The Child Behaviour Tabulation department produces a score between 0 and 100 for each child, where 100 means 'perfectly pleasant' and 0 means 'thoroughly rotten'.

\n

What is the lowest score that a child should receive in order to go on the 'nice' list?

", "minValue": "0", "maxValue": "100", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "m_n_x", "useCustomName": true, "customName": "Make the naughty and nice list", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Go back to the sleigh", "rawLabel": "Go back to the sleigh", "otherPart": 0, "variableReplacements": [{"variable": "list_done", "definition": "true"}], "availabilityCondition": "answered and credit=1", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The list is nearly finished. There are just a few children left to classify:

\n

{table(zip(children_names, children_scores), [\"Name\", \"Score\"])}

\n

You have decided that a child must obtain a score of {nice_threshold} in order to go on the 'nice' list.

\n

Which list should each of the remaining children go on?

", "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "radiogroup", "warningType": "none", "showCellAnswerState": true, "markingMethod": "sum ticked cells", "choices": "children_names", "matrix": "naughty_nice_marking", "layout": {"type": "all", "expression": ""}, "answers": ["Naughty", "Nice"]}, {"type": "gapfill", "useCustomName": true, "customName": "Inputs to estimate the weight", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Estimate the total weight", "rawLabel": "", "otherPart": 5, "variableReplacements": [{"variable": "world_num_children", "definition": "interpreted_answer[0]"}, {"variable": "present_weight", "definition": "interpreted_answer[1]"}], "availabilityCondition": "", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The Elf and Safety team wants to make sure that the sleigh will be safe to fly on Christmas Eve.

\n

In particular, they want to estimate its total weight, so they know how many sugar lumps to give to the reindeer.

\n

They present you with a form:

\n\n\n\n\n\n\n\n\n\n\n\n
Number of children in the world[[0]]
Average weight of one present[[1]]
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Number of children", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "quantity", "useCustomName": true, "customName": "Average present weight", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(1,\"kg\")", "hint": "remind units", "allow_unitless": true, "incompatible_units_action": "incorrect", "different_units_action": "convert", "different_units_penalty": "100", "wiggle": "10^-12"}}], "sortAnswers": false}, {"type": "quantity", "useCustomName": true, "customName": "Estimate the total weight", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Go back to the sleigh", "rawLabel": "Go back to the sleigh", "otherPart": 0, "variableReplacements": [{"variable": "sleigh_weight_done", "definition": "true"}], "availabilityCondition": "answered and credit=1", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}, {"label": "Close enough is good enough, right?", "rawLabel": "Close enough is good enough, right?", "otherPart": 0, "variableReplacements": [{"variable": "sleigh_weight_done", "definition": "true"}], "availabilityCondition": "answered and used_alternative=0", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The Elf and Safety team thank you for your estimates. Their model for the total weight of the sleigh is

\n

\\[ \\text{Total weight} = \\left(\\text{Number of children}\\right) \\times \\left(\\text{Average weight of one present}\\right) \\]

\n

Here's your completed form:

\n\n\n\n\n\n\n\n\n\n\n\n
Number of children in the world{{world_num_children}}
Average weight of one present{{present_weight}}
\n

What do you think the total weight of the sleigh will be?

", "alternatives": [{"type": "quantity", "useCustomName": true, "customName": "Right to 1 sig fig", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "alternativeFeedbackMessage": "

I see you're a fan of zequals! Your estimate is correct to one significant figure.

", "useAlternativeFeedback": false, "settings": {"correctAnswer": "siground(total_sleigh_weight,1)", "hint": "remind units", "allow_unitless": true, "incompatible_units_action": "incorrect", "different_units_action": "convert", "different_units_penalty": "100", "wiggle": "10^-12"}}], "settings": {"correctAnswer": "total_sleigh_weight", "hint": "remind units", "allow_unitless": true, "incompatible_units_action": "incorrect", "different_units_action": "convert", "different_units_penalty": "100", "wiggle": "10^-12"}}, {"type": "gapfill", "useCustomName": true, "customName": "Pack the presents", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "width: answers[0]\n\nheight: answers[1]\n\narea: width*height/(100^2)\n\nmark:\n assert(not (isnan(width) or isnan(height)),\n fail(\"You must give a number for both dimensions.\")\n );\n feedback(\"The area of your box is {area} m\u00b2.\");\n if(area >= min_target_area,\n if(area <= max_target_area,\n correct(\"That'll do!\"),\n incorrect(\"That's too big.\")\n ),\n incorrect(\"That's too small.\")\n )", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Go back to the sleigh", "rawLabel": "Go back to the sleigh", "otherPart": 0, "variableReplacements": [{"variable": "box_done", "definition": "true"}], "availabilityCondition": "answered and credit=1", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

As part of an efficiency drive, the elves want to use standard box sizes for every present. They'd like you to decide on the box's final dimensions.

\n

The box must have a total cross-sectional area of between {min_target_area}m² and {max_target_area}m²

\n

Either move the point on the diagram, or type the dimensions in the boxes below.

\n

{diagram}

\n

Width: [[0]] cm

\n

Height: [[1]] cm

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Width", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "A: diagram[\"A\"]\n\njxg_input (Update the diagram after the student's answer changes):\n if(not isnan(studentNumber) and studentNumber>0,\n [jxg_set_position(A,vector(studentNumber,jxg_position(A)[1]))]\n ,\n []\n )\n\njxg_output (Fill in the answer box after the diagram changes):\n dpformat(jxg_position(A)[0],0)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Height", "marks": "0", "scripts": {}, "customMarkingAlgorithm": "A: diagram[\"A\"]\n\njxg_input (Update the diagram after the student's answer changes):\n if(not isnan(studentNumber) and studentNumber>0,\n [jxg_set_position(A,vector(jxg_position(A)[0],studentNumber))]\n ,\n []\n )\n\njxg_output (Fill in the answer box after the diagram changes):\n dpformat(jxg_position(A)[1],0)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "0", "maxValue": "infinity", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "explore", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Laura Midgley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18287/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "http://localhost:8000/accounts/profile/1/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Laura Midgley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18287/"}]}