// Numbas version: exam_results_page_options {"name": "Several variables corresponding to a scenario", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"preventleave": false, "allowregen": true, "showfrontpage": false}, "question_groups": [{"questions": [{"variable_groups": [{"name": "Data", "variables": ["cities", "populations", "percents_like_chocolate"]}, {"name": "Chosen scenario", "variables": ["scenario", "city", "population", "percent_like_chocolate", "num_like_chocolate"]}], "ungrouped_variables": [], "name": "Several variables corresponding to a scenario", "preamble": {"css": "", "js": ""}, "parts": [{"showCorrectAnswer": true, "type": "numberentry", "strictPrecision": false, "allowFractions": false, "showFeedbackIcon": true, "precisionPartialCredit": 0, "minValue": "num_like_chocolate", "showPrecisionHint": true, "precisionMessage": "You have not given your answer to the correct precision.", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "prompt": "

{percent_like_chocolate}% of the residents of {city} like chocolate.

\n

How many people in {city} like chocolate?

", "scripts": {}, "precision": 0, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "precisionType": "dp", "correctAnswerStyle": "plain", "marks": 1, "maxValue": "num_like_chocolate"}], "type": "question", "tags": [], "functions": {}, "variables": {"percent_like_chocolate": {"description": "", "definition": "percents_like_chocolate[scenario]", "name": "percent_like_chocolate", "group": "Chosen scenario", "templateType": "anything"}, "scenario": {"description": "", "definition": "random(0..len(cities)-1)", "name": "scenario", "group": "Chosen scenario", "templateType": "anything"}, "population": {"description": "", "definition": "populations[scenario]", "name": "population", "group": "Chosen scenario", "templateType": "anything"}, "percents_like_chocolate": {"description": "", "definition": "[ 12, 34, 45, 82, 71 ]", "name": "percents_like_chocolate", "group": "Data", "templateType": "list of numbers"}, "populations": {"description": "", "definition": "[ 58560, 24064, 12064, 10459, 132512 ]", "name": "populations", "group": "Data", "templateType": "list of numbers"}, "city": {"description": "", "definition": "cities[scenario]", "name": "city", "group": "Chosen scenario", "templateType": "anything"}, "cities": {"description": "", "definition": "[ \"Lowestoft\", \"Bognor Regis\", \"Maryport\", \"Fort William\", \"Norwich\" ]", "name": "cities", "group": "Data", "templateType": "list of strings"}, "num_like_chocolate": {"description": "", "definition": "round(population*percent_like_chocolate/100)", "name": "num_like_chocolate", "group": "Chosen scenario", "templateType": "anything"}}, "metadata": {"description": "

Choose from one of several pre-defined scenarios, and set variables to the corresponding values, defined in lists.

\n

This question has three variables: city, population, and percent_like_chocolate. These differ for each city. We've defined a list for each variable, with the corresponding values. A variable called scenario picks a random position in the list, so the value of city, for example, is cities[scenario].

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

Mary lives in {city}. The population of {city} is {separateThousands(population,\",\")}.

", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}], "extensions": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "

Multiply the population by the percentage:

\n

\$\\var{latex(separateThousands(population,',\\\\!'))} \\times \\var{percent_like_chocolate}\\% = \\var{num_like_chocolate} \$

", "rulesets": {}}], "pickingStrategy": "all-ordered"}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}