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_registering_completion_to_uh_open_university boolean false false
id uuid uuid_generate_v4() false public.certificate_configuration_to_requirements public.chapters public.course_module_completion_registered_to_study_registries public.course_module_completions public.course_modules 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.

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_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_order_number_uniqueness UNIQUE UNIQUE NULLS NOT DISTINCT (course_id, order_number, deleted_at)
course_modules_pkey PRIMARY KEY PRIMARY KEY (id)
default_course_module_is_first_in_order CHECK CHECK (((name IS NULL) = (order_number = 0)))

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)

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