source: main/waeup.kofa/trunk/docs/source/userdocs/students.rst @ 13005

Last change on this file since 13005 was 13005, checked in by Henrik Bettermann, 9 years ago

Add Payment class attribute created_online to mark payment tickets
which are added online and not by import. This attribute is needed in
custom packages when sending data to payment gateways.

File size: 15.4 KB
Line 
1.. _student_section:
2
3Student Section :sup:`in progress`
4**********************************
5
6'Student' is a multi-purpose term in Kofa which may lead to some misconceptions. First of all, 'Student' is a Python/Grok container class and student objects are the instances of this class. Sometimes we are sluggish when talking about 'creating students' and actually mean: 'creating student container objects and storing the objects (persistently) in the ``students`` container'. The latter is the parent container for all students in the portal.
7
8The :ref:`treelike storage of objects <object_database>` in the student section can be figured as follows::
9
10
11  Student Section (StudentsContainer)
12  |
13  +---> Student
14        |
15        +---> StudentStudyCourse
16        |     |
17        |     +-----> StudentStudyLevel
18        |             |
19        |             +-----> CourseTicket
20        |
21        +---> StudentPaymentsContainer
22        |     |
23        |     +-----> StudentOnlinePayment
24        |
25        +---> StudentAccommodation
26              |
27              +-----> BedTicket
28
29
30.. note::
31
32  Throughout Kofa we distinguish singular and plural expressions. A students container contains students (or more precisely student containers), a payments container contains payments, a courses container contains courses, a certificates container contains certificates.
33
34Furthermore, a student is also a user of the portal and the student object is a user account surrogate, see :ref:`Applicants and Students <applicants_and_students>`. In the following we always refer to the student container when talking about a student.
35
36Students
37========
38
39The `Student` class is a container class which means, there are not only attributes describing the student entity but also content. Each student container contains exactly three sub-containers: ``studycourse``  (instance of `StudentStudyCourse`), ``payments`` (instance of `StudentPaymentsContainer`)  and ``accommodation`` (instance of `StudentAccommodation`). The purposes of them are described further below.
40
41Let's talk about the attributes and methods belonging to the `Student` class, the so-called 'external behaviour' of student objects specified in Zope 'interfaces'. The data stored with each student object are subdivided into three parts: base data, personal data and clearance data. Each part has its own interface.
42
43.. _kofa_interfaces:
44
45.. note::
46
47  **Interfaces** are one of the pillars of Zope's Component Architecture (ZCA, see also :ref:`prerequisites`). They document the 'external behaviour' of objects. In Kofa interfaces are used to specify the attributes, methods and schema fields of objects. The first two are well-known Python concepts. A Zope schema field is a bit more complicated. It's a detailed description of a field to be submitted via forms to the server, or which is processed by a batch processor. In both cases the input data are being validated against the schema field requirements. In Kofa, schema fields (see also note below) in interfaces are also used to automtically add `FieldProperty` attributes of the same name to most content classes. This is done by a function :py:func:`attrs_to_fields<waeup.kofa.utils.helpers.attrs_to_fields>` which is called once during startup of Kofa. These class attributes ensure that corresponding attributes of instances of this class - when being added or changed - always meet the requirements of the schema field. Another big advantage of such class attributes is, that attributes with a `FieldProperty` do not need to be set in `__init__` methods.
48
49The `Student` class implements several interfaces which we will quote to unveil the student's 'external behaviour'.
50
51`IStudentBase`
52--------------
53
54`waeup.kofa.students.interfaces.IStudentBase` defines a fundamental set of attributes, schema fields and methods which are being used throughout the portal. This set is immutable. No class statement must be removed or added in customized versions of Kofa.
55
56.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
57   :pyobject: IStudentBase
58
59The **first part** of the interface lists attributes. Except for the last two attributes (`password` and `temp_password`) they are all read-only property attributes, i.e. attributes with a getter method only. These properties are computed dynamically and can't be set. Most of them return data derived from the ``studycourse`` subobject.
60
61The **second part** of the interface specifies the schema fields
62
63.. _kofa_schemas:
64
65.. note::
66
67  **Schema fields** are instances of schema field classes with `title`, `description`, `default`, `required`, `readonly` attributes. Class names and class attributes are self-explanatory and described in the `Zope Schema`_ documentation.
68
69  A very powerful Zope Schema field is `Choice`. Choice fields 'are constrained to values drawn from a specified set, which can be static or dynamic'. This set can be a simple list of choices (= `values`), or a `vocabulary` or `source` which produce dynamic choices.
70
71  **Vocabularies and sources** are very similar. The latter is a newer concept of producing choices and considered to replace vocabularies. In Kofa we are using both. Common to both is that a set of values is accompanied by a user-friendly title, which is displayed on pages (e.g. in select boxes) instead of a less informative value token or even a cryptic representation of a persistent value object. In most cases we have a token-title pair which perfectly describes the values of a source or a vocabulary. The tokens are being sent in forms or imported by batch processors.
72
73  See `token-title pairs <http://kofa-demo.waeup.org/sources>`_ of most (non-database-dependent) sources and vocabularies in the Kofa base package.
74
75The **third part** of the interface lists the methods which can be applied to student objects.
76
77`IUGStudentClearance`
78---------------------
79
80Much like all the following student interfaces, `waeup.kofa.students.interfaces.IUGStudentClearance` describes an additional set of schema fields which are exclusively used on form pages. They do not play any role beyond that purpose. Any kind of schema field can be safely added in customized versions of these interfaces to meet the conditions of the university's matriculation process. Also `date_of_birth` and `nationality` are not used in the base package for further data processing which means, there is no dependency on these two parameters. Attention: This might be different in customized versions of Kofa. Some views might use these parameters to restrict access or make actions (e.g. payment of items) conditional on the student's nationality or current age.
81
82.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
83   :pyobject: IUGStudentClearance
84
85`clearance_locked` controls the access to the edit form page of clearance data. The corresponding attribute is automatically set by workflow transitions to lock or unlock the edit form page respectively. The attribute can also be set by officers via the manage form page to lock or unlock the page manually.
86
87`officer_comment` is usually edited by clearance officers when rejecting clearance previously requested by the student. The attribute contains the message which informs the student about the reasons of rejection. The attribute is cleared after final clearance. The message can be also found in ``students.log``.
88
89Both `clearance_locked` and `officer_comment` are controlled by workflow transitions not by states, see below.
90
91`IPGStudentClearance`
92---------------------
93
94Most universities acquire different data from undergraduate (UG) and postgraduate (PG) students. The forms vary widely. Therefore Kofa offers a second interface for acquiring PG clearance data. In the base package `IPGStudentClearance` inherits from the `IUGStudentClearance` interface. The additional `employer` field in the base package only serves as an example.
95
96.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
97   :pyobject: IPGStudentClearance
98
99`IStudentPersonal`
100------------------
101
102`waeup.kofa.students.interfaces.IUGStudentPersonal` defines an additional set of personal student data which are permantly editable by students. The set usually contains further contact data and information about the student's relatives.
103
104.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
105   :pyobject: IStudentPersonal
106
107Kofa provides a mechanism which ensures that personal data are being kept up to date. Students are regularly requested to update the personal data directly after login. The personal data expire 180 days after saving the data for the last time which is stored in the `personal_updated` attribute. Then the `personal_data_expired` property returns ``True`` and the student is redirected to the personal data edit page when logging in.
108
109`IStudentNavigation`
110--------------------
111
112See docstring.
113
114.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
115   :pyobject: IStudentNavigation
116
117Student Study Courses
118=====================
119
120All data related to an individual course of study are stored with the ``studycourse`` object. This container object is an instance of the `StudentStudyCourse` class which implements `waeup.kofa.students.interfaces.IStudentStudyCourse`, `waeup.kofa.students.interfaces.IStudentNavigation` and `waeup.kofa.students.interfaces.IStudentStudyCourseTranscript`. The latter does not add further behaviour to our classes but is needed for transcript pages only. It is not described in the user handbook.
121
122`IStudentStudyCourse`
123---------------------
124
125.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
126   :pyobject: IStudentStudyCourse
127
128All attributes are read-only property attributes which are computed dynamically.
129
130The 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.
131
132The 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.
133
134Very import - or even most important - are the parameters which describe the current state of the student's study course. `current_session`, `current_level`, `current_verdict`, `previous_verdict` and the student's workflow state (see below) declare precisely in which academic session and how successfully the student has reached the current study level and state in the portal. All these attributes are set automatically by the portal und must (normally) not be changed via manage form pages.
135
136What 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.
137
138`StudentStudyCourse` is a container class. Study courses contain `StudentStudyLevel` instances which implement `waeup.kofa.students.interfaces.IStudentStudyLevel` and also `waeup.kofa.students.interfaces.IStudentNavigation`, see above.
139
140`IStudentStudyLevel`
141--------------------
142
143`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. See `complete numbering of study levels <https://kofa-demo.waeup.org/sources#collapseStudyLevels>`_ in the base package.
144
145`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.
146
147.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
148   :pyobject: IStudentStudyLevel
149
150`StudentStudyLevel` instances also compute some statistics 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 display 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.
151
152`ICourseTicket`
153---------------
154
155Course tickets allow students to attend a course. Lecturers can enter scores at the end of the term. A `CourseTicket` instance contains a copy of the original `Course` and `CertificateCourse` data. If the courses and/or the referring certificate courses are removed, the corresponding tickets remain unchanged. So we do not need any event triggered actions on course tickets.
156
157The `CourseTicket`  implements `waeup.kofa.students.interfaces.ICourseTicket` and also `waeup.kofa.students.interfaces.IStudentNavigation`, see above.
158
159.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
160   :pyobject: ICourseTicket
161
162The quite long list of schema fields pretends that form pages may provide these fields for editing. This is not the case. Except for `score`, all these fields are 'for display' only. They can neither be changed through the UI nor by batch processing (import). They are solely meant for backing up the orginal course data. See also :ref:`course_ticket_processor`.
163
164.. note::
165
166  It may happen that a course has been accidentally misconfigured, for example the number of credits was set too high. The course object can be corrected, but, course tickets, which refer to this course, can not. They are neither adjusted automatically nor changeable by the batch processor. The only solution to 'adjust' course tickets is to replace them by new tickets.
167
168Student Payments
169================
170
171`IStudentOnlinePayment`
172-----------------------
173
174`waeup.kofa.students.interfaces.IStudentOnlinePayment` inherits from `waeup.kofa.payments.interfaces.IOnlinePayment` and has only two additional schema fields: `p_current` and `p_level` which are student-specific. It also promises three additional methods which
175
176
177xxxxxxxxxxxxxxxx
178
179.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
180   :pyobject: IStudentOnlinePayment
181
182Student Accommodation
183=====================
184
185`IBedTicket`
186------------
187
188.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
189   :pyobject: IBedTicket
190
191
192Registration Workflow
193=====================
194
195Browser Pages
196=============
197
198
199.. _zope schema: http://docs.zope.org/zope.schema
Note: See TracBrowser for help on using the repository browser.