Index

public.course_module_completions

Description

Internal student completions for course modules.

Columns

Name Type Default Nullable Children Parents Comment
completion_date timestamp with time zone false The date when the student completed the course. The value of this field is the date that will end up in the user’s study registry as the completion date. If the completion is created automatically, it is the date when the student passed the completion thresholds. If the teacher creates these completions manually, the teacher inputs this value. Usually the teacher would in this case input the date of the exam.
completion_granter_user_id uuid true public.users User who added this completion. Null if it was granted automatically.
completion_language varchar(15) false The language used in the completion of the course.
completion_registration_attempt_date timestamp with time zone true Date when the student opened the form to register their credits to the open university.
course_id uuid false public.courses Course that the completion is a part of.
course_instance_id uuid false public.course_instances Instance that the completion was on.
course_module_id uuid false public.course_modules Part of a course that the completion is for.
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
eligible_for_ects boolean false Whether or not the student can receive study credits for this completion.
email varchar(255) false Email at the time of completing the course. Used to match the student to the data that they will fill to the open university and it will remain unchanged in the event of email change because changing this would break the matching.
grade integer true Grade for completion. Numeric value or null.
id uuid uuid_generate_v4() false public.course_module_completion_registered_to_study_registries A unique, stable identifier for the record.
passed boolean false Whether or not the completion is valid for credits. Generated from grade_scale_id and grade_local_id.
prerequisite_modules_completed boolean false false Whether or not the student is able to receive credits for this completion. Completions are granted individually for each module, but the same course’s modules may depend on each other.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.
user_id uuid false public.users User who the completion is registered for.

Constraints

Name Type Definition
course_module_completions_completion_granter_user_id_fkey FOREIGN KEY FOREIGN KEY (completion_granter_user_id) REFERENCES users(id)
course_module_completions_completion_language_check CHECK CHECK (((completion_language)::text ~ ‘1{2,3}(-[A-Z][a-z]{3})?-[A-Z]{2}$’::text))
course_module_completions_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
course_module_completions_course_instance_id_fkey FOREIGN KEY FOREIGN KEY (course_instance_id) REFERENCES course_instances(id)
course_module_completions_course_module_id_fkey FOREIGN KEY FOREIGN KEY (course_module_id) REFERENCES course_modules(id)
course_module_completions_pkey PRIMARY KEY PRIMARY KEY (id)
course_module_completions_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)

Indexes

Name Definition
course_module_automatic_completion_uniqueness CREATE UNIQUE INDEX course_module_automatic_completion_uniqueness ON public.course_module_completions USING btree (course_module_id, course_instance_id, user_id) WHERE ((completion_granter_user_id IS NULL) AND (deleted_at IS NULL))
course_module_completions_pkey CREATE UNIQUE INDEX course_module_completions_pkey ON public.course_module_completions USING btree (id)

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.course_module_completions FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls


  1. a-z↩︎