// Numbas version: finer_feedback_settings {"name": "Question 21 else if functions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["a", "b"], "name": "Question 21 else if functions", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

The conditional statement returns:

\n

$y=0$ of $x$ is greater than {a};

\n

$y=1$ if $x$ is less than or equal to {b};

\n

$y=2$ otherwise.

", "rulesets": {}, "parts": [{"distractors": ["", "", ""], "prompt": "

What is the value of $y$?

", "matrix": [0, "1", 0], "shuffleChoices": true, "variableReplacements": [], "choices": ["

0

", "

1

", "

2

"], "variableReplacementStrategy": "originalfirst", "displayType": "radiogroup", "maxMarks": 0, "marks": 0, "scripts": {}, "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}], "statement": "
> x = {b}
> if(x > {a}) {
y = 0
} else if(x <= {b}) {
y = 1
} else {
y = 2
}
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(7..11#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "description": ""}, "b": {"definition": "random(1..5#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "b", "description": ""}}, "metadata": {"notes": "", "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/"}]}