Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py	(revision 14642)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py	(revision 14643)
@@ -55,5 +55,5 @@
         canvas.drawString( 0, -1, self.text)
 
-def tbl_data_to_table(data, course_codes):
+def tbl_data_to_table(data, certcourses):
     col_names = (
             #'Student Id',
@@ -62,8 +62,12 @@
             'Name',
             )
-    catalog = getUtility(ICatalog, name='courses_catalog')
-    for code in course_codes:
-        course = list(catalog.searchResults(code=(code, code)))[0]
-        col_names += (TTR('%s (%s)' % (code, course.credits)),)
+    #catalog = getUtility(ICatalog, name='courses_catalog')
+    for certcourse in certcourses:
+        course = certcourse.course
+        if certcourse.course_category:
+            col_names += (TTR('%s (%s, %s)' % (
+                course.code, course.credits, certcourse.course_category)),)
+        else:
+            col_names += (TTR('%s (%s)' % (course.code, course.credits)),)
     table = [col_names]
     sn = 1
@@ -71,6 +75,6 @@
         scores = tuple()
         composed_line = (sn,) + line[:-1]
-        for code in course_codes:
-            result = line[-1].get(code)
+        for certcourse in certcourses:
+            result = line[-1].get(certcourse.course.code)
             if not result:
                 scores += ('N/R',)
@@ -136,5 +140,6 @@
         """
         site = grok.getSite()
-        course_codes = []
+        #course_codes = []
+        certcourses = []
         department = site['faculties'][faccode][depcode]
         if certcode == 'all':
@@ -142,13 +147,15 @@
                 for certcourse in cert.values():
                     if certcourse.level == level:
-                        course_codes.append(certcourse.getCourseCode())
+                        #course_codes.append(certcourse.getCourseCode())
+                        certcourses.append(certcourse)
         else:
             certificate = site['faculties'][faccode][depcode].certificates[certcode]
             for certcourse in certificate.values():
                 if certcourse.level == level:
-                    course_codes.append(certcourse.getCourseCode())
-        return course_codes
-
-    def _get_students(self, faccode, depcode, certcode, session, level, course_codes):
+                    #course_codes.append(certcourse.getCourseCode())
+                    certcourses.append(certcourse)
+        return certcourses
+
+    def _get_students(self, faccode, depcode, certcode, session, level, certcourses):
         """Get students in a certain department/certificate who registered courses
         in a certain session at a certain level.
@@ -176,5 +183,5 @@
             scores = dict()
             for ticket in level_obj.values():
-                if ticket.code in course_codes:
+                if ticket.code in [i.course.code for i in certcourses]:
                     if ticket.total_score is not None:
                         scores[ticket.code] = (ticket.total_score, ticket.grade)
@@ -224,13 +231,16 @@
             getUtility(IKofaUtils).tzinfo).strftime("%Y-%m-%d %H:%M:%S %Z")
         self.past_levels = range(int(level/100)*100, 0, -100)
-        self.course_codes = dict()
+        #self.course_codes = dict()
+        self.certcourses = dict()
         self.data = dict()
         for level in self.past_levels:
-            course_codes = self._get_courses(
+            certcourses = self._get_courses(
                 faccode, depcode, certcode, session, level)
-            self.course_codes[level] = course_codes
+            self.certcourses[level] = certcourses
+            #course_codes = [i.getCourseCode() for i in certcourses]
+            #self.course_codes[level] = course_codes
             self.data[level] = self._get_students(
                 faccode, depcode, certcode, session,
-                self.levelcode, course_codes)
+                self.levelcode, certcourses)
 
     def create_pdf(self, job_id):
@@ -239,6 +249,6 @@
         for level in self.past_levels:
             table_data[level] = tbl_data_to_table(
-                self.data[level], self.course_codes[level])
-        col_widths = [1*cm, 4*cm, 5*cm] + [1*cm] * len(self.course_codes)
+                self.data[level], self.certcourses[level])
+        col_widths = [1*cm, 4*cm, 5*cm] + [1*cm] * len(self.certcourses)
         pdf_data = [Paragraph('<b>%s - Report %s</b>'
                               % (self.creation_dt_string, job_id),
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_raw_score_report.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_raw_score_report.py	(revision 14642)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_raw_score_report.py	(revision 14643)
@@ -38,5 +38,9 @@
         rsr = RawScoreReport('fac1', 'dep1', 'CERT1', 2010, 100)
         result = rsr._get_courses('fac1', 'dep1', 'CERT1', 2010, 100)
-        self.assertEqual(result, [(u'Course1')])
+        self.assertEqual(result, [self.certificate.values()[0]])
+        self.assertEqual(
+            result,
+            [self.app['faculties']['fac1']['dep1'].certificates[
+                'CERT1']['Course1_100']])
         return
 
@@ -57,4 +61,6 @@
 
     def test_create_pdf(self):
+        self.app['faculties']['fac1']['dep1'].certificates[
+                'CERT1']['Course1_100'].course_category = 'xyz'
         self.course = createObject('waeup.Course')
         self.course.code = 'Course2'
