Index

public.course_modules

Description

A module is a collection of chapters which can be used to categorise the chapters of a course.

Columns

Name Type Default Nullable Children Parents Comment
automatic_completion boolean false false Whether or not automatic completion is enabled for this module.
automatic_completion_number_of_exercises_attempted_treshold integer true If automatic completions are enabled, the amount of exercises that need to be attempted (submitted at least once) to be qualified for completion.
automatic_completion_number_of_points_treshold integer true If automatic completions are enabled, the amount of points that need to be gained to be qualified for completion.
automatic_completion_requires_exam boolean false false If automatic completion is enabled, whether an exam is also required or not.
certification_enabled boolean false false
completion_registration_link_override varchar(255) true If not null, use this link rather than the default one when registering course completions.
copied_from uuid true public.course_modules The original course modules record of a copy.
course_id uuid false public.chapters public.courses A module belongs to a course.
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.
ects_credits real true The amount of ECTS credits that the student can earn by completing this course module.
enable_credit_registration_via_suotar boolean false false The per-module opt-in for credit registration via Suotar, and the rollout switch. The course_modules_one_credit_registration_path constraint keeps it mutually exclusive with enable_registering_completion_to_uh_open_university, because both paths would register the same attainment in Sisu; while it is on, the legacy pull API must not see this modules completions.
enable_registering_completion_to_uh_open_university boolean false false
id uuid uuid_generate_v4() false public.certificate_configuration_to_requirements public.chapters public.cheater_thresholds public.code_giveaways public.course_module_completion_registered_to_study_registries public.course_module_completions public.course_module_suotar_configurations public.course_module_suotar_realisations public.course_modules public.credit_registrations public.suspected_cheaters A unique, stable identifier for the record.
name varchar(255) true The name of the module. Null in this field will mean that the module is the default for that course.
order_number integer false Defines the order in which the modules are shown. The index 0 is reserved for the default module of the course.
uh_course_code varchar(255) true University of Helsinki’s recognized identifier for the course. E.g. BSCS1001 (Introduction to Programming)
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.

Viewpoints

Name Definition
Credit registration How a completed course module becomes a credit in the University of Helsinki study registry. Enrolment on the course is itself the student’s consent to register the credit; once a student number is proven to be theirs, one ledger row per completion is pushed to Sisu through Suotar and polled until the registry confirms the attainment.

Constraints

Name Type Definition
course_module_automatic_completion_validity CHECK CHECK ((automatic_completion <> (COALESCE(automatic_completion_number_of_exercises_attempted_treshold, automatic_completion_number_of_points_treshold) IS NULL)))
course_modules_automatic_completion_not_null n NOT NULL automatic_completion
course_modules_automatic_completion_requires_exam_not_null n NOT NULL automatic_completion_requires_exam
course_modules_certification_enabled_not_null n NOT NULL certification_enabled
course_modules_copied_from_fkey FOREIGN KEY FOREIGN KEY (copied_from) REFERENCES course_modules(id)
course_modules_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
course_modules_course_id_not_null n NOT NULL course_id
course_modules_created_at_not_null n NOT NULL created_at
course_modules_enable_credit_registration_via_suotar_not_null n NOT NULL enable_credit_registration_via_suotar
course_modules_enable_registering_completion_to_uh_ope_not_null n NOT NULL enable_registering_completion_to_uh_open_university
course_modules_id_not_null n NOT NULL id
course_modules_one_credit_registration_path CHECK CHECK ((NOT (enable_credit_registration_via_suotar AND enable_registering_completion_to_uh_open_university))) NOT VALID
course_modules_order_number_not_null n NOT NULL order_number
course_modules_order_number_uniqueness UNIQUE UNIQUE NULLS NOT DISTINCT (course_id, order_number, deleted_at)
course_modules_pkey PRIMARY KEY PRIMARY KEY (id)
course_modules_updated_at_not_null n NOT NULL updated_at
default_course_module_is_first_in_order CHECK CHECK (((name IS NULL) = (order_number = 0)))
uh_course_code_not_empty_string CHECK CHECK ((TRIM(BOTH FROM uh_course_code) <> ’’::text))

Indexes

Name Definition
course_modules_courses_key CREATE UNIQUE INDEX course_modules_courses_key ON public.course_modules USING btree (id, course_id)
course_modules_order_number_uniqueness CREATE UNIQUE INDEX course_modules_order_number_uniqueness ON public.course_modules USING btree (course_id, order_number, deleted_at) NULLS NOT DISTINCT
course_modules_pkey CREATE UNIQUE INDEX course_modules_pkey ON public.course_modules USING btree (id)
idx_course_modules_suotar_enabled CREATE INDEX idx_course_modules_suotar_enabled ON public.course_modules USING btree (course_id, order_number) WHERE (enable_credit_registration_via_suotar AND (deleted_at IS NULL))

Triggers

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

Relations

er

Generated by tbls