// Numbas version: exam_results_page_options {"name": "Display a mixed fraction", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": [], "preamble": {"js": "", "css": ""}, "variable_groups": [], "metadata": {"description": "

Display a fraction, given as a numerator and a denominator, as a mixed fraction when appropriate.

", "licence": "Creative Commons Attribution 4.0 International"}, "variables": {}, "tags": [], "ungrouped_variables": [], "rulesets": {}, "statement": "

$\\var{mixed_fraction(0,2)}$

\n

$\\var{mixed_fraction(1,2)}$

\n

$\\var{mixed_fraction(2,2)}$

\n

$\\var{mixed_fraction(3,2)}$

\n

$\\var{mixed_fraction(4,2)}$

\n

$\\var{mixed_fraction(5,2)}$

", "name": "Display a mixed fraction", "advice": "", "parts": [{"scripts": {}, "marks": 0, "showFeedbackIcon": true, "type": "1_n_2", "choices": [], "variableReplacements": [], "distractors": [], "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "matrix": [], "minMarks": 0, "variableReplacementStrategy": "originalfirst", "showCellAnswerState": true, "shuffleChoices": false, "displayColumns": 0, "unitTests": [], "prompt": "

$\\var{mixed_fraction(5,2)}$

", "displayType": "radiogroup", "customMarkingAlgorithm": "", "maxMarks": 0}], "functions": {"mixed_fraction": {"type": "string", "parameters": [["n", "number"], ["d", "number"]], "definition": "latex(let(\n rem,mod(n,d),\n int,(n-mod(n,d))/d,\n switch(\n rem=0,\n int+'',\n int=0,\n \"\\\\frac{\"+rem+\"}{\"+d+\"}\"\n ,\n int+\" \\\\frac{\"+rem+\"}{\"+d+\"}\"\n )\n )\n)", "language": "jme"}}, "variablesTest": {"maxRuns": 100, "condition": ""}, "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "karl walton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2516/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "karl walton", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2516/"}]}