// Numbas version: finer_feedback_settings {"name": "Amy's copy of Question 4 basic what is x", "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", "b"], "name": "Amy's copy of Question 4 basic what is x", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "
a) Line 1 assigns $x$ and line 2 assigns $y$ using $x$, therefore $y=\\var{{a}+{x}}$.
Line 3 is a calculation that uses $y$ but never reassigns any of the variables.
Line 4 then overwrites $x$ using $y$. Therefore $x=\\var{{a}+{b}+{x}}$.
b) The value of $z$ is the same as the value of $x$.
", "rulesets": {}, "parts": [{"prompt": "What is the value of $x$?
", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "scripts": {}, "choices": ["{b+a+x}
", "{b + a + x + 2}
", "{x}
", "{b + 2}
"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}, {"prompt": "What is the value of $z$?
", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "scripts": {}, "choices": ["{b+a+x}
", "{b+a}
", "{b}
", "{a*x}
"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}], "statement": "> x = {x}", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(2..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "description": ""}, "x": {"definition": "random(2..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "x", "description": ""}, "b": {"definition": "random(2..10#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/"}]}
> y = {a} + x
> y + 2
> x = {b} + y
> z = {b} + y