// 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": [{"name": "Display a mixed fraction", "tags": [], "metadata": {"description": "

Display a number as a mixed fraction when appropriate, using the mixedFractions display option.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

$\\var[fractionNumbers,mixedFractions]{0}$

\n

$\\var[fractionNumbers,mixedFractions]{1/2}$

\n

$\\var[fractionNumbers,mixedFractions]{3/2}$

\n

$\\var[fractionNumbers,mixedFractions]{4/2}$

\n

$\\var[fractionNumbers,mixedFractions]{5/2}$

", "advice": "", "rulesets": {}, "extensions": [], "variables": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [], "functions": {"mixed_fraction": {"parameters": [["n", "number"], ["d", "number"]], "type": "string", "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)"}}, "preamble": {"js": "", "css": ""}, "parts": [], "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/"}]}