Exemple #1
0
 def post(self, decoded_payload):
     reg_no = decoded_payload.get('reg_no')
     data = request.json
     payload = student_api.payload or data
     response, code = StudentService.register_courses(reg_no=reg_no,
                                                      data=payload)
     return response, code
Exemple #2
0
 def post(self, decoded_payload):
     ''' HW: Register fingerprint for registered student '''
     reg_no = decoded_payload.get('reg_no')
     data = request.json
     payload = student_api.payload or data
     response, code = StudentService.register_fingerprint(reg_no=reg_no,
                                                          data=payload)
     return response, code
Exemple #3
0
    def post(self):
        data = request.json
        payload = student_api.payload or data
        schema = NewStudentSchema()

        try:
            new_payload = schema.load(payload)._asdict()
        except ValidationError as e:
            response = {'success': False, 'error': e.messages}
            return response, 400
        response, code = StudentService.create_student(data=new_payload)
        return response, code
Exemple #4
0
    def post(self, decoded_payload):
        reg_no = decoded_payload.get('reg_no')
        data = request.json
        payload = student_api.payload or data
        schema = EditMeSchema()

        try:
            new_payload = schema.load(payload)._asdict()
        except ValidationError as e:
            response = {'success': False, 'error': e.messages}
            return response, 400
        response, code = StudentService.edit_me(reg_no=reg_no,
                                                data=new_payload)
        return response, code
Exemple #5
0
 def get(self, decoded_payload):
     ''' Get details of logged in student '''
     reg_no = decoded_payload.get('reg_no')
     response, code = StudentService.get_me(reg_no=reg_no)
     return response, code
Exemple #6
0
 def get(self):
     ''' Get all students '''
     response, code = StudentService.get_all_students()
     return response, code
Exemple #7
0
 def get(self, reg_no, course, lecturer):
     ''' Take course lecture attendance for student with provided reg number '''
     response, code = StudentService.take_lecture_attendance(
         reg_no=reg_no, course_code=course, lecturer_id=lecturer)
     return response, code
Exemple #8
0
 def get(self, reg_no, course):
     ''' Take course exam attendance for student with provided reg number '''
     response, code = StudentService.take_exam_attendance(
         reg_no=reg_no, course_code=course)
     return response, code
Exemple #9
0
 def get(self, course, department):
     ''' HW: Get all the students from a department that have registered for a course '''
     response, code = StudentService.get_registered_students(
         course_code=course, department_code=department)
     return response, code
Exemple #10
0
 def get(self, reg_no, course):
     ''' Verify if student has registered a course '''
     response, code = StudentService.verify_registered_courses(
         reg_no=reg_no, course_code=course)
     return response, code
Exemple #11
0
 def get(self, decoded_payload):
     ''' View registered courses of logged in student '''
     reg_no = decoded_payload.get('reg_no')
     response, code = StudentService.get_registered_courses(reg_no=reg_no)
     return response, code
Exemple #12
0
 def get(self, semester, decoded_payload):
     ''' View student courses of specified semester '''
     reg_no = decoded_payload.get('reg_no')
     response, code = StudentService.get_me_courses(reg_no=reg_no,
                                                    semester=semester)
     return response, code
Exemple #13
0
 def get(self, decoded_payload):
     reg_no = decoded_payload.get('reg_no')
     response, code = StudentService.get_me(reg_no=reg_no)
     return response, code
Exemple #14
0
 def get(self):
     response, code = StudentService.get_all_students()
     return response, code
Exemple #15
0
 def get(self, decoded_payload):
     reg_no = decoded_payload.get('reg_no')
     response, code = StudentService.get_registered_courses(reg_no=reg_no)
     return response, code
Exemple #16
0
 def get(self, semester, decoded_payload):
     reg_no = decoded_payload.get('reg_no')
     response, code = StudentService.get_me_courses(reg_no=reg_no,
                                                    semester=semester)
     return response, code