// Numbas version: exam_results_page_options {"name": "Mark two numbers given in a gap-fill as a set", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Mark two numbers given in a gap-fill as a set", "tags": [], "metadata": {"description": "
The student is asked to give the roots of a quadratic equation. They should be able to enter the numbers in any order, and each correct number should earn a mark.
\nWhen there's only one root, the student can only fill in one of the answer fields.
\nThis is implemented with a gap-fill with two number entry gaps. The gaps have a custom marking algorithm to allow an empty answer. The gap-fill considers the student's two answers as a set, and compares with the set of correct answers.
\nThe marking corresponds to this table:
\n\n | There is one root | \nThere are two roots | \n
Student gives one correct root | \n100% | \n50%, \"The root you gave is correct, but there is another one.\" | \n
Student gives two correct roots | \nimpossible | \n100% | \n
Student gives one incorrect root | \n0% | \n0% | \n
Student gives one incorrect, one correct root | \n50% \"One of the numbers you gave is not a root\". | \n50% \"One of the numbers you gave is not a root\". | \n
Student gives two incorrect roots | \n0% | \n0% | \n
The constant term in the quadratic equation.
", "templateType": "anything", "can_override": false}, "x1,x2": {"name": "x1,x2", "group": "Ungrouped variables", "definition": "repeat(random(-1..1),2)", "description": "The roots of the equation, which may be repeated.
", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "1", "description": "The coefficient of $x^2$ in the quadratic equation.
", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "-x1-x2", "description": "The coefficient of $x$ in the quadratic equation.
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x1,x2", "a", "b", "c"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "student_set (The set of numbers that the student gave):\n set(x for: x of: interpreted_answers where: x<>nothing)\n\nexpected_set (The set of roots of the equation):\n set([x1,x2])\n\nnum_correct (The number of values in the student's set which are correct):\n len(intersection(student_set, expected_set))\n\nmark:\n if(num_correct=0,\n incorrect(\"Your answer is incorrect.\")\n , \n if(len(expected_set)=1, // there is one root\n if(len(student_set)=1, // student gave one correct root\n correct()\n , add_credit(0.5, \"One of your answers is not a root.\") // student gave one correct and one incorrect)\n )\n , // there are two roots\n switch(len(student_set)=1, // student gave one correct root and nothing else\n add_credit(0.5, \"You gave one correct root, but there is another root.\")\n , num_correct=1, // student gave one correct and one incorret\n add_credit(0.5, \"One of your answers is not a root.\")\n , // otherwise, student gave two correct answers\n correct()\n )\n )\n )", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "\nGive the root(s) of the equation:
\n\\[ \\simplify{ {a}x^2 + {b}x + {c} = 0} \\]
\nWrite a root in each box. The order does not matter.
\nIf there is only one root, you can put it in both boxes, or leave one box empty.
\n$x = $ [[0]] or [[1]]
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "student_empty: trim(studentAnswer)=\"\"\n\nmark:\n assert(student_empty, apply(base_mark))\n\ninterpreted_answer:\n if(student_empty, nothing, base_interpreted_answer)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "x1", "maxValue": "x1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": "0.5", "scripts": {}, "customMarkingAlgorithm": "student_empty: trim(studentAnswer)=\"\"\n\nmark:\n assert(student_empty, apply(base_mark))\n\ninterpreted_answer:\n if(student_empty, nothing, base_interpreted_answer)", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": false, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "x2", "maxValue": "x2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}