Changeset 14357 for main


Ignore:
Timestamp:
19 Dec 2016, 11:43:31 (8 years ago)
Author:
Henrik Bettermann
Message:

Customize passed_params.

File:
1 edited

Legend:

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

    r14355 r14357  
    8484
    8585    @property
     86    def passed_params(self):
     87        """Determine the number and credits of passed and failed courses.
     88        This method is used for level reports.
     89        """
     90        passed = failed = 0
     91        courses_failed = ''
     92        credits_failed = 0
     93        credits_passed = 0
     94        for ticket in self.values():
     95            if None not in (ticket.score, ticket.ca):
     96                if ticket.total_score < ticket.passmark:
     97                    failed += 1
     98                    credits_failed += ticket.credits
     99                    if ticket.mandatory:
     100                        courses_failed += 'm_%s_m ' % ticket.code
     101                    else:
     102                        courses_failed += '%s ' % ticket.code
     103                else:
     104                    passed += 1
     105                    credits_passed += ticket.credits
     106        return passed, failed, credits_passed, credits_failed, courses_failed
     107
     108    @property
    86109    def course_registration_forbidden(self):
    87110        fac_dep_paid = True
Note: See TracChangeset for help on using the changeset viewer.