Ignore:
Timestamp:
2 Sep 2013, 07:39:50 (11 years ago)
Author:
Henrik Bettermann
Message:

Print gpa class above each table.

File:
1 edited

Legend:

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

    r10577 r10578  
    140140                    STYLE["Normal"]),
    141141                    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"])]
    144151            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))
    145158            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
    147163        doc_title = 'Presentation of Session Results'
    148 
    149164        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']
    151167        signaturetables = get_signature_tables(signatures)
    152168        pdf_data.append(signaturetables[0])
Note: See TracChangeset for help on using the changeset viewer.