Changeset 15097 for main/kofacustom.dspg/trunk/src
- Timestamp:
- 3 Aug 2018, 09:54:07 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.dspg/trunk/src/kofacustom/dspg/students/studylevel.py
r14988 r15097 37 37 grok.implements(ICustomStudentStudyLevel, IStudentNavigation) 38 38 grok.provides(ICustomStudentStudyLevel) 39 40 @property 41 def gpa_params(self): 42 """Calculate gpa parameters for this level. 43 """ 44 credits_weighted = 0.0 45 credits_counted = 0 46 level_gpa = 0.0 47 for ticket in self.values(): 48 if ticket.total_score is not None: 49 credits_counted += ticket.credits 50 credits_weighted += ticket.credits * ticket.weight 51 if credits_counted: 52 level_gpa = round(credits_weighted / credits_counted, 2) 53 # Override level_gpa if value has been imported 54 # (not implemented in base package) 55 imported_gpa = getattr(self, 'imported_gpa', None) 56 if imported_gpa: 57 level_gpa = imported_gpa 58 return level_gpa, credits_counted, credits_weighted 59 39 60 40 61 CustomStudentStudyLevel = attrs_to_fields(
Note: See TracChangeset for help on using the changeset viewer.