Ignore:
Timestamp:
20 May 2018, 19:44:44 (7 years ago)
Author:
Henrik Bettermann
Message:

Customize GPABoundaries.

Change fee categories.

Location:
main/kofacustom.edopoly/trunk/src/kofacustom/edopoly
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/interfaces.py

    r15011 r15013  
    4949        )
    5050
     51    late_registration_fee = schema.Float(
     52        title = _(u'Late Course Reg. Fee'),
     53        default = 0.0,
     54        required = False,
     55        )
     56
     57    transcript_fee = schema.Float(
     58        title = _(u'Transcript Fee'),
     59        default = 0.0,
     60        required = False,
     61        )
     62
     63    transfer_fee = schema.Float(
     64        title = _(u'Transfer Fee'),
     65        default = 0.0,
     66        required = False,
     67        )
     68
    5169    # Additional fees in custom package add here
    5270
    53     logbook_fee = schema.Float(
    54         title = _(u'Logbook Fee'),
     71    logbool_combo_fee = schema.Float(
     72        title = _(u'Logbook Combo Fee'),
    5573        default = 0.0,
    5674        required = False,
     
    5977    ict_entre_fee = schema.Float(
    6078        title = _(u'ICT & Entrepreneur Fee'),
     79        default = 0.0,
     80        required = False,
     81        )
     82
     83    siwess_combo_fee = schema.Float(
     84        title = _(u'SIWESS Combo Fee'),
    6185        default = 0.0,
    6286        required = False,
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/studylevel.py

    r15000 r15013  
    5252
    5353class CustomCourseTicket(CourseTicket):
    54     """This is a course ticket which allows the
    55     student to attend the course. Lecturers will enter scores and more at
    56     the end of the term.
    57 
    58     A course ticket contains a copy of the original course and
    59     course referrer data. If the courses and/or their referrers are removed, the
    60     corresponding tickets remain unchanged. So we do not need any event
    61     triggered actions on course tickets.
     54    """
    6255    """
    6356    grok.implements(ICustomCourseTicket, IStudentNavigation)
    6457    grok.provides(ICustomCourseTicket)
    6558
     59    @property
     60    def _getGradeWeightFromScore(self):
     61        """EdoPoly Course Grading System
     62        """
     63        if self.total_score is None:
     64            return (None, None)
     65        if self.total_score >= 75:
     66            return ('AA',4)
     67        if self.total_score >= 70:
     68            return ('A',3.5)
     69        if self.total_score >= 65:
     70            return ('AB',3.25)
     71        if self.total_score >= 60:
     72            return ('B',3.0)
     73        if self.total_score >= 55:
     74            return ('BC',2.75)
     75        if self.total_score >= 50:
     76            return ('C',2.5)
     77        if self.total_score >= 45:
     78            return ('CD',2.25)
     79        if self.total_score >= 40:
     80            return ('D',2)
     81        return ('F',0)
    6682
    6783CustomCourseTicket = attrs_to_fields(CustomCourseTicket)
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/students/utils.py

    r15011 r15013  
    3131    STUDENT_ID_PREFIX = u'U'
    3232
    33     def GPABoundaries(self, faccode=None, depcode=None, certcode=None):
    34         return ((1, 'Fail'),
    35                (1.5, 'Pass'),
    36                (2.4, '3rd Class'),
    37                (3.5, '2nd Class Lower'),
    38                (4.5, '2nd Class Upper'),
    39                (5, '1st Class'))
     33    def GPABoundaries(self, faccode=None, depcode=None,
     34                            certcode=None, student=None):
     35        if student and student.current_mode.startswith('dp'):
     36                return ((1, 'IRNS / NER / NYV'),
     37                        (2, 'Pass'),
     38                        (2.5, 'Lower Credit'),
     39                        (3, 'Upper Credit'),
     40                        (3.5, 'Distinction'))
     41        elif student:
     42            return ((1, 'FRNS / NER / NYV'),
     43                    (1.5, 'Pass'),
     44                    (2.4, '3rd Class Honours'),
     45                    (3.5, '2nd Class Honours Lower Division'),
     46                    (4.5, '2nd Class Honours Upper Division'),
     47                    (5, '1st Class Honours'))
     48        # Session Results Presentations depend on certificate
     49        results = None
     50        if certcode:
     51            cat = queryUtility(ICatalog, name='certificates_catalog')
     52            results = list(
     53                cat.searchResults(code=(certcode, certcode)))
     54        if results and results[0].study_mode.startswith('dp'):
     55            return ((1, 'IRNS / NER / NYV'),
     56                    (2, 'Pass'),
     57                    (2.5, 'Lower Credit'),
     58                    (3, 'Upper Credit'),
     59                    (3.5, 'Distinction'))
     60        else:
     61            return ((1, 'FRNS / NER / NYV'),
     62                    (1.5, 'Pass'),
     63                    (2.4, '3rd Class Honours'),
     64                    (3.5, '2nd Class Honours Lower Division'),
     65                    (4.5, '2nd Class Honours Upper Division'),
     66                    (5, '1st Class Honours'))
     67
     68    def getClassFromCGPA(self, gpa, student):
     69        gpa_boundaries = self.GPABoundaries(student=student)
     70        if gpa < gpa_boundaries[0][0]:
     71            return 0, gpa_boundaries[0][1]
     72        if gpa < gpa_boundaries[1][0]:
     73            return 1, gpa_boundaries[1][1]
     74        if gpa < gpa_boundaries[2][0]:
     75            return 2, gpa_boundaries[2][1]
     76        if gpa < gpa_boundaries[3][0]:
     77            return 3, gpa_boundaries[3][1]
     78        if gpa < gpa_boundaries[4][0]:
     79            return 4, gpa_boundaries[4][1]
     80        if gpa <= gpa_boundaries[5][0]:
     81            return 5, gpa_boundaries[5][1]
     82        return 'N/A'
    4083
    4184    def setPaymentDetails(self, category, student,
     
    130173            else:
    131174                return _(u'No bed allocated.'), None
    132         elif category == 'logbook':
    133             amount = academic_session.logbook_fee
     175        elif category == 'logbook_combo':
     176            amount = academic_session.logbook_combo_fee
    134177        elif category == 'ict_entre':
    135178            amount = academic_session.ict_entre_fee
     179        elif category == 'siwess_combo':
     180            amount = academic_session.siwess_combo_fee
    136181        if amount in (0.0, None):
    137182            return _('Amount could not be determined.'), None
  • main/kofacustom.edopoly/trunk/src/kofacustom/edopoly/utils/utils.py

    r15011 r15013  
    2626
    2727    PAYMENT_CATEGORIES = {
    28         'schoolfee': 'School Fee',
     28        'schoolfee': 'Tuition Fee',
    2929        'clearance': 'Acceptance Fee',
    3030        'bed_allocation': 'Accommodation Booking Fee',
     
    3232        'application': 'Application Fee',
    3333        'ict_entre': 'ICT & Entrepreneur Fee',
    34         'logbook': 'Logbook Fee',
     34        'logbook_combo': 'Logbook Combo Fee',
     35        'siwess_combo': 'SIWESS Combo Fee'
    3536        }
    3637
Note: See TracChangeset for help on using the changeset viewer.