Changeset 14899 for main/waeup.aaue/trunk/src/waeup
- Timestamp:
- 16 Nov 2017, 06:51:01 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r14733 r14899 37 37 PORTRAIT_CHANGE_STATES = (ADMITTED,) 38 38 39 gpa_boundaries_diploma = ((1.5, 'Fail'), 40 (1.5, 'Fail'), 41 (2.4, 'Pass'), 42 (3.5, 'Merit'), 43 (4.5, 'Credit'), 44 (5, 'Distinction')) 45 39 46 gpa_boundaries = ((1, 'FRNS / NER / NYV'), 40 47 (1.5, 'Pass'), 41 (2.4, '3rd Class Honours '),42 (3.5, '2nd Class Honours Lower Division '),43 (4.5, '2nd Class Honours Upper Division '),44 (5, '1st Class Honours '))48 (2.4, '3rd Class Honours (Diploma: Pass)'), 49 (3.5, '2nd Class Honours Lower Division (Diploma: Merit)'), 50 (4.5, '2nd Class Honours Upper Division (Diploma: Credit)'), 51 (5, '1st Class Honours (Diploma: Distinction)')) 45 52 46 53 def getClassFromCGPA(self, gpa, student): 47 if gpa < self.gpa_boundaries[0][0]: 48 # FRNS 49 return 0, self.gpa_boundaries[0][1] 50 if student.entry_session < 2013: 51 if gpa < self.gpa_boundaries[1][0]: 54 if student.current_mode.startswith('dp'): 55 gpa_boundaries = self.gpa_boundaries_diploma 56 57 else: 58 gpa_boundaries = self.gpa_boundaries 59 if gpa < gpa_boundaries[0][0]: 60 # FRNS / Fail 61 return 0, gpa_boundaries[0][1] 62 if student.entry_session < 2013 and \ 63 not student.current_mode.startswith('dp'): 64 if gpa < gpa_boundaries[1][0]: 52 65 # Pass 53 return 1, self.gpa_boundaries[1][1]66 return 1, gpa_boundaries[1][1] 54 67 else: 55 if gpa < self.gpa_boundaries[1][0]:68 if gpa < gpa_boundaries[1][0]: 56 69 # FRNS (Pass degree has been phased out in 2013) 57 return 0, self.gpa_boundaries[0][1]58 if gpa < self.gpa_boundaries[2][0]:59 # 3rd 60 return 2, self.gpa_boundaries[2][1]61 if gpa < self.gpa_boundaries[3][0]:62 # 2nd L 63 return 3, self.gpa_boundaries[3][1]64 if gpa < self.gpa_boundaries[4][0]:65 # 2nd U 66 return 4, self.gpa_boundaries[4][1]67 if gpa <= self.gpa_boundaries[5][0]:68 # 1st 69 return 5, self.gpa_boundaries[5][1]70 return 0, gpa_boundaries[0][1] 71 if gpa < gpa_boundaries[2][0]: 72 # 3rd / Pass 73 return 2, gpa_boundaries[2][1] 74 if gpa < gpa_boundaries[3][0]: 75 # 2nd L / Merit 76 return 3, gpa_boundaries[3][1] 77 if gpa < gpa_boundaries[4][0]: 78 # 2nd U / Credit 79 return 4, gpa_boundaries[4][1] 80 if gpa <= gpa_boundaries[5][0]: 81 # 1st / Distinction 82 return 5, gpa_boundaries[5][1] 70 83 return 'N/A' 71 84
Note: See TracChangeset for help on using the changeset viewer.