// Numbas version: exam_results_page_options {"name": "Inbbavathie's copy of Applied modulo arithmetic: hours of the day (24 hours)", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"advice": "

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

\n

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

\n

Since we started at {day1} hours, $\\var{modoffset}$ hours later is {day2} hours.

", "functions": {}, "tags": [], "rulesets": {}, "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["offset", "dayList", "day1number", "day1", "day2number", "day2", "nameList", "name1", "name2", "event", "modoffset"], "extensions": [], "metadata": {"description": "

Applied questions that could be done with modulo arithmetic.

\n

Credits to : Ben Brown.

\n

used under a CC-BY 4.0 licence. https://creativecommons.org/licenses/by/4.0/

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "name": "Inbbavathie's copy of Applied modulo arithmetic: hours of the day (24 hours)", "variable_groups": [], "statement": "

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

\n

", "preamble": {"css": "", "js": ""}, "variables": {"event": {"group": "Ungrouped variables", "templateType": "anything", "name": "event", "description": "", "definition": "random('appointment', 'doctors appointment', 'dentist appointment', 'TV show', 'work shift')"}, "day1": {"group": "Ungrouped variables", "templateType": "anything", "name": "day1", "description": "", "definition": "dayList[day1number]"}, "modoffset": {"group": "Ungrouped variables", "templateType": "anything", "name": "modoffset", "description": "", "definition": "mod(offset,24)"}, "offset": {"group": "Ungrouped variables", "templateType": "anything", "name": "offset", "description": "", "definition": "random(30..200)"}, "day2": {"group": "Ungrouped variables", "templateType": "anything", "name": "day2", "description": "", "definition": "dayList[day2number]"}, "day2number": {"group": "Ungrouped variables", "templateType": "anything", "name": "day2number", "description": "", "definition": "mod(day1number+offset,24)"}, "name2": {"group": "Ungrouped variables", "templateType": "anything", "name": "name2", "description": "", "definition": "nameList[1]"}, "day1number": {"group": "Ungrouped variables", "templateType": "anything", "name": "day1number", "description": "", "definition": "random(0..23)"}, "nameList": {"group": "Ungrouped variables", "templateType": "anything", "name": "nameList", "description": "", "definition": "shuffle(['Ben','Annie', 'Clinton', 'Annette', 'Jill', 'David', 'Fran', 'Andrew', 'Keith', 'Abbey', 'Sophie', 'John', 'Simon', 'Klee', 'Daniel', 'Jason', 'Tom', 'Matt', 'Stephan','Elizabeth'])"}, "name1": {"group": "Ungrouped variables", "templateType": "anything", "name": "name1", "description": "", "definition": "nameList[0]"}, "dayList": {"group": "Ungrouped variables", "templateType": "anything", "name": "dayList", "description": "", "definition": "['2400','0100','0200','0300','0400','0500','0600','0700','0800','0900','1000','1100','1200','1300','1400','1500','1600','1700','1800','1900','2000','2100','2200','2300']"}}, "parts": [{"variableReplacements": [], "prompt": "

If {name1}'s {event} starts at {day1} hours and {name2}'s starts $\\var{offset}$ hours later, then {name2}'s {event} starts at [[0]] hours.

\n

\n

Note: midnight is 2400 hours, 1 am is 0100 hours, ..., 1 pm is at 1300 hours, ... etc.

", "scripts": {}, "gaps": [{"variableReplacements": [], "answer": "{day2}", "scripts": {}, "showFeedbackIcon": true, "displayAnswer": "{day2}", "variableReplacementStrategy": "originalfirst", "matchMode": "exact", "showCorrectAnswer": true, "type": "patternmatch", "marks": "1"}], "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "type": "gapfill", "marks": 0}], "type": "question", "contributors": [{"name": "Inbbavathie Ravi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1620/"}]}]}], "contributors": [{"name": "Inbbavathie Ravi", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1620/"}]}