// Numbas version: exam_results_page_options {"name": "Variable number of choices in a multiple choice part", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Variable number of choices in a multiple choice part", "tags": ["demo"], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "extensions": [], "variables": {"num_people": {"name": "num_people", "group": "Part a", "definition": "random(3 .. 8#1)", "description": "", "templateType": "randrange"}, "numbers": {"name": "numbers", "group": "Part b", "definition": "let(even,random(4..24#2),\n sort(shuffle(5..25 except even)[0..random(2..5)]+[even])\n)", "description": "

A random set of numbers to test for divisibility.

\n

There's always at least one even number, so there's at least one thing for the student to tick

", "templateType": "anything"}, "divisible": {"name": "divisible", "group": "Part b", "definition": "matrix(map(\n map(award(1,p|n),n,numbers),\n p,\n [2,3,5]\n))", "description": "

Is n divisible by p?

", "templateType": "anything"}, "mark_divisible": {"name": "mark_divisible", "group": "Part b", "definition": "matrix(map(\n map(if(p|n,1,-1),n,numbers),\n p,\n [2,3,5]\n))*3/total_divisible", "description": "

Marking matrix for the divisibility question - make sure total marks available is 3, and subtract marks for incorrect ticks.

", "templateType": "anything"}, "data": {"name": "data", "group": "Part a", "definition": "let(d,repeat(random(1..10),num_people-1),\n shuffle([max(d)+random(1..3)]+d)\n)", "description": "

A number for each person. There is a unique maximum: we generate n-1 values, then add another one by adding a random amount to the largest of the existing values.

", "templateType": "anything"}, "total_divisible": {"name": "total_divisible", "group": "Part b", "definition": "sum(map(sum(x),x,list(divisible)))", "description": "

Total number of ticks in the matrix

", "templateType": "anything"}, "people": {"name": "people", "group": "Part a", "definition": "map('\\$p_'+j+'\\$',j,1..num_people)", "description": "", "templateType": "anything"}, "marking": {"name": "marking", "group": "Part a", "definition": "map(award(1,data[j]=max(data)),j,0..num_people-1)", "description": "

Marking array - 1 point if this person has the highest value of data.

", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Part a", "variables": ["num_people", "people", "data", "marking"]}, {"name": "Part b", "variables": ["numbers", "divisible", "total_divisible", "mark_divisible"]}], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The following table gives the number of World Motor League championships won by the top {num_people} drivers in the world.

\n

{table([data],people)}

\n

Which driver has won the most world championships?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": "people", "matrix": "marking"}, {"type": "m_n_x", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Which of the following numbers are divisible by 2, 3 or 5?

", "minMarks": 0, "maxMarks": 0, "minAnswers": 0, "maxAnswers": 0, "shuffleChoices": false, "shuffleAnswers": false, "displayType": "checkbox", "warningType": "none", "showCellAnswerState": true, "choices": ["

2

", "

3

", "

5

"], "matrix": "mark_divisible", "layout": {"type": "all", "expression": ""}, "answers": "map(string(x),x,numbers)"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}]}