// Numbas version: finer_feedback_settings {"name": "David's copy of Display a mixed fraction", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"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)}$ = 

", "advice": "", "variables": {}, "extensions": [], "parts": [], "ungrouped_variables": [], "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"}, "functions": {"mixed_fraction": {"parameters": [["n", "number"], ["d", "number"]], "language": "jme", "type": "string", "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": {"maxRuns": 100, "condition": ""}, "rulesets": {}, "preamble": {"js": "", "css": ""}, "tags": [], "name": "David's copy of Display a mixed fraction", "variable_groups": [], "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"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": "David Cole", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2878/"}]}