Changeset 13875
- Timestamp:
- 4 Jun 2016, 08:55:08 (9 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r13866 r13875 558 558 return 559 559 if 'UPDATE' in form: 560 tno = 0561 560 error = '' 562 561 if not editable_tickets: … … 564 563 scores = form['scores'] 565 564 cas = form['cas'] 565 sids = form['sids'] 566 566 if isinstance(scores, basestring): 567 567 scores = [scores] 568 568 if isinstance(cas, basestring): 569 569 cas = [cas] 570 if isinstance(sids, basestring): 571 sids = [sids] 572 formvals = dict([(sids[i], (scores[i], cas[i])) 573 for i in range(len(sids))]) 570 574 for ticket in editable_tickets: 571 575 ticket_error = False 572 576 score = ticket.score 573 577 ca = ticket.ca 574 if scores[tno] == '': 578 sid = ticket.student.student_id 579 if formvals[sid][0] == '': 575 580 score = None 576 if cas[tno] == '':581 if formvals[sid][1] == '': 577 582 ca = None 578 583 try: 579 if scores[tno]:580 score = int( scores[tno])581 if cas[tno]:582 ca = int( cas[tno])584 if formvals[sid][0]: 585 score = int(formvals[sid][0]) 586 if formvals[sid][1]: 587 ca = int(formvals[sid][1]) 583 588 except ValueError: 584 589 error += '%s, ' % ticket.student.display_fullname … … 596 601 (ob_class, ticket.student.student_id, 597 602 ticket.level, ticket.code, ca)) 598 tno += 1599 603 if error: 600 604 self.flash(_('Error: Score(s) and CA(s) of %s have not be updated. ' -
main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/editscorespage.pt
r13770 r13875 22 22 <input type="text" name="scores" class="form-control" 23 23 tal:attributes="value ticket/score" /> 24 <input type="hidden" name="sids" 25 tal:attributes="value ticket/student/student_id" /> 24 26 </td> 25 27 <td tal:condition="ticket/editable_by_lecturer" style="width: 65px;">
Note: See TracChangeset for help on using the changeset viewer.