// Numbas version: exam_results_page_options {"name": "Explore mode - work through a list of scenarios", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Explore mode - work through a list of scenarios", "tags": [], "metadata": {"description": "

This question shows how explore mode can be used to loop through several versions of the same question. The variables for each version are stored in a list of \"scenarios\", and a counter works through that list each time the student moves on to the next part, labelled \"try the next version of this question\".

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"scenarios": {"name": "scenarios", "group": "Ungrouped variables", "definition": "[\n [\"one\", 1],\n [\"two\", 2],\n [\"three\", 3],\n [\"four\", 4],\n [\"five\", 5]\n]", "description": "

The list of scenarios. They could be any form of data; usually a list or dictionary of several values is most useful.

\n

In this example, each scenario is a list containing a word and a number.

", "templateType": "anything", "can_override": false}, "shuffled_scenarios": {"name": "shuffled_scenarios", "group": "Ungrouped variables", "definition": "shuffle(scenarios)", "description": "

The list of scenarios, shuffled so they appear in a random order.

", "templateType": "anything", "can_override": false}, "scenario_number": {"name": "scenario_number", "group": "Ungrouped variables", "definition": "0", "description": "

The number of the current scenario. This will be incremented when the student moves to the next scenario.

", "templateType": "anything", "can_override": false}, "scenario": {"name": "scenario", "group": "Ungrouped variables", "definition": "shuffled_scenarios[scenario_number]", "description": "

The current scenario.

", "templateType": "anything", "can_override": false}, "word, number": {"name": "word, number", "group": "Ungrouped variables", "definition": "scenario", "description": "

This uses destructuring to assign the variables \"word\" and \"number\" from the current scenario.

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["word, number", "scenarios", "shuffled_scenarios", "scenario_number", "scenario"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "Write this number ({scenario_number})", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Try the next version of this question", "rawLabel": "Try the next version of this question", "otherPart": 0, "variableReplacements": [{"variable": "scenario_number", "definition": "scenario_number+1"}], "availabilityCondition": "answered and scenario_number < len(scenarios)-1", "penalty": "", "penaltyAmount": 0, "showPenaltyHint": true, "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write the number {word}.

", "minValue": "number", "maxValue": "number", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "explore", "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/"}]}