// Numbas version: exam_results_page_options {"name": "test lijst", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variables": {"solutions": {"name": "solutions", "templateType": "anything", "definition": "set(roots)", "description": "", "group": "Ungrouped variables"}, "roots": {"name": "roots", "templateType": "anything", "definition": "repeat(random(-10..10),2)", "description": "", "group": "Ungrouped variables"}}, "variable_groups": [], "ungrouped_variables": ["roots", "solutions"], "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "", "tags": [], "name": "test lijst", "functions": {}, "parts": [{"variableReplacements": [], "showCorrectAnswer": true, "gaps": [{"showCorrectAnswer": true, "type": "numberentry", "variableReplacements": [], "allowFractions": false, "scripts": {"mark": {"order": "instead", "script": "var p = this;\nvar validation = this.validation;\nvalidation.badNumbers = [];\n\n// parse each answer\n// if any answer is not a valid number, this.answered will be false\nvar validNumbers = true;\nvar answers = this.studentAnswer.map(function(s) {\n if( s.length>0 && util.isNumber(s,p.settings.allowFractions) ) {\n return util.parseNumber(s,p.settings.allowFractions);\n } else {\n validNumbers = false;\n validation.badNumbers.push(s);\n }\n})\n\nif(!validNumbers) {\n this.answered = false;\n this.setCredit(0,R('part.numberentry.answer invalid'));\n return;\n}\n\nthis.answered = true;\n\nvar solutions = variables.solutions.map(Numbas.jme.unwrapValue);\n\nconsole.log(solutions);\nconsole.log(answers);\n\nvar non_solutions = answers.filter(function(n) {return !solutions.contains(n)});\nvar missing_solutions = solutions.filter(function(n) {return !answers.contains(n)});\nif(non_solutions.length) {\n this.setCredit(0,\"One or more of your answers is not a solution to the equation.\");\n} else if(missing_solutions.length) {\n this.setCredit(0,\"You did not give every solution to the equation.\");\n} else {\n this.setCredit(1,\"Your answer is correct.\");\n}"}, "constructor": {"order": "after", "script": "// this function is called when the student's answer is submitted.\n// it splits the answer into separate numbers and tidies them up (as strings)\nthis.setStudentAnswer = function() {\n var p = this;\n this.studentAnswer = this.answerList[0].split(',').map(function(answer) { return p.cleanAnswer(answer); });\n}"}}, "correctAnswerFraction": false, "correctAnswerStyle": "plain", "maxValue": "1", "mustBeReduced": false, "marks": 1, "notationStyles": ["plain", "en", "si-en"], "minValue": "0", "showFeedbackIcon": true, "mustBeReducedPC": 0, "variableReplacementStrategy": "originalfirst"}], "type": "gapfill", "marks": 0, "scripts": {}, "showFeedbackIcon": true, "prompt": "

Solve $\\simplify{x^2-{roots[0]+roots[1]}x + {roots[0]*roots[1]}} = 0$

\n

Enter your answer(s) in the box below, with a comma between each solution.

\n

$x = $ [[0]]

\n

\n

\n

$\\mathbb{Q}$

", "variableReplacementStrategy": "originalfirst"}], "preamble": {"js": "", "css": ""}, "statement": "

$\\mathbb{Q}$

", "extensions": [], "rulesets": {}, "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": ""}, "type": "question", "contributors": [{"name": "Johan Maertens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1301/"}]}]}], "contributors": [{"name": "Johan Maertens", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1301/"}]}