Changeset 8319


Ignore:
Timestamp:
1 May 2012, 06:25:53 (13 years ago)
Author:
Henrik Bettermann
Message:

Configure getReturningData. Tests will follow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r8308 r8319  
    6868    grok.implements(IStudentsUtils)
    6969
    70     # not yet changed
    7170    def getReturningData(self, student):
    7271        """ This method defines what happens after school fee payment
    73         depending on the student's senate verdict.
    74 
    75         In the base configuration current level is always increased
    76         by 100 no matter which verdict has been assigned.
     72        of returning students depending on the student's senate verdict.
    7773        """
    78         new_level = student['studycourse'].current_level + 100
     74        prev_level = student['studycourse'].current_level
     75        cur_verdict = student['studycourse'].current_verdict
     76        if cur_verdict in ('A','B','L','M','N','Z',):
     77            # Successful student
     78            new_level = divmod(int(prev_level),100)[0]*100 + 100
     79        elif cur_verdict == 'C':
     80            # Student on probation
     81            new_level = int(prev_level) + 10
     82        else:
     83            # Student is somehow in an undefined state.
     84            # Level has to be set manually.
     85            new_level = prev_level
    7986        new_session = student['studycourse'].current_session + 1
    8087        return new_session, new_level
Note: See TracChangeset for help on using the changeset viewer.