Changeset 10578
- Timestamp:
- 2 Sep 2013, 07:39:50 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py
r10577 r10578 140 140 STYLE["Normal"]), 141 141 Spacer(1, 12),] 142 143 for table in self.data: 142 students_utils = getUtility(IStudentsUtils) 143 144 145 gpa_class = 0 146 for table in self.data[:-1]: 147 pdf_data.append(Spacer(1, 20)) 148 gpa_class_name = students_utils.gpa_boundaries[gpa_class][1] 149 pdf_data += [Paragraph('<strong>%s</strong>' % gpa_class_name, 150 STYLE["Normal"])] 144 151 table_data = [('Student Id', 'Matric No.', 'Name')] + table 152 pdf_data += [Table(table_data, style=TABLE_STYLE)] #, colWidths=col_widths)] 153 gpa_class += 1 154 155 # XXX: Not yet supported by by generator page 156 if self.data[-1]: 157 pdf_data.append(Spacer(1, 20)) 145 158 pdf_data += [ 146 Table(table_data, style=TABLE_STYLE)] #, colWidths=col_widths)] 159 Paragraph('<strong>Erroneous Data</strong>', STYLE["Normal"])] 160 table_data = [('Student Id', 'Matric No.', 'Name')] + self.data[-1] 161 pdf_data += [Table(table_data, style=TABLE_STYLE)] 162 147 163 doc_title = 'Presentation of Session Results' 148 149 164 pdf_data.append(Spacer(1, 40)) 150 signatures = ['Ag. Head of Department', 'External Examiner', 'Dean of Faculty'] 165 signatures = ['Ag. Head of Department', 166 'External Examiner', 'Dean of Faculty'] 151 167 signaturetables = get_signature_tables(signatures) 152 168 pdf_data.append(signaturetables[0]) -
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.