openedx.core.djangoapps.course_apps package#
Subpackages#
Submodules#
openedx.core.djangoapps.course_apps.api module#
Python APIs for Course Apps.
- openedx.core.djangoapps.course_apps.api.is_course_app_enabled(course_key: CourseKey, app_id: str) bool#
Return if the app with the specified app_id is enabled for the specified course.
- Parameters:
course_key (CourseKey) – Course key for course
app_id (str) – The app id for a course app
- Returns:
True or False depending on if the course app is enabled or not.
openedx.core.djangoapps.course_apps.apps module#
Pluggable app config for course apps.
- class openedx.core.djangoapps.course_apps.apps.CourseAppsConfig(app_name, app_module)#
Bases:
AppConfigConfiguration class for Course Apps.
- name = 'openedx.core.djangoapps.course_apps'#
- plugin_app = {'url_config': {'cms.djangoapp': {'namespace': 'course_apps_api', 'regex': '^api/course_apps/', 'relative_path': 'rest_api.urls'}}}#
- ready()#
Override this method in subclasses to run code when Django starts.
openedx.core.djangoapps.course_apps.handlers module#
Signal handlers for course apps.
- openedx.core.djangoapps.course_apps.handlers.initialize_course_app_status(sender: str, course_key: CourseKey, is_enabled: bool, **kwargs)#
Create a new CourseAppStatus object when a course app is accessed for the first time.
For existing courses CourseAppStatus object might not exist. This handler creates a new CourseAppStatus object in such cases.
- openedx.core.djangoapps.course_apps.handlers.update_course_apps(sender, course_key, **kwargs)#
Whenever the course is published, update the status of course apps in the django models to match their status in the course.
openedx.core.djangoapps.course_apps.models module#
Models to store course apps data.
- class openedx.core.djangoapps.course_apps.models.CourseAppStatus(*args, **kwargs)#
Bases:
TimeStampedModelCourseAppStatus stores the enabled/disabled status for course apps.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- app_id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- course_key#
DO NOT REUSE THIS CLASS. Provided for backwards compatibility only!
A placeholder class that provides a way to set the attribute on the model.
- created#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- enabled#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- classmethod get_all_app_status_data_for_course(course_key: CourseKey) Dict[str, bool]#
Get a dictionary containing the status of all apps linked to the course.
- Parameters:
course_key (CourseKey) – the course id for which app status is needed
- Returns:
A dictionary where the keys are app ids and the values are booleans indicating if the app with that id is enabled
- get_next_by_created(*, field=<model_utils.fields.AutoCreatedField: created>, is_next=True, **kwargs)#
- get_next_by_modified(*, field=<model_utils.fields.AutoLastModifiedField: modified>, is_next=True, **kwargs)#
- get_previous_by_created(*, field=<model_utils.fields.AutoCreatedField: created>, is_next=False, **kwargs)#
- get_previous_by_modified(*, field=<model_utils.fields.AutoLastModifiedField: modified>, is_next=False, **kwargs)#
- history = <django.db.models.manager.HistoryManagerFromHistoricalQuerySet object>#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- modified#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- save_without_historical_record(*args, **kwargs)#
Save model without saving a historical record
Make sure you know what you’re doing before you use this method.
openedx.core.djangoapps.course_apps.plugins module#
Course Apps plugin base class and plugin manager.
- class openedx.core.djangoapps.course_apps.plugins.CourseApp#
Bases:
ABCAbstract base class for all course app plugins.
- documentation_links: Dict = {}#
- abstract classmethod get_allowed_operations(course_key: CourseKey, user: User | None = None) Dict[str, bool]#
Returns a dictionary of available operations for this app.
Not all apps will support being configured, and some may support other operations via the UI. This will list, the minimum whether the app can be enabled/disabled and whether it can be configured.
- Parameters:
course_key (CourseKey) – The course key for a course.
user (User) – The user for which the operation is to be tested.
- Returns:
A dictionary that has keys like ‘enable’, ‘configure’ etc with values indicating whether those operations are allowed.
- abstract classmethod is_available(course_key: CourseKey) bool#
Returns a boolean indicating this course app’s availability for a given course.
If an app is not available, it will not show up in the UI at all for that course, and it will not be possible to enable/disable/configure it.
- Parameters:
course_key (CourseKey) – Course key for course whose availability is being checked.
- Returns:
Availability status of app.
- Return type:
- abstract classmethod is_enabled(course_key: CourseKey) bool#
Return if this course app is enabled for the provided course.
- Parameters:
course_key (CourseKey) – The course key for the course you want to check the status of.
- Returns:
The status of the course app for the specified course.
- Return type:
openedx.core.djangoapps.course_apps.signals module#
Signals for course apps.
openedx.core.djangoapps.course_apps.tasks module#
This file contains celery tasks for course apps.
openedx.core.djangoapps.course_apps.toggles module#
Toggles for course apps.
- openedx.core.djangoapps.course_apps.toggles.COURSE_APPS_WAFFLE_NAMESPACE = 'course_apps'#
Namespace for use by course apps for creating availability toggles
- openedx.core.djangoapps.course_apps.toggles.exams_ida_enabled(course_key)#
Returns a boolean if exams ida view is enabled for a course.
- openedx.core.djangoapps.course_apps.toggles.proctoring_settings_modal_view_enabled(course_key)#
Returns a boolean if proctoring settings modal view is enabled for a course.