openedx.features.course_experience.api.v1 package#

Submodules#

openedx.features.course_experience.api.v1.serializers module#

Serializer for Course Deadlines (Mobile)

class openedx.features.course_experience.api.v1.serializers.CourseDeadlinesMobileSerializer(*args, **kwargs)#

Bases: DatesBannerSerializer

Serializer for course deadlines

get_has_ended(_)#

openedx.features.course_experience.api.v1.urls module#

Contains URLs for the Course Experience API

openedx.features.course_experience.api.v1.utils module#

Course Experience API utilities.

openedx.features.course_experience.api.v1.utils.reset_bulk_course_deadlines(request, course_keys, research_event_data={})#

Reset deadlines for multiple courses for the requesting user.

Parameters:
  • request (Request) – The request object

  • course_keys (list) – List of course keys

  • research_event_data (dict) – Any data that should be included in the research tracking event

Returns:

(success_course_keys, failed_course_keys)

Return type:

tuple

openedx.features.course_experience.api.v1.utils.reset_course_deadlines_for_user(user, course_key)#

Core function to reset deadlines for a single course and user.

Parameters:
  • user – The user object

  • course_key – The course key

Returns:

True if deadlines were reset, False if gated content prevents reset

Return type:

bool

openedx.features.course_experience.api.v1.utils.reset_deadlines_for_course(request, course_key, research_event_data={})#

Set the start_date of a schedule to today, which in turn will adjust due dates for sequentials belonging to a self paced course

Parameters:
  • request (Request) – The request object

  • course_key (str) – The course key

  • research_event_data (dict) – Any data that should be included in the research tracking event Example: sending the location of where the reset deadlines banner (i.e. outline-tab)

openedx.features.course_experience.api.v1.views module#

Views for Course Experience API.

class openedx.features.course_experience.api.v1.views.CourseDeadlinesMobileView(**kwargs)#

Bases: RetrieveAPIView

Use Cases

Request course deadline info for mobile

Example Requests

GET api/course_experience/v1/course_deadlines_info/{course_key}

Response Values

Body consists of the following fields:

dates_banner_info: (obj)

missed_deadlines: (bool) Whether the user has missed any graded content deadlines for the given course. missed_gated_content: (bool) Whether the user has missed any gated content for the given course. content_type_gating_enabled: (bool) Whether content type gating is enabled for this enrollment. verified_upgrade_link: (str) The URL to ecommerce IDA for purchasing the verified upgrade.

Returns

  • 200 on success with above fields.

  • 401 if the user is not authenticated.

  • 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'>)#
get(request, *args, **kwargs)#
permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
serializer_class#

alias of CourseDeadlinesMobileSerializer

exception openedx.features.course_experience.api.v1.views.UnableToResetDeadlines(detail=None, code=None)#

Bases: APIException

default_code = 'unable_to_reset_deadlines'#
default_detail = 'Unable to reset deadlines.'#
status_code = 400#
openedx.features.course_experience.api.v1.views.reset_all_course_deadlines(request, *args, **kwargs)#

Set the start_date of a schedule to today for all enrolled courses

Request Parameters:
research_event_data: any data that should be included in the research tracking event

Example: sending the location of where the reset deadlines banner (i.e. outline-tab)

Returns:

list of course keys for which deadlines were successfully reset failed_course_keys: list of course keys for which deadlines could not be reset

Return type:

success_course_keys

openedx.features.course_experience.api.v1.views.reset_course_deadlines(request, *args, **kwargs)#

Set the start_date of a schedule to today, which in turn will adjust due dates for sequentials belonging to a self paced course

Request Parameters:

course_key: course key research_event_data: any data that should be included in the research tracking event

Example: sending the location of where the reset deadlines banner (i.e. outline-tab)

IMPORTANT NOTE: If updates are happening to the logic here, ALSO UPDATE the reset_course_deadlines function in common/djangoapps/util/views.py as well.

Module contents#