Index: WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py	(revision 1404)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/fixLevelFromResults.py	(revision 1407)
@@ -18,7 +18,7 @@
 setheader = request.RESPONSE.setHeader
 
-#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)
     
 wftool = context.portal_workflow
@@ -42,5 +42,4 @@
 res = scat()
 for sbrain in res:
-    old_level = str(sbrain.level)
     if str(sbrain.level) == '100':
         ec = "new"
@@ -48,21 +47,20 @@
         ec = "nor"
     erg = context.results_import(matric_no=sbrain.matric_no)
-    lc = 'u'
     if erg and erg[0].Level:
-        lc = "e" # code for level status u = unset
-        level = erg[0].Level
+        lc = "N" 
+        level_res = erg[0].Level
         everdict = erg[0].Verdict
-        lnr = context.getLevelFromResultsCosCode(erg)
-        if lnr == 0:
+        level_cc = context.getLevelFromResultsCosCode(erg)
+        if level_cc == 0:
             lc = "-"
-        if "%d00" % lnr != level:
+        if "%d00" % level_cc != level_res:
             lc = "!"
         verdict,elegible = context.getVerdict(everdict)
         if elegible:
-            lc = "+"
-            level = "%d00" % (lnr + 1)
-        context.students_catalog.modifyRecord(id = sbrain.id, 
-                                              level="",
-                                              verdict = "")
+            lc = "S"
+            level = "%d00" % (level_cc + 1)
+        #context.students_catalog.modifyRecord(id = sbrain.id, 
+        #                                      level="",
+        #                                      verdict = "")
         while True:
             student = getattr(students,sbrain.id,None)
@@ -74,27 +72,27 @@
             if study_course is None:
                 break
-            study_course.getContent().edit(mapping = {'current_level':level,
-                                                      'current_verdict':verdict})
-            context.students_catalog.modifyRecord(id = sbrain.id, 
-                                                  level=level,
-                                                  verdict=verdict)
+            #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
 
-#        rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
-
-        lines.append('"%s %s","%s","%s","%s","%s","%s","%s"' % (lc,ec,
+        #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no +"--"+ old_level +"--"+ level +"<br />")
+        s = '"%s","%s","%s","%s","%s","%s","%s","%s"' % (lc,ec,
                                                            sbrain.id,
                                                            sbrain.matric_no,
-                                                           old_level,
-                                                           level,
+                                                           level_res,
+                                                           level_cc,
                                                            everdict,
-                                                           verdict))
+                                                           verdict)
+        #lines.append(s)
+    else:
+        #rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />")
+        s = '"","%s","%s","%s","",""' % (ec,sbrain.id,sbrain.matric_no)
+        #lines.append(s)
         
-
-    else:
-#        rwrite(ec +"--"+ sbrain.id +"--"+ sbrain.matric_no + "<br />")
-        lines.append('"%s","%s","%s","",""' % (ec,sbrain.id,sbrain.matric_no))
-        
+    rwrite("%s<br />" %s)
 #    count += 1
 #    if count > 60:
@@ -103,12 +101,12 @@
 #        count = 0
 
-#rwrite("<br />\n Done" )
+rwrite("<br />\n Done" )
 
-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)
 
Index: WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py	(revision 1404)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/reindex_entry_mode.py	(revision 1407)
@@ -40,5 +40,5 @@
         ec = 'cup'
         #cat.modifyRecord(id = sb.id,entry_mode = em)
-        lines.append('"%s","%s","","%s",""' % (ec,sb.id,sb.em))
+        lines.append('"%s","%s","","%s",""' % (ec,sb.id,em))
         #rwrite(ec +"--"+ sb.id +"--"+ em +"<br />")
     else:
