lms.djangoapps.certificates.views package#

Submodules#

lms.djangoapps.certificates.views.support module#

Certificate end-points used by the student support UI.

See lms/djangoapps/support for more details.

lms.djangoapps.certificates.views.support.generate_certificate_for_user(request)#

Generate certificates for a user.

This is meant to be used by support staff through the UI in lms/djangoapps/support

Parameters:

request (HttpRequest) – The request object

Returns:

HttpResponse

Example Usage:

POST /certificates/generate
  • username: “bob”

  • course_key: “edX/DemoX/Demo_Course”

Response: 200 OK

lms.djangoapps.certificates.views.support.regenerate_certificate_for_user(request)#

Regenerate certificates for a user.

This is meant to be used by support staff through the UI in lms/djangoapps/support

Parameters:

request (HttpRequest) – The request object

Returns:

HttpResponse

Example Usage:

POST /certificates/regenerate
  • username: “bob”

  • course_key: “edX/DemoX/Demo_Course”

Response: 200 OK

lms.djangoapps.certificates.views.support.require_certificate_permission(permission)#

View decorator that requires permission to view and regenerate certificates.

lms.djangoapps.certificates.views.support.search_certificates(request)#

Search for certificates for a particular user OR along with the given course.

Supports search by either username or email address along with course id.

First filter the records for the given username/email and then filter against the given course id (if given). Show the ‘Regenerate’ button if a record found in ‘generatedcertificate’ model otherwise it will show the Generate button.

Parameters:

request (HttpRequest) – The request object.

Returns:

JsonResponse

Example Usage:

GET /certificates/search?user=bob@example.com GET /certificates/search?user=bob@example.com&course_id=xyz

Response: 200 OK Content-Type: application/json [

{

“username”: “bob”, “course_key”: “edX/DemoX/Demo_Course”, “type”: “verified”, “status”: “downloadable”, “download_url”: “http://www.example.com/cert.pdf”, “grade”: “0.98”, “created”: 2015-07-31T00:00:00Z, “modified”: 2015-07-31T00:00:00Z

}

]

lms.djangoapps.certificates.views.webview module#

Certificate HTML webview.

lms.djangoapps.certificates.views.webview.get_certificate_description(mode, certificate_type, platform_name, course_key)#

:return certificate_type_description on the basis of current mode

lms.djangoapps.certificates.views.webview.render_cert_by_uuid(request, certificate_uuid)#

This public view generates an HTML representation of the specified certificate

lms.djangoapps.certificates.views.webview.render_html_view(request, course_id, certificate=None)#

This public view generates an HTML representation of the specified user and course If a certificate is not available, we display a “Sorry!” screen instead It can be overridden by setting OVERRIDE_RENDER_CERTIFICATE_VIEW to an alternative implementation.

lms.djangoapps.certificates.views.webview.render_preview_certificate(request, course_id)#

This view renders the course certificate in preview mode

lms.djangoapps.certificates.views.webview.unsupported_url(request, user_id, course_id)#

This view returns the un-supported url page aimed to let the user aware that url is no longer supported

Module contents#

Aggregate all views exposed by the certificates app.