lms.djangoapps.course_home_api.course_metadata package#
Submodules#
lms.djangoapps.course_home_api.course_metadata.serializers module#
Course Home Course Metadata Serializers. Returns Course Metadata used for all Course Home pages.
- class lms.djangoapps.course_home_api.course_metadata.serializers.CourseHomeMetadataSerializer(*args, **kwargs)#
Bases:
VerifiedModeSerializerSerializer for the Course Home Course Metadata
- class lms.djangoapps.course_home_api.course_metadata.serializers.CourseModeSerrializer(*args, **kwargs)#
Bases:
SerializerSerializer for the Course Mode
lms.djangoapps.course_home_api.course_metadata.views module#
General view for the Course Home that contains metadata every page needs.
- class lms.djangoapps.course_home_api.course_metadata.views.CourseHomeMetadataView(**kwargs)#
Bases:
RetrieveAPIViewUse Cases
Request Course metadata details for the Course Home MFE that every page needs.
Example Requests
GET api/course_home/v1/course_metadata/{course_key}
Response Values
Body consists of the following fields:
course_id: (str) The Course’s id (Course Run key) username: (str) The requesting (or masqueraded) user. Returns None for an
unauthenticated user.
is_enrolled: (bool) Indicates if the user is enrolled in the course is_self_paced: (bool) Indicates if the course is self paced is_staff: (bool) Indicates if the user is staff original_user_is_staff: (bool) Indicates if the original user has staff access
Used for when masquerading to distinguish between the original requesting user and the user being masqueraded as.
number: (str) The Course’s number org: (str) The Course’s organization tabs: List of Course Tabs to display. They are serialized as:
tab_id: (str) The tab’s id title: (str) The title of the tab to display url: (str) The url to view the tab
title: (str) The Course’s display title celebrations: (dict) a dict of celebration data user_timezone: (str) The timezone of the given user can_view_certificate: Flag to determine whether or not the learner can view their course certificate.
Returns
200 on success with above fields.
404 if the course is not available or cannot be seen.
- authentication_classes = (<class 'edx_rest_framework_extensions.auth.jwt.authentication.JwtAuthentication'>, <class 'openedx.core.lib.api.authentication.BearerAuthenticationAllowInactiveUser'>, <class 'edx_rest_framework_extensions.auth.session.authentication.SessionAuthenticationAllowInactiveUser'>)#
- dispatch(request, *args, **kwargs)#
.dispatch() is pretty much the same as Django’s regular dispatch, but with extra hooks for startup, finalize, and exception handling.
- get(request, *args, **kwargs)#
- serializer_class#
alias of
CourseHomeMetadataSerializer