Changeset 13003 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 27 May 2015, 07:20:57 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r13002 r13003 178 178 179 179 class IStudentNavigation(IStudentNavigationBase): 180 """Interface needed for student navigation, logging, etc. 181 """ 182 student = Attribute('Student object of context.') 180 """Interface needed for navigation and logging. This interface is 181 implemented by all content classes in the student section. 182 """ 183 student = Attribute('Student object of context') 183 184 184 185 def writeLogMessage(view, message): 185 186 """Write a view specific log message into students.log. 186 187 187 """ 188 188 … … 190 190 """Representation of student base data. 191 191 """ 192 password = Attribute('Encrypted password')193 temp_password = Attribute('Dictionary with user name, timestamp and encrypted password')194 192 history = Attribute('Object history, a list of messages') 195 193 state = Attribute('Registration state') … … 211 209 transcript_enabled = Attribute('True if transcript processing is enabled') 212 210 211 password = Attribute('Encrypted password') 212 temp_password = Attribute('Dictionary with user name, timestamp and encrypted password') 213 213 214 suspended = schema.Bool( 214 215 title = _(u'Account suspended'), … … 281 282 required = False, 282 283 ) 283 284 def writeLogMessage(view, message):285 """Write formatted log message into students.log.286 """287 284 288 285 def setTempPassword(user, password): … … 427 424 """Representation of student study course data. 428 425 """ 429 student = Attribute('Student object')430 426 next_session_allowed = Attribute('True if the student can proceed to next session') 431 427 is_postgrad = Attribute('True if student is postgraduate student') … … 482 478 ) 483 479 484 def writeLogMessage(view, message):485 """Write formatted log message into students.log.486 """487 488 480 def addStudentStudyLevel(cert, studylevel): 489 481 """Add a study level object. … … 577 569 """A representation of student study level data. 578 570 """ 579 student = Attribute('Student object')580 581 571 certcode = Attribute('The certificate code of the study course') 582 572 is_current_level = Attribute('True if level is current level of the student') … … 633 623 ) 634 624 635 def writeLogMessage(view, message):636 """Write formatted log message into students.log.637 """638 639 625 def addCourseTicket(ticket, course): 640 626 """Add a course ticket object. … … 649 635 """A representation of course ticket data. 650 636 """ 651 code = Attribute('code of the original course') 652 certcode = Attribute('certificate code of the study course') 653 grade = Attribute('grade calculated from score') 654 weight = Attribute('weight calculated from score') 655 removable_by_student = Attribute('Is student allowed to remove the ticket?') 656 level_session = Attribute('session of the level the ticket has been added to') 657 level = Attribute('id of the level the ticket has been added to') 637 certcode = Attribute('Certificate code of the study course') 638 level_session = Attribute('Session of the study level the ticket has been added to') 639 level = Attribute('Level value of the study level the ticket has been added to') 640 grade = Attribute('Grade calculated from score') 641 weight = Attribute('Weight calculated from score') 642 removable_by_student = Attribute('True if student is allowed to remove the ticket') 643 editable_by_lecturer = Attribute('True if lecturer is allowed to edit the ticket') 644 645 code = Attribute('Code of the original course') 658 646 659 647 title = schema.TextLine( … … 712 700 required = False, 713 701 ) 714 715 702 716 703 class ICourseTicketAdd(IKofaObject): -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r13002 r13003 143 143 def passed_params(self): 144 144 """Determine the number and credits of passed and failed courses. 145 146 145 This method is used for level reports. 147 146 """ … … 274 273 try: 275 274 return self.__parent__.__parent__.__parent__ 276 except AttributeError: 275 except AttributeError: # in unit tests 277 276 return None 278 277 … … 281 280 try: 282 281 return self.__parent__.__parent__.certificate.code 283 except AttributeError: 282 except AttributeError: # in unit tests 284 283 return None 285 284 … … 290 289 @property 291 290 def editable_by_lecturer(self): 292 cas = grok.getSite()['configuration'].current_academic_session 293 if self.student.state == VALIDATED and self.student.current_session == cas: 294 return True 291 try: 292 cas = grok.getSite()['configuration'].current_academic_session 293 if self.student.state == VALIDATED and self.student.current_session == cas: 294 return True 295 except TypeError: # in unit tests 296 pass 295 297 return False 296 298 … … 304 306 try: 305 307 return self.__parent__.level 306 except AttributeError: 308 except AttributeError: # in unit tests 307 309 return None 308 310 … … 313 315 try: 314 316 return self.__parent__.level_session 315 except AttributeError: 317 except AttributeError: # in unit tests 316 318 return None 317 319 … … 327 329 """ 328 330 return getGradeWeightFromScore(self.score)[1] 329 330 @property331 def course(self):332 """Returns the course the ticket is referring to. Returns333 None if the course has been removed.334 335 This method is not used in Kofa anymore.336 """337 cat = queryUtility(ICatalog, name='courses_catalog')338 result = cat.searchResults(code=(self.code, self.code))339 if len(result) != 1:340 return None341 return list(result)[0]342 331 343 332 CourseTicket = attrs_to_fields(CourseTicket) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r12889 r13003 1803 1803 self.browser.getControl("Show").click() 1804 1804 self.assertTrue(self.student_id in self.browser.contents) 1805 # The course ticket can be linked with the course.1806 self.assertEqual(1807 self.student['studycourse']['100']['COURSE1'].course,1808 self.course)1809 1805 # Lecturer can neither access the student ... 1810 1806 self.assertRaises(
Note: See TracChangeset for help on using the changeset viewer.