Index: WAeUP_SRP/trunk/skins/waeup_ois/academic_report_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_ois/academic_report_view.pt	(revision 5143)
+++ WAeUP_SRP/trunk/skins/waeup_ois/academic_report_view.pt	(revision 5144)
@@ -3,5 +3,5 @@
           tal:define="info context/getStudyLevelInfo;
                       contact_student_form string:contact_student_form;
-                      study_level_view string:study_level_view;">
+                      academic_report_view string:academic_report_view;">
   <metal:block define-macro="edit_form">   
               
@@ -119,5 +119,5 @@
           <td style='text-align:center' tal:content="row/exam"></td>
           <td style='text-align:center' tal:content="row/score_calc"></td>
-          <td style='text-align:center' tal:content="row/grade"></td>
+          <td style='text-align:center' tal:content="row/session_id"></td>
           <td style='text-align:center' tal:content="row/pic"></td>
           
@@ -173,5 +173,5 @@
                      
               <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
-                     tal:attributes="value study_level_view"/>  
+                     tal:attributes="value academic_report_view"/>  
                      
               <br /><br />
@@ -217,5 +217,5 @@
                      
               <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
-                     tal:attributes="value study_level_view"/>                         
+                     tal:attributes="value academic_report_view"/>                         
               <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
                      tal:attributes="value contact_student_form"/>                         
@@ -254,5 +254,5 @@
                      
               <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
-                     tal:attributes="value study_level_view"/>                         
+                     tal:attributes="value academic_report_view"/>                         
               <input type="hidden" name="action_after_reject" type="text" id="action_after_reject"
                      tal:attributes="value contact_student_form"/>    
@@ -277,5 +277,5 @@
                    />
             <input type="hidden" name="action_after_validate" type="text" id="action_after_validate"
-                     tal:attributes="value study_level_view"/>                       
+                     tal:attributes="value academic_report_view"/>                       
           </td>                
       </table>
Index: WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py	(revision 5143)
+++ WAeUP_SRP/trunk/skins/waeup_student/refresh_level.py	(revision 5144)
@@ -45,4 +45,5 @@
 level = context
 level_id = context.getId()
+session_id = context.getLevelSession(level.getContent(),student_id,level_id)
 res = context.portal_catalog(portal_type="Certificate", id = cert_id)
 query = Eq('student_id',student_id) & Eq('level_id', level_id)
@@ -73,4 +74,5 @@
         d['student_id'] = student_id
         d['level_id'] = level_id
+        d['session_id'] = session_id
         d['key'] = "%s|%s|%s" % (student_id,level_id,course_id)
         records.append(d)
@@ -79,5 +81,5 @@
 
 #session.set('in_progress','finished')
-logger.info('%s updated course list' % member)
+logger.info('%s updated level %s of %s' % (member,level_id,student_id))
 
 args = {}
Index: WAeUP_SRP/trunk/skins/waeup_utilities/fill_session_in_course_results.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_utilities/fill_session_in_course_results.py	(revision 5144)
+++ WAeUP_SRP/trunk/skins/waeup_utilities/fill_session_in_course_results.py	(revision 5144)
@@ -0,0 +1,65 @@
+## Script (Python) "fill_session"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=
+##title=
+##
+# $Id$
+"""
+"""
+try:
+    from Products.zdb import set_trace
+except:
+    def set_trace():
+        pass
+
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+if str(member) not in ('admin',):
+    return
+
+
+import logging
+import DateTime
+logger = logging.getLogger('fill_session_in_course_results')
+from Products.AdvancedQuery import Eq, Between, Le,In
+
+course_results = context.course_results
+students = context.portal_url.getPortalObject().campus.students
+
+
+brains = course_results()
+total = len(brains)
+edited = 0
+for brain in brains:
+    #set_trace()
+    if not brain.session_id:
+        data = {}
+        data['key'] = brain.key
+        
+        if not students.hasObject(brain.student_id):
+            logger.info("no student %s" % student_id)
+            continue
+        student = getattr(students, brain.student_id)        
+        if not student.hasObject("study_course"):
+            logger.info("%s: no study_course" % brain.student_id)
+            continue
+        study_course = student.study_course
+        if not study_course.hasObject(brain.level_id):
+            logger.info("%s: no level %s" % (brain.student_id,brain.level_id))
+            continue
+        level_obj = getattr(study_course, brain.level_id)    
+        level_doc = level_obj.getContent()   
+        #set_trace() 
+        session_id = level_doc.session
+        data['session_id'] = session_id
+        course_results.modifyRecord(**data)
+        logger.info("%s: session %s filled" % (brain.key,session_id))
+        edited += 1
+    #else:
+    #    logger.info("%s: %s" % (brain.student_id,brain.session_id))
+        
+logger.info("edited %d course results of %s total" % (edited,total))
