// Numbas version: finer_feedback_settings {"name": "Amy's copy of Question 5 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": ["y"], "name": "Amy's copy of Question 5 what is x", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "
a) Line 1 assigns $y=\\var{y}$.
\nLine 2 assigns $x=\\var{y-5}$.
\nLine 3 reassigns $x$ using $x=\\var{y-5}$. Therefore $x=\\var{y+y-5-5}$.
\nb) Line 5 sets $z = x + (x/2)$ but then line 6 reassigns $z$ using the previous $z$ value.
", "rulesets": {}, "parts": [{"displayColumns": 0, "prompt": "What is the value of $x$?
", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "variableReplacements": [], "choices": ["{y+y-10}
", "{y-5}
", "{y}
", "{y-10}
"], "variableReplacementStrategy": "originalfirst", "maxMarks": "1", "distractors": ["", "", "", ""], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "1_n_2", "displayType": "radiogroup", "minMarks": 0}, {"displayColumns": 0, "prompt": "What is the value of $z$?
", "matrix": ["0", 0, 0, "1"], "shuffleChoices": true, "variableReplacements": [], "choices": ["{y-10}
", "{y-5}
", "{y-5+y-5}
", "{3y-10}
"], "variableReplacementStrategy": "originalfirst", "maxMarks": "1", "distractors": ["", "", "", ""], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "1_n_2", "displayType": "radiogroup", "minMarks": 0}], "extensions": [], "statement": "> y = {y}", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"y": {"definition": "random(6..9#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "y", "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/"}]}
> x = y - 5
> x = x + x
> x
> z = x + (x/2)
> z = z + 5