// Numbas version: finer_feedback_settings {"name": "Basic R: Part 1", "duration": 0, "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "allQuestions": true, "shuffleQuestions": false, "percentPass": 0, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "pickQuestions": 0, "navigation": {"onleave": {"action": "none", "message": ""}, "reverse": true, "allowregen": true, "showresultspage": "oncompletion", "preventleave": true, "browse": true, "showfrontpage": true}, "feedback": {"showtotalmark": true, "advicethreshold": 0, "allowrevealanswer": true, "feedbackmessages": [], "showactualmark": true, "showanswerstate": true, "intro": "", "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "never"}, "type": "exam", "questions": [], "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": [{"name": "Question 1 Basic what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["x", "b", "a"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

In this question you have to remember that R can overwrite the assignment of variables.

\n

Line 1 assigns $x=\\var{x}$.

\n

In line 2 R reassigns $x$ as the solution to the equation using $x=\\var{x}$ from line 1. Thus $x=\\simplify[basic,!collectnumbers]{{a}*{x}+{b}}$, which gives $x=\\var{a*x+b}$.

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

What is the value of $x$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "scripts": {}, "choices": ["

{a*x+b}

", "

{x}

", "

{x+1}

", "

{a*x}

"], "displayType": "radiogroup", "maxMarks": "1", "marks": 0, "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": "0"}], "statement": "
> x = {x} 
> x = {a}*x+{b}
> 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..20#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "x", "description": ""}, "b": {"definition": "random(2..16#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": []}]}, {"name": "Question 2 Basic what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["x", "y", "a", "b"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) Lines 1 and 2 assign the values of $x$ and $y$.

\n

Line 3 reassigns a new value for $x$ by solving an equation involving the values in lines 1 and 2. This gives $x=\\simplify[basic,!collectnumbers]{{x}+{a}*{y}}$, therefore R has reassigned a new value for $x$. This is $x=\\var{{x}+{a}*{y}}$.

\n

Line 4 shows a calculation involving $x$. This bit is designed to catch you out. We haven't reassigned $x$ as a new value here so this doesn't change our $x$ value.

\n

Therefore the value of $x$ remains as $x=\\var{{x}+{a}*{y}}$.

\n

b) Line 2 assigns the value of $y$.

", "rulesets": {}, "parts": [{"displayColumns": 0, "prompt": "

What is the value of $x$?

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

{x+a*y}

", "

{x+a*y+b}

", "

{x}

", "

{x+b}

"], "displayType": "radiogroup", "maxMarks": "1", "scripts": {}, "marks": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}, {"displayColumns": 0, "prompt": "

What is the value of $y$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": false, "distractors": ["", "", "", ""], "choices": ["

{y}

", "

{x}

", "

{x+y}

", "

{y+2}

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

Advice section doesn't show up when you click reveal?

", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Question 3 basic what is x ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["a", "b"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) Line 1 assigns $x=\\var{a}$.

\n

b) $z=x/y$. 

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

What is the value of $x$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "scripts": {}, "choices": ["

{a}

", "

{a+a}

", "

{b+a}

", "

{b}

"], "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": false, "scripts": {}, "choices": ["

{a/b}

", "

{a+a/b}

", "

{2/b}

", "

{a}

"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}], "statement": "
> x = {a} 
> y = {b}
> x + {a}
> x
> z = x/y
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(2..20#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "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": []}]}, {"name": "Question 4 basic what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["x", "a", "b"], "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}}$.

\n

 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": false, "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": false, "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} 
> y = {a}*x
> y + 2
> x = {b}*y
> z = {b}*y
", "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": []}]}, {"name": "Question 5 what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["y"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) Line 1 assigns $y=\\var{y}$.

\n

Line 2 assigns $x=\\var{y+2}$.

\n

Line 3 reassigns $x$ using $x=\\var{y+2}$. Therefore $x=\\var{y+y+2+2}$.

\n

b) Line 5 sets $z = x + x$ but then line 6 reassigns $z$ using the previous $z$ value. 

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

What is the value of $x$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": false, "scripts": {}, "choices": ["

{y+2+y+2}

", "

{y+2}

", "

{y+y}

", "

{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": ["0", 0, 0, "1"], "shuffleChoices": false, "scripts": {}, "choices": ["

{16*y+32}

", "

{4*y+8}

", "

{3*y+6}

", "

{8*y+16}

"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}], "statement": "
> y = {y} 
> x = y + 2
> x = x + x
> x
> z = x + x
> z = z + z
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"y": {"definition": "random(2..10#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "y", "description": ""}}, "metadata": {"notes": "", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Amy's copy of Question 1 Basic what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["x", "b", "a"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

In this question you have to remember that R can overwrite the assignment of variables.

\n

Line 1 assigns $x=\\var{x}$.

\n

In line 2 R reassigns $x$ as the solution to the equation using $x=\\var{x}$ from line 1. Thus $x=\\simplify[basic,!collectnumbers]{{a}/{x}-{b}}$, which gives $x=\\var{a/x-b}$.

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

What is the value of $x$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "scripts": {}, "choices": ["

{{a/x}-b}

", "

{x}

", "

{x-b}

", "

{a/x}

"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": "0"}], "statement": "
> x = {x} 
> x = ({a}/x)-{b}
> 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..20#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "x", "description": ""}, "b": {"definition": "random(2..16#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": []}]}, {"name": "Amy's copy of Question 2 Basic what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["x", "y", "a", "b"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) Lines 1 and 2 assign the values of $x$ and $y$.

\n

Line 3 reassigns a new value for $x$ by solving an equation involving the values in lines 1 and 2. This gives $x=\\simplify[basic,!collectnumbers]{{x}-{a}/{y}}$, therefore R has reassigned a new value for $x$. This is $x=\\var{{x}-{a}/{y}}$.

\n

Line 4 shows a calculation involving $x$. This bit is designed to catch you out. We haven't reassigned $x$ as a new value here so this doesn't change our $x$ value.

\n

Therefore the value of $x$ remains as $x=\\var{{x}-{a}/{y}}$.

\n

b) Line 2 assigns the value of $y$.

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

What is the value of $x$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": true, "scripts": {}, "choices": ["

{x-(a/y)}

", "

{x-(a/y)-b}

", "

{x}

", "

{x-b}

"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}, {"prompt": "

What is the value of $y$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": false, "scripts": {}, "choices": ["

{y}

", "

{x}

", "

{x+y}

", "

{y+2}

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

Advice section doesn't show up when you click reveal?

", "description": "", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}]}, {"name": "Amy's copy of Question 3 basic what is x ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["a", "b"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) Line 1 assigns $x=\\var{a}$. The third line just involves a calculation using $x$ but no reassignment.

\n

b) $z=x - y$. 

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

What is the value of $x$?

", "matrix": ["1", 0, 0, 0], "shuffleChoices": false, "scripts": {}, "choices": ["

{a}

", "

{a*b - a}

", "

{b - a}

", "

{b}

"], "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": ["

{a - b}

", "

{a}

", "

{2/b}

", "

{a*b - a - b}

"], "marks": 0, "displayType": "radiogroup", "maxMarks": "1", "distractors": ["", "", "", ""], "displayColumns": 0, "showCorrectAnswer": true, "type": "1_n_2", "minMarks": 0}], "statement": "
> x = {a} 
> y = {b}
> (x*{b}) - {a}
> x
> z = x - y
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(2..20#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "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": []}]}, {"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}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["x", "a", "b"], "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}}$.

\n

 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} 
> y = {a} + x
> y + 2
> x = {b} + y
> z = {b} + y
", "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": []}]}, {"name": "Amy's copy of Question 5 what is x", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}], "functions": {}, "ungrouped_variables": ["y"], "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) Line 1 assigns $y=\\var{y}$.

\n

Line 2 assigns $x=\\var{y-5}$.

\n

Line 3 reassigns $x$ using $x=\\var{y-5}$. Therefore $x=\\var{y+y-5-5}$.

\n

b) 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}], "statement": "
> y = {y} 
> x = y - 5
> x = x + x
> x
> z = x + (x/2)
> z = z + 5
", "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/"}], "extensions": [], "custom_part_types": [], "resources": []}