Index: WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py	(revision 1407)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py	(revision 1408)
@@ -48,15 +48,15 @@
     erg = context.results_import(matric_no=sbrain.matric_no)
     if erg and erg[0].Level:
-        lc = "N" 
+        #lc = "N"
         level_res = erg[0].Level
         everdict = erg[0].Verdict
         level_cc = context.getLevelFromResultsCosCode(erg)
-        if level_cc == 0:
-            lc = "-"
-        if "%d00" % level_cc != level_res:
-            lc = "!"
+        #if level_cc == 0:
+            #lc = "-"
+        #if "%d00" % level_cc != level_res:
+        lc = 100*level_cc - int(level_res)
         verdict,elegible = context.getVerdict(everdict)
         if elegible:
-            lc = "S"
+            #lc = "S"
             level = "%d00" % (level_cc + 1)
         #context.students_catalog.modifyRecord(id = sbrain.id, 
@@ -81,5 +81,5 @@
 
         #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
-        s = '"%s","%s","%s","%s","%s","%s","%s","%s"' % (lc,ec,
+        s = '"%s", "%s","%s","%s","%s","%s","%s","%s"' % (str(lc),ec,
                                                            sbrain.id,
                                                            sbrain.matric_no,
Index: WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py	(revision 1407)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py	(revision 1408)
@@ -15,17 +15,18 @@
 session = request.SESSION
 response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
 students = context.portal_url.getPortalObject().campus.students
 
-#def rwrite(s):
-#    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
-#    response.write(s)
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write(s)
 
 cat = context.students_catalog
 
-#ems = cat.uniqueValuesFor('entry_mode')
-#rwrite("entry_mode values: %s<br />\n" % (str(ems)))
-#for em in ems:
-#    res = cat(entry_mode = em)
-#    rwrite("entry_mode: %s = %d<br />\n" % (em,len(res)))
+ems = cat.uniqueValuesFor('entry_mode')
+rwrite("entry_mode values: %s<br />\n" % (str(ems)))
+for em in ems:
+    res = cat(entry_mode = em)
+    rwrite("entry_mode: %s = %d<br />\n" % (em,len(res)))
 
 sbrains = cat()
@@ -37,12 +38,15 @@
     em = context.getFromData_entry_mode(sb.id)
     ec = 'x'
+    level_cat = sb.level
     if em in ('UME','DE'):
         ec = 'cup'
         #cat.modifyRecord(id = sb.id,entry_mode = em)
-        lines.append('"%s","%s","","%s",""' % (ec,sb.id,em))
-        #rwrite(ec +"--"+ sb.id +"--"+ em +"<br />")
+        s = '"%s","%s","","%s","","%s"' % (ec,sb.id,em,level_cat)
+        #lines.append('"%s","%s","","%s",""' % (ec,sb.id,em))
+        rwrite("%s<br />" %s)
     else:
         ret = context.returning_import(matric_no=sb.matric_no)
         moe = ret[0].Mode_of_Entry
+        
         if moe in ('DE','DIRECT', 'DIRECT ENTRY',):
             ec = 'de'
@@ -58,17 +62,21 @@
         #app = getattr(getattr(students,sb.id),'application',None)
         #if app is not None:
-            #app.getContent().edit(mapping={'entry_mode': new_em})
-            #cat.modifyRecord(id = sb.id,entry_mode = new_em)
+        #    app.getContent().edit(mapping={'entry_mode': new_em})
+        #    cat.modifyRecord(id = sb.id,entry_mode = new_em)
         #else:
-            #cat.modifyRecord(id = sb.id,entry_mode = "")
+        #    cat.modifyRecord(id = sb.id,entry_mode = "")
 
-        lines.append('"%s","%s","%s","%s","%s"' % (ec,sb.id,sb.matric_no,moe,new_em))
-        #rwrite(ec +"--"+ sb.id +"--"+ em +"--"+ moe +"--"+ new_em +"<br />")
+        s = '"%s","%s","%s","%s","%s","%s"' % (ec,sb.id,sb.matric_no,moe,new_em,level_cat)
+        #lines.append('"%s","%s","%s","%s","%s"' % (ec,sb.id,sb.matric_no,moe,new_em))
+        rwrite("%s<br />" %s)
 
-setheader('Content-type','text/semicolon-seperated-values')
-setheader('Content-Disposition:', 'attachment; filename="fixLevelExport.csv"')
-setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
-setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
-setheader('Cache-Control', 'post-check=0,pre-check=0')
-setheader('Pragma', 'no-cache') # HTTP/1.0
-return '\n'.join(lines)
+#setheader('Content-type','text/semicolon-seperated-values')
+#setheader('Content-Disposition:', 'attachment; filename="fixLevelExport.csv"')
+#setheader('Expires',  'Mon, 26 Jul 1997 05:00:00GMT') # Date in the past
+#setheader('Cache-Control', 'no-store, no-cache,must-revalidate') # HTTP/1.1
+#setheader('Cache-Control', 'post-check=0,pre-check=0')
+#setheader('Pragma', 'no-cache') # HTTP/1.0
+#return '\n'.join(lines)
+
+rwrite("<br />\n Done" )
+
