// Numbas version: exam_results_page_options {"name": "j's copy of Several variables corresponding to a scenario - Swansea", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "

Multiply the population by the percentage:

\n

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

", "rulesets": {}, "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"}, "tags": [], "parts": [{"prompt": "

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

\n

How many people in {city} like chocolate?

", "scripts": {}, "precision": 0, "maxValue": "num_like_chocolate", "correctAnswerStyle": "plain", "strictPrecision": false, "showFeedbackIcon": true, "variableReplacements": [], "showCorrectAnswer": true, "precisionType": "dp", "marks": 1, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "allowFractions": false, "precisionMessage": "You have not given your answer to the correct precision.", "showPrecisionHint": true, "minValue": "num_like_chocolate", "correctAnswerFraction": false, "precisionPartialCredit": 0, "variableReplacementStrategy": "originalfirst"}], "variablesTest": {"maxRuns": 100, "condition": ""}, "functions": {}, "variable_groups": [{"name": "Data", "variables": ["cities", "populations", "percents_like_chocolate"]}, {"name": "Chosen scenario", "variables": ["scenario", "city", "population", "percent_like_chocolate", "num_like_chocolate"]}], "preamble": {"js": "", "css": ""}, "name": "j's copy of Several variables corresponding to a scenario - Swansea", "variables": {"population": {"name": "population", "group": "Chosen scenario", "definition": "populations[scenario]", "description": "", "templateType": "anything"}, "populations": {"name": "populations", "group": "Data", "definition": "[ 58560, 24064, 12064, 10459, 132512 ]", "description": "", "templateType": "list of numbers"}, "percents_like_chocolate": {"name": "percents_like_chocolate", "group": "Data", "definition": "[ 12, 34, 45, 82, 71 ]", "description": "", "templateType": "list of numbers"}, "num_like_chocolate": {"name": "num_like_chocolate", "group": "Chosen scenario", "definition": "round(population*percent_like_chocolate/100)", "description": "", "templateType": "anything"}, "percent_like_chocolate": {"name": "percent_like_chocolate", "group": "Chosen scenario", "definition": "percents_like_chocolate[scenario]", "description": "", "templateType": "anything"}, "cities": {"name": "cities", "group": "Data", "definition": "[ \"Lowestoft\", \"Bognor Regis\", \"Maryport\", \"Fort William\", \"Norwich\" ]", "description": "", "templateType": "list of strings"}, "city": {"name": "city", "group": "Chosen scenario", "definition": "cities[scenario]", "description": "", "templateType": "anything"}, "scenario": {"name": "scenario", "group": "Chosen scenario", "definition": "random(0..len(cities)-1)", "description": "", "templateType": "anything"}}, "type": "question", "statement": "

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

", "ungrouped_variables": [], "extensions": [], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Angharad Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/315/"}, {"name": "j hopkins", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3761/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Angharad Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/315/"}, {"name": "j hopkins", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3761/"}]}