Ignore:
Timestamp:
31 Jul 2018, 08:16:59 (6 years ago)
Author:
Henrik Bettermann
Message:

Irrespective of the CGPA of a student, if the He/She? has
3rd Extension, such student will be graduated with a "Pass".

Part 2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r15050 r15095  
    7575    def getClassFromCGPA(self, gpa, student):
    7676        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
    7791        if gpa < gpa_boundaries[0][0]:
    7892            # FRNS / Fail
     
    90104                return 0, gpa_boundaries[0][1]
    91105        if gpa < gpa_boundaries[2][0]:
    92             # 3rd / Pass
     106            # 3rd / Merit
    93107            return 2, gpa_boundaries[2][1]
    94108        if gpa < gpa_boundaries[3][0]:
    95             # 2nd L / Merit
     109            # 2nd L / Credit
    96110            return 3, gpa_boundaries[3][1]
    97111        if gpa < gpa_boundaries[4][0]:
    98             # 2nd U / Credit
     112            # 2nd U / Distinction
    99113            return 4, gpa_boundaries[4][1]
    100114        if gpa <= gpa_boundaries[5][0]:
    101             # 1st / Distinction
     115            # 1st
    102116            return 5, gpa_boundaries[5][1]
    103         return 'N/A'
     117        return
    104118
    105119    def getDegreeClassNumber(self, level_obj):
Note: See TracChangeset for help on using the changeset viewer.