Changeset 10553 for main/waeup.kofa/trunk
- Timestamp:
- 29 Aug 2013, 05:24:10 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r10479 r10553 546 546 certcode = Attribute('The certificate code of the study course') 547 547 is_current_level = Attribute('Is this level the current level of the student?') 548 passed_params = Attribute('Information about passed and failed courses') 548 549 549 550 level_session = schema.Choice( -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r10552 r10553 54 54 if level_obj.level_session != session: 55 55 continue 56 passed_params = level_obj.passed_params 56 57 line = (stud.student_id, 57 58 stud.matric_number, 58 59 stud.display_fullname, 59 60 level_obj.total_credits, 60 level_obj.gpa) 61 passed_params[2], 62 level_obj.gpa, 63 passed_params[4], 64 ) 61 65 table.append(line) 62 66 return table -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r10552 r10553 19 19 result = get_students_by('fac1', 'dep1', 2010, 100) 20 20 self.assertEqual(result, 21 [(u'K1000000', u'1234', u'Bob Tester', 30, 5.0)])21 [(u'K1000000', u'1234', u'Bob Tester', 30, 30, 5.0, [])]) 22 22 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r10539 r10553 137 137 138 138 @property 139 def passed_params(self): 140 passed = failed = 0 141 failed_courses = [] 142 failed_credits = 0 143 passed_credits = 0 144 for ticket in self.values(): 145 if ticket.score is not None: 146 if ticket.score < ticket.passmark: 147 failed += 1 148 failed_credits += ticket.credits 149 failed_courses.append(ticket.code) 150 else: 151 passed += 1 152 passed_credits += ticket.credits 153 return passed, failed, passed_credits, failed_credits, failed_courses 154 155 @property 139 156 def is_current_level(self): 140 157 try: -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r10539 r10553 786 786 self.assertEqual(self.student['studycourse']['100']['COURSE1'].grade, 'C') 787 787 self.assertEqual(self.student['studycourse']['100']['COURSE1'].weight, 3) 788 # We add another ticket to check if GPA will be correctly calculated788 # We add another ticket to check if GPA will be correctly calculated 789 789 # (and rounded) 790 790 courseticket = createObject('waeup.CourseTicket') … … 820 820 self.assertTrue( 821 821 self.student['studycourse']['200']['COURSE1'].carry_over) 822 # Passed and failed courses have been counted 823 self.assertEqual( 824 self.student['studycourse']['100'].passed_params, 825 (1, 1, 13, 10, ['COURSE1'])) 826 self.assertEqual( 827 self.student['studycourse']['200'].passed_params, 828 (0, 0, 0, 0, [])) 822 829 return 823 830
Note: See TracChangeset for help on using the changeset viewer.