def attend(call, lang): if bool(call.data.get('u_id')): Course.Attendance(call.data['c_id'], call.data['cw_id'], call.data['u_id']).value = \ not Course.Attendance(call.data['c_id'], call.data['cw_id'], call.data['u_id']).value else: for user in Course.Course(call.data['c_id']).participants: Course.Attendance(call.data['c_id'], call.data['cw_id'], user.id).value = \ not Course.Attendance(call.data['c_id'], call.data['cw_id'], user.id).value back(call, True)
def new_class(call, lang): d = UI.to_dtime(time.time()) cw_id = Course.Classwork(call.data['c_id'], name=d, date=d).number for user in Course.Course(call.data['c_id']).participants: Course.Attendance(call.data['c_id'], cw_id, user.id).value = 0 back(call, True)