Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/level_report.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/level_report.py	(revision 14607)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/level_report.py	(revision 14608)
@@ -18,6 +18,9 @@
 
 import grok
+from zope.interface import implementer, Interface, Attribute
 from waeup.kofa.students.reports.level_report import (
-    LevelReport, LevelReportGenerator)
+    LevelReport, LevelReportGenerator,
+    ILevelReport, LevelReportGeneratorPage,
+    LevelReportPDFView)
 
 class CustomLevelReport(LevelReport):
@@ -45,5 +48,5 @@
         return [hod, dean]
 
-class LevelReportGenerator(LevelReportGenerator):
+class CustomLevelReportGenerator(LevelReportGenerator):
 
     def generate(self, site, faccode=None, depcode=None, certcode=None,
@@ -53,2 +56,44 @@
         return result
 
+# Level Report for graduating students only
+
+class GradLevelReport(CustomLevelReport):
+    """
+    """
+
+    title = 'Graduating Students Summary of Results'
+
+    def _excluded(self, level_obj):
+        """
+        """
+        if level_obj.remark not in (
+            'Pass', '3s_rd_s', '2s_2_s', '2s_1_s', '1s_st_s'):
+            return True
+        return False
+
+class GradLevelReportGenerator(LevelReportGenerator):
+
+    title = 'Graduating Students Summary of Results'
+    grok.name('grad_level_report')
+
+    def generate(self, site, faccode=None, depcode=None, certcode=None,
+                 session=None, level=None, author=None):
+        result = GradLevelReport(faccode=faccode, depcode=depcode,
+            certcode=certcode, session=session, level=level, author=author)
+        return result
+
+class GradLevelReportGeneratorPage(LevelReportGeneratorPage):
+
+    grok.context(GradLevelReportGenerator)
+
+class GradLevelReportPDFView(LevelReportPDFView):
+
+    grok.context(ILevelReport)
+    grok.name('pdf')
+    grok.require('waeup.handleReports')
+    prefix = 'GradLevelReport'
+
+    def _filename(self):
+        return 'GradLevelReport_rno%s_%s.pdf' % (
+            self.context.__name__,
+            self.context.creation_dt_string)
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_level_report.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_level_report.py	(revision 14607)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_level_report.py	(revision 14608)
@@ -4,11 +4,11 @@
 from zope.component import getUtility
 from waeup.kofa.interfaces import IJobManager
-from waeup.kofa.students.reports.level_report import (
-    get_students, ILevelReport)
+from waeup.kofa.students.reports.level_report import ILevelReport
 from waeup.kofa.students.tests.test_catalog import CatalogTestSetup
 from waeup.kofa.students.tests.test_browser import StudentsFullSetup
 from waeup.kofa.browser.tests.test_pdf import samples_dir
 
-from waeup.aaue.students.reports.level_report import CustomLevelReport
+from waeup.aaue.students.reports.level_report import (
+    CustomLevelReport, GradLevelReport)
 
 from waeup.aaue.testing import FunctionalLayer
@@ -28,5 +28,6 @@
         # we can get a table with one student
         self.student['studycourse']['100']['Course1'].ca = 0
-        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100)
+        lr =  CustomLevelReport('fac1', 'dep1', 'CERT1', 2010, 100)
+        result = lr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
         self.assertEqual(result,
             [(u'1234', u'TESTER, Bob', 30, 30, '5.000',
@@ -45,2 +46,41 @@
         print "Sample level_report.pdf written to %s" % path
         return
+
+class GradLevelReportTests(CatalogTestSetup):
+
+    layer = FunctionalLayer
+
+    def test_iface(self):
+        # ensure we fullfill interface contracts
+        obj = CustomLevelReport('fac1', 'dep1', 'CERT1', 2010, 100)
+        verifyClass(ILevelReport, GradLevelReport)
+        verifyObject(ILevelReport, obj)
+        return
+
+    def test_get_students(self):
+        
+        self.student['studycourse']['100']['Course1'].ca = 0
+        lr =  GradLevelReport('fac1', 'dep1', 'CERT1', 2010, 100)
+        # this is not a graduating student
+        result = lr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
+        self.assertEqual(result, [])
+        # if end level is 100, the student seems graduatiing and
+        # we can get a table with one student
+        self.certificate.end_level = 100
+        result = lr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
+        self.assertEqual(result,
+            [(u'1234', u'TESTER, Bob', 30, 30, '5.000',
+               'Nil', 'Nil', 30, 30, '5.00', '1s_st_s')])
+        return
+
+    def test_create_pdf(self):
+        self.student['studycourse']['100']['Course1'].ca = 0
+        self.app['faculties']['fac1'].officer_1 = 'Rosa Moonshine - Dean of Faculty'
+        self.app['faculties']['fac1']['dep1'].officer_1 = 'Amalia Sunshine - Head of Department'
+        report = GradLevelReport('fac1', 'dep1', 'CERT1', 2010, 100)
+        result = report.create_pdf('JOB_ID')
+        self.assertTrue(result.startswith('%PDF-'))
+        path = os.path.join(samples_dir(), 'grad_level_report.pdf')
+        open(path, 'wb').write(result)
+        print "Sample grad_level_report.pdf written to %s" % path
+        return
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_raw_score_report.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_raw_score_report.py	(revision 14607)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_raw_score_report.py	(revision 14608)
@@ -8,6 +8,5 @@
 from waeup.kofa.tests.test_async import FunctionalAsyncTestCase
 from waeup.kofa.browser.tests.test_pdf import samples_dir
-from waeup.kofa.students.reports.raw_score_report import (
-    get_students, IRawScoreReport, get_courses)
+from waeup.kofa.students.reports.raw_score_report import IRawScoreReport
 from waeup.aaue.students.reports.raw_score_report import CustomRawScoreReport
 from waeup.aaue.testing import FunctionalLayer
@@ -36,5 +35,6 @@
     def test_get_courses(self):
         # we can get a list with one course code
-        result = get_courses('fac1', 'dep1', 'CERT1', 2010, 100)
+        rsr =  CustomRawScoreReport('fac1', 'dep1', 'CERT1', 2010, 100)
+        result = rsr._get_courses('fac1', 'dep1', 'CERT1', 2010, 100)
         self.assertEqual(result, [u'Course1'])
         return
@@ -43,10 +43,11 @@
         # we can get a table with one student
         self.student['studycourse']['100']['Course1'].ca = 0
-        course_codes = get_courses('fac1', 'dep1', 'CERT1', 2010, 100)
-        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes)
+        rsr =  CustomRawScoreReport('fac1', 'dep1', 'CERT1', 2010, 100)
+        course_codes = rsr._get_courses('fac1', 'dep1', 'CERT1', 2010, 100)
+        result = rsr._get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes)
         self.assertEqual(result,
             [(u'1234', u'TESTER, Bob', {'Course1': (70, 'A')})])
         self.student['studycourse']['100']['Course1'].ca = None
-        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes)
+        result = rsr._get_students('fac1', 'dep1', 'CERT1', 2010, 100, course_codes)
         self.assertEqual(result,
             [(u'1234', u'TESTER, Bob', {'Course1': ('Nil', '')})])
Index: /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_session_results_presentation.py
===================================================================
--- /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_session_results_presentation.py	(revision 14607)
+++ /main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_session_results_presentation.py	(revision 14608)
@@ -6,5 +6,5 @@
 from waeup.kofa.interfaces import IJobManager
 from waeup.kofa.students.reports.session_results_presentation import (
-    get_students, ISessionResultsPresentation)
+    ISessionResultsPresentation)
 from waeup.kofa.students.tests.test_catalog import CatalogTestSetup
 from waeup.kofa.students.tests.test_browser import StudentsFullSetup
@@ -29,10 +29,11 @@
 
     def test_get_students(self):
-        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100)
+        sr = CustomSessionResultsPresentation('fac1', 'dep1', 'CERT1', 2010, 100)
+        result = sr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
         self.assertEqual(result,
             [[(u'E1000000', u'1234', u'TESTER, Bob')], [], [], [], [], [], []])
         self.student['studycourse']['100']['Course1'].score = 60
         self.student['studycourse']['100']['Course1'].ca = 10
-        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100)
+        result = sr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
         self.assertEqual(result,
             [[], [], [], [], [], [(u'E1000000', u'1234', u'TESTER, Bob')], []])
