Ignore:
Timestamp:
21 Sep 2013, 05:12:49 (11 years ago)
Author:
Henrik Bettermann
Message:

Define conditions for score editing. Tests will follow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r10630 r10631  
    30553055        session = academic_sessions_vocab.getTerm(
    30563056            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)
    30593059
    30603060    def _searchCatalog(self, session):
     
    30733073        datatable.need()
    30743074        self.tickets = self._searchCatalog(self.current_academic_session)
     3075        editable_tickets = [
     3076            ticket for ticket in self.tickets if ticket.editable_by_lecturer]
    30753077        if not self.tickets:
    30763078            self.flash(_('No student found.'))
     
    30793081            tno = 0
    30803082            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:
    30823089                score = ticket.score
    30833090                try:
    3084                     score = int(form['scores'][tno])
     3091                    score = int(scores[tno])
    30853092                except ValueError:
    30863093                    error += '%s, ' % ticket.student.display_fullname
Note: See TracChangeset for help on using the changeset viewer.