Ignore:
Timestamp:
26 Jan 2017, 07:42:39 (8 years ago)
Author:
Henrik Bettermann
Message:

Determine the class of degree which may depend on student parameters in custom packages.

File:
1 edited

Legend:

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

    r14410 r14461  
    821821                      (5, '1st Class'))
    822822
    823     def getClassFromCGPA(self, gpa):
     823    def getClassFromCGPA(self, gpa, student):
     824        """Determine the class of degree. In some custom packages
     825        this class depends on e.g. the entry session of the student. In the
     826        base package, it does not.
     827        """
    824828        if gpa < self.gpa_boundaries[0][0]:
    825829            return 0, self.gpa_boundaries[0][1]
     
    843847            # No credits weighted
    844848            return 6
    845         return self.getClassFromCGPA(level_obj.cumulative_params[0])[0]
     849        return self.getClassFromCGPA(
     850            level_obj.cumulative_params[0], level_obj.student)[0]
    846851
    847852    def renderPDFTranscript(self, view, filename='transcript.pdf',
     
    924929        f_label = Paragraph(f_label, ENTRY1_STYLE)
    925930        f_text = formatted_text('%.3f (%s)' % (
    926             transcript_data[1], self.getClassFromCGPA(transcript_data[1])[1]))
     931            transcript_data[1], self.getClassFromCGPA(
     932                transcript_data[1], student)[1]))
    927933        f_text = Paragraph(f_text, ENTRY1_STYLE)
    928934        contextdata.append([f_label,f_text])
Note: See TracChangeset for help on using the changeset viewer.