From 069eb1e0b7a1285ae925f95ae1be71befe65fc12 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 26 Jul 2019 13:58:09 +0200 Subject: [PATCH] feat(allocations): refine model for allocations --- models/allocations | 30 +++++++++++------------------- models/courses | 1 + routes | 4 ++-- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/models/allocations b/models/allocations index eeb4a1b3f..fb318b668 100644 --- a/models/allocations +++ b/models/allocations @@ -1,4 +1,3 @@ --- Reconsider all attributes commented out with "--?". Those might be added later, but are not important for now Allocation -- attributes with prefix staff- affect lecturers only, but are invisble to students name (CI Text) shorthand (CI Text) -- practical shorthand @@ -11,16 +10,14 @@ Allocation -- attributes with prefix staff- affect lecturers only, but are invis staffRegisterFrom UTCTime Maybe -- lectureres may register courses staffRegisterTo UTCTime Maybe -- course registration stops -- staffDeregisterUntil not needed: staff may make arbitrary changes until staffRegisterTo, always frozen afterwards - staffAllocationFrom UTCTime Maybe -- lecturers may accept applicants from this day onwwards or prohibited + staffAllocationFrom UTCTime Maybe -- lecturers may rate applicants from this day onwwards or prohibited staffAllocationTo UTCTime Maybe -- ---? staffMaterial Bool -- courses may provide files for prospective students. ?Why would we ever disallow this? Can be easily circumvented anyway. ---? staffUpload Bool -- or UploadModeDescr -- ?Why would want to prevent staff from asking for application-files? Can be circumvented anyway. -- Student register for this allocation -- canRegisterNow = maybe False (<= currentTime) registerFrom && maybe True (>= currentTime) registerTo registerFrom UTCTime Maybe -- student applications allowed from a given day onwwards or prohibited registerTo UTCTime Maybe -- student applications may be prohibited from a given date onwards -- deregisterUntil not needed: students may withdraw applicants until registerTo, but never after. Also see overrideDeregister - registerSecret Text Maybe -- enrolement maybe protected by a simple common passphrase + registerSecret Text Maybe -- student application maybe protected by a simple common passphrase -- overrides registerByStaffFrom UTCTime Maybe -- lecturers may directly enrol/disenrol students after a given date or prohibited registerByStaffTo UTCTime Maybe @@ -34,7 +31,8 @@ AllocationCourse allocation AllocationId course CourseId applicationText Bool -- lecturer will read application texts supplied by users - applicationFiles UploadMode -- lecturer wants to receive course specific application files? + applicationFiles UploadMode -- lecturer wants to receive course specific application files + ratingsVisible Bool -- lecturer wants applicants to receive feedback on their application (Grade & comment) UniqueAllocationCourse allocation course AllocationCourseFile @@ -42,21 +40,16 @@ AllocationCourseFile course CourseId file FileId ---? AllocationUser --? not needed requestCourses::Int bette encoded per course: student wants only 1 course, except if allocation in course y is possible ---? user UserId ---? allocation AllocationId ---? requestCourses Int -- >0, number of requested courses ---? UniqueAllocationUser allocation user AllocationUserCourse allocation AllocationId user UserId course CourseId - text Html Maybe -- free text entered by user - priority Int -- positive positive priority, higher number means higher priority - totalCourses Int -- positive, number of total allocated courses for this user must be <= than this number + text Text Maybe -- free text entered by user + priority Natural -- priority, higher number means higher priority + totalCourses Natural -- number of total allocated courses for this user must be <= than this number, if this course is part of that allocation ratingVeto Bool - ratingPoints Points Maybe -- "Just" does not mean done; not yet visible to participant - ratingComment Text Maybe -- "Just" does not mean done; not yet visible to participant + ratingPoints ExamGrade Maybe + ratingComment Text Maybe UniqueAllocationUserCourse allocation user course AllocationUserFile -- supplemental file for application by a user for a certain course, not unique @@ -65,10 +58,9 @@ AllocationUserFile -- supplemental file for application by a user for a certain course CourseId file FileId ---? not sure we really want to track this, might be problematic; also CourseParticipant would need to track if it was created by allocation or through other means! -AllocationDeregister -- user deregistered from an allocated course +AllocationDeregister -- self-inflicted user-deregistrations from an allocated course user UserId allocation AllocationId course CourseId time UTCTime - + reason Text Maybe -- if this deregistration was done by proxy (e.g. the lecturer pressed the button) diff --git a/models/courses b/models/courses index 5be19103a..1376af569 100644 --- a/models/courses +++ b/models/courses @@ -40,6 +40,7 @@ CourseParticipant -- course enrolement user UserId registration UTCTime -- time of last enrolement for this course field StudyFeaturesId Maybe -- associated degree course, user-defined; required for communicating grades + allocated Bool default=false -- participant was centrally allocated UniqueParticipant user course -- Replace the last two by the following, once an audit log is available -- CourseUserNote -- lecturers of a specific course may share a text note on each enrolled student diff --git a/routes b/routes index 3b1aa5262..9629b00d1 100644 --- a/routes +++ b/routes @@ -85,7 +85,7 @@ /lecturer-invite CLecInviteR GET POST /delete CDeleteR GET POST !lecturerANDempty /users CUsersR GET POST - !/users/new CAddUserR GET POST + !/users/new CAddUserR GET POST !lecturerANDtime -- TODO: time !/users/invite CInviteR GET POST /users/#CryptoUUIDUser CUserR GET POST !lecturerANDparticipant /correctors CHiWisR GET @@ -144,7 +144,7 @@ /edit EEditR GET POST /corrector-invite ECInviteR GET POST /users EUsersR GET POST - /users/new EAddUserR GET POST + /users/new EAddUserR GET POST -- TODO: add check that this is not used to circumvent CAddUserR /users/invite EInviteR GET POST /register ERegisterR POST !timeANDcourse-registered !timeANDexam-registered