Bug 50819 - Track exams on exam users by ucsschoolRole instead of school membership
Track exams on exam users by ucsschoolRole instead of school membership
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v5
Assigned To: Ole Schwiegert
Jürn Brodersen
Depends on:
Blocks: 50588
  Show dependency treegraph
Reported: 2020-02-13 10:14 CET by Ole Schwiegert
Modified: 2020-03-25 16:09 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted after Product Owner Review:
Ticket number: 2019120221000346
Bug group (optional):
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Ole Schwiegert univentionstaff 2020-02-13 10:14:10 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.
Comment 1 Ole Schwiegert univentionstaff 2020-02-17 10:29:43 CET
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:
Test case
Equal exam names in different schools
Comment 2 Ole Schwiegert univentionstaff 2020-02-17 13:17:36 CET
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:

Comment 5 Jürn Brodersen univentionstaff 2020-02-20 11:32:59 CET
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
Comment 6 Ole Schwiegert univentionstaff 2020-02-21 14:47:14 CET
The problem with the home folder was fixed.

Package: ucs-school-lib
Version: 12.1.10A~
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Package: ucs-school-umc-exam
Version: 9.0.1-31A~
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Package: ucs-test-ucsschool
Version: 6.0.100A~
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 7 Jürn Brodersen univentionstaff 2020-02-21 16:43:18 CET
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.
Comment 8 Ole Schwiegert univentionstaff 2020-02-24 08:15:03 CET
This is indeed a problem. As stated in the US this update is intended for an errata update.
Comment 9 Ole Schwiegert univentionstaff 2020-02-24 08:25:54 CET
I added a check into the schoolexam module that checks if exam roles exist. If not the module falls back to old behavior.

Package: ucs-school-umc-exam
Version: 9.0.1-32A~
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 10 Ole Schwiegert univentionstaff 2020-02-25 15:26:38 CET
Package: ucs-school-umc-exam
Version: 9.0.1-33A~
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Fixed a typo
Comment 11 Jürn Brodersen univentionstaff 2020-02-25 22:30:37 CET
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
Comment 12 Jürn Brodersen univentionstaff 2020-02-25 22:45:02 CET
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 :)
Comment 13 Jürn Brodersen univentionstaff 2020-02-26 10:02:44 CET
For documentation:
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
Comment 14 Sönke Schwardt-Krummrich univentionstaff 2020-03-25 16:09:27 CET
UCS@school 4.4 v5 has been released.


If this error occurs again, please clone this bug.