> ## Documentation Index
> Fetch the complete documentation index at: https://memberpulseptyltd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# UJ-M-014: Complete Course and Earn Certificate

> Member completes all course requirements and receives certificate with CPD points

## Journey Overview

| Attribute      | Value                                                    |
| -------------- | -------------------------------------------------------- |
| **Journey ID** | UJ-M-014                                                 |
| **Actor**      | Enrolled member                                          |
| **Goal**       | Complete course and earn certificate/CPD points          |
| **Trigger**    | Member begins or continues course learning               |
| **Outcome**    | Course completed, certificate issued, CPD points awarded |

## Preconditions

* Member is enrolled in the course
* Course has completion requirements defined
* Member has not already completed the course

## Journey Flow

```mermaid theme={null}
flowchart TD
    A[Access course] --> B[View curriculum]
    B --> C[Start/Continue lesson]
    C --> D[Consume content]
    D --> E{Lesson complete?}
    E -->|No| D
    E -->|Yes| F[Mark lesson complete]
    F --> G{Quiz required?}
    G -->|Yes| H[Take quiz]
    G -->|No| I[Progress updated]
    H --> J{Pass quiz?}
    J -->|Yes| I
    J -->|No| K[Review and retry]
    K --> H
    I --> L{More lessons?}
    L -->|Yes| C
    L -->|No| M{All requirements met?}
    M -->|Yes| N[Course completed]
    M -->|No| O[Show remaining requirements]
    N --> P[Certificate generated]
    P --> Q[CPD points awarded]
    Q --> R[Notification sent]
```

## Detailed Steps

<Steps>
  <Step title="Access Course">
    Member opens course from:

    * My Courses dashboard
    * "Continue Learning" widget
    * Course catalog (if enrolled)
    * Email reminder link

    **Course Interface:**

    * Left sidebar: Curriculum navigation
    * Main area: Lesson content
    * Top bar: Progress indicator
    * Right sidebar: Notes, bookmarks
  </Step>

  <Step title="Navigate Curriculum">
    Course structure:

    ```
    Module 1: Introduction
    ├── 1.1 Welcome (Video) ✅
    ├── 1.2 Overview (Text) ✅
    └── 1.3 Quiz ✅

    Module 2: Core Concepts
    ├── 2.1 Fundamentals (Video) ⏳ In Progress
    ├── 2.2 Deep Dive (Text) 🔒
    ├── 2.3 Case Study (PDF) 🔒
    └── 2.4 Assessment 🔒

    Module 3: Advanced Topics
    └── ... 🔒

    Final Exam 🔒
    ```

    **Legend:**

    * ✅ Completed
    * ⏳ In Progress
    * 🔒 Locked (complete prerequisites)
    * ⚪ Available
  </Step>

  <Step title="Complete Lessons">
    Different content types:

    <Tabs>
      <Tab title="Video Lessons">
        * Video player with progress tracking
        * Auto-mark complete when watched
        * Configurable: Must watch X% to complete
        * Playback speed options
        * Closed captions (if available)
      </Tab>

      <Tab title="Text/Article">
        * Scrollable content
        * Mark complete button at end
        * Or auto-complete on scroll to bottom
        * Time spent tracked
      </Tab>

      <Tab title="Interactive">
        * Interactive exercises
        * Complete all interactions
        * Immediate feedback
        * Progress saved automatically
      </Tab>

      <Tab title="Downloadable">
        * PDF, documents, resources
        * Download required for completion
        * Or acknowledgment checkbox
      </Tab>
    </Tabs>
  </Step>

  <Step title="Take Quizzes/Assessments">
    Quiz experience:

    **Quiz Types:**

    * Module quizzes (per section)
    * Practice quizzes (optional)
    * Final exam (if required)

    **Question Types:**

    * Multiple choice
    * Multiple select
    * True/False
    * Short answer
    * Matching

    **Quiz Settings:**

    * Time limit (or untimed)
    * Passing score (e.g., 70%)
    * Retry attempts (limited or unlimited)
    * Show correct answers (configurable)
  </Step>

  <Step title="Track Progress">
    Progress tracking:

    ```
    ┌─────────────────────────────────────────┐
    │ Course Progress                         │
    │                                         │
    │ [████████████░░░░░░░░] 65% Complete    │
    │                                         │
    │ ✅ 8 of 12 lessons completed            │
    │ ✅ 2 of 3 quizzes passed                │
    │ ⏳ 1 quiz remaining                     │
    │ ⏳ Final exam required                  │
    │                                         │
    │ Estimated time remaining: 2 hours       │
    └─────────────────────────────────────────┘
    ```
  </Step>

  <Step title="Meet Completion Requirements">
    Requirements vary by course:

    | Requirement       | Example                 |
    | ----------------- | ----------------------- |
    | Lessons completed | 100% of lessons         |
    | Quizzes passed    | Pass all module quizzes |
    | Final exam        | Score 70% or higher     |
    | Minimum time      | Spend at least 4 hours  |
    | Assignments       | Submit all assignments  |
  </Step>

  <Step title="Course Completed">
    When all requirements met:

    **Immediate:**

    * Completion status updated
    * Completion date recorded
    * Progress set to 100%
    * Celebration animation 🎉

    **Certificate Generated:**

    * PDF certificate created
    * Member name
    * Course name
    * Completion date
    * CPD points (if applicable)
    * Unique certificate ID
    * QR code for verification
  </Step>

  <Step title="CPD Points Awarded">
    If course has CPD points:

    1. CPD record created automatically
    2. Points added to member's total
    3. Category assigned (course's CPD category)
    4. Linked to certificate

    **Notification:**

    * Email: Course completed + certificate attached
    * In-app: CPD points awarded notification
  </Step>
</Steps>

## Certificate

### Certificate Contents

```
┌─────────────────────────────────────────────────────────────┐
│                                                             │
│                 CERTIFICATE OF COMPLETION                   │
│                                                             │
│                    [Organization Logo]                      │
│                                                             │
│         This is to certify that                             │
│                                                             │
│                    JOHN SMITH                               │
│                                                             │
│         has successfully completed the course               │
│                                                             │
│            "ADVANCED LEADERSHIP SKILLS"                     │
│                                                             │
│         Duration: 8 hours | CPD Points: 8                   │
│         Completed on: March 15, 2025                        │
│                                                             │
│         Certificate ID: CERT-2025-12345                     │
│                                                             │
│    [QR Code]        _____________________                   │
│                     Course Director                         │
│                                                             │
└─────────────────────────────────────────────────────────────┘
```

### Certificate Access

* Download from course completion page
* Available in My Certificates section
* Accessible from CPD records
* Shareable link (public verification)

## Retaking Courses

If course allows retakes:

* Reset progress option
* Previous completion preserved in records
* New certificate issued on re-completion
* CPD points: Configurable (once or each time)

## Related Entities

* [`Course`](/entities/core/course)
* [`Course Enrollment`](/entities/core/course-enrollment)
* [`CPD Record`](/entities/core/cpd-record)

## Related Journeys

* [UJ-M-013](/member/journeys/enroll-course)
* [UJ-M-015](/member/journeys/track-cpd)
* [UJ-M-017](/member/journeys/export-cpd)

## Acceptance Criteria

### Frontend

* [ ] Course player with lesson navigation
* [ ] Progress bar and completion percentage
* [ ] Video player with progress tracking
* [ ] Quiz interface with all question types
* [ ] Progress auto-save
* [ ] Completion celebration UI
* [ ] Certificate download button
* [ ] Share certificate functionality

### Backend

* [ ] `GET /api/courses/{id}/progress` - Get progress
* [ ] `POST /api/courses/{id}/lessons/{id}/complete` - Mark complete
* [ ] `POST /api/courses/{id}/quizzes/{id}/submit` - Submit quiz
* [ ] `GET /api/courses/{id}/certificate` - Generate certificate
* [ ] CPD auto-award on completion

### Permissions

* [ ] Only enrolled members can access course content
* [ ] Certificate only available after completion

### Business Rules

* [ ] All requirements must be met for completion
* [ ] Quiz passing score enforced
* [ ] Completion date = when final requirement met
* [ ] CPD points awarded once per completion

### Error Handling

* [ ] Progress save failures handled gracefully
* [ ] Quiz timeout handling
* [ ] Certificate generation error recovery
