Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 13874)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py	(revision 13875)
@@ -558,5 +558,4 @@
             return
         if 'UPDATE' in form:
-            tno = 0
             error = ''
             if not editable_tickets:
@@ -564,21 +563,27 @@
             scores = form['scores']
             cas = form['cas']
+            sids = form['sids']
             if isinstance(scores, basestring):
                 scores = [scores]
             if isinstance(cas, basestring):
                 cas = [cas]
+            if isinstance(sids, basestring):
+                sids = [sids]
+            formvals = dict([(sids[i], (scores[i], cas[i]))
+                             for i in range(len(sids))])
             for ticket in editable_tickets:
                 ticket_error = False
                 score = ticket.score
                 ca = ticket.ca
-                if scores[tno] == '':
+                sid = ticket.student.student_id
+                if formvals[sid][0] == '':
                     score = None
-                if cas[tno] == '':
+                if formvals[sid][1] == '':
                     ca = None
                 try:
-                    if scores[tno]:
-                        score = int(scores[tno])
-                    if cas[tno]:
-                        ca = int(cas[tno])
+                    if formvals[sid][0]:
+                        score = int(formvals[sid][0])
+                    if formvals[sid][1]:
+                        ca = int(formvals[sid][1])
                 except ValueError:
                     error += '%s, ' % ticket.student.display_fullname
@@ -596,5 +601,4 @@
                         (ob_class, ticket.student.student_id,
                          ticket.level, ticket.code, ca))
-                tno += 1
             if error:
                 self.flash(_('Error: Score(s) and CA(s) of %s have not be updated. '
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/editscorespage.pt
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/editscorespage.pt	(revision 13874)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/browser_templates/editscorespage.pt	(revision 13875)
@@ -22,4 +22,6 @@
           <input type="text" name="scores" class="form-control"
   	             tal:attributes="value ticket/score" />
+          <input type="hidden" name="sids"
+                 tal:attributes="value ticket/student/student_id" />
       </td>
   	  <td tal:condition="ticket/editable_by_lecturer" style="width: 65px;">
