Ignore:
Timestamp:
10 Jan 2017, 18:41:09 (8 years ago)
Author:
Henrik Bettermann
Message:

Exchange level and session on report slips.

Use string formatting for displaying GPA values.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/reports/raw_score_report.py

    r14381 r14384  
    230230        pdf_data += [Paragraph(
    231231                    translate(
    232                         '${a}<br />${b}<br />Level: ${c}<br />Session: ${d}',
     232                        '${a}<br />${b}<br />Session: ${c}<br />Level: ${d}',
    233233                        mapping = {'a':self.factitle,
    234234                                   'b':self.deptitle,
    235                                    'c':self.level,
    236                                    'd':self.session, }),
     235                                   'c':self.session,
     236                                   'd':self.level,
     237                                   }),
    237238                    STYLE["Normal"]),
    238239                    Spacer(1, 12),]
  • main/waeup.aaue/trunk/src/waeup/aaue/students/reports/tests/test_level_report.py

    r14374 r14384  
    3030        result = get_students('fac1', 'dep1', 2010, 100)
    3131        self.assertEqual(result,
    32             [(u'1234', u'TESTER, Bob', 30, 30, 0, 5.0, '', 30, 30, 5.0, 'Proceed')])
     32            [(u'1234', u'TESTER, Bob', 30, 30, 0, '5.00', '', 30, 30, '5.000', 'Proceed')])
    3333        return
    3434
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studycourse.py

    r14362 r14384  
    4848        return self.is_postgrad
    4949
    50     def _display_gpa(self, gpa):
    51         return int(100 * gpa) / 100.0
    52 
    5350CustomStudentStudyCourse = attrs_to_fields(CustomStudentStudyCourse)
    5451
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r14380 r14384  
    6060        return total
    6161
    62     def _display_gpa(self, gpa):
    63         return int(100 * gpa) / 100.0
    64 
    6562    @property
    6663    def gpa_params(self):
     
    7572                credits_weighted += ticket.credits * ticket.weight
    7673        if credits_counted:
    77             level_gpa = self._display_gpa(credits_weighted/credits_counted)
     74            level_gpa = credits_weighted/credits_counted
    7875        # Override level_gpa if value has been imported
    7976        imported_gpa = getattr(self, 'imported_gpa', None)
     
    110107            else:
    111108                no_courses_not_taken += 1
     109            if not len(courses_failed):
     110                ccourses_failed = 'nil'
    112111        return (passed, failed, credits_passed,
    113112                credits_failed, courses_failed,
     
    181180        if end_level and self.level >= end_level:
    182181            failed_courses = self.passed_params[4]
    183             if '_m' in failed_courses:
     182            if '_m' in failed_courses or not self.cumulative_params[0]:
    184183                return 'FRNS'
    185184            if self.cumulative_params[0] < failed_limit:
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r14375 r14384  
    116116        # sgpa = 82 / 23
    117117        self.assertEqual(
    118             self.student['studycourse']['100'].gpa_params[0], 3.56)
     118            self.student['studycourse']['100'].gpa_params[0], 3.5652173913043477)
    119119        # imported gpa values override calculated values
    120120        studylevel.imported_gpa = 4.3
     
    453453        self.assertEqual(td[0][1]['level'].level_session, 2006)
    454454        self.assertEqual(td[0][1]['tickets_1'][0].code, 'ANYCODE')
    455         self.assertEqual(td[1], 3.56)
     455        self.assertEqual(td[1], 3.5652173913043477)
    456456        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    457457        self.browser.open(self.student_path + '/studycourse/transcript')
Note: See TracChangeset for help on using the changeset viewer.