// Numbas version: exam_results_page_options {"name": "Applied modulo arithmetic: months of the year", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "functions": {}, "parts": [{"variableReplacements": [], "showCorrectAnswer": true, "gaps": [{"minMarks": 0, "type": "1_n_2", "choices": ["

January

", "

February

", "

March

", "

April

", "

May

", "

June

", "

July

", "

August

", "

September

", "

October

", "

November

", "

December

"], "variableReplacementStrategy": "originalfirst", "displayType": "dropdownlist", "displayColumns": 0, "shuffleChoices": false, "scripts": {}, "variableReplacements": [], "showCorrectAnswer": true, "distractors": ["", "", "", "", "", "", "", "", "", "", "", ""], "marks": 0, "matrix": ["if(day2number=0,1,0)", "if(day2number=1,1,0)", "if(day2number=2,1,0)", "if(day2number=3,1,0)", "if(day2number=4,1,0)", "if(day2number=5,1,0)", "if(day2number=6,1,0)", "if(day2number=7,1,0)", "if(day2number=8,1,0)", "if(day2number=9,1,0)", "if(day2number=10,1,0)", "if(day2number=11,1,0)"], "showFeedbackIcon": true, "maxMarks": 0}], "prompt": "

If {name1}'s {event} is in {day1} and {name2}'s is $\\var{offset}$ months later, then {name2}'s {event} is in [[0]].

", "type": "gapfill", "scripts": {}, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "marks": 0}], "advice": "

There are $12$ months in the year (and the order of the months doesn't change) so to do a question such as the above we should work modulo $12$.

\n

Since $\\var{offset}\\div 12=\\var{floor(offset/12)}$$\\frac{\\var{modoffset}}{12}$, when it comes to months of the year, '$\\var{offset}$ months later' is the same as '$\\var{modoffset}$ months later'.

\n

Since we started in {day1}, $\\var{modoffset}$ months later is {day2}.

", "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "

Applied questions that could be done with modulo arithmetic.

"}, "ungrouped_variables": ["offset", "dayList", "day1number", "day1", "day2number", "day2", "nameList", "name1", "name2", "event", "modoffset", "year"], "tags": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

Modulo arithmetic can help in situations where a finite number of cases is continually cycled through. 

", "extensions": [], "rulesets": {}, "name": "Applied modulo arithmetic: months of the year", "variables": {"day2": {"group": "Ungrouped variables", "definition": "dayList[day2number]", "description": "", "name": "day2", "templateType": "anything"}, "year": {"group": "Ungrouped variables", "definition": "random(18..30 except 21..23)", "description": "", "name": "year", "templateType": "anything"}, "day2number": {"group": "Ungrouped variables", "definition": "mod(day1number+offset,12)", "description": "", "name": "day2number", "templateType": "anything"}, "modoffset": {"group": "Ungrouped variables", "definition": "mod(offset,12)", "description": "", "name": "modoffset", "templateType": "anything"}, "nameList": {"group": "Ungrouped variables", "definition": "shuffle(['Ben','Annie', 'Clinton', 'Annette', 'Jill', 'David', 'Fran', 'Andrew', 'Keith', 'Abbey', 'Sophie', 'John', 'Simon', 'Klee', 'Daniel', 'Jason', 'Tom', 'Matt', 'Stephan','Elizabeth'])", "description": "", "name": "nameList", "templateType": "anything"}, "day1": {"group": "Ungrouped variables", "definition": "dayList[day1number]", "description": "", "name": "day1", "templateType": "anything"}, "name2": {"group": "Ungrouped variables", "definition": "nameList[1]", "description": "", "name": "name2", "templateType": "anything"}, "dayList": {"group": "Ungrouped variables", "definition": "['January', 'February', 'March', 'April','May','June','July', 'August', 'September', 'October', 'November', 'December']", "description": "", "name": "dayList", "templateType": "anything"}, "name1": {"group": "Ungrouped variables", "definition": "nameList[0]", "description": "", "name": "name1", "templateType": "anything"}, "offset": {"group": "Ungrouped variables", "definition": "random(100..300)", "description": "", "name": "offset", "templateType": "anything"}, "day1number": {"group": "Ungrouped variables", "definition": "random(0..11)", "description": "", "name": "day1number", "templateType": "anything"}, "event": {"group": "Ungrouped variables", "definition": "random(year+'th birthday', 'wedding', 'graduation')", "description": "", "name": "event", "templateType": "anything"}}, "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}]}], "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}]}