Changeset 13874
- Timestamp:
- 4 Jun 2016, 08:53:32 (9 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r13773 r13874 3124 3124 return 3125 3125 if 'UPDATE' in form: 3126 tno = 03127 3126 error = '' 3128 3127 if not editable_tickets: 3129 3128 return 3130 3129 scores = form['scores'] 3130 sids = form['sids'] 3131 3131 if isinstance(scores, basestring): 3132 3132 scores = [scores] 3133 if isinstance(sids, basestring): 3134 sids = [sids] 3135 formvals = dict([(sids[i], scores[i]) for i in range(len(sids))]) 3133 3136 for ticket in editable_tickets: 3134 3137 score = ticket.score 3135 if scores[tno] == '': 3138 sid = ticket.student.student_id 3139 if formvals[sid] == '': 3136 3140 score = None 3137 3141 else: 3138 3142 try: 3139 score = int( scores[tno])3143 score = int(formvals[sid]) 3140 3144 except ValueError: 3141 3145 error += '%s, ' % ticket.student.display_fullname … … 3147 3151 ticket.level, ticket.code, score)) 3148 3152 #notify(grok.ObjectModifiedEvent(ticket)) 3149 tno += 13150 3153 if error: 3151 3154 self.flash(_('Error: Score(s) of %s have not be updated. ' -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/editscorespage.pt
r13769 r13874 21 21 <input type="text" name="scores" class="form-control" 22 22 tal:attributes="value ticket/score" /> 23 <input type="hidden" name="sids" 24 tal:attributes="value ticket/student/student_id" /> 23 25 </td> 24 26 <td tal:condition="not: ticket/editable_by_lecturer"
Note: See TracChangeset for help on using the changeset viewer.