Changeset 14124
- Timestamp:
- 24 Aug 2016, 10:14:06 (8 years ago)
- 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 62 62 certificate = getattr(stud['studycourse'],'certificate',None) 63 63 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. 64 66 if stud.current_level >= end_level: 65 67 remark = getattr(level_obj, 'final_remark', None) 68 if '_m' in failed_courses: 69 remark = 'FRNS' 66 70 else: 67 71 remark = getattr(level_obj, 'remark', None) … … 90 94 from waeup.kofa.reports import Report 91 95 from waeup.kofa.browser.interfaces import IPDFCreator 96 from waeup.kofa.browser.pdf import SMALL_PARA_STYLE 92 97 93 98 STYLE = getSampleStyleSheet() … … 127 132 sn = 1 128 133 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() 129 139 line = (sn,) + line 130 140 table.append(line) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r14079 r14124 2 2 from zc.async.testing import wait_for_result 3 3 from zope.interface.verify import verifyClass, verifyObject 4 from zope.component import getUtility 4 from zope.component import getUtility, createObject 5 5 from waeup.kofa.interfaces import IJobManager 6 6 from waeup.kofa.students.reports.level_report import ( … … 24 24 25 25 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 26 40 # we can get a table with one student 27 41 result = get_students('fac1', 'dep1', 2010, 100) 28 42 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)]) 30 45 return 31 46 32 47 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 33 62 report = LevelReport('fac1', 'dep1', 2010, 100) 34 63 result = report.create_pdf()
Note: See TracChangeset for help on using the changeset viewer.