// Numbas version: exam_results_page_options {"name": "Fraction of an amount", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "ungrouped_variables": ["total", "denom", "num", "switch", "colours", "colour", "otherColour", "answer", "denomsimp", "numsimp"], "name": "Fraction of an amount", "tags": [], "advice": "

See step.

", "rulesets": {}, "parts": [{"stepsPenalty": 0, "prompt": "

There are $\\var{total}$ beads in a box.  The beads are either black or white.

\n

If $\\frac {\\var{numsimp}} {\\var{denomsimp}} $ of the beads are $\\var{colour}$, how many are $\\var{othercolour}$ ?

\n

Answer: there are [[0]] $\\var{othercolour}$ beads in the box.

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "answer", "minValue": "answer", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"prompt": "

You need to find how many $\\var{colour}$ beads there are.

\n

So you need to find $\\frac {\\var{numsimp}} {\\var{denomsimp}}$ of $\\var{total}$  (that's $\\frac {\\var{numsimp}} {\\var{denomsimp}}$ × $\\var{total}$)

\n

See if you can cancel: $\\frac {\\var{numsimp} × \\var{total}} {\\var{denomsimp}} = ?$

\n

Then take this number from $\\var{total}$ to find how many $\\var{othercolour}$ beads there are.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "marks": 0, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill"}], "extensions": [], "statement": "

A word problem involving fractions.

", "variable_groups": [], "variablesTest": {"maxRuns": "166", "condition": "mod(total,denom) =0"}, "preamble": {"css": "", "js": ""}, "variables": {"numsimp": {"definition": "num/gcd(num,denom)", "templateType": "anything", "group": "Ungrouped variables", "name": "numsimp", "description": ""}, "otherColour": {"definition": "colours[mod(switch+1,2)]", "templateType": "anything", "group": "Ungrouped variables", "name": "otherColour", "description": ""}, "colour": {"definition": "colours[switch]", "templateType": "anything", "group": "Ungrouped variables", "name": "colour", "description": ""}, "colours": {"definition": "[ \"black\", \"white\" ]", "templateType": "list of strings", "group": "Ungrouped variables", "name": "colours", "description": ""}, "answer": {"definition": "total*(1-num/denom)", "templateType": "anything", "group": "Ungrouped variables", "name": "answer", "description": ""}, "switch": {"definition": "random(0,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "switch", "description": ""}, "num": {"definition": "random(1..denom-1)", "templateType": "anything", "group": "Ungrouped variables", "name": "num", "description": ""}, "denom": {"definition": "random(6..20 except total)", "templateType": "anything", "group": "Ungrouped variables", "name": "denom", "description": ""}, "total": {"definition": "random(2..4)*random(3..5)*random(1..2)", "templateType": "anything", "group": "Ungrouped variables", "name": "total", "description": ""}, "denomsimp": {"definition": "denom/gcd(num,denom)", "templateType": "anything", "group": "Ungrouped variables", "name": "denomsimp", "description": ""}}, "metadata": {"description": "

Simple word-problem reinforcement of fractions.

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Rob Cade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/70/"}]}]}], "contributors": [{"name": "Rob Cade", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/70/"}]}