// Numbas version: exam_results_page_options {"name": "Mixed fractions", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Mixed fractions", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"a,b": {"name": "a,b", "group": "Ungrouped variables", "definition": "repeat(\n random(1..9)+random(1..9#2)/11\n,2)", "description": "", "templateType": "anything"}, "q": {"name": "q", "group": "Ungrouped variables", "definition": "mixedfraction(a)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a,b", "q"], "variable_groups": [], "functions": {"mixedfraction": {"parameters": [["n", "rational"]], "type": "string", "language": "javascript", "definition": "if(n.denominator==1) {\n return n.numerator+'';\n} else if(n.numerator > n.denominator) {\n var mod = n.numerator % n.denominator;\n var int = (n.numerator - mod) / n.denominator;\n return int+' \\\\frac{'+mod+'}{'+n.denominator+'}';\n} else {\n return '\\\\frac{'+n.numerator+'}{'+n.denominator+'}';\n}"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {"validate": {"script": "// don't let the student submit if their answer wasn't in the right format\nif(!this.mixedFraction) {\n this.giveWarning(\"Write your answer as a whole number or a mixed fraction.\");\n}\nreturn true;", "order": "instead"}}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Write $\\var{latex(mixedfraction(a))}+\\var{latex(mixedfraction(b))}$ as a single, improper fraction.

", "minValue": "a+b", "maxValue": "a+b", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "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/"}]}