# Teacher/Content Creator — Role Definition — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: teacher_role.md — every capability, onboarding path, restriction, and rule covered

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 1. Role & Onboarding | Predefined role: editable but not deletable | TC-SA-TEACH-01-001 |
| 1. Role & Onboarding | Path A: independent subscription onboarding | TC-SA-TEACH-01-002 |
| 1. Role & Onboarding | Path B: mapped through school/institute admin | TC-SA-TEACH-01-003 |
| 1. Role & Onboarding | Super Admin assigns courses to Path A teacher | TC-SA-TEACH-01-004 |
| 1. Role & Onboarding | Role assignment and removal audit-logged | TC-SA-TEACH-01-005 |
| 1. Role & Onboarding | Rule: role changes via Role Assignment | TC-SA-TEACH-01-006 |
| 2. Content Management | Upload and manage assigned course content | TC-SA-TEACH-02-001 |
| 2. Content Management | Create video tutorials and podcasts | TC-SA-TEACH-02-002 |
| 2. Content Management | Design exams, quizzes, assessments | TC-SA-TEACH-02-003 |
| 2. Content Management | Create resource guides, flashcards, mind maps | TC-SA-TEACH-02-004 |
| 2. Content Management | Rule: content scoped to assigned courses only | TC-SA-TEACH-02-005 |
| 2. Content Management | Rule: content enters approval workflow where required | TC-SA-TEACH-02-006 |
| 2. Content Management | Rule: deletion retains version history | TC-SA-TEACH-02-007 |
| 3. Student-Facing & Analytics | Respond to student queries in assigned subjects | TC-SA-TEACH-03-001 |
| 3. Student-Facing & Analytics | View student performance analytics (own courses only) | TC-SA-TEACH-03-002 |
| 3. Student-Facing & Analytics | Schedule live sessions (if applicable) | TC-SA-TEACH-03-003 |
| 3. Student-Facing & Analytics | Access AI-generated content effectiveness insights | TC-SA-TEACH-03-004 |
| 3. Student-Facing & Analytics | View assigned courses and students | TC-SA-TEACH-03-005 |
| 3. Student-Facing & Analytics | Rule: analytics read-only | TC-SA-TEACH-03-006 |
| 3. Student-Facing & Analytics | Rule: analytics limited to own courses | TC-SA-TEACH-03-007 |
| 4. Restrictions | No billing or subscription access | TC-SA-TEACH-04-001 |
| 4. Restrictions | No license management access | TC-SA-TEACH-04-002 |
| 4. Restrictions | No access to other teachers' content | TC-SA-TEACH-04-003 |
| 4. Restrictions | No system settings or user management access | TC-SA-TEACH-04-004 |
| 4. Restrictions | No content approval authority | TC-SA-TEACH-04-005 |
| 4. Restrictions | Rule: restrictions enforced at API layer | TC-SA-TEACH-04-006 |
| 4. Restrictions | Rule: denied attempts logged | TC-SA-TEACH-04-007 |
| 5. Lifecycle & Edge Cases | Path B teacher deactivated on institute removal | TC-SA-TEACH-05-001 |
| 5. Lifecycle & Edge Cases | Path A teacher deactivated on subscription lapse | TC-SA-TEACH-05-002 |
| 5. Lifecycle & Edge Cases | Role edit propagates to all holders | TC-SA-TEACH-05-003 |
| 5. Lifecycle & Edge Cases | No conflicting privileges via this role | TC-SA-TEACH-05-004 |
| 5. Lifecycle & Edge Cases | Unassigned courses invisible to teacher | TC-SA-TEACH-05-005 |

## 1. Role & Onboarding

### TC-SA-TEACH-01-001 — Teacher role is predefined, editable, not deletable
**Type:** Positive
**Covers:** 1 → Predefined role: editable but not deletable
**Preconditions:** Super Admin logged in.
**Steps:**
1. Open Role & Permission Management → Roles and locate Teacher/Content Creator.
2. Attempt to delete the role; then edit its permission set.
**Expected Result:** Deletion is unavailable; editing is allowed and audit-logged.
**Priority:** Critical

### TC-SA-TEACH-01-002 — Path A: independent subscription onboarding
**Type:** Positive
**Covers:** 1 → Path A: independent subscription onboarding
**Preconditions:** A new teacher self-registers and completes an independent subscription.
**Steps:**
1. The teacher self-registers and verifies their email.
2. Completes the independent subscription.
3. Super Admin assigns the Teacher/Content Creator role.
**Expected Result:** The teacher account is active with the role; the teacher can log in and see the teacher panels.
**Priority:** Critical

### TC-SA-TEACH-01-003 — Path B: mapped through school/institute admin
**Type:** Positive
**Covers:** 1 → Path B: mapped through school/institute admin
**Preconditions:** A school/institute admin with teacher-creation rights.
**Steps:**
1. The institute admin creates a teacher account and assigns them to courses.
2. The Teacher/Content Creator role is applied through the mapping flow.
**Expected Result:** The teacher is active, linked to the institute, and sees only the institute's assigned scope.
**Priority:** Critical

### TC-SA-TEACH-01-004 — Super Admin assigns courses to a Path A teacher
**Type:** Positive
**Covers:** 1 → Super Admin assigns courses to Path A teacher
**Preconditions:** An active Path A teacher with no courses.
**Steps:**
1. Super Admin assigns two courses to the teacher.
**Expected Result:** The teacher sees exactly those two courses in My Courses.
**Priority:** High

### TC-SA-TEACH-01-005 — Role assignment and removal are audit-logged
**Type:** Positive
**Covers:** 1 → Role assignment and removal audit-logged
**Preconditions:** Role assignment and removal performed.
**Steps:**
1. Review the permission audit trail.
**Expected Result:** Both the assignment and removal are audit-logged with actor, user, role, and timestamp.
**Priority:** High

### TC-SA-TEACH-01-006 — Role changes go through Role Assignment
**Type:** Positive
**Covers:** 1 → Rule: role changes via Role Assignment
**Preconditions:** Super Admin logged in.
**Steps:**
1. Reassign a teacher from Teacher/Content Creator to a custom role via Role Assignment.
**Expected Result:** The change applies on the teacher's next request; the teacher's capabilities match the new role.
**Priority:** High

## 2. Content Management

### TC-SA-TEACH-02-001 — Upload and manage assigned course content
**Type:** Positive
**Covers:** 2 → Upload and manage assigned course content
**Preconditions:** A teacher with an assigned course.
**Steps:**
1. Upload a new content item; then view, edit, and delete it.
**Expected Result:** All four operations succeed within the assigned course.
**Priority:** Critical

### TC-SA-TEACH-02-002 — Create video tutorials and podcasts
**Type:** Positive
**Covers:** 2 → Create video tutorials and podcasts
**Preconditions:** A teacher with an assigned course.
**Steps:**
1. Upload a video tutorial with subtitles; upload a podcast audio lesson.
**Expected Result:** Both are created, organized under the course, and available per the approval policy.
**Priority:** High

### TC-SA-TEACH-02-003 — Design exams, quizzes, and assessments
**Type:** Positive
**Covers:** 2 → Design exams, quizzes, assessments
**Preconditions:** A teacher with an assigned course; question bank available.
**Steps:**
1. Create a quiz selecting questions from the bank; set passing mark and attempts.
2. Publish to the course.
**Expected Result:** The quiz is created with the exact settings and is available to the course's students.
**Priority:** High

### TC-SA-TEACH-02-004 — Create resource guides, flashcards, and mind maps
**Type:** Positive
**Covers:** 2 → Create resource guides, flashcards, mind maps
**Preconditions:** A teacher with an assigned course.
**Steps:**
1. Create a resource guide, a flashcard deck, and a mind map for a topic.
**Expected Result:** All three are created and linked to the topic.
**Priority:** Medium

### TC-SA-TEACH-02-005 — Content scoped to assigned courses only
**Type:** Negative
**Covers:** 2 → Rule: content scoped to assigned courses only
**Preconditions:** A teacher with one assigned course; another course exists.
**Steps:**
1. Attempt to open or upload content in the unassigned course via UI and direct endpoint call.
**Expected Result:** The unassigned course is invisible; the endpoint call is denied.
**Priority:** Critical

### TC-SA-TEACH-02-006 — Content enters approval workflow where required
**Type:** Positive
**Covers:** 2 → Rule: content enters approval workflow where required
**Preconditions:** A course where the policy requires content review.
**Steps:**
1. The teacher uploads new content.
2. Check the content's status and the reviewer's queue.
**Expected Result:** The content is in "pending review" status and appears in the Content Reviewer's queue; it is not live for students until approved.
**Priority:** Critical

### TC-SA-TEACH-02-007 — Deletion retains version history
**Type:** Positive
**Covers:** 2 → Rule: deletion retains version history
**Preconditions:** A content item with prior versions.
**Steps:**
1. Delete the content item.
2. Review the content version history.
**Expected Result:** The item is removed from the course; prior versions remain in the version history.
**Priority:** High

## 3. Student-Facing & Analytics

### TC-SA-TEACH-03-001 — Respond to student queries in assigned subjects
**Type:** Positive
**Covers:** 3 → Respond to student queries in assigned subjects
**Preconditions:** A student query in the teacher's assigned subject.
**Steps:**
1. Open the Query Inbox and respond to the query.
**Expected Result:** The student receives the response; the query is resolved and logged.
**Priority:** High

### TC-SA-TEACH-03-002 — View student performance analytics for own courses
**Type:** Positive
**Covers:** 3 → View student performance analytics (own courses only)
**Preconditions:** A teacher with an assigned course that has student activity.
**Steps:**
1. Open Performance Analytics for the course.
**Expected Result:** Completion, assessment results, and engagement are shown for that course's students only.
**Priority:** High

### TC-SA-TEACH-03-003 — Schedule live sessions
**Type:** Positive
**Covers:** 3 → Schedule live sessions (if applicable)
**Preconditions:** A teacher with an assigned course where live sessions are enabled.
**Steps:**
1. Schedule a live session with date, time, and topic.
**Expected Result:** The session is scheduled; enrolled students are notified.
**Priority:** Medium

### TC-SA-TEACH-03-004 — Access AI content effectiveness insights
**Type:** Positive
**Covers:** 3 → Access AI-generated content effectiveness insights
**Preconditions:** A teacher with content that has student interaction data.
**Steps:**
1. Open AI Insights for a video.
**Expected Result:** Insights (e.g., drop-off points, engagement) are shown for the teacher's own content.
**Priority:** Medium

### TC-SA-TEACH-03-005 — View assigned courses and students
**Type:** Positive
**Covers:** 3 → View assigned courses and students
**Preconditions:** A teacher with assigned courses and enrolled students.
**Steps:**
1. Open My Courses and My Students.
**Expected Result:** Only the teacher's assigned courses and their enrolled students are listed.
**Priority:** High

### TC-SA-TEACH-03-006 — Analytics are read-only
**Type:** Negative
**Covers:** 3 → Rule: analytics read-only
**Preconditions:** A teacher viewing course analytics.
**Steps:**
1. Attempt to modify any analytics value.
**Expected Result:** No modification controls exist; the attempt is rejected.
**Priority:** High

### TC-SA-TEACH-03-007 — Analytics limited to own courses
**Type:** Negative
**Covers:** 3 → Rule: analytics limited to own courses
**Preconditions:** A teacher's session token; another course with analytics exists.
**Steps:**
1. Call the analytics endpoint for the other course with the teacher's token.
**Expected Result:** The call is denied (403); no data is returned.
**Priority:** Critical

## 4. Restrictions

### TC-SA-TEACH-04-001 — No billing or subscription access
**Type:** Negative
**Covers:** 4 → No billing or subscription access
**Preconditions:** A teacher logged in.
**Steps:**
1. Attempt to open billing or subscription management screens.
**Expected Result:** Access is denied; the screens are not in navigation.
**Priority:** Critical

### TC-SA-TEACH-04-002 — No license management access
**Type:** Negative
**Covers:** 4 → No license management access
**Preconditions:** A teacher logged in.
**Steps:**
1. Attempt to open license management.
**Expected Result:** Access is denied; the screen is not in navigation.
**Priority:** Critical

### TC-SA-TEACH-04-003 — No access to other teachers' content
**Type:** Negative
**Covers:** 4 → No access to other teachers' content
**Preconditions:** Two teachers with different courses; a teacher's session token.
**Steps:**
1. Call the content endpoint for the other teacher's course with the token.
**Expected Result:** The call is denied; the other teacher's content is not visible.
**Priority:** Critical

### TC-SA-TEACH-04-004 — No system settings or user management access
**Type:** Negative
**Covers:** 4 → No system settings or user management access
**Preconditions:** A teacher logged in.
**Steps:**
1. Attempt to open system settings or user management.
**Expected Result:** Access is denied; the screens are not in navigation.
**Priority:** Critical

### TC-SA-TEACH-04-005 — No content approval authority
**Type:** Negative
**Covers:** 4 → No content approval authority
**Preconditions:** A teacher with content in the review queue.
**Steps:**
1. Attempt to approve or reject any content item.
**Expected Result:** Approval/rejection actions are unavailable; the attempt is denied.
**Priority:** Critical

### TC-SA-TEACH-04-006 — Restrictions enforced at API layer
**Type:** Negative
**Covers:** 4 → Rule: restrictions enforced at API layer
**Preconditions:** A teacher's session token.
**Steps:**
1. Call a billing endpoint and a user-management endpoint directly with the token.
**Expected Result:** Both calls return denials (403); no data is returned.
**Priority:** Critical

### TC-SA-TEACH-04-007 — Denied attempts are logged
**Type:** Positive
**Covers:** 4 → Rule: denied attempts logged
**Preconditions:** Denied access attempts made by a teacher.
**Steps:**
1. Review the audit trail for the teacher's account.
**Expected Result:** Each denied attempt is logged with the account, target, and timestamp.
**Priority:** High

## 5. Lifecycle & Edge Cases

### TC-SA-TEACH-05-001 — Path B teacher deactivated on institute removal
**Type:** Positive
**Covers:** 5 → Path B teacher deactivated on institute removal
**Preconditions:** A Path B teacher mapped to an institute.
**Steps:**
1. The institute admin removes the teacher.
2. Attempt to log in as the teacher.
**Expected Result:** The account is deactivated; login is denied; the teacher's content and history are retained.
**Priority:** High

### TC-SA-TEACH-05-002 — Path A teacher deactivated on subscription lapse
**Type:** Positive
**Covers:** 5 → Path A teacher deactivated on subscription lapse
**Preconditions:** A Path A teacher whose independent subscription lapses.
**Steps:**
1. Let the subscription lapse (or simulate it).
2. Attempt to log in as the teacher.
**Expected Result:** The account is deactivated on lapse; login is denied; prior content is retained.
**Priority:** High

### TC-SA-TEACH-05-003 — Role edit propagates to all holders
**Type:** Positive
**Covers:** 5 → Role edit propagates to all holders
**Preconditions:** Multiple teachers hold the role; Super Admin logged in.
**Steps:**
1. Super Admin adds a permission to the Teacher/Content Creator role with the change preview.
2. A teacher makes a request exercising the new permission.
**Expected Result:** The preview showed the affected holder count; the new capability is available on the teacher's next request without re-login.
**Priority:** High

### TC-SA-TEACH-05-004 — No conflicting privileges via this role
**Type:** Negative
**Covers:** 5 → No conflicting privileges via this role
**Preconditions:** A teacher holding only the Teacher/Content Creator role.
**Steps:**
1. Attempt to exercise content approval (a Content Reviewer capability).
**Expected Result:** The capability is unavailable; additional capabilities require a separate or custom role.
**Priority:** High

### TC-SA-TEACH-05-005 — Unassigned courses invisible to teacher
**Type:** Negative
**Covers:** 5 → Unassigned courses invisible to teacher
**Preconditions:** A teacher with one assigned course; other courses exist on the platform.
**Steps:**
1. Review the teacher's course list and attempt to navigate to an unassigned course by URL.
**Expected Result:** The unassigned course is absent from the list; direct navigation is denied.
**Priority:** Critical
