Changeset 13002 for main/waeup.kofa


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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/docs/source/userdocs/students.rst

    r13000 r13002  
    118118   :pyobject: IStudentStudyCourse
    119119
    120 The first schema field is a `Choice` field and only values from the `CertificateSource` are allowed. The source provides all certificates stored in the portal. This way, `StudentStudyCourse` objects point to exactly one `Certificate` object in the portal. If the certificate is removed, an event handler takes care of clearing also all referring `certificate` attribute. The tokens of the `CertificateSource` are the certicate codes which means, that in forms and import files the unique code must be given and the desired `Certificate` object will be stored.
     120All attributes are read-only property attributes which are computed dynamically.
     121
     122The first schema field is a `Choice` field which allows values from the `CertificateSource`. The source provides all certificates stored in the portal. This way, `StudentStudyCourse` objects point to exactly one `Certificate` object in the portal. If the certificate is removed, an event handler takes care of clearing also all referring `certificate` attribute. The tokens of the `CertificateSource` are the certicate codes which means, that in forms and import files the unique code must be given and the desired `Certificate` object will be stored.
    121123
    122124The interface has two entry parameter fields. `entry_mode` stores the study mode of the programme and `entry_session` the academic year when the study course was started. Usually these parameters are fixed and must not be changed during course of study.
     
    126128What is a verdict? A verdict is the individual judgement of a jury (senate in Nigeria) at the end of each academic session. The jury's verdict tells the portal, if the student has successfully completed an academic session or not. Depending on the verdict, the student will be either allowed to proceed to the next study level or forced to repeat the current level. Without a verdict, the student gets stuck and cannot even pay school fees for the next academic year. This will be further exlplained in the workflow section below.
    127129
    128 `StudentStudyCourse` is a container class. Study courses contain `StudentStudyLevel` instances.
     130`StudentStudyCourse` is a container class. Study courses contain `StudentStudyLevel` instances which implement `waeup.kofa.students.interfaces.IStudentStudyLevel`.
    129131
    130132`IStudentStudyLevel`
    131133--------------------
    132134
     135`StudentStudyLevel` instances contain information about the study progress achieved at that level. In Kofa study levels range from 100 to 900. There are two additional levels: a pre-studies level (10) and a special postgraduate level (999). There are also two probation levels per regular study level. Level 120, for instance, means level 100 on second probation. The complete numbering of study levels can be viewed `here <https://kofa-demo.waeup.org/sources#collapseStudyLevels>`_.
     136
     137`StudentStudyLevel` instances are container objects which contain course tickets. We therefore sometimes speak of a level course list instead of a study level. The study level stores and provides the information when (`validation_date`) and by whom (`validated_by`) the course list was validated, in which session the level was taken (`level_session`) and which verdict the student finally obtained.
     138
    133139.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
    134140   :pyobject: IStudentStudyLevel
     141
     142`StudentStudyLevel` instances also compute some statistical values on the fly to give an overview of the courses taken. These read-only property attributes are: `number_of_tickets`, `passed_params`, `gpa_params`, `gpa_params_rectified`, `cumulative_params`, `total_credits` and `gpa`. The attentive reader may wonder why the latter two are not listed in the attributes section of the interface, but as read-only schema fields further below. This is a trick which we used to properly display these fields on some form pages and pdf slips. However, the `attrs_to_fields` function explicitly excludes them when starting the portal, so that these fields are not used for persistent storage of same-named attributes in the database.
    135143
    136144`ICourseTicket`
  • 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.