Ignore:
Timestamp:
16 Jan 2017, 10:52:15 (8 years ago)
Author:
Henrik Bettermann
Message:

Use old grading system.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/studylevel.py

    r10482 r14406  
    3131    ICustomStudentStudyLevel, ICustomCourseTicket)
    3232
     33def getGradeWeightFromScore(score):
     34    if score is None:
     35        return (None, None)
     36    if score >= 70:
     37        return ('A',5)
     38    if score >= 60:
     39        return ('B',4)
     40    if score >= 50:
     41        return ('C',3)
     42    if score >= 45:
     43        return ('D',2)
     44    if score >= 40:
     45        return ('E',1)
     46    return ('F',0)
    3347
    3448class CustomStudentStudyLevel(StudentStudyLevel):
     
    6882        return True
    6983
     84    @property
     85    def grade(self):
     86        """Returns the grade calculated from total score.
     87        """
     88        return getGradeWeightFromScore(self.total_score, self.student)[0]
     89
     90    @property
     91    def weight(self):
     92        """Returns the weight calculated from total score.
     93        """
     94        return getGradeWeightFromScore(self.total_score, self.student)[1]
     95
    7096CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
    7197
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r14193 r14406  
    248248        self.certificate.study_mode = 'ug_ft'
    249249        error, payment = utils.setPaymentDetails('schoolfee',self.student)
    250         self.assertEqual(payment.amount_auth,  61300.0)
     250        self.assertEqual(payment.amount_auth,  56300.0)
    251251        self.assertEqual(error, None)
    252252        # UG cleared students pay 65650
Note: See TracChangeset for help on using the changeset viewer.