// Numbas version: finer_feedback_settings {"name": "Question 17 function", "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 17 function", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

a) In the first part, the function takes the value $\\var{a}$ as input, and returns $\\var{2*a}$, the value multiplied by $2$.

\n

b) In the second part, the function takes $y = \\var{2*a}$ as input (set in part a) and again returns the value multiplied by $2$.

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

What is the value of $y$?

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

{2*x}

", "

2

", "

{2*a}

", "

{x}

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

{4*a}

", "

{4*x}

", "

{2*x}

", "

{2*a}

"], "variableReplacementStrategy": "originalfirst", "maxMarks": "1", "distractors": ["", "", "", ""], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "1_n_2", "displayType": "radiogroup", "minMarks": 0}], "extensions": [], "statement": "
> x = {x}
> fun1 = function(x) {
+ return(2*x)
+ }
> (y= fun1({a}))
> (z= fun1(y))
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(6..15#1)", "templateType": "randrange", "group": "Ungrouped variables", "name": "a", "description": ""}, "x": {"definition": "random(1..5#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/"}], "resources": []}]}], "contributors": [{"name": "Amy Chadwick", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/505/"}]}