Changeset 14529 for main/waeup.kofa


Ignore:
Timestamp:
10 Feb 2017, 09:13:56 (8 years ago)
Author:
Henrik Bettermann
Message:

Revert r14524 and r14521.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students/reports
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py

    r14524 r14529  
    8383                stud.matric_number,
    8484                fullname,
    85                 level_obj.total_credits,
     85                level_obj.gpa_params[1],
    8686                passed_params[2],
    8787                format_float(level_obj.gpa, 3),
     
    8989                failed_courses,
    9090                not_taken_courses,
    91                 level_obj.cumulative_params[3],
     91                level_obj.cumulative_params[1],
    9292                level_obj.cumulative_params[4],
    9393                cgpa,
     
    132132            'Matric No.',
    133133            translate(_('Student Name')),
    134             TTR(translate(_('Total Credits Registered'))),
     134            TTR(translate(_('Total Credits Taken'))),
    135135            TTR(translate(_('Total Credits Passed'))),
    136136            TTR(translate(_('GPA'))),
    137137            translate(_('Courses Failed')),
    138138            translate(_('Outstanding Courses')),
    139             TTR(translate(_('Cum. Credits Registered'))),
     139            TTR(translate(_('Cum. Credits Taken'))),
    140140            TTR(translate(_('Cum. Credits Passed'))),
    141141            TTR(translate(_('CGPA'))),
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py

    r14524 r14529  
    2323        return
    2424
    25     def test_get_students(self):
     25        # Credits counted (taken): 90
     26        # Credits passed: 60
     27        # Credits failed: 30
     28        # Credits registered (total_credits): 180
     29        # Course1 and Course3 are passed
     30        # Course2 is failed
     31        # Course4, Course5 and Course6 have not ben taken
     32
     33    def _add_tickets(self):
    2634        ticket = createObject('waeup.CourseTicket')
    2735        ticket.code = 'Course2'
     
    4452        ticket.passmark = 40
    4553        self.student['studycourse']['100']['Course4'] = ticket
    46         # we can get a table with one student
     54        ticket = createObject('waeup.CourseTicket')
     55        ticket.code = 'Course5'
     56        ticket.credits = 30
     57        self.student['studycourse']['100']['Course5'] = ticket
     58        ticket = createObject('waeup.CourseTicket')
     59        ticket.code = 'Course6'
     60        ticket.credits = 30
     61        self.student['studycourse']['100']['Course6'] = ticket
     62        return
     63
     64    def test_get_students(self):
     65        self._add_tickets()
     66         # we can get a table with one student
    4767        result = get_students('fac1', 'dep1', 'CERT1', 2010, 100)
    4868        self.assertEqual(result,
    49             [(u'1234', u'Bob Tester', 120, 30, '1.666',
    50             'm_Course2_m Course3', 'Course4', 120, 30, '1.666', '')])
     69            [(u'1234', u'Bob Tester', 90, 30, '1.666',
     70            'm_Course2_m Course3', 'Course4 Course5\nCourse6',
     71            90, 30, '1.666', '')])
    5172        # same result when selecting all certificates
    5273        result = get_students('fac1', 'dep1', 'all', 2010, 100)
    5374        self.assertEqual(result,
    54             [(u'1234', u'Bob Tester', 120, 30, '1.666',
    55             'm_Course2_m Course3', 'Course4', 120, 30, '1.666', '')])
     75            [(u'1234', u'Bob Tester', 90, 30, '1.666',
     76            'm_Course2_m Course3', 'Course4 Course5\nCourse6',
     77            90, 30, '1.666', '')])
    5678        return
    5779
     
    6082        self.student.lastname = u'Ehissouria'
    6183        self.student['studycourse']['100']['Course1'].passmark = 40
    62         ticket = createObject('waeup.CourseTicket')
    63         ticket.code = 'Course2'
    64         ticket.credits = 30
    65         ticket.score = 30
    66         ticket.mandatory = True
    67         ticket.passmark = 40
    68         self.student['studycourse']['100']['Course2'] = ticket
    69         ticket = createObject('waeup.CourseTicket')
    70         ticket.code = 'Course3'
    71         ticket.credits = 30
    72         ticket.score = 30
    73         self.student['studycourse']['100']['Course3'] = ticket
    74         ticket2 = createObject('waeup.CourseTicket')
    75         ticket2.code = 'Course4'
    76         ticket2.credits = 30
    77         self.student['studycourse']['100']['Course4'] = ticket2
    78         ticket3 = createObject('waeup.CourseTicket')
    79         ticket3.code = 'Course5'
    80         ticket3.credits = 30
    81         self.student['studycourse']['100']['Course5'] = ticket3
    82         ticket4 = createObject('waeup.CourseTicket')
    83         ticket4.code = 'Course6'
    84         ticket4.credits = 30
    85         self.student['studycourse']['100']['Course6'] = ticket4
     84        self._add_tickets()
    8685        report = LevelReport('fac1', 'dep1', 'all', 2010, 100)
    8786        result = report.create_pdf('JOB_ID')
     
    8988        path = os.path.join(samples_dir(), 'level_report.pdf')
    9089        open(path, 'wb').write(result)
    91         # Credits counted (taken): 90
    92         # Credits passed: 60
    93         # Credits failed: 30
    94         # Credits registered (total_credits): 180
    95         # Course1 and Course3 are passed
    96         # Course2 is failed
    97         # Course4, Course5 and Course6 have not ben taken
    9890        print "Sample level_report.pdf written to %s" % path
    9991        return
Note: See TracChangeset for help on using the changeset viewer.