Skip to main content

Module courses

Module courses 

Source

Structs§

CompleteCourseMetadata
Course
CourseAuditingData
CourseAuditingDataUpdate
CourseBreadcrumbInfo
CourseContextData
CourseCount
CourseInfo
CourseLanguageVersionNavigationInfo
All the necessary info that can be used to switch the user’s browser to a different language version of the course.
CourseMaterialCourse
A subset of the Course struct that contains the fields that are allowed to be shown to all students on the course materials.
CourseMetadata
CourseMetadataUpdate
CourseStructure
CourseUpdate
CourseWithOrganizationName
A course with its organization’s name, as listed to a native client.
NewCourse
Represents the subset of page fields that are required to create a new course.
TextEmbeddings
Embeddings of course name, description, audience and prerequisite texts, made before a save’s transaction so that the save doesn’t wait for the embedding API while holding row locks. Texts it lacks, such as ones changed in between, are embedded during the save.

Enums§

CourseAiPolicy
The AI policy a teacher has selected for a course. Drives which variant of the student-facing AI usage notice is shown; NotSet (the default) keeps the generic default message.

Functions§

all_courses
all_courses_for_auditing
all_courses_user_enrolled_to
all_courses_with_roles_for_user
audience_snapshots 🔒
The audiences of an edit, sorted by id as CourseSettingsSnapshot::audiences are.
changed_audiences 🔒
The audiences of audiences that live lacks or has with another text.
changed_embedded_texts 🔒
The name and description of settings whose course embeddings need updating.
changed_prerequisites 🔒
The prerequisites of prerequisites that old lacks or has with another text.
changed_settings_texts 🔒
The texts whose embeddings write_settings updates when writing settings over live.
changed_texts 🔒
The ids and texts of new that old lacks or has with another text.
course_auditing_data_by_id
defer_structure_constraints 🔒
Lets the rest of the transaction swap chapter numbers, module and page order numbers, page paths and citation keys, and point a chapter at a front page it writes later; these constraints are checked at commit.
delete_course
embed_changed_metadata 🔒
Embeds the settings texts that edit of the live settings and saving prerequisites would add or change.
embed_texts 🔒
get_active_course_id_by_slug
None when no active course has this slug.
get_active_courses_for_organization
get_active_courses_for_organization_count
get_all_language_versions_of_course
get_by_course_language_group_ids
The courses of the course language groups: get_all_language_versions_of_course for many groups at once.
get_by_course_or_organization_role
The courses the user holds a role in, directly or through the course’s organization, by name. Which of them the user may edit is for headless_lms_authorization to decide.
get_by_description_vectors
get_by_id_and_join_code
get_by_ids
get_by_organization_id
get_cfgname_by_tag
get_course
get_course_breadcrumb_info
get_course_by_slug
get_course_structure
Gets full course structure including all the pages.
get_course_with_join_code
get_enrolled_courses_with_exercise_types
Courses the user is enrolled on, through any of their instances, that contain at least one task of any of the given exercise types; each course once, ordered by name. An empty exercise_types matches nothing.
get_metadata
get_nondeleted_course_id_by_slug
get_organization_id
insert
is_draft
is_joinable_by_code_only
load_settings 🔒
organization_course_count
organization_courses_visible_to_user_paginated
search_courses_by_slug_or_name
Finds courses by slug or (fuzzy) name for the support chatbot’s find_course tool. Exact slug matches rank first, then substring name matches, then trigram similarity to name.
set_cheater_detection_enabled
Enables or disables suspected-cheater detection for a single course. Used by the seed routine to turn detection off for seeded courses (which are completed in seconds and would otherwise flag every seeded user); production courses keep the on-by-default value set at creation.
set_join_code_for_course
set_metadata
Saves the course description, audiences and prerequisites, and records the course settings in their history.
settings_texts 🔒
Every text of settings that has an embedding, for settings with no earlier version.
update_course
Saves the course’s editable fields and records the result in its history. Errors with PreconditionFailed if the update changes can_add_chatbot and can_change_chatbot is false.
update_course_auditing_data
Saves the auditing view’s changes and records the course settings and modules it changed in their history. Modules of other courses in the update are ignored.
update_course_base_module_completion_count_requirement
update_course_embeddings
Saves the course’s title and description embeddings, keeping the stored one where an argument is None.
write_prerequisites 🔒
Saves the course’s prerequisites as listed, deleting the ones left out. Only new and changed prerequisites get new embeddings, taken from embeddings where it has them.
write_settings
Writes the course settings of the snapshot without recording history: the course row in one write, and the audiences that differ from live, the current settings. Embeddings of the changed name, description and audiences come from embeddings where it has them. Errors with PreconditionFailed if the snapshot is of another course, or if it changes can_add_chatbot and can_change_chatbot is false.