// Numbas version: exam_results_page_options {"duration": 0, "navigation": {"showfrontpage": true, "showresultspage": "oncompletion", "browse": true, "reverse": true, "onleave": {"message": "", "action": "none"}, "preventleave": true, "allowregen": true}, "timing": {"timedwarning": {"message": "", "action": "none"}, "timeout": {"message": "", "action": "none"}, "allowPause": true}, "name": "Transpositions Worksheet", "question_groups": [{"pickQuestions": 1, "pickingStrategy": "all-ordered", "name": "Group", "questions": [{"name": "TP1", "extensions": [], "custom_part_types": [], "resources": [["question-resources/image_K0BP3FV.png", "/srv/numbas/media/question-resources/image_K0BP3FV.png"], ["question-resources/image_jS71fGY.png", "/srv/numbas/media/question-resources/image_jS71fGY.png"], ["question-resources/image_8rDGI2c.png", "/srv/numbas/media/question-resources/image_8rDGI2c.png"], ["question-resources/image_AgeDfYh.png", "/srv/numbas/media/question-resources/image_AgeDfYh.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "parts": [{"variableReplacementStrategy": "originalfirst", "sortAnswers": false, "prompt": "

$3x+A=5+A$ [[0]]

", "type": "gapfill", "scripts": {}, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCellAnswerState": true, "type": "1_n_2", "scripts": {}, "customMarkingAlgorithm": "", "maxMarks": 0, "displayType": "radiogroup", "matrix": ["1", 0], "showCorrectAnswer": true, "showFeedbackIcon": true, "distractors": ["Well done. The statement is true, as we are adding the same thing to both sides. Increasing the left hand side and the right hand side by the same amount means that the sides are still equal.", "Your answer is incorrect. The statement is true, as we are adding the same thing to both sides. Increasing the left hand side and the right hand side by the same amount means that the sides are still equal."], "displayColumns": 0, "unitTests": [], "minMarks": 0, "marks": 0, "extendBaseMarkingAlgorithm": true, "choices": ["True", "False"], "shuffleChoices": false}], "unitTests": [], "variableReplacements": [], "marks": 0, "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "sortAnswers": false, "prompt": "

$9x^2=25$ [[0]]

", "type": "gapfill", "scripts": {}, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCellAnswerState": true, "type": "1_n_2", "scripts": {}, "customMarkingAlgorithm": "", "maxMarks": 0, "displayType": "radiogroup", "matrix": ["1", 0], "showCorrectAnswer": true, "showFeedbackIcon": true, "distractors": ["Correct - the statement is true. Both sides were squared - i.e. the same thing was done to both sides. Multiplying both sides by the same thing means both sides are still equal. Since $3x=5$, multiplying by $3x$ is the same as multiplying by $5$ (i.e. multiplying the left hand side by $3x$ and the right hand side by $5$ is doing the same thing to both sides.)", "Incorrect - the statement is true. Both sides were squared - i.e. the same thing was done to both sides. Multiplying both sides by the same thing means both sides are still equal. Since $3x=5$, multiplying by $3x$ is the same as multiplying by $5$ (i.e. multiplying the left hand side by $3x$ and the right hand side by $5$ is doing the same thing to both sides.)"], "displayColumns": 0, "unitTests": [], "minMarks": 0, "marks": 0, "extendBaseMarkingAlgorithm": true, "choices": ["True", "False"], "shuffleChoices": false}], "unitTests": [], "variableReplacements": [], "marks": 0, "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "sortAnswers": false, "prompt": "

$x=5-3$ [[0]]

", "type": "gapfill", "scripts": {}, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCellAnswerState": true, "type": "1_n_2", "scripts": {}, "customMarkingAlgorithm": "", "maxMarks": 0, "displayType": "radiogroup", "matrix": [0, "1"], "showCorrectAnswer": true, "showFeedbackIcon": true, "distractors": ["Incorrect - the statement is false. To get $x$ on its own on the left hand side, we need to divide by $3$. To keep both sides equal, we must do the same to the right hand side. If we subtract $3$ instead, we have done something different to each side, so the sides are no longer equal.", "Correct - the statement is false. To get $x$ on its own on the left hand side, we need to divide by $3$. To keep both sides equal, we must do the same to the right hand side. If we subtract $3$ instead, we have done something different to each side, so the sides are no longer equal."], "displayColumns": 0, "unitTests": [], "minMarks": 0, "marks": 0, "extendBaseMarkingAlgorithm": true, "choices": ["True", "False"], "shuffleChoices": false}], "unitTests": [], "variableReplacements": [], "marks": 0, "extendBaseMarkingAlgorithm": true}, {"variableReplacementStrategy": "originalfirst", "sortAnswers": false, "prompt": "

$x=\\frac{5}{-3}$ [[0]]

", "type": "gapfill", "scripts": {}, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "showFeedbackIcon": true, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "showCellAnswerState": true, "type": "1_n_2", "scripts": {}, "customMarkingAlgorithm": "", "maxMarks": 0, "displayType": "radiogroup", "matrix": [0, "1"], "showCorrectAnswer": true, "showFeedbackIcon": true, "distractors": ["Incorrect - the statement is false. To get $x$ on its own on the left hand side, we need to divide by $3$. To keep both sides equal, we must do the same to the right hand side. If we divide the right hand side by $-3$ instead, we have divided the left by $3$ but the right by $-3$ i.e. we have done something different to each side, so they are no longer equal.", "Correct - the statement is false. To get $x$ on its own on the left hand side, we need to divide by $3$. To keep both sides equal, we must do the same to the right hand side. If we divide the right hand side by $-3$ instead, we have divided the left by $3$ but the right by $-3$ i.e. we have done something different to each side, so they are no longer equal."], "displayColumns": 0, "unitTests": [], "minMarks": 0, "marks": 0, "extendBaseMarkingAlgorithm": true, "choices": ["True", "False"], "shuffleChoices": false}], "unitTests": [], "variableReplacements": [], "marks": 0, "extendBaseMarkingAlgorithm": true}], "variable_groups": [], "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "statement": "

If $3x=5$, decide whether each of the following statements is true or false.

", "preamble": {"css": "", "js": ""}, "ungrouped_variables": [], "advice": "", "functions": {}, "variables": {}, "metadata": {"description": "", "licence": "None specified"}, "tags": [], "type": "question"}, {"name": "TP2", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "ungrouped_variables": [], "tags": [], "functions": {}, "variables": {}, "statement": "

In the following formula, $r$ represents the thickness of an engineering part. In an exam, students had to re-arrange (transpose) the formula to write $r$ as the subject.

\n

\\[ p=\\frac{r^2+q^2}{L} \\]

\n

Below are two solutions by two different students. At least one of these solutions is incorrect.

", "advice": "", "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "metadata": {"description": "", "licence": "None specified"}, "parts": [{"variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "showFeedbackIcon": true, "marks": 0, "sortAnswers": false, "gaps": [{"variableReplacementStrategy": "originalfirst", "shuffleChoices": false, "displayColumns": 0, "customMarkingAlgorithm": "", "showFeedbackIcon": false, "minMarks": 0, "marks": 0, "showCellAnswerState": false, "choices": ["Solution A is correct", "Solution A is incorrect"], "distractors": ["", ""], "matrix": ["1", "0"], "type": "1_n_2", "scripts": {}, "displayType": "radiogroup", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "variableReplacements": [], "maxMarks": 0}, {"variableReplacementStrategy": "originalfirst", "shuffleChoices": false, "displayColumns": 0, "customMarkingAlgorithm": "", "showFeedbackIcon": false, "minMarks": 0, "marks": 0, "showCellAnswerState": true, "choices": ["Solution B is correct", "Solution B is incorrect"], "distractors": ["", ""], "matrix": [0, "1"], "type": "1_n_2", "scripts": {}, "displayType": "radiogroup", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "variableReplacements": [], "maxMarks": 0}], "prompt": "

Decide whether each solution is correct or incorrect:

\n

Solution A:

\n

$p = \\frac{r^2+q^2}{L}$

\n

$pL = r^2 + q^2$

\n

$pL - q^2 = r^2$

\n

$r = \\sqrt{pL - q^2}$

\n

\n

[[0]]

\n

\n

Solution B:

\n

$p = \\frac{r^2+q^2}{L}$

\n

$pL = r^2 + q^2$

\n

$\\sqrt{pL} = r + q$

\n

$r = \\sqrt{pL} - q$

\n

[[1]]

", "type": "gapfill", "scripts": {}, "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "variableReplacements": []}, {"variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "showFeedbackIcon": true, "marks": 0, "sortAnswers": false, "gaps": [{"scripts": {}, "marks": 0, "minMarks": 0, "unitTests": [], "shuffleChoices": false, "distractors": ["", "", "", ""], "type": "m_n_2", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": false, "choices": ["$pL = r^2+q^2$", "$pL-q^2=r^2$", "$r=\\sqrt{pL-q^2}$", "None of these - solution A is correct"], "maxAnswers": 0, "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "displayColumns": "1", "matrix": [0, 0, 0, "1"], "showFeedbackIcon": false, "warningType": "none", "variableReplacements": [], "minAnswers": 0, "displayType": "checkbox", "showCellAnswerState": true}, {"scripts": {}, "marks": 0, "minMarks": 0, "unitTests": [], "shuffleChoices": false, "distractors": ["", "", "", ""], "type": "m_n_2", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": false, "choices": ["$pL = r^2 + q^2$", "$\\sqrt{pL} = r + q$", "$r = \\sqrt{pL} - q$", "None of these - solution B is correct"], "maxAnswers": 0, "maxMarks": 0, "variableReplacementStrategy": "originalfirst", "displayColumns": "1", "matrix": [0, "1", 0, 0], "showFeedbackIcon": false, "warningType": "none", "variableReplacements": [], "minAnswers": 0, "displayType": "checkbox", "showCellAnswerState": true}], "prompt": "

Select the part(s) of the solution(s) where the mistake is made.

\n

Solution A:

\n

$p = \\frac{r^2+q^2}{L}$

\n

[[0]]

\n

\n

Solution B:

\n

$p = \\frac{r^2+q^2}{L}$

\n

[[1]]

\n

", "type": "gapfill", "scripts": {}, "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "variableReplacements": []}, {"variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "showFeedbackIcon": true, "marks": 0, "prompt": "

For each part you selected in part (b), write down on a sheet of paper why you thought that step was incorrect. Click on the \"Show steps\" button below to see if your answers above were correct.

", "type": "information", "scripts": {}, "steps": [{"variableReplacementStrategy": "originalfirst", "prompt": "

Recall that, in order to keep both sides equal, if you change one side, you must change the other side in the same way i.e. do the same thing to both sides.

\n

Solution A is correct. The steps for solution A are:

\n

$p = \\frac{r^2 + q^2}{L}$

\n

$pL = r^2 + q^2$                   Correct. Multiplying both sides by $L$.

\n

$pL - q^2 = r^2$                    Correct. Subtracting $q^2$ from both sides.

\n

$r = \\sqrt{pL - q^2}$             Correct. Taking the positive square root of both sides. (Remember that $r$ represents a thickness and so cannot be negative. Therefore, when taking the square root, we do not need to include $\\pm$ in this example.)

\n

\n

\n

Solution B is incorrect. The steps for solution B are:

\n

$p = \\frac{r^2 + q^2}{L}$

\n

$pL = r^2 + q^2$                  Correct. Multiplying both sides by $L$.

\n

$\\sqrt{pL} = r + q$             Incorrect. The square root is not linear, that is, $\\sqrt{r^2 +q^2} \\neq \\sqrt{r^2} + \\sqrt{q^2}$. For example $\\sqrt{3^2+4^2} = \\sqrt{9+16}=\\sqrt{25}=5$ but $\\sqrt{3^2}+\\sqrt{4^2}=3+4=7 \\neq 5$.  So in this step, we have taken the square root of the left hand side, but have not correctly taken the square root of the right hand side. This means that the same thing has not been done to both sides and so the two sides are no longer equal.

\n

$r = \\sqrt{pL} - q$                 Correct. There is nothing wrong with this step - if the previous step had been correct, here $q$ is being subtracted from both sides.

", "type": "information", "scripts": {}, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "marks": 0, "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": ""}], "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "variableReplacements": [], "stepsPenalty": 0}], "type": "question"}, {"name": "TP3", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "ungrouped_variables": [], "metadata": {"licence": "None specified", "description": ""}, "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"extendBaseMarkingAlgorithm": true, "variableReplacementStrategy": "originalfirst", "steps": [{"showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "prompt": "

If we begin with the first equation, $3x-4y=4$, where the left hand side is equal to the right hand side, we can keep the two sides equal as long as we do the same thing to both sides. In particular, if we add the same thing to both sides, the two sides will still be equal.

\n

For example, if we add $7$ to both sides we get:

\n

\\[ 3x-4y \\color{red}{+7}=4 \\color{red}{+7} \\]

\n

Or, if we add $2x$ to both sides, we get:

\n

\\[ 3x-4y \\color{red}{+2x}=4 \\color{red}{+2x} \\]

\n

This second example could also be written as

\n

\\[ 3x-4y \\color{red}{+2x}=4 \\color{red}{+x+x} \\]

\n

since $2x=x+x$. So although what we're adding to the left hand side might look a little different to what we're adding to the right hand side, they are really the same thing and so the two sides are still equal.

\n

Now, the 2nd equation in our pair of simultaneous equations above states that $6x+4y=12$. This means that adding $6x+4y$ is the same as adding $12$ (since they are equal to each other). Therefore, if we begin with the first equation, $3x-4y=4$ we can add $6x+4y$ to the left hand side and add $12$ to the right hand side. This gives

\n

\\[ 3x-4y \\color{red}{+6x+4y}=4 \\color{red}{+12} \\]

\n

In the same way as adding $2x$ to one side and adding $x+x$ to the other side is the same, adding $6x+4y$ to the left hand side and adding $12$ to the right hand side is also doing the same thing to both sides, thereby keeping the two sides equal to one another.

", "variableReplacements": [], "customMarkingAlgorithm": "", "scripts": {}, "marks": 0, "unitTests": [], "type": "information", "showCorrectAnswer": true}], "variableReplacements": [], "unitTests": [], "type": "gapfill", "showCorrectAnswer": true, "showFeedbackIcon": true, "customMarkingAlgorithm": "", "sortAnswers": false, "stepsPenalty": 0, "marks": 0, "scripts": {}, "prompt": "

Click on the \"Show steps\" button below to check your answer.

"}], "statement": "

Consider the following simultaneous equations:

\n

\\[ \\begin{align*} 3x-4y & = 4\\\\ 6x+4y & = 12  \\end{align*} \\]

\n

One way of solving these is to begin by adding the two equations together. On your page, write down why you think this is a valid thing to do (i.e. why this is mathematically correct).

", "variables": {}, "advice": "", "tags": [], "rulesets": {}, "variable_groups": [], "preamble": {"css": "", "js": ""}, "type": "question"}, {"name": "TP4", "extensions": [], "custom_part_types": [{"source": {"pk": 2, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/2/edit"}, "name": "List of numbers", "short_name": "list-of-numbers", "description": "

The answer is a comma-separated list of numbers.

\n

The list is marked correct if each number occurs the same number of times as in the expected answer, and no extra numbers are present.

\n

You can optionally treat the answer as a set, so the number of occurrences doesn't matter, only whether each number is included or not.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "join(\n if(settings[\"correctAnswerFractions\"],\n map(let([a,b],rational_approximation(x), string(a/b)),x,settings[\"correctAnswer\"])\n ,\n settings[\"correctAnswer\"]\n ),\n settings[\"separator\"] + \" \"\n)", "hint": {"static": false, "value": "if(settings[\"show_input_hint\"],\n \"Enter a list of numbers separated by {settings['separator']}.\",\n \"\"\n)"}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "bits:\nlet(b,filter(x<>\"\",x,split(studentAnswer,settings[\"separator\"])),\n if(isSet,list(set(b)),b)\n)\n\nexpected_numbers:\nlet(l,settings[\"correctAnswer\"] as \"list\",\n if(isSet,list(set(l)),l)\n)\n\nvalid_numbers:\nif(all(map(not isnan(x),x,interpreted_answer)),\n true,\n let(index,filter(isnan(interpreted_answer[x]),x,0..len(interpreted_answer)-1)[0], wrong, bits[index],\n warn(wrong+\" is not a valid number\");\n fail(wrong+\" is not a valid number.\")\n )\n )\n\nis_sorted:\nassert(sort(interpreted_answer)=interpreted_answer,\n multiply_credit(0.5,\"Not in order\")\n )\n\nincluded:\nmap(\n let(\n num_student,len(filter(x=y,y,interpreted_answer)),\n num_expected,len(filter(x=y,y,expected_numbers)),\n switch(\n num_student=num_expected,\n true,\n num_studentThe separate items in the student's answer

", "definition": "let(b,filter(x<>\"\",x,split(studentAnswer,settings[\"separator\"])),\n if(isSet,list(set(b)),b)\n)"}, {"name": "expected_numbers", "description": "", "definition": "let(l,settings[\"correctAnswer\"] as \"list\",\n if(isSet,list(set(l)),l)\n)"}, {"name": "valid_numbers", "description": "

Is every number in the student's list valid?

", "definition": "if(all(map(not isnan(x),x,interpreted_answer)),\n true,\n let(index,filter(isnan(interpreted_answer[x]),x,0..len(interpreted_answer)-1)[0], wrong, bits[index],\n warn(wrong+\" is not a valid number\");\n fail(wrong+\" is not a valid number.\")\n )\n )"}, {"name": "is_sorted", "description": "

Are the student's answers in ascending order?

", "definition": "assert(sort(interpreted_answer)=interpreted_answer,\n multiply_credit(0.5,\"Not in order\")\n )"}, {"name": "included", "description": "

Is each number in the expected answer present in the student's list the correct number of times?

", "definition": "map(\n let(\n num_student,len(filter(x=y,y,interpreted_answer)),\n num_expected,len(filter(x=y,y,expected_numbers)),\n switch(\n num_student=num_expected,\n true,\n num_studentHas every number been included the right number of times?

", "definition": "all(included)"}, {"name": "no_extras", "description": "

True if the student's list doesn't contain any numbers that aren't in the expected answer.

", "definition": "if(all(map(x in expected_numbers, x, interpreted_answer)),\n true\n ,\n incorrect(\"Your answer contains \"+extra_numbers[0]+\" but should not.\");\n false\n )"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "if(lower(studentAnswer) in [\"empty\",\"\u2205\"],[],\n map(\n if(settings[\"allowFractions\"],parsenumber_or_fraction(x,notationStyles), parsenumber(x,notationStyles))\n ,x\n ,bits\n )\n)"}, {"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=\"\",fail(\"You have not entered an answer\"),false);\napply(valid_numbers);\napply(included);\napply(no_extras);\ncorrectif(all_included and no_extras)"}, {"name": "notationStyles", "description": "", "definition": "[\"en\"]"}, {"name": "isSet", "description": "

Should the answer be considered as a set, so the number of times an element occurs doesn't matter?

", "definition": "settings[\"isSet\"]"}, {"name": "extra_numbers", "description": "

Numbers included in the student's answer that are not in the expected list.

", "definition": "filter(not (x in expected_numbers),x,interpreted_answer)"}], "settings": [{"name": "correctAnswer", "label": "Correct answer", "help_url": "", "hint": "The list of numbers that the student should enter. The order does not matter.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "allowFractions", "label": "Allow the student to enter fractions?", "help_url": "", "hint": "", "input_type": "checkbox", "default_value": false}, {"name": "correctAnswerFractions", "label": "Display the correct answers as fractions?", "help_url": "", "hint": "", "input_type": "checkbox", "default_value": false}, {"name": "isSet", "label": "Is the answer a set?", "help_url": "", "hint": "If ticked, the number of times an element occurs doesn't matter, only whether it's included at all.", "input_type": "checkbox", "default_value": false}, {"name": "show_input_hint", "label": "Show the input hint?", "help_url": "", "hint": "", "input_type": "checkbox", "default_value": true}, {"name": "separator", "label": "Separator", "help_url": "", "hint": "The substring that should separate items in the student's list", "input_type": "string", "default_value": ",", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "advice": "

We wish to solve for $x$, so we must get $x$ on its own. At the moment, the only $x$ in the equation is under the square root. Because there is something else (in this case a 9) being added to the $x^2$ under the square root, the $x^2$ and the 9 are trapped together until the square root is gone.

\n

How can we get rid of a square root? Ans: Apply the inverse function of the square root (i.e. do the opposite of taking the square root) which is to square.

\n

Remember, if we wish to keep the equation balanced i.e. keep both sides equal, we must always do the same thing to both sides. So, if we square the left hand side in order to get rid of the square root, we must also square the right hand side:

\n

\\[ \\begin{align*} \\left( \\sqrt{x^2 + 9} \\right)^{\\color{red}{2}} & = 5^{\\color{red}{2}}\\\\ \\Rightarrow \\  x^2 + 9 & = 25 \\end{align*}\\]

\n

Now that the square root is gone, the $x^2$ and the 9 are no longer trapped together. If we wish to get $x^2$ on its own therefore, we can now get rid of the 9 that is being added on the left hand side. How do we do this? Ans: Apply the inverse function of adding (i.e. do the opposite to adding) which is subtracting. So we subtract 9. As before, if we wish to keep the equation balanced i.e. keep both sides equal, we must do the same to both sides. So, if we subtract 9 from the left hand side, we must also subtract 9 from the right hand side:

\n

\\[ \\begin{align*} x^2 + 9 \\color{red}{- 9} & = 25 \\color{red}{- 9}\\\\ \\Rightarrow \\ x^2 & = 16  \\end{align*} \\]

\n

Finally, we wish to find $x$ rather than $x^2$, so we apply the inverse function of squaring (i.e. do the opposite of squaring). The inverse of squaring is to take the square root. Again, in order to keep both sides equal, we must also take the square root of the right hand side:

\n

\\[ \\begin{align*} \\color{red}{\\sqrt{\\color{black}{x^2}}} & = \\color{red}{\\sqrt{\\color{black}{16}}}\\\\ x & = \\color{red}{\\pm} 4  \\end{align*}.\\]

\n

Note: When taking the square root (or fourth root or sixth root or any even root) we must always remember to include the negative solutions e.g. $4^2=16$ but so also is $(-4)^2$. If we only include the positive square root of 4, we are missing out on the solution of -4.

", "variables": {}, "variable_groups": [], "ungrouped_variables": [], "preamble": {"css": "", "js": ""}, "tags": [], "variablesTest": {"condition": "", "maxRuns": 100}, "rulesets": {}, "statement": "

Given the equation $\\sqrt{x^2+9}=5$, solve for $x$.

", "metadata": {"description": "", "licence": "None specified"}, "functions": {}, "parts": [{"showCorrectAnswer": true, "unitTests": [], "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "type": "gapfill", "variableReplacements": [], "scripts": {}, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "sortAnswers": false, "prompt": "

$x= $ [[0]]

\n

", "marks": 0, "gaps": [{"showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "type": "list-of-numbers", "settings": {"correctAnswer": "[-4,4]"}, "marks": "4", "unitTests": [], "scripts": {"mark": {"order": "instead", "script": "var answer=this.studentAnswer;\n// mark the answer\nif(answer==[-4,4]) {\n this.setCredit(1,'Correct. Well done!');\n} else if(answer==[4,-4]) {\n this.setCredit(1,'Correct. Well done!');\n} else if(answer==4) {\n this.setCredit(0.5,'Some good work here, but not quite there yet. Did you remember to take the positive and negative square root?');\n} else if(answer==-4){\n this.setCredit(0.5, 'Some good work here, but not quite there yet. Did you remember to take the positive and negative square root?');\n} else{\n this.setCredit(0,'Not correct');\n}\n\n// you must set this.answered to say if the student gave a valid answer\nthis.answered = answer!==undefined;"}}}]}], "type": "question"}, {"name": "TP5", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}], "advice": "

We wish to make $p$ the subject, so we must get $p$ on its own. At the moment, the only $p$ in the equation is under the square root (where we see $2np$). Because there is something else (in this case a $10m$) being subtracted from the $2np$ under the square root, the $2np$ and the $10m$ are trapped together until the square root is gone.

\n

How can we get rid of a square root? Ans: Apply the inverse function of the square root (i.e. do the opposite of taking the square root) which is to square.

\n

Remember, if we wish to keep the equation balanced i.e. keep both sides equal, we must always do the same thing to both sides. So, if we square the right hand side in order to get rid of the square root, we must also square the left hand side:

\n

\\[ \\begin{align*} n^{\\color{red}{2}} & = \\left( \\sqrt{2np-10m} \\right)^{\\color{red}{2}}\\\\ \\Rightarrow \\  n^2 & = 2np - 10m \\end{align*}\\]

\n

Now that the square root is gone, the $2np$ and the $10m$ are no longer trapped together. If we wish to get $2np$ on its own therefore, we can now get rid of the $10m$ that is being subtracted on the right hand side. How do we do this? Ans: Apply the inverse function of subtracting (i.e. do the opposite to subtracting) which is adding. So we add $10m$. As before, if we wish to keep the equation balanced i.e. keep both sides equal, we must do the same to both sides. So, if we add $10m$ to the right hand side, we must also add $10m$ to the left hand side:

\n

\\[ \\begin{align*} n^2 \\color{red}{+10m} & = 2np - 10m \\color{red}{+10m}\\\\ \\Rightarrow \\ n^2 + 10m & = 2np \\end{align*} \\]

\n

Next, we wish to find $p$ rather than $2np$, so we need to get rid of the $2n$ that is being multiplied by $p$. How do we do this? Ans: Apply the inverse function of multiplying (i.e. do the opposite of multiplying). The inverse of multiplying is dividing, so we divide the right hand side by $2n$. Again, in order to keep both sides equal, we must also divide the left hand side by $2n$:

\n

\\[ \\begin{align*} \\frac{n^2 + 10m}{\\color{red}{2n}} & = \\frac{2np}{\\color{red}{2n}}\\\\ \\frac{n^2+10m}{2n} & = p \\end{align*} \\]

\n

To simplify our answer as much as possible, we can split our fraction on the left hand side into two separate fractions and try to write each fraction in its simplest form. Splitting the fraction on the left into two separate fractions gives: 

\n

\\[ \\color{red}{\\frac{n^2}{2n} + \\frac{10m}{2n}} = p \\]

\n

Now writing each of the two fractions in its simplest form (dividing the top and bottom of the first fraction by $n$ and dividing the top and bottom of the second fraction by $2$:

\n

\\[ \\frac{n}{2} + \\frac{5m}{n} = p \\]

", "variables": {}, "preamble": {"css": "", "js": ""}, "rulesets": {}, "variable_groups": [], "metadata": {"licence": "None specified", "description": ""}, "parts": [{"variableReplacements": [], "sortAnswers": false, "showCorrectAnswer": true, "prompt": "

$p = $ [[0]]

", "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "gapfill", "showFeedbackIcon": true, "useCustomName": false, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 0, "unitTests": [], "gaps": [{"variableReplacements": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "showCorrectAnswer": true, "checkingAccuracy": 0.001, "answer": "n/2+5m/n", "failureRate": 1, "scripts": {}, "extendBaseMarkingAlgorithm": true, "type": "jme", "showFeedbackIcon": true, "showPreview": true, "useCustomName": false, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": "2", "valuegenerators": [{"name": "m", "value": ""}, {"name": "n", "value": ""}], "unitTests": [], "checkingType": "absdiff", "checkVariableNames": false, "customName": ""}], "customName": ""}], "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": [], "functions": {}, "statement": "

Rearrange the equation $n=\\sqrt{2np-10m}$ to make $p$ the subject, simplifying your answer as much as possible.

\n

[Hint: Your answer should be two separate fractions.]

", "tags": []}, {"name": "TP6", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "parts": [{"showFeedbackIcon": true, "prompt": "

\n

$y = $ [[0]]

", "variableReplacements": [], "sortAnswers": false, "showCorrectAnswer": true, "marks": 0, "variableReplacementStrategy": "originalfirst", "unitTests": [], "extendBaseMarkingAlgorithm": true, "scripts": {}, "customMarkingAlgorithm": "", "steps": [{"showFeedbackIcon": true, "scripts": {}, "prompt": "

It may be helpful to factor out y. For example: 

\n

\\[\\simplify{x^{{n1}}*y+{n2}*y*x - {n3}*y}=y(\\simplify{x^{{n1}} + {n2}*x - {n3}})\\]

", "showCorrectAnswer": true, "variableReplacements": [], "customMarkingAlgorithm": "", "marks": 0, "type": "information", "variableReplacementStrategy": "originalfirst", "unitTests": [], "extendBaseMarkingAlgorithm": true}], "type": "gapfill", "stepsPenalty": 0, "gaps": [{"showFeedbackIcon": true, "checkVariableNames": false, "variableReplacements": [], "showCorrectAnswer": true, "vsetRangePoints": 5, "expectedVariableNames": [], "variableReplacementStrategy": "originalfirst", "unitTests": [], "extendBaseMarkingAlgorithm": true, "failureRate": 1, "scripts": {}, "customMarkingAlgorithm": "", "showPreview": true, "vsetRange": [0, 1], "type": "jme", "answer": "{n4}/(x^{{n1}} + {n2}*x-{n3})", "marks": "5", "checkingType": "absdiff", "checkingAccuracy": 0.001}]}], "tags": [], "functions": {}, "advice": "

Here, we first have to collect all terms involving $y$ on the same side. Hence, we get:

\n

\\[\\simplify{x^{{n1}}*y+{n2}*y*x - {n3}*y} = \\var{n4}\\]

\n

We then spot that $y$ appears exactly once in each term on the left, so factorise:

\n

\\[y(\\simplify{x^{{n1}} + {n2}*x - {n3}}) = \\var{n4}\\]

\n

and simple division gives the answer.

", "rulesets": {}, "ungrouped_variables": ["n1", "n2", "n3", "n4"], "statement": "

Consider the equation:

\n

\\[\\simplify{x^{{n1}}*y + {n2}*y*x} = \\simplify{{n3}*y} + \\var{n4}\\]

\n

Re-arrange this equation to make $y$ the subject.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"js": "", "css": ""}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Another transposition question, which requires (basic) factorisation.

\n

rebelmaths

"}, "variables": {"n1": {"definition": "random(2..6)", "group": "Ungrouped variables", "templateType": "anything", "name": "n1", "description": ""}, "n4": {"definition": "random(1..10)", "group": "Ungrouped variables", "templateType": "anything", "name": "n4", "description": ""}, "n3": {"definition": "random(-7..7 except 0 n2)", "group": "Ungrouped variables", "templateType": "anything", "name": "n3", "description": ""}, "n2": {"definition": "random(-7..7 except 0)", "group": "Ungrouped variables", "templateType": "anything", "name": "n2", "description": ""}}, "type": "question"}, {"name": "TP7", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "preamble": {"js": "", "css": ""}, "parts": [{"variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "prompt": "

$S = $ [[0]]

\n

", "scripts": {}, "unitTests": [], "showFeedbackIcon": true, "variableReplacements": [], "marks": 0, "gaps": [{"answer": "({b}*V)/({a}-V)", "variableReplacementStrategy": "originalfirst", "expectedVariableNames": [], "showCorrectAnswer": true, "checkingAccuracy": 0.001, "scripts": {}, "failureRate": 1, "vsetRange": [0, 1], "vsetRangePoints": 5, "unitTests": [], "showFeedbackIcon": true, "variableReplacements": [], "marks": "5", "showPreview": true, "checkingType": "absdiff", "extendBaseMarkingAlgorithm": true, "checkVariableNames": false, "customMarkingAlgorithm": "", "type": "jme"}], "sortAnswers": false, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": "", "type": "gapfill"}], "tags": [], "functions": {}, "advice": "

Start by multiplying both sides by the denominator.

\n

For example if you have $V=\\frac{5S}{S+12}$ then multiply both sides by $(S+12)$.

\n

This gives:  $V \\color{red}{(S+12)}=\\frac{5S}{S+12} \\color{red}{(S+12)} $

\n

The $(S+12)$ terms on the right hand side cancel out to give: $V(S+12)=5S$

\n

Now expand out the brackets on the left hand side:  $\\color{red}{VS+12V}=5S$

\n

Next collect the like terms, you want to get all the terms with $S$ in them onto one side, so subtract $VS$ from both sides:

\n

$VS \\color{red}{-VS} + 12V=5S \\color{red}{-VS}$

\n

This becomes $12V=5S-VS$

\n

Now you can factorise the right hand side: $12V=\\color{red}{S(5-V)}$

\n

Finally divide both sides by $(5-V)$ to leave $S$ on its own: $\\frac{12V}{\\color{red}{5-V}}=S$

\n

", "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

rearranging the Michelas-Menten equation to make the substrate the subject.

\n

rebelmaths

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"name": "a", "templateType": "anything", "definition": "random(2..8)", "description": "", "group": "Ungrouped variables"}, "b": {"name": "b", "templateType": "anything", "definition": "random(5..16)", "description": "", "group": "Ungrouped variables"}}, "statement": "

Rearrange the following equation to make $S$ the subject:

\n

\n

\\[ V=\\frac{\\var{a}S}{S+\\var{b}}\\]

\n

\n

Note: To write a fraction you type (numerator)/(denominator).

", "variable_groups": [], "ungrouped_variables": ["a", "b"], "type": "question"}, {"name": "TP8", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "variables": {"c": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "c", "definition": "random(2..30 except([a,b]))"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "a", "definition": "random(2..15)"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "b", "definition": "random([3,5,7,11,13,17,19] except(a))"}}, "ungrouped_variables": ["a", "b", "c"], "rulesets": {}, "parts": [{"sortAnswers": false, "variableReplacements": [], "prompt": "

$x = $ [[0]]

", "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "marks": 0, "scripts": {}, "unitTests": [], "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "gaps": [{"variableReplacements": [], "vsetRangePoints": 5, "expectedVariableNames": [], "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showPreview": true, "marks": 1, "scripts": {}, "unitTests": [], "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "answer": "({c} p^2 - {a})/{b}", "checkingType": "absdiff", "checkingAccuracy": 0.001, "checkVariableNames": false, "failureRate": 1, "showFeedbackIcon": true, "type": "jme", "vsetRange": [0, 1]}], "showFeedbackIcon": true, "type": "gapfill"}], "advice": "

We wish to make $x$ the subject, so we must get $x$ on its own. At the moment, the only $x$ in the equation is in the fraction under the square root. Until the square root is gone, everything under the square root is trapped together.

\n

How can we get rid of the square root? Ans: Apply the inverse function of the square root (i.e. do the opposite of taking the square root) which is to square.

\n

Remember, if we wish to keep the equation balanced i.e. keep both sides equal, we must always do the same thing to both sides. So, if we square the right hand side in order to get rid of the square root, we must also square the left hand side:

\n

\\[ \\begin{align*} p^{\\color{red}{2}} & =  \\left( \\sqrt{\\frac{\\var{a}+\\var{b}x}{\\var{c}}} \\right)^{\\color{red}{2}} \\\\ \\Rightarrow \\  p^2 & = \\frac{\\var{a}+\\var{b}x}{\\var{c}}\\end{align*}\\]

\n

Now looking at the right hand side, we have a fraction. Everything on top of the line of a fraction is trapped together and everything under the line of a fraction is trapped together until the fraction is gone. So we need to get rid of the fraction. We do this by multiplying both sides by the denominator, $\\var{c}$ (since multiplication is the opposite of division). This gives:

\n

\\[ \\begin{align*}  p^2 \\color{red}{\\times \\var{c}} & =\\frac{\\var{a}+\\var{b}x}{\\var{c}} \\color{red}{\\times \\var{c}}\\\\  \\Rightarrow \\ \\var{c} p^2  & = \\var{a} + \\var{b}x \\end{align*} \\]

\n

\n

Next, we subtract $\\var{a}$ from both sides to get rid of it from the right hand side:

\n

\\[ \\begin{align*} \\var{c} p^2  \\color{red}{- \\var{a}} & = \\var{a} + \\var{b}x \\color{red}{- \\var{a}}\\\\ \\Rightarrow \\ \\var{c} p^2 - \\var{a} & = \\var{b} x \\end{align*} \\]

\n

Finally, we divide both sides by $\\var{b}$ to get $x$ on its own on the right hand side (since division is the opposite of multiplication). This gives:

\n

\\[ \\begin{align*} \\frac{\\var{c} p^2 - \\var{a}}{\\color{red}{\\var{b}}} & = \\frac{\\var{b} x}{\\color{red}{\\var{b}}}\\\\ \\Rightarrow \\ \\frac{\\var{c} p^2 - \\var{a}}{\\var{b}} & = x\\end{align*} \\]

", "statement": "

Make $x$ the subject of the following formula: 

\n

\\[ p=\\sqrt{\\frac{\\var{a}+\\var{b}x}{\\var{c}}} \\]

", "metadata": {"licence": "None specified", "description": ""}, "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"css": "", "js": ""}, "variable_groups": [], "tags": [], "functions": {}, "type": "question"}, {"name": "TP9", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}], "statement": "

Transpose the following equation to find $B$

\n

\\[ \\frac{1}{A} = \\frac{1}{B} + \\frac{1}{C} \\]

\n

Note: When inputting an expression like $AB$, you need to input $A * B$.

", "rulesets": {}, "tags": [], "parts": [{"scripts": {}, "marks": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "sortAnswers": false, "showCorrectAnswer": true, "variableReplacements": [], "prompt": "

$B = $ [[0]]

", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "unitTests": [], "type": "gapfill", "gaps": [{"checkingType": "absdiff", "scripts": {}, "marks": "2", "customMarkingAlgorithm": "", "checkingAccuracy": 0.001, "expectedVariableNames": [], "extendBaseMarkingAlgorithm": true, "vsetRangePoints": 5, "checkVariableNames": false, "showCorrectAnswer": true, "variableReplacements": [], "showPreview": true, "answer": "A*C/(C-A)", "showFeedbackIcon": true, "unitTests": [], "vsetRange": [0, 1], "failureRate": 1, "type": "jme", "variableReplacementStrategy": "originalfirst"}]}], "variablesTest": {"condition": "", "maxRuns": 100}, "preamble": {"css": "", "js": ""}, "variables": {}, "functions": {}, "metadata": {"licence": "None specified", "description": ""}, "ungrouped_variables": [], "variable_groups": [], "advice": "

We need to get $B$ on its own. There are a number of different ways you might do this. This is just one possible solution:

\n

At the moment, there is a single $B$ in the first fraction on the right hand side. Therefore we need to get rid of that fraction. Very often it can make calculations easier if there are no fractions at all, and it is often as easy to get rid of all fractions as to get rid of just one fraction. That is the case here. If we multiply both sides by $ABC$, we can get rid of all fractions in our equation:

\n

\\[  \\begin{align*} \\frac{1}{A} \\color{red}{\\times ABC} & = \\frac{1}{B} \\color{red}{\\times ABC} + \\frac{1}{C} \\color{red}{\\times ABC}\\\\ BC & = AC + AB \\end{align*} \\]

\n

Since we wish to get $B$ on its own, we now make sure every term that has a $B$ is on the one side of the equals sign and every term without a $B$ is on the other side. If we subtract $AB$ from both sides we get:

\n

\\[ \\begin{align*} BC \\color{red}{- AB} & = AC + AB \\color{red}{- AB}\\\\ BC - AB & = AC  \\end{align*} \\]

\n

Next, factorising the left hand side:

\n

\\[  \\color{red}{B(C - A)} = AC \\]

\n

Finally, dividing both sides by $C - A$:

\n

\\[ \\begin{align*} \\frac{B(C - A)}{\\color{red}{C - A}} & = \\frac{AC}{\\color{red}{C - A}}\\\\ B & = \\frac{AC}{C - A} \\end{align*} \\]

", "type": "question"}]}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Questions on transposition

"}, "feedback": {"advicethreshold": 0, "showanswerstate": true, "showactualmark": true, "intro": "", "showtotalmark": true, "allowrevealanswer": true, "feedbackmessages": []}, "showstudentname": true, "percentPass": 0, "showQuestionGroupNames": false, "type": "exam", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Clodagh Carroll", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/384/"}, {"name": "Catherine Palmer", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/423/"}, {"name": "David Goulding", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2365/"}], "extensions": [], "custom_part_types": [{"source": {"pk": 2, "author": {"name": "Christian Lawson-Perfect", "pk": 7}, "edit_page": "/part_type/2/edit"}, "name": "List of numbers", "short_name": "list-of-numbers", "description": "

The answer is a comma-separated list of numbers.

\n

The list is marked correct if each number occurs the same number of times as in the expected answer, and no extra numbers are present.

\n

You can optionally treat the answer as a set, so the number of occurrences doesn't matter, only whether each number is included or not.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "join(\n if(settings[\"correctAnswerFractions\"],\n map(let([a,b],rational_approximation(x), string(a/b)),x,settings[\"correctAnswer\"])\n ,\n settings[\"correctAnswer\"]\n ),\n settings[\"separator\"] + \" \"\n)", "hint": {"static": false, "value": "if(settings[\"show_input_hint\"],\n \"Enter a list of numbers separated by {settings['separator']}.\",\n \"\"\n)"}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "bits:\nlet(b,filter(x<>\"\",x,split(studentAnswer,settings[\"separator\"])),\n if(isSet,list(set(b)),b)\n)\n\nexpected_numbers:\nlet(l,settings[\"correctAnswer\"] as \"list\",\n if(isSet,list(set(l)),l)\n)\n\nvalid_numbers:\nif(all(map(not isnan(x),x,interpreted_answer)),\n true,\n let(index,filter(isnan(interpreted_answer[x]),x,0..len(interpreted_answer)-1)[0], wrong, bits[index],\n warn(wrong+\" is not a valid number\");\n fail(wrong+\" is not a valid number.\")\n )\n )\n\nis_sorted:\nassert(sort(interpreted_answer)=interpreted_answer,\n multiply_credit(0.5,\"Not in order\")\n )\n\nincluded:\nmap(\n let(\n num_student,len(filter(x=y,y,interpreted_answer)),\n num_expected,len(filter(x=y,y,expected_numbers)),\n switch(\n num_student=num_expected,\n true,\n num_studentThe separate items in the student's answer

", "definition": "let(b,filter(x<>\"\",x,split(studentAnswer,settings[\"separator\"])),\n if(isSet,list(set(b)),b)\n)"}, {"name": "expected_numbers", "description": "", "definition": "let(l,settings[\"correctAnswer\"] as \"list\",\n if(isSet,list(set(l)),l)\n)"}, {"name": "valid_numbers", "description": "

Is every number in the student's list valid?

", "definition": "if(all(map(not isnan(x),x,interpreted_answer)),\n true,\n let(index,filter(isnan(interpreted_answer[x]),x,0..len(interpreted_answer)-1)[0], wrong, bits[index],\n warn(wrong+\" is not a valid number\");\n fail(wrong+\" is not a valid number.\")\n )\n )"}, {"name": "is_sorted", "description": "

Are the student's answers in ascending order?

", "definition": "assert(sort(interpreted_answer)=interpreted_answer,\n multiply_credit(0.5,\"Not in order\")\n )"}, {"name": "included", "description": "

Is each number in the expected answer present in the student's list the correct number of times?

", "definition": "map(\n let(\n num_student,len(filter(x=y,y,interpreted_answer)),\n num_expected,len(filter(x=y,y,expected_numbers)),\n switch(\n num_student=num_expected,\n true,\n num_studentHas every number been included the right number of times?

", "definition": "all(included)"}, {"name": "no_extras", "description": "

True if the student's list doesn't contain any numbers that aren't in the expected answer.

", "definition": "if(all(map(x in expected_numbers, x, interpreted_answer)),\n true\n ,\n incorrect(\"Your answer contains \"+extra_numbers[0]+\" but should not.\");\n false\n )"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "if(lower(studentAnswer) in [\"empty\",\"\u2205\"],[],\n map(\n if(settings[\"allowFractions\"],parsenumber_or_fraction(x,notationStyles), parsenumber(x,notationStyles))\n ,x\n ,bits\n )\n)"}, {"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "if(studentanswer=\"\",fail(\"You have not entered an answer\"),false);\napply(valid_numbers);\napply(included);\napply(no_extras);\ncorrectif(all_included and no_extras)"}, {"name": "notationStyles", "description": "", "definition": "[\"en\"]"}, {"name": "isSet", "description": "

Should the answer be considered as a set, so the number of times an element occurs doesn't matter?

", "definition": "settings[\"isSet\"]"}, {"name": "extra_numbers", "description": "

Numbers included in the student's answer that are not in the expected list.

", "definition": "filter(not (x in expected_numbers),x,interpreted_answer)"}], "settings": [{"name": "correctAnswer", "label": "Correct answer", "help_url": "", "hint": "The list of numbers that the student should enter. The order does not matter.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "allowFractions", "label": "Allow the student to enter fractions?", "help_url": "", "hint": "", "input_type": "checkbox", "default_value": false}, {"name": "correctAnswerFractions", "label": "Display the correct answers as fractions?", "help_url": "", "hint": "", "input_type": "checkbox", "default_value": false}, {"name": "isSet", "label": "Is the answer a set?", "help_url": "", "hint": "If ticked, the number of times an element occurs doesn't matter, only whether it's included at all.", "input_type": "checkbox", "default_value": false}, {"name": "show_input_hint", "label": "Show the input hint?", "help_url": "", "hint": "", "input_type": "checkbox", "default_value": true}, {"name": "separator", "label": "Separator", "help_url": "", "hint": "The substring that should separate items in the student's list", "input_type": "string", "default_value": ",", "subvars": false}], "public_availability": "always", "published": true, "extensions": []}], "resources": [["question-resources/image_K0BP3FV.png", "/srv/numbas/media/question-resources/image_K0BP3FV.png"], ["question-resources/image_jS71fGY.png", "/srv/numbas/media/question-resources/image_jS71fGY.png"], ["question-resources/image_8rDGI2c.png", "/srv/numbas/media/question-resources/image_8rDGI2c.png"], ["question-resources/image_AgeDfYh.png", "/srv/numbas/media/question-resources/image_AgeDfYh.png"]]}