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

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

"}, "functions": {"show_factors": {"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", "language": "jme", "parameters": [["n", "number"]]}}, "name": "sean's copy of Show the prime factorisation of a number", "parts": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "marks": 0, "showCorrectAnswer": true, "prompt": "

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

", "sortAnswers": false, "gaps": [{"vsetRange": [0, 1], "variableReplacementStrategy": "originalfirst", "failureRate": 1, "showFeedbackIcon": true, "scripts": {}, "checkVariableNames": false, "showPreview": true, "variableReplacements": [], "answer": "{f}", "marks": 1, "showCorrectAnswer": true, "vsetRangePoints": 5, "checkingAccuracy": 0.001, "checkingType": "absdiff", "unitTests": [], "extendBaseMarkingAlgorithm": true, "expectedVariableNames": [], "type": "jme", "customMarkingAlgorithm": ""}], "type": "gapfill", "extendBaseMarkingAlgorithm": true, "unitTests": [], "customMarkingAlgorithm": ""}], "preamble": {"js": "", "css": ""}, "variables": {"a": {"definition": "random(1..50)", "templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "a"}, "f": {"definition": "show_factors(a)", "templateType": "anything", "group": "Ungrouped variables", "description": "

show_factors is defined in the Extensions & Scripts tab

", "name": "f"}, "primes": {"definition": "[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]", "templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "primes"}}, "advice": "", "type": "question", "rulesets": {}, "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/"}], "extensions": []}]}], "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/"}]}