// Numbas version: exam_results_page_options {"name": "Display a mixed fraction", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"preventleave": false, "showfrontpage": false, "allowregen": true}, "question_groups": [{"questions": [{"variable_groups": [], "functions": {"mixed_fraction": {"type": "string", "parameters": [["n", "number"], ["d", "number"]], "language": "jme", "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)"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/", "name": "Christian Lawson-Perfect"}], "type": "question", "preamble": {"js": "", "css": ""}, "extensions": [], "rulesets": {}, "tags": [], "advice": "", "variables": {}, "parts": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

"}, "ungrouped_variables": [], "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"}], "pickingStrategy": "all-ordered"}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/", "name": "Christian Lawson-Perfect"}]}