5
5
from time import sleep
6
6
7
7
8
-
9
8
def choose_status_state (message , user , is_entry = False ):
10
9
if is_entry :
11
10
bot .send_message (message .chat .id ,
@@ -32,15 +31,21 @@ def choose_status_state(message, user, is_entry=False):
32
31
'''
33
32
PARENTS
34
33
'''
34
+
35
+
35
36
def parents_state (message , user , is_entry = False ):
36
37
if is_entry :
37
38
bot .send_message (message .chat .id ,
38
39
DICTIONARY ['ua' ]['is_children_msg' ],
39
40
reply_markup = get_parents_choose_keyboard ('ua' ))
40
41
else :
41
42
if message .text == DICTIONARY ['ua' ]['is_children_button' ]:
43
+ user .with_child_in_school = True
44
+ user .save ()
42
45
return True , 'parents_with_children_state'
43
46
elif message .text == DICTIONARY ['ua' ]['no_children_button' ]:
47
+ user .with_child_in_school = False
48
+ user .save ()
44
49
return True , 'parents_without_children_state'
45
50
else :
46
51
bot .send_message (message .chat .id ,
@@ -73,7 +78,6 @@ def parents_with_children_state(message, user, is_entry=False):
73
78
return False , ''
74
79
75
80
76
-
77
81
def parents_without_children_state (message , user , is_entry = False ):
78
82
if is_entry :
79
83
bot .send_message (message .chat .id ,
@@ -87,8 +91,11 @@ def parents_without_children_state(message, user, is_entry=False):
87
91
photo = open ('img/excursion.png' , 'rb' ),
88
92
caption = DICTIONARY ['ua' ]['excursion_msg' ],
89
93
reply_markup = get_excursion_button_keyboard ('ua' ))
90
- elif message .text == DICTIONARY ['ua' ]['choose_school_button' ]:
91
- pass
94
+ elif message .text == DICTIONARY ['ua' ]['ask_mon_question_btn' ]:
95
+ return True , 'ask_mon_question_state'
96
+ elif message .text == DICTIONARY ['ua' ]['rating_mon_question_btn' ]:
97
+ bot .send_message (message .chat .id ,
98
+ DICTIONARY ['ua' ]['rating_mon_question_msg' ])
92
99
elif message .text == DICTIONARY ['ua' ]['back_button' ]:
93
100
return True , 'parents_state'
94
101
else :
@@ -181,6 +188,8 @@ def thematic_sections_state(message, user, is_entry=False):
181
188
"""
182
189
TEACHERS
183
190
"""
191
+
192
+
184
193
def teachers_state (message , user , is_entry = False ):
185
194
if is_entry :
186
195
bot .send_message (message .chat .id ,
@@ -246,7 +255,7 @@ def mon_state(message, user, is_entry=False):
246
255
if is_entry :
247
256
bot .send_message (message .chat .id ,
248
257
DICTIONARY ['ua' ]['mon_msg' ],
249
- reply_markup = get_mon_keyboard ('ua' ))
258
+ reply_markup = get_mon_keyboard ('ua' ))
250
259
else :
251
260
if message .text == DICTIONARY ['ua' ]['ask_mon_question_btn' ]:
252
261
return True , 'ask_mon_question_state'
@@ -276,7 +285,10 @@ def ask_mon_question_state(message, user, is_entry=False):
276
285
else :
277
286
if message .text == DICTIONARY ['ua' ]['back_button' ]:
278
287
if user .role == ROLES [0 ]:
279
- return True , 'parents_with_children_state'
288
+ if user .with_child_in_school :
289
+ return True , 'parents_with_children_state'
290
+ elif user .with_child_in_school is False :
291
+ return True , 'parents_without_children_state'
280
292
elif user .role == ROLES [1 ]:
281
293
return True , 'mon_state'
282
- return False , ''
294
+ return False , ''
0 commit comments