Skip to content

Instantly share code, notes, and snippets.

@fadhilinsemwa
Last active January 16, 2026 20:29
Show Gist options
  • Select an option

  • Save fadhilinsemwa/a25b736a781c6ee509d359af13405302 to your computer and use it in GitHub Desktop.

Select an option

Save fadhilinsemwa/a25b736a781c6ee509d359af13405302 to your computer and use it in GitHub Desktop.

Revisions

  1. fadhilinsemwa revised this gist Jan 16, 2026. 1 changed file with 22 additions and 30 deletions.
    52 changes: 22 additions & 30 deletions results-publication-workflow.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ TIMS manages the end-to-end academic results lifecycle from mark entry in the LM

    ### Core Principles

    - **Separation of Duties**: Teacher who enters marks cannot authorize or publish
    - **Separation of Duties**: Clear role-based authorization and publication workflow
    - **Unanimous Approval**: All committee members must approve before publication
    - **Audit Trail**: Every action is logged with timestamps and actor identity
    - **Results Invisibility**: Results remain hidden until final publication
    @@ -98,19 +98,15 @@ Edit Notes (Required) (Unanimous Consent)
    ↓ ↓
    System Routes to Examination Officer
    System Admin Publishes
    (Teacher ≠ Exam Officer)
    Admin Applies Fixes
    (Using Committee Notes) System Validates
    Admin Applies Fixes Examination Officer
    (Using Committee Notes) Publishes Results
    ↓ ↓
    Results Re-Evaluated ┌──────────────────────────────┐
    (No Re-Auth Required) │ Examination Officer Publishes │
    ↓ │ (Teacher ≠ Publisher)
    ↓ │ (Even if also Teacher)
    (Re-enters Committee State) └──────────────────────────────┘
    System Validates Eligibility
    ❌ Block if Exam Officer = Teacher
    ✅ Publish Results
    Results Visible to Students
    @@ -142,8 +138,8 @@ Ready for Examination Committee

    | Role | Allowed Self-Action | Condition |
    |------|---------------------|-----------|
    | HoD | May self-confirm | Must NOT be the teacher |
    | Examination Officer | May self-authorize | Must NOT be the teacher |
    | HoD | May self-confirm | ✅ Allowed |
    | Examination Officer | May self-authorize | ✅ Allowed (even if teacher) |

    ---

    @@ -213,23 +209,23 @@ Routed to System Admin

    ### Critical Rule

    > **The Examination Officer is the ONLY role authorized to publish results. The teacher who entered the module marks CANNOT be the Examination Officer publishing those results.**
    > **The Examination Officer is the ONLY role authorized to publish results. The Examination Officer CAN publish even if they also entered the marks as a teacher.**
    ### Publisher

    | Role | Can Publish? | Condition |
    |------|--------------|-----------|
    | Examination Officer | ✅ Yes | Must NOT be the teacher |
    | Examination Officer | ✅ Yes | Can publish (even if also teacher) |
    | HoD | ❌ No | Authorization/Confirmation only |
    | Academic Officer | ❌ No | Not a publisher |
    | Teacher |Never | Cannot publish own marks |
    | Teacher (non-Exam Officer) |No | Must go through Exam Officer |

    ### Validation

    ```
    Examination Officer initiates publication
    System validates: Exam Officer ≠ Teacher?
    System validates: Is Exam Officer role?
    ↙ ↘
    NO YES
    @@ -249,7 +245,7 @@ System validates: Exam Officer ≠ Teacher?
    | 1 | Examination Officer | Authorizes results ||
    | 2 | HoD | Confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks Exam Officer ≠ Teacher | Must pass |
    | 4 | System | Validates Exam Officer role | |
    | 5 | Examination Officer | Publishes results | ✅ Results visible |

    ---
    @@ -315,7 +311,7 @@ Direct Re-Publication
    | Editor | System Admin only |
    | Committee Re-Approval | ❌ Not required |
    | Authorization/Confirmation | ❌ Not required |
    | Publisher Eligibility |Still enforced (Publisher ≠ Teacher) |
    | Publisher Eligibility |Exam Officer role required |
    | Audit Trail | ✅ Fully preserved |

    ---
    @@ -330,7 +326,7 @@ Before allowing publication, the system **MUST** verify:
    | No Pending Edits | No edits are pending or needed ||
    | Authorization Complete | Examination Officer authorized (or self-authorized) ||
    | Confirmation Complete | HoD confirmed (or self-confirmed) ||
    | Publisher Eligibility | Publisher is NOT the teacher who entered marks ||
    | Publisher Eligibility | Publisher has Examination Officer role ||
    | Timestamp Validity | All approval timestamps are valid and sequential ||

    > **If ANY check fails → Publication BLOCKED**
    @@ -341,11 +337,11 @@ Before allowing publication, the system **MUST** verify:

    | Rule | Description |
    |------|-------------|
    | **Teacher-Publisher Restriction** | Teacher who entered marks CANNOT authorize, confirm, or publish those results |
    | **Publisher Role** | Only Examination Officer can publish (even if also teacher) |
    | **Committee First** | Examination Committee must approve BEFORE any publication path |
    | **Unanimous Approval** | ALL committee members must approve before publication |
    | **No Edits to Publish** | Can only proceed to publication if zero edits needed |
    | **Self-Authorization** | Exam Officer can self-authorize (if not the teacher) |
    | **Self-Authorization** | Exam Officer can self-authorize |
    | **Post-Publication Edits** | Admin only, direct re-publication (no committee re-approval) |
    | **Pre-Publication Edits** | Teacher only, requires complete restart of approval chain |
    | **Parent Notification** | Automatic upon successful publication |
    @@ -375,10 +371,7 @@ graph TD
    AdminFix --> Committee
    Committee -->|All Members Approve| Unanimous[Unanimous Approval Locked]
    Unanimous --> Validate{Exam Officer ≠ Teacher?}
    Validate -->|No| Block[❌ BLOCKED]
    Validate -->|Yes| Publish[✅ Exam Officer Publishes]
    Unanimous --> Publish[✅ Exam Officer Publishes]
    Publish --> Visible[Results Visible to Students]
    Visible --> Notify[Automatic Parent Notification]
    @@ -410,10 +403,9 @@ graph TD
    4. HoD confirms
    5. Examination Committee reviews
    6. **All** committee members approve
    7. System validates Exam Officer ≠ Teacher
    8. Examination Officer publishes
    9. Students see results
    10. Parents are notified
    7. Examination Officer publishes
    8. Students see results
    9. Parents are notified

    ---

    @@ -425,7 +417,7 @@ graph TD
    | Single publisher role | Only Examination Officer can publish |
    | Committee-driven edit notes | Precise admin fixes, no guesswork |
    | Post-publication edits fast | Non-blocking, no re-approval chain |
    | Teacher influence excluded | System-enforced beyond submission |
    | Role-based publishing | Only Exam Officer can publish |
    | Results invisible | Locked until final publish action |

    ---
    @@ -454,7 +446,7 @@ DRAFT → SUBMITTED → AUTHORIZED → CONFIRMED → COMMITTEE_REVIEW

    | Field | Value |
    |-------|-------|
    | Version | 1.1 |
    | Version | 1.2 |
    | Last Updated | January 2026 |
    | Status | Final |
    | Author | TIMS Development Team |
  2. fadhilinsemwa revised this gist Jan 16, 2026. 1 changed file with 36 additions and 66 deletions.
    102 changes: 36 additions & 66 deletions results-publication-workflow.md
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,8 @@ This document defines the complete workflow for academic results publication in
    3. [Complete Publication Workflow](#complete-publication-workflow)
    4. [Pre-Committee Authorization](#pre-committee-authorization)
    5. [Examination Committee Review](#examination-committee-review)
    6. [Publisher Selection & Eligibility](#publisher-selection--eligibility)
    7. [Publication Paths](#publication-paths)
    6. [Publisher Role](#publisher-role)
    7. [Publication Flow](#publication-flow)
    8. [Edit Permissions](#edit-permissions)
    9. [Post-Publication Edits](#post-publication-edits)
    10. [System Validation Checks](#system-validation-checks)
    @@ -96,20 +96,20 @@ Do ALL Committee Members Approve?
    Committee Records Committee Approval Locked
    Edit Notes (Required) (Unanimous Consent)
    ↓ ↓
    System Routes to Publisher Selection Enabled
    System Admin (Committee-Only View)
    Admin Applies Fixes Select Eligible Publisher
    (Using Committee Notes) (Teacher ≠ Publisher)
    System Routes to Examination Officer
    System Admin Publishes
    (Teacher ≠ Exam Officer)
    Admin Applies Fixes
    (Using Committee Notes) System Validates
    ↓ ↓
    Results Re-Evaluated ┌──────────────────────────────┐
    (No Re-Auth Required) │ HoD / Exam Officer / Academic
    ↓ │ Officer (One Selected)
    (No Re-Auth Required) │ Examination Officer Publishes
    ↓ │ (Teacher ≠ Publisher)
    (Re-enters Committee State) └──────────────────────────────┘
    System Validates Eligibility
    ❌ Block if Publisher = Teacher
    ❌ Block if Exam Officer = Teacher
    ✅ Publish Results
    @@ -160,18 +160,18 @@ Check: All Members Approved?
    ↙ ↘
    NO YES
    ↓ ↓
    Publisher UI Publisher Selection UI
    Hidden Visible (Committee Only)
    Publish UI Publish Button Enabled
    Hidden (Exam Officer Only)
    ```

    ### Committee Approval Rules

    | Rule | Description |
    |------|-------------|
    | **Unanimous Consent** | ALL committee members must approve |
    | **UI Visibility** | Publisher selection appears ONLY after unanimous approval |
    | **Selection Authority** | ANY committee member may select the publisher |
    | **Audit** | Selection action is logged (who selected, when) |
    | **UI Visibility** | Publish button appears ONLY after unanimous approval |
    | **Publisher** | Examination Officer is the ONLY authorized publisher |
    | **Audit** | Publication action is logged (who published, when) |

    ### Committee Edit Handling (Smooth Handoff)

    @@ -209,69 +209,49 @@ Routed to System Admin

    ---

    ## Publisher Selection & Eligibility
    ## Publisher Role

    ### Critical Rule

    > **The teacher who entered the module marks CANNOT be the same person authorizing or publishing those results.**
    > **The Examination Officer is the ONLY role authorized to publish results. The teacher who entered the module marks CANNOT be the Examination Officer publishing those results.**
    ### Eligible Publishers
    ### Publisher

    | Role | Can Publish? | Condition |
    |------|--------------|-----------|
    | HoD | ✅ Yes | Must NOT be the teacher |
    | Examination Officer | ✅ Yes | Must NOT be the teacher |
    | Academic Officer | ✅ Yes | Must NOT be the teacher |
    | HoD | ❌ No | Authorization/Confirmation only |
    | Academic Officer | ❌ No | Not a publisher |
    | Teacher | ❌ Never | Cannot publish own marks |

    ### Selection Enforcement
    ### Validation

    ```
    Committee selects eligible publisher
    Examination Officer initiates publication
    System validates: Publisher ≠ Teacher?
    System validates: Exam Officer ≠ Teacher?
    ↙ ↘
    NO YES
    ↓ ↓
    ❌ BLOCKED ✅ Proceed to
    Publication Publication
    ❌ BLOCKED ✅ Publish
    Results
    ```

    ---

    ## Publication Paths
    ## Publication Flow

    ### Path 1: HoD Publishes
    ### Single Publication Path: Examination Officer

    | Step | Actor | Action | Validation |
    |------|-------|--------|------------|
    | 1 | Examination Officer | Authorizes results ||
    | 2 | HoD | Self-confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks HoD ≠ Teacher | Must pass |
    | 5 | HoD | Publishes results | ✅ Results visible |

    ### Path 2: Examination Officer Publishes

    | Step | Actor | Action | Validation |
    |------|-------|--------|------------|
    | 1 | Examination Officer | Self-authorizes ||
    | 2 | HoD | Confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks Exam Officer ≠ Teacher | Must pass |
    | 5 | Examination Officer | Publishes results | ✅ Results visible |

    ### Path 3: Academic Officer Publishes

    | Step | Actor | Action | Validation |
    |------|-------|--------|------------|
    | 1 | Examination Officer | Authorizes ||
    | 2 | HoD | Confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks Academic Officer ≠ Teacher | Must pass |
    | 5 | Academic Officer | Publishes results | ✅ Results visible |

    ---

    ## Edit Permissions
    @@ -365,7 +345,7 @@ Before allowing publication, the system **MUST** verify:
    | **Committee First** | Examination Committee must approve BEFORE any publication path |
    | **Unanimous Approval** | ALL committee members must approve before publication |
    | **No Edits to Publish** | Can only proceed to publication if zero edits needed |
    | **Self-Authorization** | HoD can self-confirm (Path 1), Exam Officer can self-authorize (Path 2) |
    | **Self-Authorization** | Exam Officer can self-authorize (if not the teacher) |
    | **Post-Publication Edits** | Admin only, direct re-publication (no committee re-approval) |
    | **Pre-Publication Edits** | Teacher only, requires complete restart of approval chain |
    | **Parent Notification** | Automatic upon successful publication |
    @@ -395,19 +375,10 @@ graph TD
    AdminFix --> Committee
    Committee -->|All Members Approve| Unanimous[Unanimous Approval Locked]
    Unanimous --> PubSelect[Publisher Selection Enabled]
    PubSelect --> SelectPub{Select Eligible Publisher}
    SelectPub --> Path1[HoD]
    SelectPub --> Path2[Exam Officer]
    SelectPub --> Path3[Academic Officer]
    Path1 --> Validate{Publisher ≠ Teacher?}
    Path2 --> Validate
    Path3 --> Validate
    Unanimous --> Validate{Exam Officer ≠ Teacher?}
    Validate -->|No| Block[❌ BLOCKED]
    Validate -->|Yes| Publish[✅ Publish Results]
    Validate -->|Yes| Publish[✅ Exam Officer Publishes]
    Publish --> Visible[Results Visible to Students]
    Visible --> Notify[Automatic Parent Notification]
    @@ -439,11 +410,10 @@ graph TD
    4. HoD confirms
    5. Examination Committee reviews
    6. **All** committee members approve
    7. Committee selects publisher
    8. System validates publisher ≠ teacher
    9. Publication occurs
    10. Students see results
    11. Parents are notified
    7. System validates Exam Officer ≠ Teacher
    8. Examination Officer publishes
    9. Students see results
    10. Parents are notified

    ---

    @@ -452,7 +422,7 @@ graph TD
    | Guarantee | Enforcement |
    |-----------|-------------|
    | Committee unanimity required | System blocks publication until all approve |
    | Publisher selection hidden | UI invisible until full approval |
    | Single publisher role | Only Examination Officer can publish |
    | Committee-driven edit notes | Precise admin fixes, no guesswork |
    | Post-publication edits fast | Non-blocking, no re-approval chain |
    | Teacher influence excluded | System-enforced beyond submission |
    @@ -484,7 +454,7 @@ DRAFT → SUBMITTED → AUTHORIZED → CONFIRMED → COMMITTEE_REVIEW

    | Field | Value |
    |-------|-------|
    | Version | 1.0 |
    | Version | 1.1 |
    | Last Updated | January 2026 |
    | Status | Final |
    | Author | TIMS Development Team |
  3. fadhilinsemwa revised this gist Jan 16, 2026. 1 changed file with 11 additions and 27 deletions.
    38 changes: 11 additions & 27 deletions results-publication-workflow.md
    Original file line number Diff line number Diff line change
    @@ -9,17 +9,16 @@ This document defines the complete workflow for academic results publication in
    ## Table of Contents

    1. [System Overview](#system-overview)
    2. [Authentication](#authentication)
    3. [LMS-TIMS Integration](#lms-tims-integration)
    4. [Complete Publication Workflow](#complete-publication-workflow)
    5. [Pre-Committee Authorization](#pre-committee-authorization)
    6. [Examination Committee Review](#examination-committee-review)
    7. [Publisher Selection & Eligibility](#publisher-selection--eligibility)
    8. [Publication Paths](#publication-paths)
    9. [Edit Permissions](#edit-permissions)
    10. [Post-Publication Edits](#post-publication-edits)
    11. [System Validation Checks](#system-validation-checks)
    12. [Key Rules Summary](#key-rules-summary)
    2. [LMS-TIMS Integration](#lms-tims-integration)
    3. [Complete Publication Workflow](#complete-publication-workflow)
    4. [Pre-Committee Authorization](#pre-committee-authorization)
    5. [Examination Committee Review](#examination-committee-review)
    6. [Publisher Selection & Eligibility](#publisher-selection--eligibility)
    7. [Publication Paths](#publication-paths)
    8. [Edit Permissions](#edit-permissions)
    9. [Post-Publication Edits](#post-publication-edits)
    10. [System Validation Checks](#system-validation-checks)
    11. [Key Rules Summary](#key-rules-summary)

    ---

    @@ -36,18 +35,6 @@ TIMS manages the end-to-end academic results lifecycle from mark entry in the LM

    ---

    ## Authentication

    ### OTP (One-Time Password) Requirements

    | Setting | Value |
    |---------|-------|
    | Authentication | OTP required for every login |
    | Token Lifetime | 24 hours |
    | Re-authentication | Required after token expiry |

    ---

    ## LMS-TIMS Integration

    ### Module Types (Marked in LMS)
    @@ -84,8 +71,6 @@ TIMS Tracks Performance Progress
    ```
    Teacher Enters Module Marks (LMS)
    OTP Authenticated Login (24h Token)
    Teacher Clicks "Send to TIMS"
    LMS Pushes CA / Practical / Exam Marks
    @@ -394,8 +379,7 @@ For systems supporting Mermaid rendering:

    ```mermaid
    graph TD
    Start[Teacher Enters Module Marks in LMS] --> OTP[OTP Authenticated Login]
    OTP --> Send[Teacher Clicks 'Send to TIMS']
    Start[Teacher Enters Module Marks in LMS] --> Send[Teacher Clicks 'Send to TIMS']
    Send --> Push[LMS Pushes CA/Practical/Exam Marks]
    Push --> Receive[TIMS Receives Marks]
    Receive --> Calc[TIMS Calculates Grades & GPA]
  4. fadhilinsemwa created this gist Jan 16, 2026.
    510 changes: 510 additions & 0 deletions results-publication-workflow.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,510 @@
    # TIMS Results Publication System

    > **Tandabui Information Management System – Results Publication Workflow**
    This document defines the complete workflow for academic results publication in TIMS, including LMS integration, approval chains, committee oversight, and publication authority rules.

    ---

    ## Table of Contents

    1. [System Overview](#system-overview)
    2. [Authentication](#authentication)
    3. [LMS-TIMS Integration](#lms-tims-integration)
    4. [Complete Publication Workflow](#complete-publication-workflow)
    5. [Pre-Committee Authorization](#pre-committee-authorization)
    6. [Examination Committee Review](#examination-committee-review)
    7. [Publisher Selection & Eligibility](#publisher-selection--eligibility)
    8. [Publication Paths](#publication-paths)
    9. [Edit Permissions](#edit-permissions)
    10. [Post-Publication Edits](#post-publication-edits)
    11. [System Validation Checks](#system-validation-checks)
    12. [Key Rules Summary](#key-rules-summary)

    ---

    ## System Overview

    TIMS manages the end-to-end academic results lifecycle from mark entry in the LMS through final publication to students and parent notification. The system enforces strict separation of duties, unanimous committee approval, and complete audit trails.

    ### Core Principles

    - **Separation of Duties**: Teacher who enters marks cannot authorize or publish
    - **Unanimous Approval**: All committee members must approve before publication
    - **Audit Trail**: Every action is logged with timestamps and actor identity
    - **Results Invisibility**: Results remain hidden until final publication

    ---

    ## Authentication

    ### OTP (One-Time Password) Requirements

    | Setting | Value |
    |---------|-------|
    | Authentication | OTP required for every login |
    | Token Lifetime | 24 hours |
    | Re-authentication | Required after token expiry |

    ---

    ## LMS-TIMS Integration

    ### Module Types (Marked in LMS)

    | Module Type | Description |
    |-------------|-------------|
    | **Continuous Assessment (CA)** | Ongoing coursework, assignments, quizzes |
    | **Practical** | Lab work, field exercises, demonstrations |
    | **End of Semester** | Semester-end assessments |
    | **Exam/Final** | Final examination marks |

    ### Integration Workflow

    ```
    Teacher Enters Marks (LMS)
    Teacher Clicks "Send to TIMS"
    LMS Pushes Module Marks to TIMS
    TIMS Receives & Validates Marks
    TIMS Calculates Grades & GPA
    TIMS Tracks Performance Progress
    ```

    ---

    ## Complete Publication Workflow

    ### Master Flow Diagram

    ```
    Teacher Enters Module Marks (LMS)
    OTP Authenticated Login (24h Token)
    Teacher Clicks "Send to TIMS"
    LMS Pushes CA / Practical / Exam Marks
    TIMS Receives Marks
    TIMS Calculates Grades & GPA
    ┌─────────────────────────────────────┐
    │ Pre-Committee Processing │
    ├─────────────────────────────────────┤
    │ Examination Officer Authorization │
    │ ↓ │
    │ HoD Confirmation │
    └─────────────────────────────────────┘
    Examination Committee Review (FINAL AUTHORITY)
    Do ALL Committee Members Approve?
    ↙ ↘
    NO YES
    ↓ ↓
    Committee Records Committee Approval Locked
    Edit Notes (Required) (Unanimous Consent)
    ↓ ↓
    System Routes to Publisher Selection Enabled
    System Admin (Committee-Only View)
    ↓ ↓
    Admin Applies Fixes Select Eligible Publisher
    (Using Committee Notes) (Teacher ≠ Publisher)
    ↓ ↓
    Results Re-Evaluated ┌──────────────────────────────┐
    (No Re-Auth Required) │ HoD / Exam Officer / Academic │
    ↓ │ Officer (One Selected) │
    (Re-enters Committee State) └──────────────────────────────┘
    System Validates Eligibility
    ❌ Block if Publisher = Teacher
    ✅ Publish Results
    Results Visible to Students
    Automatic Parent Notification
    Process Complete
    ```

    ---

    ## Pre-Committee Authorization

    Authorization and confirmation occur **BEFORE** the Examination Committee review.

    ### Authorization Flow

    ```
    Pre-Committee Checks
    Examination Officer Authorization
    HoD Confirmation
    Ready for Examination Committee
    ```

    ### Self-Action Rules

    | Role | Allowed Self-Action | Condition |
    |------|---------------------|-----------|
    | HoD | May self-confirm | Must NOT be the teacher |
    | Examination Officer | May self-authorize | Must NOT be the teacher |

    ---

    ## Examination Committee Review

    The Examination Committee serves as the **FINAL AUTHORITY** before publication.

    ### Unanimous Approval Requirement

    ```
    Committee Approval State
    Check: All Members Approved?
    ↙ ↘
    NO YES
    ↓ ↓
    Publisher UI Publisher Selection UI
    Hidden Visible (Committee Only)
    ```

    ### Committee Approval Rules

    | Rule | Description |
    |------|-------------|
    | **Unanimous Consent** | ALL committee members must approve |
    | **UI Visibility** | Publisher selection appears ONLY after unanimous approval |
    | **Selection Authority** | ANY committee member may select the publisher |
    | **Audit** | Selection action is logged (who selected, when) |

    ### Committee Edit Handling (Smooth Handoff)

    When edits are required, the committee provides structured feedback:

    ```
    Committee Review Screen
    Edit Needed Identified
    Committee Member Adds:
    • Affected Course / Module
    • Issue Category (Marks / GPA / Mapping / Other)
    • Free-text Notes
    All Notes Aggregated
    Locked Committee Decision
    Routed to System Admin
    ```

    ### Edit Note Requirements

    | Field | Description | Required |
    |-------|-------------|----------|
    | Affected Course/Module | Specific course or module needing edit | ✅ Yes |
    | Issue Category | Type: Marks / GPA / Mapping / Other | ✅ Yes |
    | Notes | Free-text explanation of required changes | ✅ Yes |

    **Key Behaviors:**
    - Multiple committee members may add notes
    - Notes are **immutable** once routed
    - Admin sees exact edit targets, not generic rework requests

    ---

    ## Publisher Selection & Eligibility

    ### Critical Rule

    > **The teacher who entered the module marks CANNOT be the same person authorizing or publishing those results.**
    ### Eligible Publishers

    | Role | Can Publish? | Condition |
    |------|--------------|-----------|
    | HoD | ✅ Yes | Must NOT be the teacher |
    | Examination Officer | ✅ Yes | Must NOT be the teacher |
    | Academic Officer | ✅ Yes | Must NOT be the teacher |
    | Teacher | ❌ Never | Cannot publish own marks |

    ### Selection Enforcement

    ```
    Committee selects eligible publisher
    System validates: Publisher ≠ Teacher?
    ↙ ↘
    NO YES
    ↓ ↓
    ❌ BLOCKED ✅ Proceed to
    Publication Publication
    ```

    ---

    ## Publication Paths

    ### Path 1: HoD Publishes

    | Step | Actor | Action | Validation |
    |------|-------|--------|------------|
    | 1 | Examination Officer | Authorizes results ||
    | 2 | HoD | Self-confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks HoD ≠ Teacher | Must pass |
    | 5 | HoD | Publishes results | ✅ Results visible |

    ### Path 2: Examination Officer Publishes

    | Step | Actor | Action | Validation |
    |------|-------|--------|------------|
    | 1 | Examination Officer | Self-authorizes ||
    | 2 | HoD | Confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks Exam Officer ≠ Teacher | Must pass |
    | 5 | Examination Officer | Publishes results | ✅ Results visible |

    ### Path 3: Academic Officer Publishes

    | Step | Actor | Action | Validation |
    |------|-------|--------|------------|
    | 1 | Examination Officer | Authorizes ||
    | 2 | HoD | Confirms ||
    | 3 | Examination Committee | Reviews & approves (all members) | No edits needed |
    | 4 | System | Checks Academic Officer ≠ Teacher | Must pass |
    | 5 | Academic Officer | Publishes results | ✅ Results visible |

    ---

    ## Edit Permissions

    ### Before Publishing (Pre-Publication Edits)

    | Who Can Edit | Process |
    |--------------|---------|
    | **Teacher ONLY** | Teacher edits marks in LMS |

    #### Pre-Publication Edit Flow

    ```
    Teacher Edits Marks (LMS)
    Re-sends to TIMS
    TIMS Recalculates Grades/GPA
    Full Approval Chain Restarts:
    • Examination Officer Authorization
    • HoD Confirmation
    • Examination Committee Approval
    • Final Publication
    ```

    ### After Publishing (Post-Publication Edits)

    | Who Can Edit | Process |
    |--------------|---------|
    | **System Admin ONLY** | Admin applies correction directly |

    ---

    ## Post-Publication Edits

    Post-publication edits follow a **streamlined flow** without requiring re-authorization or committee re-approval.

    ### Post-Publication Edit Flow

    ```
    Results Published
    Edit Required?
    ↙ ↘
    YES NO
    ↓ ↓
    System Admin End
    Only
    Admin Applies Correction
    Direct Re-Publication
    (by Eligible Publisher)
    ```

    ### Post-Publication Edit Rules

    | Aspect | Requirement |
    |--------|-------------|
    | Editor | System Admin only |
    | Committee Re-Approval | ❌ Not required |
    | Authorization/Confirmation | ❌ Not required |
    | Publisher Eligibility | ✅ Still enforced (Publisher ≠ Teacher) |
    | Audit Trail | ✅ Fully preserved |

    ---

    ## System Validation Checks

    Before allowing publication, the system **MUST** verify:

    | Check | Description | Required |
    |-------|-------------|----------|
    | Committee Approval | Examination Committee has approved (unanimously) ||
    | No Pending Edits | No edits are pending or needed ||
    | Authorization Complete | Examination Officer authorized (or self-authorized) ||
    | Confirmation Complete | HoD confirmed (or self-confirmed) ||
    | Publisher Eligibility | Publisher is NOT the teacher who entered marks ||
    | Timestamp Validity | All approval timestamps are valid and sequential ||

    > **If ANY check fails → Publication BLOCKED**
    ---

    ## Key Rules Summary

    | Rule | Description |
    |------|-------------|
    | **Teacher-Publisher Restriction** | Teacher who entered marks CANNOT authorize, confirm, or publish those results |
    | **Committee First** | Examination Committee must approve BEFORE any publication path |
    | **Unanimous Approval** | ALL committee members must approve before publication |
    | **No Edits to Publish** | Can only proceed to publication if zero edits needed |
    | **Self-Authorization** | HoD can self-confirm (Path 1), Exam Officer can self-authorize (Path 2) |
    | **Post-Publication Edits** | Admin only, direct re-publication (no committee re-approval) |
    | **Pre-Publication Edits** | Teacher only, requires complete restart of approval chain |
    | **Parent Notification** | Automatic upon successful publication |
    | **Results Visibility** | Locked until final publication, unlocked immediately after |

    ---

    ## Mermaid Diagram

    For systems supporting Mermaid rendering:

    ```mermaid
    graph TD
    Start[Teacher Enters Module Marks in LMS] --> OTP[OTP Authenticated Login]
    OTP --> Send[Teacher Clicks 'Send to TIMS']
    Send --> Push[LMS Pushes CA/Practical/Exam Marks]
    Push --> Receive[TIMS Receives Marks]
    Receive --> Calc[TIMS Calculates Grades & GPA]
    Calc --> PreComm[Pre-Committee Processing]
    PreComm --> ExamAuth[Examination Officer Authorization]
    ExamAuth --> HoDConf[HoD Confirmation]
    HoDConf --> Committee{Examination Committee Review}
    Committee -->|Not All Approve| EditNotes[Committee Records Edit Notes]
    EditNotes --> AdminRoute[Route to System Admin]
    AdminRoute --> AdminFix[Admin Applies Fixes]
    AdminFix --> Committee
    Committee -->|All Members Approve| Unanimous[Unanimous Approval Locked]
    Unanimous --> PubSelect[Publisher Selection Enabled]
    PubSelect --> SelectPub{Select Eligible Publisher}
    SelectPub --> Path1[HoD]
    SelectPub --> Path2[Exam Officer]
    SelectPub --> Path3[Academic Officer]
    Path1 --> Validate{Publisher ≠ Teacher?}
    Path2 --> Validate
    Path3 --> Validate
    Validate -->|No| Block[❌ BLOCKED]
    Validate -->|Yes| Publish[✅ Publish Results]
    Publish --> Visible[Results Visible to Students]
    Visible --> Notify[Automatic Parent Notification]
    Notify --> Complete[Process Complete]
    Complete --> PostEdit{Post-Pub Edit Needed?}
    PostEdit -->|No| End[End]
    PostEdit -->|Yes| AdminOnly[System Admin Edits]
    AdminOnly --> RePub[Direct Re-Publication]
    RePub --> Visible
    style Start fill:#e1f5fe
    style Publish fill:#c8e6c9
    style Visible fill:#c8e6c9
    style Notify fill:#c8e6c9
    style Block fill:#ffcdd2
    style EditNotes fill:#fff3e0
    style Committee fill:#fff9c4
    style AdminOnly fill:#fff3e0
    ```

    ---

    ## Logical Order (Authoritative Sequence)

    1. Teacher submits marks (LMS → TIMS)
    2. TIMS computes grades and GPA
    3. Examination Officer authorizes
    4. HoD confirms
    5. Examination Committee reviews
    6. **All** committee members approve
    7. Committee selects publisher
    8. System validates publisher ≠ teacher
    9. Publication occurs
    10. Students see results
    11. Parents are notified

    ---

    ## System Guarantees

    | Guarantee | Enforcement |
    |-----------|-------------|
    | Committee unanimity required | System blocks publication until all approve |
    | Publisher selection hidden | UI invisible until full approval |
    | Committee-driven edit notes | Precise admin fixes, no guesswork |
    | Post-publication edits fast | Non-blocking, no re-approval chain |
    | Teacher influence excluded | System-enforced beyond submission |
    | Results invisible | Locked until final publish action |

    ---

    ## Approval State Transitions

    ```
    DRAFT → SUBMITTED → AUTHORIZED → CONFIRMED → COMMITTEE_REVIEW
    ┌──────┴──────┐
    ↓ ↓
    NEEDS_EDITS APPROVED
    ↓ ↓
    (Admin Fix) PENDING_PUBLISH
    ↓ ↓
    COMMITTEE_REVIEW PUBLISHED
    POST_PUB_EDIT
    REPUBLISHED
    ```

    ---

    ## Document Information

    | Field | Value |
    |-------|-------|
    | Version | 1.0 |
    | Last Updated | January 2026 |
    | Status | Final |
    | Author | TIMS Development Team |

    ---

    *This document serves as the authoritative reference for TIMS results publication implementation.*