// 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": [{"tags": [], "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)}$ + $\\var{mixed_fraction(8,3)}$ = 

", "rulesets": {}, "variable_groups": [], "ungrouped_variables": [], "parts": [], "functions": {"mixed_fraction": {"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)", "type": "string", "language": "jme"}}, "preamble": {"css": "", "js": ""}, "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.

"}, "type": "question", "variables": {}, "advice": "", "extensions": [], "name": "Display a mixed fraction", "variablesTest": {"condition": "", "maxRuns": 100}, "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}, {"name": "David Cole", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2878/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}, {"name": "David Cole", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2878/"}]}