Changeset 10631 for main/waeup.kofa/trunk/src
- Timestamp:
- 21 Sep 2013, 05:12:49 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r10627 r10631 644 644 current_academic_session = schema.Choice( 645 645 title = _(u'Current Academic Session'), 646 description = _(u'Session for which score editing is allowed'), 646 647 source = academic_sessions_vocab, 647 648 default = None, -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r10630 r10631 3055 3055 session = academic_sessions_vocab.getTerm( 3056 3056 self.current_academic_session).title 3057 return ' Students registered for %s in academic session %s' % (3058 self.context. longtitle(), session)3057 return '%s tickets in academic session %s' % ( 3058 self.context.code, session) 3059 3059 3060 3060 def _searchCatalog(self, session): … … 3073 3073 datatable.need() 3074 3074 self.tickets = self._searchCatalog(self.current_academic_session) 3075 editable_tickets = [ 3076 ticket for ticket in self.tickets if ticket.editable_by_lecturer] 3075 3077 if not self.tickets: 3076 3078 self.flash(_('No student found.')) … … 3079 3081 tno = 0 3080 3082 error = '' 3081 for ticket in self.tickets: 3083 if not editable_tickets: 3084 return 3085 scores = form['scores'] 3086 if isinstance(scores, basestring): 3087 scores = [scores] 3088 for ticket in editable_tickets: 3082 3089 score = ticket.score 3083 3090 try: 3084 score = int( form['scores'][tno])3091 score = int(scores[tno]) 3085 3092 except ValueError: 3086 3093 error += '%s, ' % ticket.student.display_fullname -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/editscorespage.pt
r10627 r10631 25 25 <td tal:content="ticket/student/current_level">LEVEL</td> 26 26 <td tal:content="ticket/level">LEVEL</td> 27 <td><input type="text" name="scores" class="span1" 28 tal:attributes="value ticket/score" /></td> 27 <td tal:condition="ticket/editable_by_lecturer"> 28 <input type="text" name="scores" class="span1" 29 tal:attributes="value ticket/score" /> 30 </td> 31 <td tal:condition="not: ticket/editable_by_lecturer" 32 tal:content="ticket/score">SCORE</td> 29 33 </tr> 30 34 </tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r10618 r10631 25 25 from zope.component import createObject, queryUtility 26 26 from zope.interface import implementedBy 27 from waeup.kofa.interfaces import academic_sessions_vocab 27 from waeup.kofa.interfaces import academic_sessions_vocab, VALIDATED 28 28 from waeup.kofa.students.interfaces import ( 29 29 IStudentStudyLevel, IStudentNavigation, ICourseTicket) … … 291 291 return not self.mandatory 292 292 293 @property 294 def editable_by_lecturer(self): 295 cas = grok.getSite()['configuration'].current_academic_session 296 if self.student.state == VALIDATED and self.student.current_session == cas: 297 return True 298 return False 299 293 300 def writeLogMessage(self, view, message): 294 301 return self.__parent__.__parent__.__parent__.writeLogMessage(view, message)
Note: See TracChangeset for help on using the changeset viewer.