def download(): course_name = request.headers.get('courseName') students_class_id = request.headers.get('classId') filename = 'Statistics_' + str(course_name) + '_' + str(students_class_id) print("download", filename) attendance_agg = AttendanceAgg(mongo.db.attendance) result = attendance_agg.get_group_data(course_name, students_class_id) xls = XLS_File_Generator() xls.generate_xls_file_at_course(result, filename) response = send_file('generated_xlsx_files/' + filename + '.xlsx', mimetype='application/excel', as_attachment=True) response.headers['filename'] = filename return response
def get_student_attendances(user_id): attendance_agg = AttendanceAgg(mongo.db.attendance) return attendance_agg.get_student_attendances(user_id)
def remove_generated_attendance(): generated_attendance_agg = GeneratedAttendanceAgg( mongo.db.generatedAttendance) attendance_agg = AttendanceAgg(mongo.db.attendance) attendance_agg.remove_generated_attendance(request) return generated_attendance_agg.remove_generated_attendance(request)
def insert_attendance(): attendance_agg = AttendanceAgg(mongo.db.attendance) return attendance_agg.insert_attendance(request)
def update_student_attendances(): attendance_agg = AttendanceAgg(mongo.db.attendance) return attendance_agg.update_student_grade(request)
def search_student_attendances(user_id): attendance_agg = AttendanceAgg(mongo.db.attendance) return attendance_agg.search_student_attendances(user_id)
def get_students_at_course(course_qr): attendance_agg = AttendanceAgg(mongo.db.attendance) return attendance_agg.get_students_at_course(course_qr)