Index: WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py	(revision 1505)
+++ WAeUP_SRP/trunk/skins/waeup_student/getSessionResults.py	(revision 1510)
@@ -6,6 +6,10 @@
 import DateTime
 current = DateTime.DateTime()
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
 pr = context.portal_registration
-
 request = context.REQUEST
 returning = context.returning_import
@@ -20,6 +24,4 @@
     return None
 info = {}
-#from Products.zdb import set_trace
-#set_trace()
 requested_id = context.getStudentId()
 if requested_id and not context.isStaff() and member_id != requested_id:
@@ -98,6 +100,6 @@
 
 
-if student_from_cat.verdict:
-    verdict_voc = context.portal_vocabularies.verdicts
+verdict_voc = context.portal_vocabularies.verdicts
+if verdict_voc.has_key(student_from_cat.verdict):
     info['verdict'] = verdict_voc.get(student_from_cat.verdict).upper()
 else:
Index: WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py	(revision 1510)
+++ WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py	(revision 1510)
@@ -0,0 +1,99 @@
+##parameters=
+# $Id$
+"""
+process the Application Form
+return html renderer + psm
+"""
+request = context.REQUEST
+import DateTime,logging
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_portal = context.portal_catalog.evalAdvancedQuery
+aq_courses = context.courses_catalog.evalAdvancedQuery
+
+current = DateTime.DateTime()
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+redirect = response.redirect
+logger = logging.getLogger('Student.create_level')
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+member_id = str(member)
+wt = context.waeup_tool
+student = context.students_catalog(id=context.getStudentId())[0]
+cert_id = student.course
+current_level = student.level
+in_progress =  session.get('in_progress','finished')
+if in_progress == 'finished':
+    session.set('in_progress','started')
+    view = context.in_progress_view(refresh=3,page='study_level_view')
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.setHeader('Content-length','%d' % (len(view)))
+    response.setStatus('OK')
+    response.write(view)
+    response.write('')
+elif in_progress == 'started':
+    return
+level = context
+results = context.results_import(matric_no = student.matric_no)
+if results:
+    #carry_overs = [brain for brain in results if brain.GRADE in ('D','E','F')]
+    l = []
+    carry_overs = results
+    for co in carry_overs:
+        carry_over = False
+        query = Eq('code',co.CosCode)
+        c_res = aq_courses(query)
+        if not c_res:
+            logger.info('"%s","%s course not found in courses catalog"' % (student.id,co.CosCode))
+            continue
+        course_cat_entry = c_res[0]
+        if not course_cat_entry.passmark:
+            carry_over = co.GRADE in ('D','E','F')
+        else:
+            try:
+                score = int(co.Score)
+            except:
+                logger.info('"%s"," course %s invalid score %s"' % (student.id,
+                                                                    co.CosCode,
+                                                                    co.Score))
+                continue
+            if int(c_res[0].passmark) <= score:  
+                continue
+            carry_over = True
+        if not carry_over:
+            continue
+        d = context.getCourseInfo(co.CosCode)
+        d['grade'] = co.GRADE
+        d['carry_level'] = co.CarryLevel
+        course_id = "%s_co" % co.CosCode
+        if not context.hasObject(course_id):
+            cr_id = level.invokeFactory('StudentCourseResult',course_id)
+            course_result = getattr(level,cr_id)
+            context.portal_workflow.doActionFor(course_result,'open')
+            course_result.getContent().edit(mapping=d)
+res = context.portal_catalog(portal_type="Certificate", id = cert_id)
+l = []
+if res:
+    cert = res[0]
+    path = cert.getPath()
+    query = Eq("path",path) &\
+            Eq('portal_type','CertificateCourse') &\
+            Eq('SearchableText', "%s" % student.level)
+    courses = aq_portal(query)
+    for c in courses:
+        if not context.hasObject(c.getId):
+            d = context.getCourseInfo(c.getId)
+            cr_id = level.invokeFactory('StudentCourseResult',c.getId)
+            course_result = getattr(level,cr_id)
+            context.portal_workflow.doActionFor(course_result,'open')
+            d['core_or_elective'] = getattr(c.getObject().getContent(),'core_or_elective')
+            course_result.getContent().edit(mapping=d)
+session.set('in_progress','finished')
+return
+return response.redirect("%s" % level.absolute_url())
Index: WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt	(revision 1505)
+++ WAeUP_SRP/trunk/skins/waeup_student/study_level_view.pt	(revision 1510)
@@ -90,7 +90,7 @@
                        (cpsmcat('description_confirm_delete'), )" 
                        />
-                <input tal:condition="python: 0"
-                       type="submit" name="id_rename_form:method"
-                       class="context" value="Change Object ID" i18n:attributes="value" 
+                <input tal:condition="python: 1"
+                       type="submit" name="refresh_level:method"
+                       class="context" value="Refresh List" 
                        />
               </span>
