Index: WAeUP_SRP/base/WAeUPTool.py
===================================================================
--- WAeUP_SRP/base/WAeUPTool.py	(revision 3154)
+++ WAeUP_SRP/base/WAeUPTool.py	(revision 3155)
@@ -2121,5 +2121,5 @@
         #
         not_imported_keys = import_keys + ["Error",]
-        not_imported_file = open(not_imported_fn,"a")
+        not_imported_file = open(not_imported_fn,"w")
         not_imported_csv_writer = csv.DictWriter(not_imported_file,
                                                     not_imported_keys,
@@ -2134,5 +2134,5 @@
         if 'id' not in imported_keys:
             imported_keys.insert(0,"id")
-        imported_file = open(imported_fn,"a")
+        imported_file = open(imported_fn,"w")
         imported_csv_writer = csv.DictWriter(imported_file,
                                              imported_keys,
@@ -2178,5 +2178,9 @@
                 pending_imported_ids = []
                 pending_imported = []
-                for item in pending_records.values():
+                for record in pending_records.values():
+                    item = {}
+                    for k,v in record.items():
+                        if v:
+                            item[k] = v
                     results = importer(item)
                     id = results[0]
@@ -2185,15 +2189,13 @@
                     if is_pending:
                         continue
-                    if error:
-                        continue
-                    msg = format % item
+                    del item['Error']
+                    msg = ";".join(["%s : %s" % (k,v) for k,v in item.items()])
                     logger.info("imported from %(pending_fn)s %(msg)s" % vars())
                     pending_imported.append(item)
                     pending_imported_ids += id,
                     total_pending_imported = len(pending_imported_ids)
-                logger.info("imported %d pending imports" % len(pending_imported_ids))
+                    logger.info("imported %d pending imports" % len(pending_imported_ids))
                 for id in pending_imported_ids:
-                    if pending_records.has_key(id):
-                        del pending_records[id]
+                    del pending_records[id]
             pending_imports_file = open(pending_fn,'w')
             pending_csv_writer = csv.DictWriter(pending_imports_file,
Index: WAeUP_SRP/base/skins/waeup_utilities/ti_474_resolve.py
===================================================================
--- WAeUP_SRP/base/skins/waeup_utilities/ti_474_resolve.py	(revision 3155)
+++ WAeUP_SRP/base/skins/waeup_utilities/ti_474_resolve.py	(revision 3155)
@@ -0,0 +1,67 @@
+## Script (Python) "ti_71fc_resolve"
+##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','joachim'):
+    return
+
+
+import logging
+import DateTime
+logger = logging.getLogger('Skins.ti_71fc_resolve')
+from Products.AdvancedQuery import Eq, Between, Le,In
+aq_students = context.students_catalog.evalAdvancedQuery
+aq_portal = context.portal_catalog_real.evalAdvancedQuery
+course_results = context.course_results
+aq_course_results = course_results.evalAdvancedQuery
+students_folder = context.portal_url.getPortalObject().campus.students
+
+request = context.REQUEST
+session = request.SESSION
+response = request.RESPONSE
+setheader = request.RESPONSE.setHeader
+def rwrite(s):
+    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
+    response.write("%s<br>\n\r" % s)
+course_results_to_change = []
+logger.info('start')
+set_trace()
+for result in course_results():
+    student_id,level_id,code = result.key.split('|')
+    if result.student_id != student_id:
+        d = {}
+        d['key'] = result.key
+        d['student_id'] = student_id
+        d['level_id'] = level_id
+        course = context.courses_catalog.getRecordByKey(result.code)
+        d['credits'] = course.credits
+        d['semester'] = course.semester
+        d['session_id'] = '06'
+        course_results_to_change += d,
+logger.info('found %d correctable results' % len(course_results_to_change))
+set_trace()
+for result in course_results_to_change:
+    try:
+        course_results.modifyRecord(**result)
+        logger.info('%(student_id)s correcting %(key)s' % result)
+    except KeyError:
+        set_trace()
+        logger.info('%(student_id)s %(key)s not found there' % result)
+    
+logger.info('finished')
