Changeset 14529 for main/waeup.kofa/trunk/src/waeup/kofa/students/reports
- Timestamp:
- 10 Feb 2017, 09:13:56 (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
r14524 r14529 83 83 stud.matric_number, 84 84 fullname, 85 level_obj. total_credits,85 level_obj.gpa_params[1], 86 86 passed_params[2], 87 87 format_float(level_obj.gpa, 3), … … 89 89 failed_courses, 90 90 not_taken_courses, 91 level_obj.cumulative_params[ 3],91 level_obj.cumulative_params[1], 92 92 level_obj.cumulative_params[4], 93 93 cgpa, … … 132 132 'Matric No.', 133 133 translate(_('Student Name')), 134 TTR(translate(_('Total Credits Registered'))),134 TTR(translate(_('Total Credits Taken'))), 135 135 TTR(translate(_('Total Credits Passed'))), 136 136 TTR(translate(_('GPA'))), 137 137 translate(_('Courses Failed')), 138 138 translate(_('Outstanding Courses')), 139 TTR(translate(_('Cum. Credits Registered'))),139 TTR(translate(_('Cum. Credits Taken'))), 140 140 TTR(translate(_('Cum. Credits Passed'))), 141 141 TTR(translate(_('CGPA'))), -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r14524 r14529 23 23 return 24 24 25 def test_get_students(self): 25 # Credits counted (taken): 90 26 # Credits passed: 60 27 # Credits failed: 30 28 # Credits registered (total_credits): 180 29 # Course1 and Course3 are passed 30 # Course2 is failed 31 # Course4, Course5 and Course6 have not ben taken 32 33 def _add_tickets(self): 26 34 ticket = createObject('waeup.CourseTicket') 27 35 ticket.code = 'Course2' … … 44 52 ticket.passmark = 40 45 53 self.student['studycourse']['100']['Course4'] = ticket 46 # we can get a table with one student 54 ticket = createObject('waeup.CourseTicket') 55 ticket.code = 'Course5' 56 ticket.credits = 30 57 self.student['studycourse']['100']['Course5'] = ticket 58 ticket = createObject('waeup.CourseTicket') 59 ticket.code = 'Course6' 60 ticket.credits = 30 61 self.student['studycourse']['100']['Course6'] = ticket 62 return 63 64 def test_get_students(self): 65 self._add_tickets() 66 # we can get a table with one student 47 67 result = get_students('fac1', 'dep1', 'CERT1', 2010, 100) 48 68 self.assertEqual(result, 49 [(u'1234', u'Bob Tester', 120, 30, '1.666', 50 'm_Course2_m Course3', 'Course4', 120, 30, '1.666', '')]) 69 [(u'1234', u'Bob Tester', 90, 30, '1.666', 70 'm_Course2_m Course3', 'Course4 Course5\nCourse6', 71 90, 30, '1.666', '')]) 51 72 # same result when selecting all certificates 52 73 result = get_students('fac1', 'dep1', 'all', 2010, 100) 53 74 self.assertEqual(result, 54 [(u'1234', u'Bob Tester', 120, 30, '1.666', 55 'm_Course2_m Course3', 'Course4', 120, 30, '1.666', '')]) 75 [(u'1234', u'Bob Tester', 90, 30, '1.666', 76 'm_Course2_m Course3', 'Course4 Course5\nCourse6', 77 90, 30, '1.666', '')]) 56 78 return 57 79 … … 60 82 self.student.lastname = u'Ehissouria' 61 83 self.student['studycourse']['100']['Course1'].passmark = 40 62 ticket = createObject('waeup.CourseTicket') 63 ticket.code = 'Course2' 64 ticket.credits = 30 65 ticket.score = 30 66 ticket.mandatory = True 67 ticket.passmark = 40 68 self.student['studycourse']['100']['Course2'] = ticket 69 ticket = createObject('waeup.CourseTicket') 70 ticket.code = 'Course3' 71 ticket.credits = 30 72 ticket.score = 30 73 self.student['studycourse']['100']['Course3'] = ticket 74 ticket2 = createObject('waeup.CourseTicket') 75 ticket2.code = 'Course4' 76 ticket2.credits = 30 77 self.student['studycourse']['100']['Course4'] = ticket2 78 ticket3 = createObject('waeup.CourseTicket') 79 ticket3.code = 'Course5' 80 ticket3.credits = 30 81 self.student['studycourse']['100']['Course5'] = ticket3 82 ticket4 = createObject('waeup.CourseTicket') 83 ticket4.code = 'Course6' 84 ticket4.credits = 30 85 self.student['studycourse']['100']['Course6'] = ticket4 84 self._add_tickets() 86 85 report = LevelReport('fac1', 'dep1', 'all', 2010, 100) 87 86 result = report.create_pdf('JOB_ID') … … 89 88 path = os.path.join(samples_dir(), 'level_report.pdf') 90 89 open(path, 'wb').write(result) 91 # Credits counted (taken): 9092 # Credits passed: 6093 # Credits failed: 3094 # Credits registered (total_credits): 18095 # Course1 and Course3 are passed96 # Course2 is failed97 # Course4, Course5 and Course6 have not ben taken98 90 print "Sample level_report.pdf written to %s" % path 99 91 return
Note: See TracChangeset for help on using the changeset viewer.