Ignore:
Timestamp:
16 Dec 2016, 11:45:22 (8 years ago)
Author:
Henrik Bettermann
Message:

Apply Nigerian Course Grading System.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r14247 r14350  
    4747    return co_ticket
    4848
    49 def getGradeWeightFromScore(score):
    50     if score is None:
     49def getGradeWeightFromScore(total, student):
     50    """Nigerian Course Grading System
     51    """
     52    if total is None:
    5153        return (None, None)
    52     if score >= 70:
     54    if total >= 70:
    5355        return ('A',5)
    54     if score >= 60:
     56    if total >= 60:
    5557        return ('B',4)
    56     if score >= 50:
     58    if total >= 50:
    5759        return ('C',3)
    58     if score >= 45:
     60    if total >= 45:
    5961        return ('D',2)
    60     if score >= 40:
     62    if total >= 40 and student.entry_session < 2013:
    6163        return ('E',1)
    6264    return ('F',0)
     
    377379        """Returns the grade calculated from total score.
    378380        """
    379         return getGradeWeightFromScore(self.total_score)[0]
     381        return getGradeWeightFromScore(self.total_score, self.student)[0]
    380382
    381383    @property
     
    383385        """Returns the weight calculated from total score.
    384386        """
    385         return getGradeWeightFromScore(self.total_score)[1]
     387        return getGradeWeightFromScore(self.total_score, self.student)[1]
    386388
    387389CourseTicket = attrs_to_fields(CourseTicket)
Note: See TracChangeset for help on using the changeset viewer.