def classroom_student_list_view(teacher, classroom): students = Student.get_classroom_students(classroom.id) if len(students) == 0: ru_text = "В этой классной комнате пока что нет ни одного ученика" en_text = "There are no students in this classroom yet" text = ru_text if teacher.language_code == 'ru' else en_text else: text = f"*{classroom.name}*\n\n" for student in students: text += f"{student.fullname}\n" bot.send_message(teacher.id, text, parse_mode='Markdown')
def new_task_notification(task): classroom = Classroom.get(task.classroom_id) teacher = Teacher.get(classroom.teacher_id) students = Student.get_classroom_students(classroom.id) ru_text = f"🔔 Новое задание: *{task.name}*\n\n*{classroom.name}*. Учитель: _{teacher.fullname}_" en_text = f"🔔 New task: *{task.name}*\n\n*{classroom.name}*. Teacher: _{teacher.fullname}_" for student in students: text = ru_text if student.language_code == 'ru' else en_text bot.send_message(student.id, text, parse_mode='MarkDown') task_detail_view(student, task)