Skip to content

Commit 0c6f418

Browse files
committed
In the "Diary_Slim" module, I have made the following changes:
I moved the "Define_Additional_Information" and "Verify_Input" methods from the root class to the "Write_On_Diary_Slim" class. I changed the "Define" part to "Get" in the first method. I have greatly improved the way that the Diary Slim texts define root and statistics questions. Now, all questions are in dictionaries "Question" and "Questions". The question keys are now more or less the same, such as the question type key (Yes or No, Type, or Select). In addition, there are also keys for the texts that appear when the user needs to type something or select an item from a list. The "Get_Additional_Information" method now creates a dictionary of questions, adding each question to it. If there is only one question, it puts it in the first position. If there are more questions, it adds them all to the dictionary of questions, with their corresponding position keys. After that, it iterates over the dictionary of questions, always checking the type of question (Yes or No, Type, or Select). If it is "Yes or No", it asks the question and tries to find the answer in the dictionary of answers called "Answers". Then, it stores the answer in the dictionary of user answers called "Response", formatting the answer and changing the text to be written, if necessary. If it is "Type", it checks the user's input and stores that information in the "Response" dictionary. If it is "Select", it sets the texts for the list item name and the type text. Then, it asks the user to select an item from the list and stores that selection in the "Response" dictionary. If the "Genres" key exists in the question dictionary, it formats the text to be typed with the selected item and a format text for the question, based on the genre. Finally, it returns a dictionary with the text to be written, the dictionary of questions with their answers, and the state variable "Has questions". I also changed the "Manage_Statistic" method to reflect the changes in the way the class handles questions, now using the new dictionary of questions.
1 parent 2a8b252 commit 0c6f418

File tree

3 files changed

+422
-405
lines changed

3 files changed

+422
-405
lines changed

Module files/Food_Time/Times.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"Will be hungry": 3
1111
},
1212
"Ate": {
13-
"Object": "2025-01-07 20:24:37-03:00",
13+
"Object": "2025-01-08 21:32:11-03:00",
1414
"Time": 0,
15-
"Time text": "20:24",
15+
"Time text": "21:32",
1616
"Unit": {
1717
"en": "hours",
1818
"pt": "horas"
@@ -23,9 +23,9 @@
2323
}
2424
},
2525
"Can drink water": {
26-
"Object": "2025-01-07 21:04:37-03:00",
26+
"Object": "2025-01-08 22:12:11-03:00",
2727
"Time": 40,
28-
"Time text": "21:04",
28+
"Time text": "22:12",
2929
"Unit": {
3030
"en": "minutes",
3131
"pt": "minutos"
@@ -36,9 +36,9 @@
3636
}
3737
},
3838
"Will be hungry": {
39-
"Object": "2025-01-07 23:24:37-03:00",
39+
"Object": "2025-01-09 00:32:11-03:00",
4040
"Time": 3,
41-
"Time text": "23:24",
41+
"Time text": "00:32",
4242
"Unit": {
4343
"en": "hours",
4444
"pt": "horas"

0 commit comments

Comments
 (0)