openedx.core.djangoapps.content.learning_sequences.api package#

Subpackages#

Submodules#

openedx.core.djangoapps.content.learning_sequences.api.outlines module#

All Course Outline related business logic. Do not import from this module directly. Use openedx.core.djangoapps.content.learning_sequences.api – that __init__.py imports from here, and is a more stable place to import from.

openedx.core.djangoapps.content.learning_sequences.api.outlines.get_content_errors(course_key: CourseKey) List[ContentErrorData]#

Get ContentErrors created in the most recent publish of this Course run.

openedx.core.djangoapps.content.learning_sequences.api.outlines.get_course_keys_with_outlines() QuerySet#

Queryset of ContextKeys, iterable as a flat list.

The function_trace time here is a little misleading because querysets are lazily evaluated. It’s mostly there to get information about how often it’s being called and by what transactions.

openedx.core.djangoapps.content.learning_sequences.api.outlines.get_course_outline(course_key: CourseKey) CourseOutlineData#

Get the outline of a course run.

There is no user-specific data or permissions applied in this function.

See the definition of CourseOutlineData for details about the data returned.

openedx.core.djangoapps.content.learning_sequences.api.outlines.get_user_course_outline(course_key: CourseKey, user: User, at_time: datetime) UserCourseOutlineData#

Get an outline customized for a particular user at a particular time.

user is a Django User object (including the AnonymousUser) at_time should be a UTC datetime.datetime object.

See the definition of UserCourseOutlineData for details about the data returned.

openedx.core.djangoapps.content.learning_sequences.api.outlines.get_user_course_outline_details(course_key: CourseKey, user: User, at_time: datetime) UserCourseOutlineDetailsData#

Get an outline with supplementary data like scheduling information.

See the definition of UserCourseOutlineDetailsData for details about the data returned.

openedx.core.djangoapps.content.learning_sequences.api.outlines.key_supports_outlines(opaque_key: OpaqueKey) bool#

Does this key-type support outlines?

Allow all non-deprecated CourseKeys except for v1 Libraries (which subclass CourseKey but shouldn’t). So our normal SplitMongo courses (CourseLocator) will work, as will CCX courses. But libraries, pathways, and Old Mongo courses will not.

openedx.core.djangoapps.content.learning_sequences.api.outlines.replace_course_outline(course_outline: CourseOutlineData, content_errors: List[ContentErrorData] | None = None)#

Replace the model data stored for the Course Outline with the contents of course_outline (a CourseOutlineData). Record any content errors.

This isn’t particularly optimized at the moment.

openedx.core.djangoapps.content.learning_sequences.api.permissions module#

Simple permissions for Learning Sequences.

Most access rules determining what a user will see are determined within the outline processors themselves. This is where we’d put permissions that are used to determine whether those processors even need to be run to filter the results.

openedx.core.djangoapps.content.learning_sequences.api.permissions.can_see_all_content(requesting_user: User, course_key: CourseKey) bool#

Global staff, course staff, and instructors can see everything.

There’s no need to run processors to restrict results for these users.

Module contents#