lock_chapter

Function lock_chapter 

Source
async fn lock_chapter(
    chapter_id: Path<Uuid>,
    pool: Data<PgPool>,
    user: AuthUser,
) -> ControllerResult<Json<UserChapterLockingStatus>>
Expand description

POST /api/v0/course-material/chapters/:chapter_id/lock - Complete chapter (mark as done)

Completes a chapter for the authenticated user (marks it as done).

Validates that:

  • Course has chapter_locking_enabled
  • Chapter is currently unlocked (student can work on it)
  • All previous chapters in the same module are completed (sequential completion)
  • Moves all exercises to manual review
  • Unlocks next chapters for the user