Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_vocabularies.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_vocabularies.py	(revision 7624)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_vocabularies.py	(revision 7625)
@@ -36,28 +36,33 @@
         values = studylevelsource.getValues(studycourse)
         self.assertEqual(values, [100, 110, 120, 200, 210, 220, 300, 310, 320,
-            400, 410, 420, 500, 510, 520, 600, 610])
-        self.assertTrue(studylevelsource.getTitle(studycourse, 0),
+            400, 410, 420, 500, 510, 520, 600, 610, 620])
+        self.assertEqual(studylevelsource.getTitle(studycourse, None),
+            'Error: level id None out of range')
+        self.assertEqual(studylevelsource.getTitle(studycourse, 0),
             'Error: level id 0 out of range')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 10),
+        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
             'Error: level id 10 out of range')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 100),
+        self.assertEqual(studylevelsource.getTitle(studycourse, 100),
             '100 (Year 1)')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 110),
-            '100 (Year 1) on 1. probation')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 120),
-            '100 (Year 1) on 2. probation')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 500),
+        self.assertEqual(studylevelsource.getTitle(studycourse, 110),
+            '100 (Year 1) on 1st probation')
+        self.assertEqual(studylevelsource.getTitle(studycourse, 120),
+            '100 (Year 1) on 2nd probation')
+        self.assertEqual(studylevelsource.getTitle(studycourse, 500),
             '500 (Year 5)')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 600),
-            '500 (Year 5) spillover')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 610),
+        self.assertEqual(studylevelsource.getTitle(studycourse, 600),
+            '500 (Year 5) 1st spillover')
+        self.assertEqual(studylevelsource.getTitle(studycourse, 610),
             '500 (Year 5) 2nd spillover')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 620),
-            'Error: level id 620 out of range')
-        self.assertTrue(studylevelsource.getTitle(studycourse, 900),
-            'Error: level id 900 out of range')
-        # Now we change the certificates start_level in order to include
-        # pre-studies
+        self.assertEqual(studylevelsource.getTitle(studycourse, 620),
+            '500 (Year 5) 3rd spillover')
+        self.assertEqual(studylevelsource.getTitle(studycourse, 630),
+            'Error: level id 630 out of range')
+        self.assertEqual(studylevelsource.getTitle(studycourse, 700),
+            'Error: level id 700 out of range')
+        # Now we change the certificates start_level to pre-studies
         studycourse.certificate.start_level = 10
-        self.assertTrue(studylevelsource.getTitle(studycourse, 10),
+        self.assertEqual(studylevelsource.getTitle(studycourse, 10),
             'Pre-Studies')
+        # Repeating Pre-Studies level does not exist
+        self.assertRaises(KeyError,studylevelsource.getTitle,studycourse,20)
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py	(revision 7624)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py	(revision 7625)
@@ -40,9 +40,13 @@
         start_level = int(studycourse.certificate.start_level)
         end_level = int(studycourse.certificate.end_level)
+        if start_level == 10:
+            levels = [10,] + [level for level in range(100,end_level+200,10)
+                if level % 100 < 30]
+        else:
+            levels = [level for level in range(start_level,end_level+200,10)
+                if level % 100 < 30]
     else:
-        start_level = 10
-        end_level = 800
-    levels = [level for level in range(start_level,end_level+200,10)
-               if level % 100 < 30 and level < end_level + 120]
+        # default level range
+        levels = [level for level in range(100,800,10) if level % 100 < 30]
     return levels
 
@@ -66,8 +70,10 @@
             end_level = int(context.certificate.end_level)
         else:
-            start_level = 10
-            end_level = 800
-        if value < start_level or value > end_level + 110:
+            # default level range
+            start_level = 100
+            end_level = 600
+        if value < start_level or value > end_level + 120:
             return "Error: level id %s out of range" % value
+        # Special treatment for pre-studies level
         if value == 10:
             return course_levels.by_value[value].title
@@ -76,12 +82,17 @@
         repeat = repeat//10
         title = course_levels.by_value[level].title
-        if level > end_level and repeat:
+        if level > end_level and repeat == 1:
             title = course_levels.by_value[level - 100].title
             return "%s 2nd spillover" % title
+        if level > end_level and repeat == 2:
+            title = course_levels.by_value[level - 100].title
+            return "%s 3rd spillover" % title
         if level > end_level:
             title = course_levels.by_value[level - 100].title
-            return  "%s spillover" % title
-        if repeat:
-            return "%s on %d. probation" % (title, repeat)
+            return  "%s 1st spillover" % title
+        if repeat == 1:
+            return "%s on 1st probation" % title
+        if repeat == 2:
+            return "%s on 2nd probation" % title
         return title
 
