Example #1
0
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
Example #2
0
def get_student_attendances(user_id):
    attendance_agg = AttendanceAgg(mongo.db.attendance)
    return attendance_agg.get_student_attendances(user_id)
Example #3
0
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)
Example #4
0
def insert_attendance():
    attendance_agg = AttendanceAgg(mongo.db.attendance)
    return attendance_agg.insert_attendance(request)
Example #5
0
def update_student_attendances():
    attendance_agg = AttendanceAgg(mongo.db.attendance)
    return attendance_agg.update_student_grade(request)
Example #6
0
def search_student_attendances(user_id):
    attendance_agg = AttendanceAgg(mongo.db.attendance)
    return attendance_agg.search_student_attendances(user_id)
Example #7
0
def get_students_at_course(course_qr):
    attendance_agg = AttendanceAgg(mongo.db.attendance)
    return attendance_agg.get_students_at_course(course_qr)