Ignore:
Timestamp:
6 Dec 2016, 15:41:25 (8 years ago)
Author:
Henrik Bettermann
Message:

Provide option to render performance data in custom packages.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

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

    r14305 r14314  
    32673267    grok.require('waeup.editScores')
    32683268
    3269     def table_data(self, session):
     3269    def data(self, session):
    32703270        cat = queryUtility(ICatalog, name='coursetickets_catalog')
    32713271        coursetickets = cat.searchResults(
     
    32903290                  ticket.score]
    32913291            tickets.append(row)
    3292         return header + sorted(tickets, key=lambda value: value[0])
     3292        return header + sorted(tickets, key=lambda value: value[0]), None
    32933293
    32943294    def render(self):
     
    32993299        students_utils = getUtility(IStudentsUtils)
    33003300        return students_utils.renderPDFCourseticketsOverview(
    3301             self, session, self.table_data(session), lecturers)
     3301            self, session, self.data(session), lecturers)
    33023302
    33033303class ExportJobContainerOverview(KofaPage):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r14294 r14314  
    955955
    956956    def renderPDFCourseticketsOverview(
    957             self, view, session, table_data, lecturers):
     957            self, view, session, data, lecturers):
    958958        filename = 'coursetickets_%s_%s_%s.pdf' % (
    959959            view.context.code, session, view.request.principal.id)
     
    967967            translate(_('<b>Credits: ${a}</b>',
    968968                      mapping = {'a':view.context.credits})), style["Normal"]),]
     969        # Not used in base package.
     970        if data[1]:
     971            pdf_data += [Paragraph(
     972                translate(_('<b>Pass: ${a}%</b>',
     973                    mapping = {'a':data[1][0]})), style["Normal"]),]
     974            pdf_data += [Paragraph(
     975                translate(_('<b>Fail: ${a}%</b>',
     976                    mapping = {'a':data[1][1]})), style["Normal"]),]
    969977        pdf_data.append(Spacer(1, 20))
    970         pdf_data += [Table(table_data, style=CONTENT_STYLE)]
     978        pdf_data += [Table(data[0], style=CONTENT_STYLE)]
    971979        doc_title = translate(_('${a} (${b}) - Academic Session ${d}',
    972980            mapping = {'a':view.context.title,
Note: See TracChangeset for help on using the changeset viewer.