// Numbas version: exam_results_page_options {"name": "sean's copy of Show the prime factorisation of a number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

A function which renders the factorisation of a number in LaTeX.

"}, "functions": {"show_factors": {"language": "jme", "parameters": [["n", "number"]], "definition": "latex( // mark the output as a string of raw LaTeX\n join(\n map(\n if(a=1,p,p+'^{'+a+'}'), // when the exponent is 1, return p, otherwise return p^{exponent}\n [p,a],\n filter(x[1]>0,x,zip(primes,factorise(n))) // for all the primes p which are factors of n, return p and its exponent\n ),\n ' \\\\times ' // join all the prime powers up with \\times symbols\n )\n)", "type": "string"}}, "variable_groups": [], "ungrouped_variables": ["primes", "a", "f"], "rulesets": {}, "variables": {"a": {"group": "Ungrouped variables", "definition": "random(1..50)", "name": "a", "templateType": "anything", "description": ""}, "primes": {"group": "Ungrouped variables", "definition": "[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]", "name": "primes", "templateType": "anything", "description": ""}, "f": {"group": "Ungrouped variables", "definition": "show_factors(a)", "name": "f", "templateType": "anything", "description": "

show_factors is defined in the Extensions & Scripts tab

"}}, "extensions": [], "statement": "", "advice": "", "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "preamble": {"css": "", "js": ""}, "name": "sean's copy of Show the prime factorisation of a number", "parts": [{"prompt": "

$\\var{a}$= [[0]]

", "showFeedbackIcon": true, "unitTests": [], "type": "gapfill", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "marks": 0, "variableReplacements": [], "scripts": {}, "showCorrectAnswer": true, "sortAnswers": false, "gaps": [{"vsetRange": [0, 1], "expectedVariableNames": [], "showFeedbackIcon": true, "unitTests": [], "type": "jme", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "showPreview": true, "checkingAccuracy": 0.001, "answer": "{f}", "checkingType": "absdiff", "extendBaseMarkingAlgorithm": true, "marks": 1, "variableReplacements": [], "vsetRangePoints": 5, "scripts": {}, "showCorrectAnswer": true, "checkVariableNames": false, "failureRate": 1}]}], "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "sean hunte", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3167/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "sean hunte", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3167/"}]}