lms.djangoapps.mobile_api.course_info package#

Submodules#

lms.djangoapps.mobile_api.course_info.models module#

A models.py is required to make this an app (until we move to Django 1.7)

lms.djangoapps.mobile_api.course_info.urls module#

URLs for course_info API

lms.djangoapps.mobile_api.course_info.views module#

Views for course info API

class lms.djangoapps.mobile_api.course_info.views.CourseGoalsRecordUserActivity(**kwargs)#

Bases: APIView

API that allows the mobile_apps to record activity for course goals to the user activity table

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

Handle the POST request

Populate the user activity table.

class lms.djangoapps.mobile_api.course_info.views.CourseHandoutsList(**kwargs)#

Bases: ListAPIView

Use Case

Get the HTML for course handouts.

Example Request

GET /api/mobile/v0.5/course_info/{course_id}/handouts

Response Values

If the request is successful, the request returns an HTTP 200 “OK” response along with the following value.

  • handouts_html: The HTML for course handouts.

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'>)#
list(request, course, *args, **kwargs)#
permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
class lms.djangoapps.mobile_api.course_info.views.CourseUpdatesList(**kwargs)#

Bases: ListAPIView

Use Case

Get the content for course updates.

Example Request

GET /api/mobile/v0.5/course_info/{course_id}/updates

Response Values

If the request is successful, the request returns an HTTP 200 “OK” response along with an array of course updates. Each course update contains the following values.

  • content: The content, as an HTML string, of the course update.

  • date: The date of the course update.

  • id: The unique identifier of the update.

  • status: Whether the update is visible or not.

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'>)#
list(request, course, *args, **kwargs)#
permission_classes = (<class 'rest_framework.permissions.IsAuthenticated'>,)#
lms.djangoapps.mobile_api.course_info.views.apply_wrappers_to_content(content, block, request)#

Updates a piece of html content with the filter functions stored in its module system, then replaces any static urls with absolute urls.

Parameters:
  • content – The html content to which to apply the content wrappers generated for this module system.

  • block – The block containing a reference to the module system which contains functions to apply to the

  • include (content. These functions) –

    • Replacing static url’s

    • Replacing course url’s

    • Replacing jump to id url’s

  • request – The request, used to replace static URLs with absolute URLs.

Returns: A piece of html content containing the original content updated by each wrapper.

Module contents#

Course info API