// Numbas version: finer_feedback_settings
{"name": "Find the root(s) of a quadratic equation.", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Find the root(s) of a quadratic equation.", "tags": [], "metadata": {"description": "The student is asked to identify the number of roots of a quadratic equation, and then to give the root or roots. There is a hint to calculate the discriminant, and then further hints with the formula for the discriminant and the decision to make based on its value.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "
$f(x) = \\simplify{{c1}x^2 + {c2}x + {c3}}$
", "advice": "", "rulesets": {}, "extensions": ["stats"], "variables": {"root1": {"name": "root1", "group": "Ungrouped variables", "definition": "random(-5..5)", "description": "", "templateType": "anything"}, "root2": {"name": "root2", "group": "Ungrouped variables", "definition": "random(root1,random(-5..5 except root1))", "description": "50% chance of being the same as root1
", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random([1,1,1]+list(2..7))", "description": "", "templateType": "anything"}, "c1": {"name": "c1", "group": "Ungrouped variables", "definition": "a", "description": "", "templateType": "anything"}, "c2": {"name": "c2", "group": "Ungrouped variables", "definition": "a*(-root2 -root1)", "description": "", "templateType": "anything"}, "c3": {"name": "c3", "group": "Ungrouped variables", "definition": "a*root1*root2", "description": "", "templateType": "anything"}, "num_roots": {"name": "num_roots", "group": "Ungrouped variables", "definition": "if(root1=root2,1,2)", "description": "", "templateType": "anything"}, "discriminant": {"name": "discriminant", "group": "Ungrouped variables", "definition": "c2^2-4*c1*c3", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["root1", "root2", "a", "c1", "c2", "c3", "num_roots", "discriminant"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": true, "customName": "How many roots?", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "Enter the root", "rawLabel": "", "otherPart": 1, "variableReplacements": [], "availabilityCondition": "interpreted_answer=1", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Enter the roots", "rawLabel": "", "otherPart": 2, "variableReplacements": [], "availabilityCondition": "interpreted_answer=2", "penalty": "", "penaltyAmount": 0, "lockAfterLeaving": false}, {"label": "Calculate the discriminant", "rawLabel": "", "otherPart": 3, "variableReplacements": [], "availabilityCondition": "credit<1", "penalty": "Discriminant hint", "penaltyAmount": "0.5", "lockAfterLeaving": false}], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Write the number of roots", "prompt": "How many distinct solutions does $f(x)=0$ have?
", "minValue": "num_roots", "maxValue": "num_roots", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Enter the root", "marks": "2", "scripts": {}, "customMarkingAlgorithm": "mark (Mark the student's answer):\n apply(validNumber);\n if(studentNumber in [root1,root2],\n correct(),\n incorrect(\"Your answer is not a root of the equation\")\n )", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "minValue": "root1", "maxValue": "root1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "gapfill", "useCustomName": true, "customName": "Enter the roots", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "distinct_roots: \n set(answers)\n\ncorrect_roots:\n filter(x in [root1,root2],x,distinct_roots)\n\nincorrect_roots:\n filter(not (x in [root1,root2]),x,distinct_roots)\n\nq1: len(correct_roots)=len(set([root1,root2]))\n\nq:\n switch(\n len(correct_roots)=len(set([root1,root2])),\n correct();\n if(len(incorrect_roots)>0,\n sub_credit(0.5,\"One of your answers is not a solution of the equation $f(x) = 0$.\")\n ),\n len(correct_roots)>0,\n if(len(incorrect_roots)>0,\n set_credit(0.5,\"One of your answers is not a solution of the equation $f(x) = 0$.\"),\n set_credit(0.5,\"You have written the same solution twice.\")\n ),\n //otherwise\n incorrect(\"Neither of your answers is a solution of the equation $f(x) = 0$.\")\n )\n\nmark:\n assert(all_valid or not settings[\"sortAnswers\"], fail(translate(\"question.can not submit\")));\n apply(q)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "prompt": "Write the two roots, $x_1$ and $x_2$, of the equation $f(x)=0$, such that $x_1 \\lt x_2$:
\n$x_1 = $ [[0]]
\n$x_2 = $ [[1]]
", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "$x_1$", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "minValue": "min(root1,root2)", "maxValue": "min(root1,root2)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "$x_2$", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": "Identify the root(s)", "minValue": "max(root1,root2)", "maxValue": "max(root1,root2)", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": true}, {"type": "numberentry", "useCustomName": true, "customName": "Calculate the discriminant", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [{"label": "See how to calculate the discriminant", "rawLabel": "See how to calculate the discriminant", "otherPart": 4, "variableReplacements": [], "availabilityCondition": "", "penalty": "Formula for the discriminant", "penaltyAmount": "0.25", "lockAfterLeaving": false}, {"label": "What to do with the discriminant", "rawLabel": "", "otherPart": 5, "variableReplacements": [], "availabilityCondition": "answered and credit=1", "penalty": "What to do with the discriminant", "penaltyAmount": "0.25", "lockAfterLeaving": false}], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": "Calculate the discriminant", "prompt": "What is the discriminant of $f(x)$?
", "minValue": "discriminant", "maxValue": "discriminant", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "information", "useCustomName": true, "customName": "Discriminant formula", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "For a quadratic equation in the form $ax^2 + bx + c$, the discriminant $D$ is
\n\\[ D = b^2-4ac \\]
"}, {"type": "information", "useCustomName": true, "customName": "What to do with the discriminant", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": true, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "The number of distinct roots of the equation depends on the value of the discriminant:
\n