Index: WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py	(revision 1400)
+++ WAeUP_SRP/trunk/skins/waeup_pins/search_pins.py	(revision 1401)
@@ -102,4 +102,5 @@
 info = {}
 info['used'] = []
+#from Products.zdb import set_trace;set_trace()
 if context.portal_type == "ScratchCardBatch":
     info['batch_doc'] = context.getContent() 
Index: WAeUP_SRP/trunk/skins/waeup_student/getLevelFromResultsCosCode.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getLevelFromResultsCosCode.py	(revision 1401)
+++ WAeUP_SRP/trunk/skins/waeup_student/getLevelFromResultsCosCode.py	(revision 1401)
@@ -0,0 +1,19 @@
+## Script (Python) "getLevelFromResultsList"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=list
+##title=
+##
+# $Id$
+lnr = 0
+for e in list:
+    try:
+        cc = int(e.CosCode[3])
+    except:
+        continue
+    if lnr <= cc:
+        lnr = cc
+return lnr
Index: WAeUP_SRP/trunk/skins/waeup_student/getVerdict.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getVerdict.py	(revision 1401)
+++ WAeUP_SRP/trunk/skins/waeup_student/getVerdict.py	(revision 1401)
@@ -0,0 +1,24 @@
+## Script (Python) "getVerdict"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=verdict
+##title=
+##
+# $Id$
+
+verdicts = {'SUCCESSFUL STUDENT': ('successful',True),
+            'STUDENT WITH CARRYOVER COURSES': ('carryover',True),
+            'STUDENT ON PROBATION': ('probation',False),
+            'WITHDRAWAL STUDENT': ('withdrawal',False),
+            'FIRST CLASS HONOURS': ('first_class',False),
+            'SECOND CLASS HONOURS (UPPER DIVISION)': ('second_class_upper',False),
+            'SECOND CLASS HONOURS (LOWER DIVISION)': ('second_class_lower',False),
+            'THIRD CLASS': ('third_class',False),
+#            '': ('',False),
+            }
+
+return verdicts.get(verdict,('no_such_verdict',False))
+
Index: WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py	(revision 1400)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py	(revision 1401)
@@ -34,17 +34,13 @@
 
 
-
-
 if str(member) not in ('admin','joachim'):
     return
 count = 0
-lc = 1
+line_count = 0
 lines = []
 #from Products.zdb import set_trace;set_trace()
 res = scat()
 for sbrain in res:
-
     old_level = str(sbrain.level)
- 
     if str(sbrain.level) == '100':
         ec = "new"
@@ -52,15 +48,21 @@
         ec = "nor"
     erg = context.results_import(matric_no=sbrain.matric_no)
+    lc = 'u'
     if erg and erg[0].Level:
-        ec = "e"
+        lc = "e" # code for level status u = unset
         level = erg[0].Level
-        for e in erg:
-            ec = "E"
-            if level != e.Level:
-                ec = "%s:%s!=%s<br />\n" % (sbrain.matric_no,level,e.Level)
-        level = "%d" % (int(level) + 100)
-
-        context.students_catalog.modifyRecord(id = sbrain.id, level="")
-
+        everdict = erg[0].Verdict
+        lnr = context.getLevelFromResultsCosCode(erg)
+        if lnr == 0:
+            lc = "-"
+        if "%d00" % lnr != level:
+            lc = "!"
+        verdict,elegible = context.getVerdict(everdict)
+        if elegible:
+            lc = "+"
+            level = "%d00" % (lnr + 1)
+        context.students_catalog.modifyRecord(id = sbrain.id, 
+                                              level="",
+                                              verdict = "")
         while True:
             student = getattr(students,sbrain.id,None)
@@ -72,8 +74,9 @@
             if study_course is None:
                 break
-
-            study_course.getContent().edit(mapping = {'current_level':level})
-            context.students_catalog.modifyRecord(id = sbrain.id, level=level)
-
+            study_course.getContent().edit(mapping = {'current_level':level,
+                                                      'current_verdict':verdict})
+            context.students_catalog.modifyRecord(id = sbrain.id, 
+                                                  level=level,
+                                                  verdict=verdict)
             ec = "reg"
             break
@@ -81,5 +84,11 @@
 #        rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
 
-        lines.append('"%s","%s","%s","%s","%s"' % (ec,sbrain.id,sbrain.matric_no,old_level,level))
+        lines.append('"%s %s","%s","%s","%s","%s","%s","%s"' % (lc,ec,
+                                                           sbrain.id,
+                                                           sbrain.matric_no,
+                                                           old_level,
+                                                           level,
+                                                           everdict,
+                                                           verdict))
         
 
@@ -90,6 +99,6 @@
 #    count += 1
 #    if count > 60:
-#        lc += 1
-#        rwrite("<br />\n%3d " % lc)
+#        line_count += 1
+#        rwrite("<br />\n%3d " % line_count)
 #        count = 0
 
