Changeset 16662 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 5 Oct 2021, 10:30:09 (3 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r16431 r16662 148 148 student.get('studycourse', None), 'certificate', None) 149 149 if certificate: 150 allticketcodes = [] 151 failedticketcodes = '' # taken but failed 152 nottakenticketcodes = '' # registered but not taken 153 missedticketcodes = '' # not registered 150 allticketcodes = list() 151 failedticketcodes = list() # taken but failed 152 nottakenticketcodes = list() # registered but not taken 153 missedticketcodes = list() # not registered 154 # collect failed, not taken and all courses 154 155 for level in student['studycourse'].values(): 155 failedticketcodes += level.passed_params[4] 156 nottakenticketcodes += level.passed_params[5] 156 failedticketcodes += level.passed_params[4].split() 157 nottakenticketcodes += level.passed_params[5].split() 157 158 for ticket in level.values(): 158 159 allticketcodes.append(ticket.code) 160 # check if failed or not taken courses have been passed later 161 for code in failedticketcodes: 162 if code in level.passed_params[6]: 163 failedticketcodes.remove(code) 164 for code in nottakenticketcodes: 165 if code in level.passed_params[6]: 166 nottakenticketcodes.remove(code) 167 # collect missed tickets 159 168 for certcourse in certificate.values(): 160 169 if certcourse.getCourseCode() not in allticketcodes: 161 missedticketcodes += '%s ' % certcourse.__name__170 missedticketcodes.append(certcourse.__name__) 162 171 student_wo = (student, missedticketcodes, 163 172 failedticketcodes, nottakenticketcodes) … … 602 611 value = getattr(context[0], name, None) 603 612 elif name == 'missed': 604 value = context[1]613 value = ' '.join(context[1]) 605 614 elif name == 'failed': 606 value = context[2]615 value = ' '.join(context[2]) 607 616 elif name == 'nottaken': 608 value = context[3]617 value = ' '.join(context[3]) 609 618 return super( 610 619 OutstandingCoursesExporter, self).mangle_value( -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r16029 r16662 164 164 credits_passed = 0 165 165 courses_not_taken = '' 166 courses_passed = '' 166 167 for ticket in self.values(): 167 168 if ticket.total_score is not None: … … 176 177 passed += 1 177 178 credits_passed += ticket.credits 179 courses_passed += '%s ' % ticket.code 178 180 else: 179 181 courses_not_taken += '%s ' % ticket.code 180 182 return (passed, failed, credits_passed, 181 183 credits_failed, courses_failed, 182 courses_not_taken )184 courses_not_taken, courses_passed) 183 185 184 186 @property -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r16609 r16662 1062 1062 self.assertEqual( 1063 1063 self.student['studycourse']['100'].passed_params, 1064 (1, 1, 13, 10, 'COURSE1 ', '' ))1064 (1, 1, 13, 10, 'COURSE1 ', '', 'ANYCODE ')) 1065 1065 self.assertEqual( 1066 1066 self.student['studycourse']['200'].passed_params, 1067 (0, 0, 0, 0, '', 'COURSE1 ' ))1067 (0, 0, 0, 0, '', 'COURSE1 ', '')) 1068 1068 # And also cumulative params can be calculated. Meanwhile we have the 1069 1069 # following courses: COURSE1 and COURSE2 in level 100 and -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r16333 r16662 890 890 result, 891 891 'student_id,matric_number,certcode,display_fullname,missed,failed,nottaken\r\n' 892 'A111111,234,CERT1,Anna M. Tester,C2_400 ,C3 ,C1 CRS1\r\n'892 'A111111,234,CERT1,Anna M. Tester,C2_400,C3,C1 CRS1\r\n' 893 893 ) 894 894 return
Note: See TracChangeset for help on using the changeset viewer.