Changeset 15095 for main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
- Timestamp:
- 31 Jul 2018, 08:16:59 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py
r15050 r15095 75 75 def getClassFromCGPA(self, gpa, student): 76 76 gpa_boundaries = self.GPABoundaries(student=student) 77 78 try: 79 certificate = getattr(student['studycourse'],'certificate',None) 80 end_level = getattr(certificate, 'end_level', None) 81 final_level = max([studylevel.level for studylevel in student['studycourse'].values()]) 82 if end_level and final_level >= end_level: 83 dummy, repeat = divmod(final_level, 100) 84 if gpa <= 5.1 and repeat == 20: 85 # Irrespective of the CGPA of a student, if the He/She has 86 # 3rd Extension, such student will be graduated with a "Pass". 87 return 1, gpa_boundaries[1][1] 88 except ValueError: 89 pass 90 77 91 if gpa < gpa_boundaries[0][0]: 78 92 # FRNS / Fail … … 90 104 return 0, gpa_boundaries[0][1] 91 105 if gpa < gpa_boundaries[2][0]: 92 # 3rd / Pass106 # 3rd / Merit 93 107 return 2, gpa_boundaries[2][1] 94 108 if gpa < gpa_boundaries[3][0]: 95 # 2nd L / Merit109 # 2nd L / Credit 96 110 return 3, gpa_boundaries[3][1] 97 111 if gpa < gpa_boundaries[4][0]: 98 # 2nd U / Credit112 # 2nd U / Distinction 99 113 return 4, gpa_boundaries[4][1] 100 114 if gpa <= gpa_boundaries[5][0]: 101 # 1st / Distinction115 # 1st 102 116 return 5, gpa_boundaries[5][1] 103 return 'N/A'117 return 104 118 105 119 def getDegreeClassNumber(self, level_obj):
Note: See TracChangeset for help on using the changeset viewer.