Ignore:
Timestamp:
12 Aug 2013, 09:08:35 (11 years ago)
Author:
Henrik Bettermann
Message:

Reinvent unrectified sessional gpa (adjustments to base package).

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/locales/en/LC_MESSAGES/waeup.kofa.po

    r10299 r10480  
    3333msgstr "Total Units"
    3434
     35#: manually included
     36msgid "Sessional GPA (rectified)"
     37msgstr "Sessional GPA"
     38
    3539#: waeup/kofa/students/interfaces.py:531
    3640#: waeup/kofa/university/interfaces.py:152
  • main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py

    r10442 r10480  
    6868    """
    6969    grok.context(ICustomStudentStudyLevel)
    70     form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit('total_credits')
     70    form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit(
     71        'total_credits', 'gpa')
    7172    form_fields[
    7273        'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     
    7980    form_fields = grok.AutoFields(ICustomStudentStudyLevel).omit(
    8081        'level_session', 'level_verdict',
    81         'validated_by', 'validation_date')
     82        'validated_by', 'validation_date', 'gpa')
    8283
    8384    omit_fields = ('password', 'suspended', 'suspended_comment',
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r10443 r10480  
    5656
    5757    @property
    58     def gpa_params(self):
    59         weighted_credits = 0.0
    60         credits_counted = 0
    61         level_gpa = 0.0
    62         for ticket in self.values():
    63             if ticket.score:
    64                 credits_counted += ticket.credits
    65                 weighted_credits += ticket.credits * ticket.weight
    66         if credits_counted:
    67             level_gpa = round(weighted_credits/credits_counted, 2)
    68         return level_gpa, credits_counted, weighted_credits
     58    def gpa_params_rectified(self):
     59        return self.gpa_params
    6960
    7061CustomStudentStudyLevel = attrs_to_fields(
    7162    CustomStudentStudyLevel, omit=[
    72     'total_credits', 'total_credits_s1', 'total_credits_s2'])
     63    'total_credits', 'total_credits_s1', 'total_credits_s2', 'gpa'])
    7364
    7465class CustomStudentStudyLevelFactory(StudentStudyLevelFactory):
Note: See TracChangeset for help on using the changeset viewer.