1 | .. _applicant_registration: |
---|
2 | |
---|
3 | Registration |
---|
4 | ============ |
---|
5 | |
---|
6 | The `ApplicantRegistrationPage` allows to register in create or in |
---|
7 | update mode, depending on the |
---|
8 | :ref:`mode of its context<application_mode>`, i.e. the applicants |
---|
9 | container. |
---|
10 | |
---|
11 | In create mode, `firstname`, `middlename`, `lastname`, `email` and |
---|
12 | `phone` are requested. A new record is being created. |
---|
13 | |
---|
14 | In update mode, only `reg_number`, `lastname` and `email` have to be |
---|
15 | entered. Kofa searches for an applicant record with matching |
---|
16 | registration number and lowercased lastname. If the search does not |
---|
17 | yield a result, the flash message: 'No application record found' is |
---|
18 | returned. The anonymous user will not know, if the registration |
---|
19 | number does not exist or the provided lastname does not match. |
---|
20 | Another ``if`` statement checks whether the password has already |
---|
21 | been set and used, i.e. the the application has already been |
---|
22 | started. If so, the anonymous user can't register again and is being |
---|
23 | requested to proceed to the login page. |
---|
24 | |
---|
25 | In both registration modes a randomly generated password is set and |
---|
26 | the email address is saved. An email with login credentials is sent |
---|
27 | to this address. Finally, the browser is redirected to a landing |
---|
28 | page. Depending on the portals configuration, the landing page tells |
---|
29 | the user that an email has been send to her/his mailbox, or even |
---|
30 | discloses additionally the login credentials. The disclosure of |
---|
31 | credentials has two substantial drawbacks: (1) The login credentials |
---|
32 | can be misused by web crawlers for bulk account creation, which may |
---|
33 | cause the system to crash. (2) The email address provided by the |
---|
34 | user is not being verified and there is no guarantee that the |
---|
35 | address belongs to the user or that a mailbox with such an address |
---|
36 | exists. Therefore, we strongly recommend to only send credentials to |
---|
37 | email addresses. |
---|
38 | |
---|
39 | |
---|
40 | .. _application_form_locking: |
---|
41 | |
---|
42 | Form Locking |
---|
43 | ============ |
---|
44 | |
---|
45 | We mentioned regular :ref:`page_locking` mechanisms. The |
---|
46 | `ApplicantEditFormPage` has two additional locks. One is the same |
---|
47 | named applicant attribute `locked`. Applicants can only enter the |
---|
48 | edit page if their record is 'unlocked'. Locking and unlocking is |
---|
49 | automatically done by workflow event handlers. By default, the |
---|
50 | record is unlocked. Only when the applicant submits the record, it |
---|
51 | is being locked, which means the attribute is set ``True`` and the |
---|
52 | data can no longer be edited. |
---|
53 | |
---|
54 | The reader may wonder why Kofa is not using the workflow state |
---|
55 | instead. The additional locking mechanism allows officers to unlock |
---|
56 | and lock forms without triggering workflow transitions. A transition |
---|
57 | is always a major, and sometimes inappropriate intervention which is |
---|
58 | also recorded in the application history. |
---|
59 | |
---|
60 | Use case: An applicant has made a mistake and requests a change of |
---|
61 | submitted data. An officer accepts the change, temporarily unlocks |
---|
62 | the form to allow editing the data. Unlocking and re-locking is |
---|
63 | logged in ``applicants.log`` but not shown on pages or the |
---|
64 | application slip. |
---|
65 | |
---|
66 | The second lock is induced by the application deadline. If the |
---|
67 | application period has expired and the applicants container's |
---|
68 | `strict_deadline` attribute is set, the applicant is also not |
---|
69 | allowed to edit or even submit the form. |
---|
70 | |
---|
71 | .. note:: |
---|
72 | |
---|
73 | A locked-out applicant can still login and access the display pages |
---|
74 | of the recod and also download payment and application slips. To |
---|
75 | expell an applicant from the portal, the account has to be suspended |
---|
76 | by setting the same-named attribute. |
---|
77 | |
---|
78 | |
---|
79 | .. _applicant_payment_tickets: |
---|
80 | |
---|
81 | Payment |
---|
82 | ======= |
---|
83 | |
---|
84 | In contrast to the students section, there is no |
---|
85 | `PaymentsManageFormPage` to handle payment tickets separately. |
---|
86 | Payment tickets can be viewed, added and removed directly on the |
---|
87 | applicant manage and edit form pages. Officers can remove all |
---|
88 | payment tickets, applicants only those without a response code |
---|
89 | (`r_code`) and, if the form is unlocked, so that they are allowed to |
---|
90 | edit their data. |
---|
91 | |
---|
92 | As already mentioned in the workflow chapter, making a payment and |
---|
93 | redeeming a payment is done in one step. When the payment was |
---|
94 | successful or has been approved, also the applicant is automatically |
---|
95 | set to state ``paid``. There is no need to redeem the ticket |
---|
96 | manually. |
---|
97 | |
---|
98 | |
---|
99 | .. _creating_students: |
---|
100 | |
---|
101 | Creating Student Records |
---|
102 | ======================== |
---|
103 | |
---|
104 | As brought up in the :ref:`application_workflow` chapter, the final |
---|
105 | step of the application process is the creation of the student |
---|
106 | record on the basis of the application data. Only applicants in |
---|
107 | state ``admitted`` can be turned into students. This is possible at |
---|
108 | various application section levels: |
---|
109 | |
---|
110 | 1. Officers can create student records from single applicant |
---|
111 | records. A link button appears on the display page of each admitted |
---|
112 | applicants which directly triggers the creation process: |
---|
113 | |
---|
114 | |create_student_button| |
---|
115 | |
---|
116 | 2. The `ApplicantsContainerManageFormPage` provides a form button |
---|
117 | which allows to create student records from above selected |
---|
118 | applicants: |
---|
119 | |
---|
120 | |create_selected_students_button| |
---|
121 | |
---|
122 | Only admitted applicants will be processed. Other selected |
---|
123 | applicants will be skipped without further notice |
---|
124 | |
---|
125 | 3. Last but not least, the portal manager with user id ``admin`` |
---|
126 | does see a link buttons: |
---|
127 | |
---|
128 | |create_students_button| |
---|
129 | |
---|
130 | on the `ApplicantsContainerPage` and on the `ApplicantsRootPage` |
---|
131 | which creates student records from applicants inside a single |
---|
132 | applicants container or even portal-wide respectively. |
---|
133 | |
---|
134 | The reader may wonder: Why only user ``admin``? |
---|
135 | |
---|
136 | Batch creation of thousands or even tenthousands of student records |
---|
137 | is very computation intensive and takes quite a long time, even with |
---|
138 | powerful computers. Experience has shown that the portal must be |
---|
139 | disconnected from the Internet in order to avoid database write |
---|
140 | conflict errors, which cannot be resolved if also students access |
---|
141 | the portal. Usually conflict errrors are not serious. Unresolved |
---|
142 | conflicts just lead to an error message and the database remains |
---|
143 | unchanged. Unfortunataly, student creation does not only alter the |
---|
144 | object database. As we will see below, also folders and files in the |
---|
145 | filesystem are added. These filesystem changes are not being |
---|
146 | reverted after unresolved conflicts, a fact which can cause serious |
---|
147 | problems. |
---|
148 | |
---|
149 | So the answer to the question is trivial: We expect that the admin |
---|
150 | user knows what s/he is doing and is careful enough to start the |
---|
151 | creation process in maintenance mode, which means when the portal is |
---|
152 | disconnected from a public network. |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | .. |create_student_button| image:: create_student_button.png |
---|
157 | :scale: 50 % |
---|
158 | |
---|
159 | .. |create_students_button| image:: create_students_button.png |
---|
160 | :scale: 50 % |
---|
161 | |
---|
162 | .. |create_selected_students_button| image:: create_selected_students_button.png |
---|
163 | :scale: 50 % |
---|
164 | |
---|
165 | `Applicant.createStudent` |
---|
166 | ------------------------- |
---|
167 | |
---|
168 | The `createStudent` method is called for each admitted applicant. |
---|
169 | The method performs a series of checks before it creates a new |
---|
170 | student record: |
---|
171 | |
---|
172 | 1. Is the applicant really in the correct state? |
---|
173 | |
---|
174 | 2. Has the registration number not been assigned to another student? |
---|
175 | |
---|
176 | 3. Is a certificate (`course_admitted`) provided? |
---|
177 | |
---|
178 | 4. Can all required student attributes be copied and set? The |
---|
179 | following attributes are copied: |
---|
180 | |
---|
181 | .. autoattribute:: waeup.kofa.applicants.applicant.Applicant.applicant_student_mapping |
---|
182 | :noindex: |
---|
183 | |
---|
184 | 5. Can the application slip can be created? Defective images may |
---|
185 | cause the adapter method to raise an exception (``IOError``). |
---|
186 | |
---|
187 | If all these checks are passed, a new student record is created, a |
---|
188 | password is set, the transitions ``create`` and ``admit`` are fired |
---|
189 | and all student study course attributes are set. These are the |
---|
190 | changes which affect the database. |
---|
191 | |
---|
192 | Furthermore, `createStudent` also produces an application slip pdf |
---|
193 | file, creates a new folder for the student in the filesystem and |
---|
194 | copies the pdf file together with the passport jpeg image file into |
---|
195 | the newly created folder. The copied application slip ensures, that |
---|
196 | the original application data do not get lost, when the application |
---|
197 | section is being purged. |
---|
198 | |
---|
199 | As mentioned above, folder creation and file copying are not being |
---|
200 | rolled back if the database transactions fails, e.g. due to write |
---|
201 | conflict errors. Therefore, batch student creation should only be |
---|
202 | performed if the portal is offline. |
---|