// Numbas version: exam_results_page_options {"name": "Numbas demo: Randomisation", "extensions": ["random_person"], "custom_part_types": [], "resources": [["question-resources/numbas-randomised-prices_PqUkZL7.svg", "/srv/numbas/media/question-resources/numbas-randomised-prices_PqUkZL7.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Numbas demo: Randomisation", "tags": [], "metadata": {"description": "

Demonstration of randomisation: many elements in this question are randomised. The names of the products and clients are randomly chosen, as are the prices and order amounts.

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

Numbas can randomise every element of a question. In this question, the names of the products and people are randomly chosen, as well as the prices and order amounts.

\n

See this question in the public editor.

\n
\n

The Newcastle Calculating Machines Emporium sells a variety of devices for performing calculations. Their two most popular products are {name_x} and {name_y}.

", "advice": "

a)

\n

The formula for the total cost of an order is

\n

\\[ \\simplify{{price_x}*{initial_x} + {price_y}*{initial_y}} \\]

\n

b)

\n

The order totals are as follows:

\n

{table(zip(names,total_costs),[\"Client\",\"Order total (£)\"])}

", "rulesets": {}, "extensions": ["random_person"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"num_people": {"name": "num_people", "group": "Ungrouped variables", "definition": "5", "description": "", "templateType": "anything", "can_override": false}, "price_x, price_y": {"name": "price_x, price_y", "group": "Ungrouped variables", "definition": "shuffle(2..6)", "description": "

The prices of the products. They are never equal.

", "templateType": "anything", "can_override": false}, "orders": {"name": "orders", "group": "Ungrouped variables", "definition": "repeat(shuffle(0..10)[0..2],num_people)", "description": "

For each person, how much of each product they ordered. Each quantity is distinct

", "templateType": "anything", "can_override": false}, "all_product_names": {"name": "all_product_names", "group": "Ungrouped variables", "definition": "[ \"Calculon\", \"Subtractrix\", \"Addios\", \"Factroid\", \"Plustre\" ]", "description": "

Possible product names. They each start with a different letter.

", "templateType": "list of strings", "can_override": false}, "total_costs": {"name": "total_costs", "group": "Ungrouped variables", "definition": "map(\n eval(cost_formula,dict([[string(initial_x),x],[string(initial_y),y]])),\n [x,y],\n orders\n)", "description": "

The total cost of each person's order.

", "templateType": "anything", "can_override": false}, "name_x, name_y": {"name": "name_x, name_y", "group": "Ungrouped variables", "definition": "shuffle(all_product_names)", "description": "

The names of the two products.

", "templateType": "anything", "can_override": false}, "order_table_data": {"name": "order_table_data", "group": "Ungrouped variables", "definition": "map([name]+order,[name,order],zip(names,orders))", "description": "

The data for the table: the person's name, then the quantities of each product ordered.

", "templateType": "anything", "can_override": false}, "names": {"name": "names", "group": "Ungrouped variables", "definition": "map(p[\"name\"],p,random_people_with_different_initials(num_people))", "description": "

Names for the people. They each start with a different letter.

", "templateType": "anything", "can_override": false}, "initial_x,initial_y": {"name": "initial_x,initial_y", "group": "Ungrouped variables", "definition": "map(name(lower(name[0])),name,[name_x,name_y])", "description": "

Variable names to use for the two products.

", "templateType": "anything", "can_override": false}, "cost_formula": {"name": "cost_formula", "group": "Ungrouped variables", "definition": "substitute([\"price_x\":price_x, \"price_y\": price_y, \"x\": initial_x, \"y\": initial_y],expression(\"price_x * x + price_y*y\"))", "description": "

The formula for the total cost of an order.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["price_x, price_y", "name_x, name_y", "initial_x,initial_y", "num_people", "names", "orders", "order_table_data", "all_product_names", "cost_formula", "total_costs"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Here is a page from the Emporium's latest catalogue:

\n

\"{name_x}:

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

Write a formula for the total cost of an order of $\\var{initial_x}$ {name_x} units and $\\var{initial_y}$ {name_y} units.

\n

Total cost = [[0]]

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{price_x}*{initial_x} + {price_y}*{initial_y}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}, {"type": "information", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The last 5 orders from the Newcastle Calculating Machines Emporium are shown below.

\n

{table(order_table_data,[\"Client\",name_x,name_y])}

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

Calculate the total cost of each order.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ClientOrder total (£)
{names[0]}[[0]]
{names[1]}[[1]]
{names[2]}[[2]]
{names[3]}[[3]]
{names[4]}[[4]]
\n

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "{names[0]}", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "cost_formula", "part": "p1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "total_costs[0]", "maxValue": "total_costs[0]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "{names[1]}", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "cost_formula", "part": "p1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "total_costs[1]", "maxValue": "total_costs[1]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "{names[2]}", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "cost_formula", "part": "p1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "total_costs[2]", "maxValue": "total_costs[2]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "{names[3]}", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "cost_formula", "part": "p1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "total_costs[3]", "maxValue": "total_costs[3]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "{names[4]}", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "cost_formula", "part": "p1", "must_go_first": false}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "total_costs[4]", "maxValue": "total_costs[4]", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}