// Numbas version: finer_feedback_settings {"name": "1.3.4. Task: Factorise 3", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "1.3.4. Task: Factorise 3", "tags": [], "metadata": {"description": "

Factorise an expression of 2 or 3 terms where the gcd is a letter times a number. Part of HELM Book 1.3.4

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

Factorise $\\var{q2expr}$

\n

", "advice": "

The two terms share a common factor of $\\var{q2gcd}\\var{latex(q2v[0])}$ which can be factored out.

\n

So $\\var{q2expr} = \\var{q2ans}$

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"alphabet": {"name": "alphabet", "group": "Ungrouped variables", "definition": "shuffle(['a','b','c','d','f','g','h','k','m','n','p','q','r','s','t','u','v','w','x','y','z'])", "description": "", "templateType": "anything", "can_override": false}, "q2c": {"name": "q2c", "group": "question part c", "definition": "[random(-9..9 except 0), random(-9..9 except 0), random(2..9)]", "description": "", "templateType": "anything", "can_override": false}, "q2v": {"name": "q2v", "group": "question part c", "definition": "alphabet[2..4]", "description": "", "templateType": "anything", "can_override": false}, "q2expr": {"name": "q2expr", "group": "question part c", "definition": "simplify(expression(\n q2terms[0] + \"+\" + q2terms[1]\n ),[\"basic\",\"cancelFactors\",\"unitFactor\"])", "description": "", "templateType": "anything", "can_override": false}, "q2terms": {"name": "q2terms", "group": "question part c", "definition": "[q2coeffs[0] +\"*\"+ q2v[0],q2coeffs[1] +\"*\"+ q2v[0] + \"*\" + q2v[1]]", "description": "", "templateType": "anything", "can_override": false}, "q2gcd": {"name": "q2gcd", "group": "question part c", "definition": "if( (q2c[0] < 0 & q2c[1] < 0),\n-1*gcd(q2c[0],q2c[1])*q2c[2],\ngcd(q2c[0],q2c[1])*q2c[2]\n)", "description": "", "templateType": "anything", "can_override": false}, "q2ans": {"name": "q2ans", "group": "question part c", "definition": "simplify(expression(\n q2gcd + \"*\" + q2v[0] + \"*(\" + q2c[0]*q2c[2]/q2gcd + \"+\" + q2c[1]*q2c[2]/q2gcd + q2v[1] + \")\" ),[\"basic\",\"unitFactor\"])", "description": "", "templateType": "anything", "can_override": false}, "q2coeffs": {"name": "q2coeffs", "group": "question part c", "definition": "[q2c[0]*q2c[2],q2c[1]*q2c[2]]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["alphabet"], "variable_groups": [{"name": "question part c", "variables": ["q2c", "q2v", "q2coeffs", "q2terms", "q2expr", "q2gcd", "q2ans"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "stepsPenalty": 0, "steps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

First identify the common factor. (Hint: it is made up of two common factors)

", "answer": "expression(q2c[0]*q2v[0])", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "q2c", "value": ""}, {"name": "q2v", "value": ""}]}], "answer": "{q2ans}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": true, "singleLetterVariables": true, "allowUnknownFunctions": false, "implicitFunctionComposition": false, "caseSensitive": false, "musthave": {"strings": ["(", ")"], "showStrings": false, "partialCredit": 0, "message": ""}, "mustmatchpattern": {"pattern": "// a number and a letter times...\n`+-$n`? * $v *\n(\n // either a number 'a' times x,\n // or x on its own, and 'a' is implicitly 1\n `+-($n;a * $v`? `| $v;a:1) \n \n + `+-\n \n // either a number 'b' times x,\n // or x on its own, and 'b' is implicitly 1\n ($n;b * $v`? `| $v;b:1)\n)\n\n// a and b must be coprime\n`where\n\n(gcd(a,b)=1)", "partialCredit": 0, "message": "You have not fully factorised the expression.", "nameToCompare": ""}, "valuegenerators": []}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}