// Numbas version: exam_results_page_options {"name": "Cost of Sales Figures", "extensions": ["stats"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"parts": [{"shuffleChoices": false, "extendBaseMarkingAlgorithm": true, "unitTests": [], "choices": ["Choice 1", "Choice 2"], "variableReplacements": [], "displayType": "radiogroup", "minMarks": 0, "type": "1_n_2", "distractors": ["", ""], "matrix": [0, "1"], "displayColumns": 0, "scripts": {}, "marks": 0, "customMarkingAlgorithm": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "showCorrectAnswer": true, "maxMarks": 0}], "variables": {"sales": {"templateType": "anything", "group": "Ungrouped variables", "name": "sales", "definition": "repeat(random(1000..10000#100),numdepts)", "description": ""}, "tab": {"templateType": "anything", "group": "Ungrouped variables", "name": "tab", "definition": "table(data+[['Total','','',thousandsformat(sum(totals))]],['Dept','Cost','Sales','Profit'])", "description": ""}, "data": {"templateType": "anything", "group": "Ungrouped variables", "name": "data", "definition": "map(\n [\nnames[j],\nthousandsformat(costs[j]),\nthousandsformat(sales[j]),\nthousandsformat(totals[j])\n ],\n j,\n 0..numdepts-1\n)", "description": ""}, "costs": {"templateType": "anything", "group": "Ungrouped variables", "name": "costs", "definition": "repeat(random(1000..10000#100),numdepts)", "description": ""}, "names": {"templateType": "anything", "group": "Ungrouped variables", "name": "names", "definition": "shuffle(\n [\"Sales\",\"Engineering\",\"Research\",\"Production\",\"H R\"]\n)[0..numdepts]", "description": ""}, "totals": {"templateType": "anything", "group": "Ungrouped variables", "name": "totals", "definition": "map(sales[j]-costs[j],j,0..numdepts-1)", "description": ""}, "numdepts": {"templateType": "anything", "group": "Ungrouped variables", "name": "numdepts", "definition": "4", "description": ""}}, "variable_groups": [], "functions": {"thousandsformat": {"type": "string", "parameters": [["n", "number"]], "definition": "n = Math.round(n)+'';\nreturn n.replace(/(\\d{1,3}?)(\\d{3})$/,'$1,$2');", "language": "javascript"}}, "advice": "
Advice!
", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "A randomised table is contained in a div tag with the id #sales-table
, so it can be styled using the CSS preamble.
The Greenslate Profit Figures for 2018 are presented below.
\n