The progress tracking system records which lectures a student has completed within a course and computes an overallDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Pragyat-Nikunj/Learning-Management-System-backend/llms.txt
Use this file to discover all available pages before exploring further.
completionPercentage automatically. Each CourseProgress document is keyed by both a user and a course ObjectId, so every student has their own independent progress record per course. The completionPercentage and isCompleted fields are recalculated on every save via a pre-save hook — you never need to compute them yourself.
All progress endpoints are prefixed with
/api/v1/progress. All four endpoints require authentication via the HTTP-only token cookie.GET /api/v1/progress/:courseId
Retrieve the authenticated user’s progress record for a specific course. The response includes the populated course metadata and user info, as well as the per-lecture completion breakdown. Auth required: YesPath parameters
MongoDB ObjectId of the course whose progress you want to retrieve.
Response — 200
"success"Errors
| Status | Condition |
|---|---|
400 | courseId is missing |
401 | Missing or invalid auth cookie |
404 | Course not found |
404 | No progress record found for this user and course |
PATCH /api/v1/progress/:courseId/lectures/:lectureId
Mark a single lecture as completed or uncompleted. If no progress record exists for the user/course pair yet, the server creates one initialised with all lectures set toisCompleted: false and returns it immediately without applying the isCompleted update from the request body. On subsequent calls the specific lecture’s status is updated and completionPercentage is recalculated.
Auth required: Yes
Path parameters
MongoDB ObjectId of the parent course.
MongoDB ObjectId of the lecture to update.
Request body
Pass
true to mark the lecture completed, false to mark it incomplete.Response — 200
"success"Errors
| Status | Condition |
|---|---|
400 | courseId or lectureId is missing |
400 | The specified lecture does not belong to this course |
401 | Missing or invalid auth cookie |
POST /api/v1/progress/:courseId/complete
Mark every lecture in the course as completed in one operation, settingisCompleted: true on all lecture progress entries and the top-level isCompleted flag to true. The completionPercentage is saved as 100 after the pre-save hook runs.
Auth required: Yes
Path parameters
MongoDB ObjectId of the course to mark as fully completed.
Request body
No request body is required.Response — 200
"success""Course marked as completed"Errors
| Status | Condition |
|---|---|
400 | courseId is missing |
401 | Missing or invalid auth cookie |
404 | No progress record found for this user and course |
POST /api/v1/progress/:courseId/reset
Reset all lecture progress for a course to its initial state. Every lecture entry’sisCompleted is set to false, lastWatched is cleared to null, and the top-level isCompleted is set to false. The completionPercentage is recomputed to 0 by the pre-save hook.
Auth required: Yes
Path parameters
MongoDB ObjectId of the course whose progress should be reset.
Request body
No request body is required.Response — 200
"success""Course progress has been reset"Errors
| Status | Condition |
|---|---|
400 | courseId is missing |
401 | Missing or invalid auth cookie |
404 | No progress record found for this user and course |