# 1. Academic Course Management — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: academic_course_management.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature,
  expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 1.1 Create, Edit, and Delete Academic Courses | Create an academic course: title, description, and the board/grade/subject it belongs to | TC-SA-06-01-001 |
| 1.1 Create, Edit, and Delete Academic Courses | Edit a course's details (title, description, structure) | TC-SA-06-01-002 |
| 1.1 Create, Edit, and Delete Academic Courses | Delete or archive a course (archive preferred where enrollments exist) | TC-SA-06-01-003 |
| 1.1 Create, Edit, and Delete Academic Courses | Course list with status, structure placement, and enrollment counts | TC-SA-06-01-004 |
| 1.1 Create, Edit, and Delete Academic Courses | Dependency check before delete: courses with enrollments are flagged for archive | TC-SA-06-01-005 |
| 1.1 Create, Edit, and Delete Academic Courses | Course status: draft, published, archived (see Course Status Management) | TC-SA-06-01-006 |
| 1.1 Create, Edit, and Delete Academic Courses | Audit logging of course create/edit/delete | TC-SA-06-01-007 |
| 1.1 Create, Edit, and Delete Academic Courses | Rule: an academic course belongs to a board → grade → subject node; the placement is set at creation and is its context | TC-SA-06-01-001 |
| 1.1 Create, Edit, and Delete Academic Courses | Rule: a course with enrollments is archived, not deleted; deletion is reserved for courses with no dependencies | TC-SA-06-01-003 |
| 1.1 Create, Edit, and Delete Academic Courses | Rule: archiving stops new enrollment but preserves existing learners' progress and history; it is reversible | TC-SA-06-01-008 |
| 1.1 Create, Edit, and Delete Academic Courses | Rule: the dependency check runs before delete and blocks it with the specific reason where dependencies exist | TC-SA-06-01-005 |
| 1.1 Create, Edit, and Delete Academic Courses | Rule: course status (draft/published/archived) governs availability (see Course Status Management) | TC-SA-06-01-006 |
| 1.1 Create, Edit, and Delete Academic Courses | Rule: all course changes are audit-logged with the acting admin and timestamp | TC-SA-06-01-007 |
| 1.2 Structure Courses Under Board → Grade → Subject | Structure placement: the course's board, grade, and subject (set at creation) | TC-SA-06-01-009 |
| 1.2 Structure Courses Under Board → Grade → Subject | Placement validation: the board/grade/subject nodes must exist and be active | TC-SA-06-01-010 |
| 1.2 Structure Courses Under Board → Grade → Subject | Structure view: courses listed under their board → grade → subject node | TC-SA-06-01-011 |
| 1.2 Structure Courses Under Board → Grade → Subject | Board-appropriate surfacing: a course appears in its board's context for its grade/subject | TC-SA-06-01-012 |
| 1.2 Structure Courses Under Board → Grade → Subject | Placement correction: moving a course to the correct node where it was misplaced | TC-SA-06-01-013 |
| 1.2 Structure Courses Under Board → Grade → Subject | Consistency: a course has one structure placement (no ambiguous context) | TC-SA-06-01-014 |
| 1.2 Structure Courses Under Board → Grade → Subject | Audit logging of placement changes | TC-SA-06-01-015 |
| 1.2 Structure Courses Under Board → Grade → Subject | Rule: a course has one structure placement (board → grade → subject); the context is unambiguous | TC-SA-06-01-014 |
| 1.2 Structure Courses Under Board → Grade → Subject | Rule: placement nodes must exist and be active; an invalid node cannot be selected | TC-SA-06-01-010 |
| 1.2 Structure Courses Under Board → Grade → Subject | Rule: board-appropriate surfacing is enforced: a course appears in its board's context, not another board's | TC-SA-06-01-012 |
| 1.2 Structure Courses Under Board → Grade → Subject | Rule: a placement correction moves the course to the right node; existing enrollments are handled per the correction's impact (reviewed before the move) | TC-SA-06-01-013 |
| 1.2 Structure Courses Under Board → Grade → Subject | Rule: the structure view shows courses per node, so a misplacement is visible | TC-SA-06-01-011 |
| 1.2 Structure Courses Under Board → Grade → Subject | Rule: placement changes are audit-logged with the course, from/to nodes, and timestamp | TC-SA-06-01-015 |
| 1.3 Assign Content Units to Courses | Assign content units to a course (lessons, topics, materials) | TC-SA-06-01-016 |
| 1.3 Assign Content Units to Courses | Ordering: the content units are sequenced within the course | TC-SA-06-01-017 |
| 1.3 Assign Content Units to Courses | Mapping to curriculum topics: content units can map to the subject's topics | TC-SA-06-01-018 |
| 1.3 Assign Content Units to Courses | Coverage view: the course's content per topic, so gaps are visible | TC-SA-06-01-019 |
| 1.3 Assign Content Units to Courses | Reordering and replacement of content units | TC-SA-06-01-020 |
| 1.3 Assign Content Units to Courses | Readiness: a course is ready to publish when its content is complete | TC-SA-06-01-021 |
| 1.3 Assign Content Units to Courses | Audit logging of content assignment changes | TC-SA-06-01-022 |
| 1.3 Assign Content Units to Courses | Rule: content units are assigned to a course and sequenced; the order is the learning order | TC-SA-06-01-017 |
| 1.3 Assign Content Units to Courses | Rule: content units can map to curriculum topics; the mapping keeps the course aligned to the structure | TC-SA-06-01-018 |
| 1.3 Assign Content Units to Courses | Rule: coverage is visible per topic; a topic with no content is a gap, not a silent omission | TC-SA-06-01-019 |
| 1.3 Assign Content Units to Courses | Rule: a content replacement updates the course's material; learners see the current version | TC-SA-06-01-020 |
| 1.3 Assign Content Units to Courses | Rule: a course is ready to publish when its content is complete; an incomplete course is not published cleanly | TC-SA-06-01-021 |
| 1.3 Assign Content Units to Courses | Rule: content assignment changes are audit-logged with the course, units, and timestamp | TC-SA-06-01-022 |

## 1.1 Create, Edit, and Delete Academic Courses

### TC-SA-06-01-001 — Create an academic course with title, description, and board/grade/subject placement
**Type:** Positive
**Covers:** 1.1 → Create an academic course: title, description, and the board/grade/subject it belongs to; Rule: an academic course belongs to a board → grade → subject node; the placement is set at creation and is its context
**Preconditions:** The curriculum nodes Cambridge → Grade 10 → Mathematics exist and are active.
**Steps:**
1. Open Course Management → Academic.
2. Create the course: title "Cambridge Grade 10 Mathematics", a description, and its placement (Cambridge → Grade 10 → Mathematics).
3. Save and verify the course appears in the list as a draft under its structure node.
**Expected Result:** The academic course is created with its identity and placement; it appears as a draft under its structure node, ready for content assignment.
**Priority:** Critical

### TC-SA-06-01-002 — Edit a course's details (title, description, structure)
**Type:** Positive
**Covers:** 1.1 → Edit a course's details (title, description, structure)
**Preconditions:** An academic course exists; its description needs a clearer scope statement.
**Steps:**
1. Open the course and edit its description (a clearer scope statement).
2. Save and verify the updated details are stored.
3. Verify the change is recorded in the audit trail.
**Expected Result:** The course's details are edited and stored; the change is recorded.
**Priority:** High

### TC-SA-06-01-003 — Delete or archive a course: archive where enrollments exist; delete only a draft with no dependencies
**Type:** Negative
**Covers:** 1.1 → Delete or archive a course (archive preferred where enrollments exist); Rule: a course with enrollments is archived, not deleted; deletion is reserved for courses with no dependencies
**Preconditions:** Course A has active enrollments (a syllabus change means it is no longer offered); Course B is a draft created in error with no content or enrollments.
**Steps:**
1. For Course A, attempt deletion and verify it is not offered cleanly (enrollments exist).
2. Archive Course A and verify it becomes unavailable for new enrollment.
3. For Course B, delete it and verify the dependency check passes and the course is removed.
**Expected Result:** The course with enrollments is archived (not deleted); the draft with no dependencies is deleted — deletion is reserved for no-dependency courses.
**Priority:** Critical

### TC-SA-06-01-004 — The course list shows status, structure placement, and enrollment counts
**Type:** Positive
**Covers:** 1.1 → Course list with status, structure placement, and enrollment counts
**Preconditions:** Multiple academic courses exist with varying statuses and enrollments.
**Steps:**
1. Open the academic course list.
2. Verify each course shows its status, structure placement, and enrollment count.
**Expected Result:** The course list shows status, structure placement, and enrollment counts — the catalog state is clear.
**Priority:** High

### TC-SA-06-01-005 — Dependency check before delete: courses with enrollments are flagged for archive; the check blocks delete with the specific reason
**Type:** Negative
**Covers:** 1.1 → Dependency check before delete: courses with enrollments are flagged for archive; Rule: the dependency check runs before delete and blocks it with the specific reason where dependencies exist
**Preconditions:** A course has active enrollments.
**Steps:**
1. Attempt to delete the course.
2. Verify the dependency check runs before delete and blocks it.
3. Verify the block shows the specific reason (enrollments exist) and flags the course for archive.
**Expected Result:** The dependency check blocks the delete with the specific reason (enrollments exist) and flags the course for archive.
**Priority:** Critical

### TC-SA-06-01-006 — Course status (draft/published/archived) governs availability
**Type:** Positive
**Covers:** 1.1 → Course status: draft, published, archived (see Course Status Management); Rule: course status (draft/published/archived) governs availability (see Course Status Management)
**Preconditions:** Courses exist in draft, published, and archived states.
**Steps:**
1. Verify the draft course is not available for enrollment.
2. Verify the published course is available for enrollment.
3. Verify the archived course is not available for new enrollment.
**Expected Result:** The course status governs availability — draft and archived are not available; published is available.
**Priority:** Critical

### TC-SA-06-01-007 — Course create, edit, archive, and delete are audit-logged with the acting admin and timestamp
**Type:** Positive
**Covers:** 1.1 → Audit logging of course create/edit/delete; Rule: all course changes are audit-logged with the acting admin and timestamp
**Preconditions:** Courses have been created, edited, archived, and deleted.
**Steps:**
1. Open the audit trail and filter by "course".
2. Verify entries for create, edit, archive, and delete with the acting admin and the timestamp.
**Expected Result:** Each course create, edit, archive, and delete is audit-logged with the acting admin and timestamp.
**Priority:** Critical

### TC-SA-06-01-008 — Archiving stops new enrollment but preserves existing learners' progress and history; it is reversible
**Type:** Edge
**Covers:** 1.1 → Rule: archiving stops new enrollment but preserves existing learners' progress and history; it is reversible
**Preconditions:** A course with active enrollments is archived.
**Steps:**
1. Verify new enrollment in the archived course is blocked.
2. Verify existing learners' progress and history remain intact.
3. Un-archive (restore) the course and verify it is available again.
**Expected Result:** Archiving stops new enrollment but preserves existing learners' progress and history; it is reversible.
**Priority:** High

## 1.2 Structure Courses Under Board → Grade → Subject

### TC-SA-06-01-009 — Structure placement: the course's board, grade, and subject (set at creation)
**Type:** Positive
**Covers:** 1.2 → Structure placement: the course's board, grade, and subject (set at creation)
**Preconditions:** The curriculum nodes exist and are active.
**Steps:**
1. Creating a course, select its structure placement: the board (Cambridge), the grade (Grade 10), and the subject (Mathematics) from the existing curriculum nodes.
2. Save and verify the course is placed under Cambridge → Grade 10 → Mathematics.
**Expected Result:** The course's structure placement (board, grade, subject) is set at creation and stored.
**Priority:** Critical

### TC-SA-06-01-010 — Placement validation: the board/grade/subject nodes must exist and be active; an invalid node cannot be selected
**Type:** Negative
**Covers:** 1.2 → Placement validation: the board/grade/subject nodes must exist and be active; Rule: placement nodes must exist and be active; an invalid node cannot be selected
**Preconditions:** A grade node is inactive (or a node does not exist).
**Steps:**
1. Creating a course, attempt to select the inactive/missing node for placement.
2. Verify the node is flagged and cannot be selected.
**Expected Result:** The inactive/missing node is flagged and cannot be selected — placement nodes must exist and be active.
**Priority:** Critical

### TC-SA-06-01-011 — The structure view lists courses under their board → grade → subject node; a misplacement is visible
**Type:** Positive
**Covers:** 1.2 → Structure view: courses listed under their board → grade → subject node; Rule: the structure view shows courses per node, so a misplacement is visible
**Preconditions:** Courses are placed under various nodes.
**Steps:**
1. Open the structure view for Cambridge → Grade 10 → Mathematics.
2. Verify the courses under the node are listed.
3. Verify a misplaced course is visible (it appears under the wrong node).
**Expected Result:** The structure view shows courses per node — a misplacement is visible.
**Priority:** High

### TC-SA-06-01-012 — Board-appropriate surfacing: a course appears in its board's context for its grade/subject, not another board's
**Type:** Negative
**Covers:** 1.2 → Board-appropriate surfacing: a course appears in its board's context for its grade/subject; Rule: board-appropriate surfacing is enforced: a course appears in its board's context, not another board's
**Preconditions:** A course is placed under Cambridge → Grade 10 → Mathematics; a learner is in Cambridge Grade 10.
**Steps:**
1. As the Cambridge Grade 10 learner, verify the course is surfaced in their board context (their grade and subject).
2. Verify the course does not appear in another board's context.
**Expected Result:** The course is surfaced in its board's context for its grade/subject — not in another board's context.
**Priority:** Critical

### TC-SA-06-01-013 — Placement correction: moving a course to the correct node where it was misplaced; existing enrollments are reviewed before the move
**Type:** Positive
**Covers:** 1.2 → Placement correction: moving a course to the correct node where it was misplaced; Rule: a placement correction moves the course to the right node; existing enrollments are handled per the correction's impact (reviewed before the move)
**Preconditions:** A course was misplaced at creation (assigned to the wrong grade); it has existing enrollments.
**Steps:**
1. Review the correction's impact on the existing enrollments before the move.
2. Correct the placement to the right node.
3. Verify the course moves in the structure view and the change is recorded.
**Expected Result:** The course is moved to the right node; the existing enrollments are handled per the correction's impact (reviewed before the move); the change is recorded.
**Priority:** High

### TC-SA-06-01-014 — Consistency: a course has one structure placement (no ambiguous context); no duplicate placement
**Type:** Negative
**Covers:** 1.2 → Consistency: a course has one structure placement (no ambiguous context); Rule: a course has one structure placement (board → grade → subject); the context is unambiguous
**Preconditions:** A course exists with a structure placement.
**Steps:**
1. Verify the course has exactly one structure placement.
2. Attempt to assign a second placement and verify it is not allowed (no duplicate or ambiguous context).
**Expected Result:** The course has exactly one structure placement — the context is unambiguous, no duplicate.
**Priority:** High

### TC-SA-06-01-015 — Placement changes are audit-logged with the course, from/to nodes, and timestamp
**Type:** Positive
**Covers:** 1.2 → Audit logging of placement changes; Rule: placement changes are audit-logged with the course, from/to nodes, and timestamp
**Preconditions:** A course's placement has been corrected (moved between nodes).
**Steps:**
1. Open the audit trail and filter by "placement".
2. Verify the entry shows the course, the from/to nodes, and the timestamp.
**Expected Result:** The placement change is audit-logged with the course, from/to nodes, and timestamp.
**Priority:** Critical

## 1.3 Assign Content Units to Courses

### TC-SA-06-01-016 — Assign content units to a course (lessons, topics, materials)
**Type:** Positive
**Covers:** 1.3 → Assign content units to a course (lessons, topics, materials)
**Preconditions:** A draft course exists; content units (lessons, materials) exist.
**Steps:**
1. Open the draft course and assign its content units: the lessons and materials for each topic.
2. Save and verify the content units are assigned to the course.
**Expected Result:** The content units (lessons, topics, materials) are assigned to the course.
**Priority:** Critical

### TC-SA-06-01-017 — Ordering: the content units are sequenced within the course (the learning order)
**Type:** Positive
**Covers:** 1.3 → Ordering: the content units are sequenced within the course; Rule: content units are assigned to a course and sequenced; the order is the learning order
**Preconditions:** A course has content units assigned.
**Steps:**
1. Sequence the units so the learning order is correct (foundations before advanced material, matching the topic progression).
2. Verify the sequence is maintained within the course.
**Expected Result:** The content units are sequenced within the course — the order is the learning order.
**Priority:** High

### TC-SA-06-01-018 — Mapping to curriculum topics: content units can map to the subject's topics; the mapping keeps the course aligned to the structure
**Type:** Positive
**Covers:** 1.3 → Mapping to curriculum topics: content units can map to the subject's topics; Rule: content units can map to curriculum topics; the mapping keeps the course aligned to the structure
**Preconditions:** A course has content units; the subject's curriculum topics exist.
**Steps:**
1. Map the content units to the curriculum topics.
2. Verify the course's material aligns to the subject's structure.
**Expected Result:** The content units are mapped to the curriculum topics — the course is aligned to the structure.
**Priority:** High

### TC-SA-06-01-019 — Coverage view: the course's content per topic, so gaps are visible; a topic with no content is a gap
**Type:** Negative
**Covers:** 1.3 → Coverage view: the course's content per topic, so gaps are visible; Rule: coverage is visible per topic; a topic with no content is a gap, not a silent omission
**Preconditions:** A course has content assigned; one topic has no content.
**Steps:**
1. Open the coverage view for the course.
2. Verify each topic shows its assigned content.
3. Verify the topic with no content is a visible gap (not a silent omission).
**Expected Result:** The coverage view shows the course's content per topic; the topic with no content is a visible gap.
**Priority:** High

### TC-SA-06-01-020 — Reordering and replacement of content units: a content replacement updates the course's material; learners see the current version
**Type:** Positive
**Covers:** 1.3 → Reordering and replacement of content units; Rule: a content replacement updates the course's material; learners see the current version
**Preconditions:** A course has a content unit (a lesson) that is revised.
**Steps:**
1. Replace the content unit in the course with the revised lesson.
2. Verify the course's material is updated.
3. Verify learners see the updated (current) version.
**Expected Result:** The content unit is replaced; the course's material is updated and learners see the current version.
**Priority:** High

### TC-SA-06-01-021 — Readiness: a course is ready to publish when its content is complete; an incomplete course is not published cleanly
**Type:** Negative
**Covers:** 1.3 → Readiness: a course is ready to publish when its content is complete; Rule: a course is ready to publish when its content is complete; an incomplete course is not published cleanly
**Preconditions:** Course A has complete, sequenced content; Course B has incomplete content (a topic with no content).
**Steps:**
1. Verify Course A is ready to publish (content complete and sequenced).
2. Attempt to publish Course B and verify it is not published cleanly (incomplete content).
**Expected Result:** The complete course is ready to publish; the incomplete course is not published cleanly.
**Priority:** Critical

### TC-SA-06-01-022 — Content assignment changes are audit-logged with the course, units, and timestamp
**Type:** Positive
**Covers:** 1.3 → Audit logging of content assignment changes; Rule: content assignment changes are audit-logged with the course, units, and timestamp
**Preconditions:** Content units have been assigned, reordered, and replaced.
**Steps:**
1. Open the audit trail and filter by "content assignment".
2. Verify entries show the course, the units, and the timestamp.
**Expected Result:** The content assignment changes are audit-logged with the course, units, and timestamp.
**Priority:** Critical
