Changeset 14361


Ignore:
Timestamp:
22 Dec 2016, 19:58:41 (8 years ago)
Author:
Henrik Bettermann
Message:

AAUE has requested to display only two digits of the GPA without rounding. _display_gpa can be used to customize this.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

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

    r14205 r14361  
    120120        return
    121121
     122    def _display_gpa(self, gpa):
     123        return round(gpa, 2)
     124
    122125    def getTranscriptData(self):
    123126        """Get a sorted list of dicts with level and course ticket data.
     
    152155                     sgpa=sgpa))
    153156        if total_credits_counted:
    154             cgpa = round(cgpa/total_credits_counted, 2)
     157            cgpa = self._display_gpa(cgpa/total_credits_counted)
    155158        # Override cgpa if value has been imported
    156159        # (not implemented in base package)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r14351 r14361  
    108108        return session_string
    109109
     110    def _display_gpa(self, gpa):
     111        return round(gpa, 3)
     112
    110113    @property
    111114    def gpa_params_rectified(self):
     
    127130                credits_weighted += ticket.credits * ticket.weight
    128131        if credits_counted:
    129             level_gpa = round(credits_weighted/credits_counted, 3)
     132            level_gpa = self._display_gpa(credits_weighted/credits_counted)
    130133        return level_gpa, credits_counted, credits_weighted
    131134
     
    142145                credits_weighted += ticket.credits * ticket.weight
    143146        if credits_counted:
    144             level_gpa = round(credits_weighted/credits_counted, 3)
     147            level_gpa = self._display_gpa(credits_weighted/credits_counted)
    145148        # Override level_gpa if value has been imported
    146149        # (not implemented in base package)
     
    201204                total_credits_weighted += gpa_params[2]
    202205            if total_credits_counted:
    203                 cgpa = round(total_credits_weighted / total_credits_counted, 3)
     206                cgpa = self._display_gpa(total_credits_weighted/total_credits_counted)
    204207            # Override cgpa if value has been imported
    205208            # (not implemented in base package)
Note: See TracChangeset for help on using the changeset viewer.