def student_id_and_class_id(class_id, student_id): # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) results = get_student_marks_by_course_service(student_id, class_id) if "status" in results.keys(): return jsonify({"msg": results["msg"]}), results["status"] results = get_paginated_results(results, request.base_url, int(offset), int(limit)) return jsonify(results), 200
def get_all_students(): try: # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) students = get_all_student_names() results = get_paginated_results(students, request.base_url, int(offset), int(limit)) return jsonify(results), 200 except Exception as e: logger.exception(e) abort(500)
def students_who_attended(class_id): try: # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) students_enrolled = get_students_enrolled(class_id) results = get_paginated_results(students_enrolled, request.base_url, int(offset), int(limit)) return jsonify(results), 200 except Exception as e: logger.exception(e) abort(500)
def studentwise_performance(class_id): try: # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) classwise_performance = get_student_performance_in_class(class_id) results = get_paginated_results(classwise_performance, request.base_url, int(offset), int(limit)) return jsonify(results), 200 except Exception as e: logger.exception(e) abort(500)
def final_grade_sheet(class_id): try: # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) results = final_grade_sheet_service(class_id) if "status" in results.keys(): return jsonify({"msg": results["msg"]}), results["status"] results = get_paginated_results(results, request.base_url, int(offset), int(limit)) return jsonify(results), 200 except Exception as e: logger.exception(e) abort(500)
def classwise_performance_of_a_student(student_id): try: # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) performance_classwise = get_classes_performance(student_id) if "status" in performance_classwise.keys(): return jsonify({"msg": performance_classwise["msg"] }), performance_classwise["status"] results = get_paginated_results(performance_classwise, request.base_url, int(offset), int(limit)) return jsonify(results), 200 except Exception as e: logger.exception(e) abort(500)
def classes_taken_by(student_id): try: # reading the request arguments offset = request.args.get('offset', 0) limit = request.args.get('limit', 10) classes_taken = get_classes_taken(student_id) # if the given student id does not exist in DB if "status" in classes_taken.keys(): return jsonify({"msg": classes_taken["msg"]}), classes_taken["status"] # if the given student_id exists in DB results = get_paginated_results(classes_taken, request.base_url, int(offset), int(limit)) return jsonify(results), 200 except Exception as e: logger.exception(e) abort(500)