Changeset 10578 for main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
- Timestamp:
- 2 Sep 2013, 07:39:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10576 r10578 663 663 return pdf_stream 664 664 665 gpa_boundaries = (1, 1.5, 2.4, 3.5, 4.5, 5) 665 gpa_boundaries = ((1, 'Fail'), 666 (1.5, 'Pass'), 667 (2.4, '3rd Class'), 668 (3.5, '2nd Class Lower'), 669 (4.5, '2nd Class Upper'), 670 (5, '1st Class')) 666 671 667 672 def getClassFromCGPA(self, gpa): 668 if gpa < self.gpa_boundaries[0] :669 return 0, 'Fail'670 if gpa < self.gpa_boundaries[1] :671 return 1, 'Pass'672 if gpa < self.gpa_boundaries[2] :673 return 2, '3rd Class'674 if gpa < self.gpa_boundaries[3] :675 return 3, '2nd Class Lower'676 if gpa < self.gpa_boundaries[4] :677 return 4, '2nd Class Upper'678 if gpa <= self.gpa_boundaries[5] :679 return 5, '1st Class'680 return 999,'N/A'673 if gpa < self.gpa_boundaries[0][0]: 674 return 0, self.gpa_boundaries[0][1] 675 if gpa < self.gpa_boundaries[1][0]: 676 return 1, self.gpa_boundaries[1][1] 677 if gpa < self.gpa_boundaries[2][0]: 678 return 2, self.gpa_boundaries[2][1] 679 if gpa < self.gpa_boundaries[3][0]: 680 return 3, self.gpa_boundaries[3][1] 681 if gpa < self.gpa_boundaries[4][0]: 682 return 4, self.gpa_boundaries[4][1] 683 if gpa <= self.gpa_boundaries[5][0]: 684 return 5, self.gpa_boundaries[5][1] 685 return 'N/A' 681 686 682 687 def renderPDFTranscript(self, view, filename='transcript.pdf',
Note: See TracChangeset for help on using the changeset viewer.