// Numbas version: finer_feedback_settings {"name": "JSXGraph: interactive 2D optimisation", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "JSXGraph: interactive 2D optimisation", "tags": [], "metadata": {"description": "
A 2D linear programming problem: optimise the profit from producing two different kinds of product, which both use the same limited resources.
\nA JSXGraph diagram illustrates the problem and can be used to find an answer.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "A factory produces two items, {prod_1_name} and {prod_2_name}.
\nThey both use {resource_1_name} and {resource_2_name}.
\nYou have {max_resource_1} {resource_1_unit} {resource_1_name} and {max_resource_2} {resource_2_unit} {resource_2_name}.
\nEach {prod_1_name} uses {resource_1_per_prod_1} {resource_1_unit} {resource_1_name} and {resource_2_per_prod_1} {resource_2_unit} {resource_2_name}, and can be sold for {currency(prod_1_price,\"£\",\"p\")}.
\nEach {prod_2_name} uses {resource_1_per_prod_2} {resource_1_unit} {resource_1_name} and {resource_2_per_prod_2} {resource_2_unit} {resource_2_name}, and can be sold for {currency(prod_2_price,\"£\",\"p\")}.
\nThe graph below shows these constraints: the horizontal axis corresponds to the number of {prod_1_name} produced, and the vertical axis corresponds to the number of {prod_2_name} produced.
\nThe solid lines show the constraints corresponding to the amounts of {resource_1_name} and {resource_2_name} available, and the dashed line represents revenue.
\n{diagram}
", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"max_resource_1": {"name": "max_resource_1", "group": "Setup", "definition": "random(100..200#10)", "description": "", "templateType": "anything", "can_override": false}, "resource_1_per_prod_1": {"name": "resource_1_per_prod_1", "group": "Setup", "definition": "round(max_resource_1/random(1..10))", "description": "", "templateType": "anything", "can_override": false}, "resource_1_per_prod_2": {"name": "resource_1_per_prod_2", "group": "Setup", "definition": "round(max_resource_1/random(8..20))", "description": "", "templateType": "anything", "can_override": false}, "max_resource_2": {"name": "max_resource_2", "group": "Setup", "definition": "random(1000..2000#50)", "description": "", "templateType": "anything", "can_override": false}, "resource_2_per_prod_1": {"name": "resource_2_per_prod_1", "group": "Setup", "definition": "round(max_resource_2/random(8..20))", "description": "", "templateType": "anything", "can_override": false}, "resource_2_per_prod_2": {"name": "resource_2_per_prod_2", "group": "Setup", "definition": "round(max_resource_2/random(1..10))", "description": "", "templateType": "anything", "can_override": false}, "resource_1_name, resource_2_name": {"name": "resource_1_name, resource_2_name", "group": "Ungrouped variables", "definition": "[\"metal\", \"plastic\"]", "description": "", "templateType": "anything", "can_override": false}, "prod_1_name, prod_2_name": {"name": "prod_1_name, prod_2_name", "group": "Ungrouped variables", "definition": "[\"toy\", \"kitchen utensil\"]", "description": "", "templateType": "anything", "can_override": false}, "prod_1_price": {"name": "prod_1_price", "group": "Setup", "definition": "random(1..3#0.1)", "description": "", "templateType": "anything", "can_override": false}, "prod_2_price": {"name": "prod_2_price", "group": "Setup", "definition": "random(1..3#0.1)", "description": "", "templateType": "anything", "can_override": false}, "resource_1_unit, resource_2_unit": {"name": "resource_1_unit, resource_2_unit", "group": "Ungrouped variables", "definition": "[\"kg\", \"kg\"]", "description": "", "templateType": "anything", "can_override": false}, "diagram": {"name": "diagram", "group": "Diagram", "definition": "jessiecode(400,400,[-prod_1_max_production*0.3, prod_2_max_production*1.5, prod_1_max_production*1.5, -prod_2_max_production*0.3],\"\"\"\n l1a = point(0,{max_resource_1/resource_1_per_prod_2}) <How many of each product should you make, in order to maximise your income? You can type your answer in the boxes below, or move the point on the diagram above.
\n[[0]] {prod_1_name}
\n[[1]] {prod_2_name}
\n", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Number of {prod_1_name} to make", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "point: diagram[\"p\"]\n\npos: jxg_position(point)\n\njxg_input:\n if(pos[1]=studentNumber, [], [jxg_set_position(point, vector(studentNumber,pos[1]))])\n\njxg_output:\n dpformat(pos[0],0)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "best_x", "maxValue": "best_x", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Number of {prod_2_name} to make", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "point: diagram[\"p\"]\n\npos: jxg_position(point)\n\njxg_input:\n if(pos[1]=studentNumber, [], [jxg_set_position(point, vector(pos[0],studentNumber))])\n\njxg_output:\n dpformat(pos[1],0)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "best_y", "maxValue": "best_y", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "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/"}]}]}], "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/"}]}