-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON enrollment data importer (v1) #2131
Comments
Thoughts / Questions / Ideas
|
yes, this logic needs to be applied here as well
closed
yes, but only if they have a
yes, please
we can assume them to be standard-compliant case-insensitive UUIDs for now
yes (for now)
do you mean if for some reason the CMS doesn't export them correctly anymore? courses/evaluations are only added to the JSON file when there are enrollments for them. so there should be almost no cases where they are manually deleted from that point on. then let's say for all deletions we only notify by email and expect the managers to do the deletion manually. |
Edits:
- 2024-03-25: Added "scale" which defines whether the Course is graded or not
- 2024-03-25: Added "relatedevents" which defines that two events belong to the same Course, changed previous logic with "lvnr"
- 2024-05-27: Removed that "All changes should be made by an 'import user' who will be the
user
forLogEntry
s." Other automatic changes have no user set in theLogEntry
, so we don't need it here either.A new enrollment data importer must be implemented. This importer will process JSON files containing account and course/evaluation data.
This is a first version of the importer, it will be extended in future issues. The JSON files will contain additional information that is omitted here (e.g. "students" in "events" will have additional attributes, hence the bulky format).
The importer will be called by a management command (which will be called by a cron job) and will process a single file specified by a parameter. A second parameter specifies the
Semester
for which the data is to be imported.Unlike the current importer, there won't be a GUI, so error messages will have to be sent by email.
In addition, a log should be created and also sent by email after a successful import. This log should contain
UserProfile
sCourse
s/Evaluation
s createdCourse
s/Evaluation
sCourse
s/Evaluation
sAPPROVED
The JSON file is formatted as described below.
UserProfile
which can be identified by theemail
.gguid
is a unique ID that will be used to reference the UserProfile in a later step.name
->last_name
christianname
->first_name_given
UserProfile
which can be identified by theemail
.gguid
is a unique ID that will be used to reference the UserProfile in a later step.name
->last_name
christianname
->first_name_given
titlefront
->title
gguid
should be stored ascms_id
(Campus Management System ID) as a unique identifier for aCourse
to reference later changes. If noCourse
with thisgguid
exists, it needs to be created, otherwise it needs to be updated if there are changes in the metadata. The data is mapped like this:title
->name_de
title_en
->name_en
type
->CourseType
(name_de
) - If there is noCourseType
with this name, it should be created automatically.courses.cprid
->Degree
(name_de
) - This should be mapped viaimport_names
. If noDegree
with a matchingimport_name
exists, it should be created automatically.lecturers
->responsibles
- The corresponding user is referenced inlecturers
via the above-mentionedgguid
.gguid
should be stored ascms_id
as a unique identifier for anEvaluation
to reference later changes (the samegguid
will be set for the Course and its main Evaluation, they are only unique within classes). If noEvaluation
with thiscms_id
exists, it must be created, otherwise it must be updated when the metadata changes. The data is mapped like this:relatedevents.gguid
: If the evaluation is not the main evaluation (so ifisexam
istrue
), this links the Evaluation to its Course viacourse.cms_id
.isexam
: Iftrue
,name_de
should be "Klausur" andname_en
should be "Exam", otherwise both are empty (main Evaluation).appointments.end
-> Ifisexam
is true,vote_start_datetime
is 08:00 on the day after the given date,vote_end_date
is three days after the given date. Otherwise,vote_start_datetime
is 08:00 on Monday of the week before the given date,vote_end_date
is Sunday of the week of the given date (using Monday as the first day of the week).lecturers
->contributors
(referenced bygguid
in "lecturers") -- Contributors should only be added by the importer, not removed. In case contributors are removed in a later import, this should be ignored.students
->participants
(referenced bygguid
in "students")courses.scale
: If set,wait_for_grade_upload_before_publishing
isTrue
, otherwise itsFalse
Changes to existing evaluations should only be made when the evaluation is in a state <
APPROVED
. Attempted changes in later states should be logged.Format
Example
The text was updated successfully, but these errors were encountered: