// Numbas version: finer_feedback_settings {"name": "Question 22 else if ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["x", "a"], "name": "Question 22 else if ", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "
We are given that $x=\\var{x}$, which does not fit the criteria for $z=0$ or $z=1$ as these are both ranges that do not include $x=\\var{x}$.
", "rulesets": {}, "parts": [{"displayColumns": 0, "prompt": "What is the value of $z$?
", "matrix": [0, 0, "1"], "shuffleChoices": false, "variableReplacements": [], "choices": ["0
", "1
", "2
"], "variableReplacementStrategy": "originalfirst", "maxMarks": "1", "distractors": ["", "", ""], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "1_n_2", "displayType": "radiogroup", "minMarks": 0}], "extensions": [], "statement": "> x = {x}", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(1..5#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "description": ""}, "x": {"definition": "random(1..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "x", "description": ""}}, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}]}]}], "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}]}
> y = \"Male\"
> if(x > {{x}+{a}} & y == \"Female\"){
z = 0
} else if(x < {x} & y == \"Male\"){
z = 1
} else {
z = 2
}