// Numbas version: exam_results_page_options {"name": "Modular Arithmetic: time", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["hours24", "hours12", "start", "duration", "ansA", "ansB", "startb", "ansC", "c"], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

a. In 24 hour time: {hours24[start]} + {duration}:00 = {start+duration+1}:00 = {hours24[mod(start+duration,24)]}

\n

b. In 12 hour time {hours12[startb]} + {duration}:00 = {startb+duration+1}:00 = {hours12[mod(startb+duration,12)]}

\n

c. A time of {hours12[c]} in 12-hour format could mean {hours24[c]} or {hours24[c+12]} in 24-hour format.

", "metadata": {"description": "

Simple intro to mod arithmetic

", "licence": "Creative Commons Attribution-ShareAlike 4.0 International"}, "rulesets": {}, "functions": {}, "name": "Modular Arithmetic: time", "preamble": {"css": "", "js": ""}, "variable_groups": [], "tags": [], "variables": {"startb": {"group": "Ungrouped variables", "name": "startb", "definition": "random(5..10)", "templateType": "anything", "description": ""}, "c": {"group": "Ungrouped variables", "name": "c", "definition": "random(0..11)", "templateType": "anything", "description": ""}, "hours24": {"group": "Ungrouped variables", "name": "hours24", "definition": "[\"01:00\",\"02:00\",\"03:00\",\"04:00\",\"05:00\",\"06:00\",\"07:00\",\"08:00\",\"09:00\",\"10:00\",\"11:00\",\"12:00\",\"13:00\",\"14:00\",\"15:00\",\"16:00\",\"17:00\",\"18:00\",\"19:00\",\"20:00\",\"21:00\",\"22:00\",\"23:00\",\"00:00\"]", "templateType": "anything", "description": ""}, "start": {"group": "Ungrouped variables", "name": "start", "definition": "random(18..22 except startb+12)", "templateType": "anything", "description": ""}, "hours12": {"group": "Ungrouped variables", "name": "hours12", "definition": "[\"1:00\",\"2:00\",\"3:00\",\"4:00\",\"5:00\",\"6:00\",\"7:00\",\"8:00\",\"9:00\",\"10:00\",\"11:00\",\"12:00\"]", "templateType": "anything", "description": ""}, "ansC": {"group": "Ungrouped variables", "name": "ansC", "definition": "map(if(mod(x,12) = c,1,-1), x, 0..23)", "templateType": "anything", "description": ""}, "ansB": {"group": "Ungrouped variables", "name": "ansB", "definition": "map(if(mod(startb + duration,12) = x,1,0), x, 0..11)", "templateType": "anything", "description": ""}, "ansA": {"group": "Ungrouped variables", "name": "ansA", "definition": "map(if(mod(start + duration,24) = x,1,0), x, 0..23)", "templateType": "anything", "description": ""}, "duration": {"group": "Ungrouped variables", "name": "duration", "definition": "random(7..10)", "templateType": "anything", "description": ""}}, "parts": [{"showCorrectAnswer": true, "maxMarks": 0, "customName": "", "type": "1_n_2", "variableReplacements": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "displayType": "dropdownlist", "matrix": "{ansA}", "shuffleChoices": false, "minMarks": 0, "scripts": {}, "useCustomName": false, "displayColumns": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

If you go to bed at $\\var{hours24[start]}$ and sleep for $\\var{duration}$ hours, at what time will you wake up? Give your answer in 24-hour format.

", "showCellAnswerState": true, "choices": "{hours24}", "marks": 0}, {"showCorrectAnswer": true, "maxMarks": 0, "customName": "", "type": "1_n_2", "variableReplacements": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "displayType": "dropdownlist", "matrix": "{ansB}", "shuffleChoices": false, "minMarks": 0, "scripts": {}, "useCustomName": false, "displayColumns": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

If you go to bed at $\\var{hours12[startb]}$ and sleep for $\\var{duration}$ hours, at what time will you wake up? Give your answer in 12-hour format.

", "showCellAnswerState": true, "choices": "{hours12}", "marks": 0}, {"displayColumns": 0, "customMarkingAlgorithm": "", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "displayType": "checkbox", "useCustomName": false, "minMarks": 0, "variableReplacementStrategy": "originalfirst", "prompt": "

Deep in thought about discrete mathematics, you lost track of day and night. You glance at a 12-hour clock that reads $\\var{hours12[c]}$. What time is it in 24-hour time (tick all that could be true)?

", "minAnswers": 0, "maxAnswers": 0, "showCorrectAnswer": true, "customName": "", "warningType": "none", "variableReplacements": [], "maxMarks": 0, "shuffleChoices": false, "matrix": "{ansC}", "scripts": {}, "type": "m_n_2", "showCellAnswerState": true, "choices": "{hours24}", "marks": 0}], "statement": "

The concept of modular arithmetic is already familiar from everyday life.

", "extensions": [], "type": "question", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}]}], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}