Univention Bugzilla – Bug 50819
Track exams on exam users by ucsschoolRole instead of school membership
Last modified: 2020-03-25 16:09:27 CET
+++ This bug was initially created as a clone of Bug #50588 +++
At the moment the exams an Exam User participates in is determined by a local check in the umcs-exam-module and a check in the exam-master-module which decides by school membership in how many exams the student still is.
Wit the fix of Bug #50588 it became obvious that this system does not work for mutlischool users and is very error prone. Thus the exams an Exam User participates in, should be tracked by roles in the "exam" context.
For this the new context has to be introduced into ucsschool as well since so far only the context school is in use.
Implemented on branch oschwieg/4.4/50819
The following was done so far:
- schoolexam module sends exam to schoolexam-master in exam_user create and remove UMCP calls
- schoolexam module always sends exam_user remove UMCP call (parallel user check was removed)
- schoolexam-master now sets ucsschool roles with exam context to track the exams a user is writing at the moment if exam is sent by the schoolexam module. Otherwise is stays on the old behavior
Fix for Bug #50588 was applied. That repairs the school caching but also reveals the error in writing exams in multiple schools at the same time. From my understanding that feature never worked and thus it should be OK to just apply that particular patch without regard of backwards compatibility.
What is missing:
Equal exam names in different schools
The following commits were cherry picked into feature/kelvin and therefore have to be QA'ed:
d8434af028f9b3d1b07649a44a69bcfc9cd9819d Bug #50819: Extend create_ucsschool_role_string functions to create other context types
0394aee0f31e7b5080a7bbb9d8a55ce942bcfd5d Bug #50819: Add function to separate ucsschool role strings into its individual elements
7247a60d1fc2aea6cb0e72200c8eb3a6433aec29 Bug #50819: Respect all context types in role string validation
The problem of two exams in two different schools sharing an exam user having the same name was solved by appending -$OU to the context part of the ucsschool role. For example the role string for an exam student participating in the exam test1 of DEMOSCHOOL:
exam users home folder is removed to early
How to reproduce:
Set "ucr set ucsschool/exam/user/homedir/autoremove=true"
Add two computerrooms in the same school
write two different exams in both rooms for the same class
The home folder is removed when stopping an exam and not when stopping the last exam
The problem with the home folder was fixed.
Reopen for question:
(In reply to Ole Schwiegert from comment #6)
> The problem with the home folder was fixed.
In case the master is not updated, the exam user account is now removed on stopping the first exam and not the last.
Is that ok? I guess as long this isn't released as an errata, that should be fine.
This is indeed a problem. As stated in the US this update is intended for an errata update.
I added a check into the schoolexam module that checks if exam roles exist. If not the module falls back to old behavior.
Fixed a typo
The home directories were removed too early if the master *isn't* updated.
In case the master isn't updated, the (global) parallel_users is empty and the home dir is always removed, even if a parallel exam is running.
I don't see a reason to check the global parallel users by the local exam module. The "or" check makes this redundant any ways, as far as I can tell?
I already committed and build the package, to get test results for tomorrow.
Please check if I missed something and if the changes are ok with you. Thanks!
[4.4 89a6181f4] Bug #50819: Adjust test to check home dir removal
[4.4 8d4b3a818] Bug #50819: Fix home dir removal
[4.4 ed8061ee7] Bug #50819: yaml
Otherwise this looks good to me :)
What I tested:
* Fully updated environment:
Started two parallel exams in an updated environment with multi school users -> Examusers and home directories (if configured) were removed after the *last* exam is finished -> OK (Very nice!)
* slave not updated:
Old behaviour is used -> OK
* master not updated:
Users are not deleted before the last exam is finished -> OK
Users are deleted after the last exam is finished (for exams in the same school, the behaviour for multi school exams is addressed by this bug) -> OK
Users home dir is deleted after the last exam is finished -> Addressed by comment 11
Test -> OK
kelvin merge -> OK
If jenkins is green tomorrow and you are fine with my changes, you can consider this bug verified :)
A user who is writing an exam parallel at two school gets a separate home dir on each school dc an exam is written on
UCS@school 4.4 v5 has been released.
If this error occurs again, please clone this bug.