Ignore:
Timestamp:
26 May 2015, 15:34:36 (9 years ago)
Author:
Henrik Bettermann
Message:

More docs. Complete IStudentStudyCourse and IStudentStudyLevel interfaces and adjust unit tests.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r12999 r13002  
    427427    """Representation of student study course data.
    428428    """
     429    student = Attribute('Student object')
     430    next_session_allowed = Attribute('True if the student can proceed to next session')
     431    is_postgrad = Attribute('True if student is postgraduate student')
     432    is_current = Attribute('True if the study course is the current course of studies')
     433    is_previous = Attribute('True if the study course is the previous course of studies')
     434
    429435    certificate = schema.Choice(
    430436        title = _(u'Certificate'),
     
    476482        )
    477483
     484    def writeLogMessage(view, message):
     485        """Write formatted log message into students.log.
     486        """
     487
     488    def addStudentStudyLevel(cert, studylevel):
     489        """Add a study level object.
     490        """
     491
     492    def getTranscriptData():
     493        """Get a sorted list of dicts with level and course ticket data.
     494        This method is used for transcripts.
     495        """
     496
    478497class IStudentStudyCourseTransfer(IStudentStudyCourse):
    479498    """An interface used for student transfers.
     
    558577    """A representation of student study level data.
    559578    """
     579    student = Attribute('Student object')
     580
     581    certcode = Attribute('The certificate code of the study course')
     582    is_current_level = Attribute('True if level is current level of the student')
     583    level_title = Attribute('Level title from source')
     584    getSessionString = Attribute('Session title from source')
    560585    number_of_tickets = Attribute('Number of tickets contained in this level')
    561     certcode = Attribute('The certificate code of the study course')
    562     is_current_level = Attribute('Is this level the current level of the student?')
    563586    passed_params = Attribute('Information about passed and failed courses')
     587    gpa_params_rectified = Attribute('Corrected sessional GPA parameters')
     588    gpa_params = Attribute('GPA parameters for this level.')
     589    cumulative_params = Attribute('Cumulative GPA and other cumulative parameters for this level')
    564590
    565591    level = schema.Choice(
     
    606632        readonly = True,
    607633        )
     634
     635    def writeLogMessage(view, message):
     636        """Write formatted log message into students.log.
     637        """
    608638
    609639    def addCourseTicket(ticket, course):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py

    r10479 r13002  
    7171    @property
    7272    def is_current(self):
    73         if '_' in self.__name__:
     73        if self.__name__ and '_' in self.__name__:
    7474            return False
    7575        return True
  • main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py

    r12882 r13002  
    101101    @property
    102102    def gpa_params_rectified(self):
    103         """Calculate corrected corrected level (sesional) gpa parameters.
    104 
     103        """Calculate corrected level (sessional) gpa parameters.
    105104        The corrected gpa is displayed on transcripts only.
    106105        """
     
    166165        """Calculate the cumulative gpa and other cumulative parameters
    167166        for this level.
    168 
    169167        All levels below this level are taken under consideration
    170168        (including repeating levels). This method is used for level reports.
     
    175173        total_credits_weighted = 0
    176174        cgpa = 0.0
    177         for level in self.__parent__.values():
    178             if level.level > self.level:
    179                 continue
    180             credits_passed += level.passed_params[2]
    181             total_credits += level.total_credits
    182             gpa_params = level.gpa_params
    183             total_credits_counted += gpa_params[1]
    184             total_credits_weighted += gpa_params[2]
    185         if total_credits_counted:
    186             cgpa = round(total_credits_weighted / total_credits_counted, 3)
     175        if self.__parent__:
     176            for level in self.__parent__.values():
     177                if level.level > self.level:
     178                    continue
     179                credits_passed += level.passed_params[2]
     180                total_credits += level.total_credits
     181                gpa_params = level.gpa_params
     182                total_credits_counted += gpa_params[1]
     183                total_credits_weighted += gpa_params[2]
     184            if total_credits_counted:
     185                cgpa = round(total_credits_weighted / total_credits_counted, 3)
    187186        return (cgpa, total_credits_counted, total_credits_weighted,
    188187               total_credits, credits_passed)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py

    r12971 r13002  
    7878        self.studycourse = StudentStudyCourse()
    7979        self.studylevel = StudentStudyLevel()
     80        self.studylevel.level_session = 2015
    8081        self.courseticket = CourseTicket()
    8182        self.payments = StudentPaymentsContainer()
Note: See TracChangeset for help on using the changeset viewer.