Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py	(revision 9293)
@@ -334,9 +334,9 @@
         self.assertEqual(num_warns,2)
         fail_contents = open(fail_file, 'rb').read()
-        shutil.rmtree(os.path.dirname(fail_file))
         # CERT2 is in wrong category ...
         self.assertTrue('course1: wrong application category' in fail_contents)
         # ... and CERT3 does not exist.
         self.assertTrue('course1: Invalid value' in fail_contents)
+        shutil.rmtree(os.path.dirname(fail_file))
         return
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py	(revision 9293)
@@ -734,5 +734,9 @@
         # Check if new verdict is provided
         if row['current_verdict'] in (IGNORE_MARKER, ''):
-            return 'Verdict is missing.'
+            return 'No verdict in import file.'
+        # Check if studylevel exists#
+        level_string = str(obj.current_level)
+        if obj.get(level_string) is None:
+            return 'Study level object is missing.'
         # Check if student is in state REGISTERED or VALIDATED
         if row.get('bypass_validation') in ('1', 'True', 'TRUE', 'yes'):
@@ -750,10 +754,9 @@
         vals_to_set = dict((key, val) for key, val in row.items()
                            if key not in ('current_session','current_level'))
-        items_changed = super(StudentVerdictProcessor, self).updateEntry(
-            obj, vals_to_set, site)
-        parent = self.getParent(row, site)
-        parent.__parent__.logger.info(
-            '%s - Verdict updated: %s'
-            % (parent.student_id, items_changed))
+        super(StudentVerdictProcessor, self).updateEntry(obj, vals_to_set, site)
+        parent = self.getParent(row, site)
+        # Set current_vedict in corresponding studylevel
+        level_string = str(obj.current_level)
+        obj[level_string].level_verdict = row['current_verdict']
         # Fire transition depending on student's state
         if obj.__parent__.state == REGISTERED:
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_student_data.csv	(revision 9293)
@@ -7,2 +7,3 @@
 X999999,Herbert,Mueller,6,1990-01-02,100005,aa@aa.ng,1234,m,courses registered
 X111111,Fabian,Riester,7,1990-01-02,100006,aa@aa.ng,1234,m,courses validated
+X222222,Thomas,Kinderman,8,1990-01-02,100007,aa@aa.ng,1234,m,courses validated
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studycourse_data.csv
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studycourse_data.csv	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studycourse_data.csv	(revision 9293)
@@ -8,2 +8,3 @@
 6,,CERT1,2008,200
 7,,CERT1,2008,200
+8,,CERT1,2008,200
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studylevel_data.csv
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studylevel_data.csv	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_studylevel_data.csv	(revision 9293)
@@ -1,6 +1,11 @@
 reg_number,matric_number,level_session,level_verdict,level
-1,,2008,A,100
+1,,2008,,100
+1,,2008,,200
 2,,2008,B,100
 ,100002,2009,C,100
 1,,2008,A,111
 1,,2008,A,nonsense
+4,,2008,A,200
+5,,2008,A,200
+6,,2008,A,200
+7,,2008,A,200
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_verdict_data.csv
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_verdict_data.csv	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_verdict_data.csv	(revision 9293)
@@ -1,4 +1,4 @@
 matric_number,current_session,current_level,current_verdict,bypass_validation
-100000,2008,200,A,0
+100000,2008,200,0,0
 100001,2008,100,B,False
 100002,2007,200,C,
@@ -7,2 +7,3 @@
 100005,2008,200,A,1
 100006,2008,200,A,True
+100007,2008,200,A,True
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py	(revision 9293)
@@ -360,5 +360,5 @@
             self.csv_file, STUDENT_HEADER_FIELDS)
         self.assertEqual(num_warns,0)
-        self.assertEqual(len(self.app['students']), 8)
+        self.assertEqual(len(self.app['students']), 9)
         self.assertEqual(self.app['students']['X666666'].reg_number,'1')
         self.assertEqual(
@@ -594,4 +594,13 @@
             studycourse_file, STUDYCOURSE_HEADER_FIELDS,'update')
         shutil.rmtree(os.path.dirname(fin_file))
+        # Import study levels
+        self.csv_file = os.path.join(
+            self.workdir, 'sample_studylevel_data.csv')
+        open(self.csv_file, 'wb').write(STUDYLEVEL_SAMPLE_DATA)
+        processor = StudentStudyLevelProcessor()
+        num, num_warns, fin_file, fail_file = processor.doImport(
+            self.csv_file, STUDYLEVEL_HEADER_FIELDS,'create')
+        content = open(fail_file).read()
+        shutil.rmtree(os.path.dirname(fin_file))
 
         self.processor = StudentVerdictProcessor()
@@ -602,17 +611,20 @@
 
     def test_import(self):
-        num, num_warns, fin_file, fail_file = self.processor.doImport(
-            self.csv_file, VERDICT_HEADER_FIELDS,'update')
-        self.assertEqual(num_warns,4)
         studycourse = self.processor.getEntry(dict(matric_number='100000'),
                                               self.app)
+        self.assertEqual(studycourse['200'].level_verdict, None)
         student = self.processor.getParent(
             dict(matric_number='100000'), self.app)
-        self.assertEqual(studycourse.current_verdict, 'A')
+        num, num_warns, fin_file, fail_file = self.processor.doImport(
+            self.csv_file, VERDICT_HEADER_FIELDS,'update')
+        content = open(fail_file).read()
+        self.assertEqual(num_warns,5)
+        self.assertEqual(studycourse.current_verdict, '0')
         self.assertEqual(student.state, 'returning')
         self.assertEqual(studycourse.current_level, 200)
+        self.assertEqual(studycourse['200'].level_verdict, '0')
         student = self.processor.getParent(
             dict(matric_number='100005'), self.app)
-        self.assertEqual(studycourse.current_verdict, 'A')
+        self.assertEqual(studycourse.current_verdict, '0')
         self.assertEqual(student.state, 'returning')
         self.assertEqual(studycourse.current_level, 200)
@@ -625,5 +637,6 @@
             '2007,C,<IGNORE>,100002,200,Current session does not correspond.\r\n'
             '2008,A,<IGNORE>,100003,200,Student in wrong state.\r\n'
-            '2008,<IGNORE>,<IGNORE>,100004,200,Verdict is missing.\r\n'
+            '2008,<IGNORE>,<IGNORE>,100004,200,No verdict in import file.\r\n'
+            '2008,A,True,100007,200,Study level object is missing.\r\n'
             )
         shutil.rmtree(os.path.dirname(fin_file))
@@ -685,5 +698,5 @@
         self.assertEqual(studylevel.__parent__.certificate.code, u'CERT1')
         self.assertEqual(studylevel.level_session, 2008)
-        self.assertEqual(studylevel.level_verdict, 'A')
+        self.assertEqual(studylevel.level_verdict, None)
         self.assertEqual(studylevel.level, 100)
         shutil.rmtree(os.path.dirname(fin_file))
Index: main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py	(revision 9292)
+++ main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py	(revision 9293)
@@ -106,5 +106,4 @@
         self.logfile = os.path.join(
             self.app['datacenter'].storage, 'logs', 'main.log')
-        return
         return
 
