Courses

Introduction

This document provides detailed information about the course-related endpoints in the Powerpath API. These endpoints allow you to retrieve available courses and get a user's progress within a specific course.

Base URL

All API requests should be made to:

https://api.alpha1edtech.com

List Available Courses

Retrieves an array of available courses for students to attempt.

Endpoint: GET /courses

Example Request:

GET /courses

Example Response:

[
  {
    "id": 128,
    "status": "active",
    "dateLastModified": "2024-06-03T02:22:35.515Z",
    "metadata": null,
    "title": "3rd Grade Language",
    "schoolYear": "2024",
    "courseCode": "3rd Grade Language",
    "grades": "3",
    "subjects": "Language",
    "subjectCodes": "Language",
    "defaultModuleId": 1663,
    "metadata": "{\"video\": 0,\n   \"article\": 2,\n   \"exercise\": 18,\n   \"quiz\": 25,\n   \"grade test\": 60\n }"
  },
  {
    "id": 127,
    "status": "active",
    "dateLastModified": "2024-06-03T02:22:31.493Z",
    "metadata": null,
    "title": "5th Grade Language",
    "schoolYear": "2024",
    "courseCode": "5th Grade Language",
    "grades": "5",
    "subjects": "Language",
    "subjectCodes": "Language",
    "defaultModuleId": 1662
  }
]

Notes:

  • This endpoint returns all available courses.

  • The metadata field contains information about the xp awarded of different types of content in the course (videos, articles, exercises, quizzes, and grade tests).

Get User's Course Progress

Retrieves a user's progress in a specific course, including all modules and their items in sequential order.

Endpoint: GET /users/{userId}/courses/{courseId}

Path Parameters:

  • userId (integer, required): The ID of the user

  • courseId (integer, required): The ID of the course

Example Request:

GET /users/123/courses/123

Example Response:

[
  {
    "id": 11272,
    "name": "Information and Ideas",
    "unlock_at": "2024-04-22T03:09:38.515Z",
    "state": "active",
    "startingItemId": 69954,
    "startingModuleId": null,
    "items": [
      {
        "id": 69954,
        "name": "Central Ideas and Details",
        "state": "active",
        "lti_url": "",
        "contentType": "quiz",
        "metadata": null,
        "isPlacementTest": false,
        "thirdPartyId": null,
        "xp": null,
        "progress": 40,
        "status": "Completed",
        "completedAt": "2024-08-26T12:52:57.371Z",
        "highestValue": 40
      },
      {
        "id": 69956,
        "name": "Command of Evidence: Textual",
        "state": "active",
        "lti_url": "",
        "contentType": "quiz",
        "metadata": null,
        "isPlacementTest": false,
        "thirdPartyId": null,
        "xp": null,
        "progress": 53,
        "status": "Completed",
        "completedAt": "2024-08-26T13:56:51.019Z",
        "highestValue": 53
      },
      {
        "id": 69957,
        "name": "Inferences",
        "state": "active",
        "lti_url": "",
        "contentType": "quiz",
        "metadata": null,
        "isPlacementTest": false,
        "thirdPartyId": null,
        "xp": null,
        "progress": 73,
        "status": "Completed",
        "completedAt": "2024-08-26T15:19:48.275Z",
        "highestValue": 73
      }
    ],
    "progress": 100
  },
  {
    "id": 11280,
    "name": "Information and Ideas - Redo",
    "unlock_at": "2024-04-22T03:09:38.515Z",
    "state": "active",
    "startingItemId": 69998,
    "startingModuleId": null,
    "items": [
      // ... more items
    ],
    "progress": 100
  }
]

Notes:

  • The response includes all modules in the course, each containing an array of items.

  • Each item includes details such as progress, completion status, and highest value achieved.

  • The next item for a user to attempt is an item with a progress less than 100.

  • Users must progress through modules and their items sequentially until the progress is at 100.

Best Practices

  1. Use the List Available Courses endpoint to present course options to users.

  2. When displaying course progress, use the Get User's Course Progress endpoint to show detailed information about modules and items.

  3. Pay attention to the unlock_at date for modules to ensure content is not made available before the specified time.

  4. Use the progress field at both the module and item level to track overall course completion.

  5. Consider using the contentType field to differentiate between different types of items (e.g., quizzes, videos, articles) when displaying course content.

  6. Regularly fetch updated course progress to keep the user's view of their progress current.

Remember to replace {userId} and {courseId} with actual values in your requests.

Last updated