Changeset 10445 for main/waeup.kofa


Ignore:
Timestamp:
2 Aug 2013, 05:51:20 (11 years ago)
Author:
Henrik Bettermann
Message:

Determine and print GPA class.

File:
1 edited

Legend:

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

    r10439 r10445  
    661661        return pdf_stream
    662662
     663    def getClassFromCGPA(self, gpa):
     664        if gpa < 1:
     665            return 'Fail'
     666        if gpa < 1.5:
     667            return 'Pass'
     668        if gpa < 2.4:
     669            return '3rd Class'
     670        if gpa < 3.5:
     671            return '2nd Class Lower'
     672        if gpa < 4.5:
     673            return '2nd Class Upper'
     674        if gpa <= 5:
     675            return '1st Class'
     676        return 'N/A'
     677
    663678    def renderPDFTranscript(self, view, filename='transcript.pdf',
    664679                  student=None,
     
    737752        f_label = trans(_('Cumulative GPA:'), portal_language)
    738753        f_label = Paragraph(f_label, ENTRY1_STYLE)
    739         f_text = formatted_text(gpa)
     754        f_text = formatted_text('%s (%s)' % (gpa, self.getClassFromCGPA(gpa)))
    740755        f_text = Paragraph(f_text, ENTRY1_STYLE)
    741756        contextdata.append([f_label,f_text])
Note: See TracChangeset for help on using the changeset viewer.