Changeset 14124 for main


Ignore:
Timestamp:
24 Aug 2016, 10:14:06 (8 years ago)
Author:
Henrik Bettermann
Message:

Underline mandatory (core) courses.

If one mandatory course has been failed, the final remark is 'FRNS'.

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

Legend:

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

    r14103 r14124  
    6262        certificate = getattr(stud['studycourse'],'certificate',None)
    6363        end_level = certificate.end_level
     64        # This is a very special column requested by AAUE, Nigeria.
     65        # The 'remark' column remains empty in base package.
    6466        if stud.current_level >= end_level:
    6567            remark = getattr(level_obj, 'final_remark', None)
     68            if '_m' in failed_courses:
     69                remark = 'FRNS'
    6670        else:
    6771            remark = getattr(level_obj, 'remark', None)
     
    9094from waeup.kofa.reports import Report
    9195from waeup.kofa.browser.interfaces import IPDFCreator
     96from waeup.kofa.browser.pdf import SMALL_PARA_STYLE
    9297
    9398STYLE = getSampleStyleSheet()
     
    127132    sn = 1
    128133    for line in data:
     134        # Underline mandatory (core) courses
     135        failed_courses = Paragraph(
     136            line[5].replace('m_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE)
     137        line = line[:5] + (failed_courses,) + line[6:]
     138        import pdb; pdb.set_trace()
    129139        line = (sn,) + line
    130140        table.append(line)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py

    r14079 r14124  
    22from zc.async.testing import wait_for_result
    33from zope.interface.verify import verifyClass, verifyObject
    4 from zope.component import getUtility
     4from zope.component import getUtility, createObject
    55from waeup.kofa.interfaces import IJobManager
    66from waeup.kofa.students.reports.level_report import (
     
    2424
    2525    def test_get_students(self):
     26        ticket = createObject('waeup.CourseTicket')
     27        ticket.code = 'Course2'
     28        ticket.credits = 30
     29        ticket.score = 30
     30        ticket.mandatory = True
     31        ticket.passmark = 40
     32        self.student['studycourse']['100']['Course2'] = ticket
     33        ticket = createObject('waeup.CourseTicket')
     34        ticket.code = 'Course3'
     35        ticket.credits = 30
     36        ticket.score = 30
     37        ticket.mandatory = False
     38        ticket.passmark = 40
     39        self.student['studycourse']['100']['Course3'] = ticket
    2640        # we can get a table with one student
    2741        result = get_students('fac1', 'dep1', 2010, 100)
    2842        self.assertEqual(result,
    29             [(u'1234', u'Bob Tester', 30, 30, 5.0, '', 30, 30, 5.0, None)])
     43            [(u'1234', u'Bob Tester', 90, 30, 1.667, 'm_Course2_m Course3',
     44              90, 30, 1.667, None)])
    3045        return
    3146
    3247    def test_create_pdf(self):
     48        ticket = createObject('waeup.CourseTicket')
     49        ticket.code = 'Course2'
     50        ticket.credits = 30
     51        ticket.score = 30
     52        ticket.mandatory = True
     53        ticket.passmark = 40
     54        self.student['studycourse']['100']['Course2'] = ticket
     55        ticket = createObject('waeup.CourseTicket')
     56        ticket.code = 'Course3'
     57        ticket.credits = 30
     58        ticket.score = 30
     59        ticket.mandatory = False
     60        ticket.passmark = 40
     61        self.student['studycourse']['100']['Course3'] = ticket
    3362        report = LevelReport('fac1', 'dep1', 2010, 100)
    3463        result = report.create_pdf()
Note: See TracChangeset for help on using the changeset viewer.