Ignore:
Timestamp:
29 Aug 2016, 09:10:46 (8 years ago)
Author:
Henrik Bettermann
Message:

Add summary.

File:
1 edited

Legend:

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

    r13969 r14138  
    5252        )
    5353    students_utils = getUtility(IStudentsUtils)
    54     table = []
     54    table = list()
    5555    for i in range(len(students_utils.gpa_boundaries)+1):
    5656        # The last list is reserved for students with more than one
     
    8686            continue
    8787        # Session GPA can be determined
    88         table[students_utils.getClassFromCGPA(level_obj.gpa)[0]].append(line)
     88        gpaclass = students_utils.getClassFromCGPA(level_obj.gpa)[0]
     89        table[gpaclass].append(line)
    8990    return table
    9091
     
    160161            table_data = [('Student Id', 'Matric No.', 'Name')] + self.data[gpa_class]
    161162            pdf_data += [Table(table_data, style=TABLE_STYLE)]    #, colWidths=col_widths)]
    162             gpa_class += 1
    163163        if self.data[-1]:
    164164            pdf_data.append(Spacer(1, 20))
     
    170170            table_data = [('Student Id', 'Matric No.', 'Name')] + self.data[-1]
    171171            pdf_data += [Table(table_data, style=TABLE_STYLE)]
     172        pdf_data.append(Spacer(1, 20))
     173        pdf_data += [Paragraph('<strong>Summary</strong>', STYLE["Normal"])]
     174        pdf_data.append(Spacer(1, 10))
     175        for gpa_class in range(len(students_utils.gpa_boundaries)-1,-1,-1):
     176            gpa_class_name = students_utils.gpa_boundaries[gpa_class][1]
     177            gpa_count = len(self.data[gpa_class])
     178            pdf_data += [Paragraph('%s: %s'
     179                         % (gpa_class_name, gpa_count), STYLE["Normal"])]
     180            pass
    172181
    173182        doc_title = translate(_('Presentation of Session Results'))
Note: See TracChangeset for help on using the changeset viewer.