Skip to main content

An Open edX plugin to add API for course outline (modules) for the Learn product page

Project description

A django app plugin to add a new API to Open edX that returns a course outline summary (one entry per chapter) for a given course.

Installation

For detailed installation instructions, please refer to the plugin installation guide.

Installation required in:

  • LMS

How To Use

The API supports a GET call to:

  • <LMS_BASE>/api/ol-course-outline/v0/<course_id>/

The endpoint is protected by the platform API auth and requires an admin user (DRF IsAdminUser).

The successful response for http://local.openedx.io:8000/api/ol-course-outline/v0/course-v1:edX+DemoX+Demo_Course/ would look like:

{
    "course_id": "course-v1:edX+DemoX+Demo_Course",
    "generated_at": "2026-03-17T12:34:56Z",
    "modules": [
        {
            "id": "block-v1:edX+DemoX+Demo_Course+type@chapter+block@1414ffd5143b4b5",
            "title": "Example Week 1: Getting Started",
            "effort_time": 121,
            "effort_activities": 1,
            "counts": {
                "videos": 5,
                "readings": 3,
                "problems": 2,
                "assignments": 1,
                "app_items": 0
            }
        }
    ]
}

Notes

  • generated_at is the timestamp when the outline was built (cached responses return the same value).

  • effort_time and effort_activities come from the platform Effort Estimation transformer via the Blocks API.

  • counts are computed by walking the Blocks API tree under each chapter (staff-only blocks are excluded): - videos: blocks with type video - readings: blocks with type html - problems: blocks with type problem - assignments: sequential blocks that are graded or have a non-empty format (except notgraded) - app_items: leaf blocks that are not video, html, or problem (and not container types)

Caching

This endpoint caches the full JSON response using Django’s configured cache backend.

  • TTL: configurable via OL_COURSE_OUTLINE_API_CACHE_TIMEOUT_SECONDS (default: 1 week).

  • Cache key: <prefix>s<schema_version>:<course_key>:<content_version>. - prefix is configurable via OL_COURSE_OUTLINE_API_CACHE_KEY_PREFIX (default: ol_course_outline_api:outline:v0:). - schema_version is a plugin constant (bump it when you change the response shape or computation logic). - content_version is course.course_version when present; otherwise the key uses na.

  • Invalidation: - Publishing a course that updates course.course_version produces a new cache key, effectively invalidating old entries.

Troubleshooting

  • Page not found (404): ensure the plugin is installed in the LMS and the URLs are registered.

  • Course ID in the URL: course keys contain +. Use URL-encoded form (%2B) when needed, e.g. /api/ol-course-outline/v0/course-v1:OpenedX%2BDemoX%2BDemoCourse/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ol_openedx_course_outline_api-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ol_openedx_course_outline_api-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file ol_openedx_course_outline_api-0.1.0.tar.gz.

File metadata

File hashes

Hashes for ol_openedx_course_outline_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15a7a22d7ca4f36f2a6619dfcbf96d70c3d6774e544ace08161145e037417006
MD5 d2669a3bb4bc0e6d1ba631a237aa1630
BLAKE2b-256 c377cf771aa91c9fff3a7a37d7c51a5f3f252a5398b3ce9a089253c9d9238b81

See more details on using hashes here.

File details

Details for the file ol_openedx_course_outline_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ol_openedx_course_outline_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a8305364c070fc297c81038e022a40ed23cae8e4410fcbf6159ee6200b74571
MD5 b79d35b12a18948e6eb3320fc891f4c1
BLAKE2b-256 225970213f0b6e04acbefb7e7c57e15c0a8a5bfb51df6469d49024630cc1d32a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page