# 4. Session Analytics — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: session_analytics.md — every feature, sub-feature, 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 |
|---------|--------------------|----------|
| 4.1 Attendance Tracking | Per-session attendance (joined, join/leave times) | TC-SA-LS-15-001 |
| 4.1 Attendance Tracking | Attendance rate per session | TC-SA-LS-15-002 |
| 4.1 Attendance Tracking | Per-student and per-teacher attendance history | TC-SA-LS-15-003 |
| 4.1 Attendance Tracking | No-show identification | TC-SA-LS-15-004 |
| 4.1 Attendance Tracking | Rule: zero-enrolled session has no rate | TC-SA-LS-15-005 |
| 4.1 Attendance Tracking | Audit logging of attendance data access | TC-SA-LS-15-006 |
| 4.2 Engagement Metrics | Average watch time and Q&A participation | TC-SA-LS-16-001 |
| 4.2 Engagement Metrics | Whiteboard interaction and composite engagement score | TC-SA-LS-16-002 |
| 4.2 Engagement Metrics | Engagement trend over time | TC-SA-LS-16-003 |
| 4.2 Engagement Metrics | Rule: score formula documented and stable | TC-SA-LS-16-004 |
| 4.2 Engagement Metrics | Audit logging of engagement data access | TC-SA-LS-16-005 |
| 4.3 Recording Playback Stats | Plays, completion rate, average watch time | TC-SA-LS-17-001 |
| 4.3 Recording Playback Stats | Re-watch behavior and playback trend | TC-SA-LS-17-002 |
| 4.3 Recording Playback Stats | Rule: zero-play recording has no completion rate | TC-SA-LS-17-003 |
| 4.3 Recording Playback Stats | Audit logging of playback data access | TC-SA-LS-17-004 |
| 4.4 Session Quality Scores | Quality score per session (composite) | TC-SA-LS-18-001 |
| 4.4 Session Quality Scores | Feedback collection (post-session rating) | TC-SA-LS-18-002 |
| 4.4 Session Quality Scores | Quality ranking and trend per teacher/subject | TC-SA-LS-18-003 |
| 4.4 Session Quality Scores | Low-quality session flagging | TC-SA-LS-18-004 |
| 4.4 Session Quality Scores | Rule: no-feedback session still scores on attendance/engagement | TC-SA-LS-18-005 |
| 4.4 Session Quality Scores | Audit logging of quality score access | TC-SA-LS-18-006 |

## 4.1 Attendance Tracking

### TC-SA-LS-15-001 — Per-session attendance (joined, join/leave times)
**Type:** Positive
**Covers:** 4.1 → Per-session attendance
**Preconditions:** A Super Admin account is active; a completed session has attendance data.
**Steps:**
1. As a Super Admin, open Session Analytics → Attendance for the session.
2. Verify who joined and the join/leave timestamps are shown.
**Expected Result:** Per-session attendance — delivered exactly as documented.
**Priority:** Critical

### TC-SA-LS-15-002 — Attendance rate per session
**Type:** Positive
**Covers:** 4.1 → Attendance rate
**Preconditions:** A completed session has enrolled and attending students.
**Steps:**
1. View the session's attendance rate.
2. Verify it equals attended / enrolled.
**Expected Result:** Attendance rate per session — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-15-003 — Per-student and per-teacher attendance history
**Type:** Positive
**Covers:** 4.1 → Per-student/teacher history
**Preconditions:** Multiple sessions have attendance data.
**Steps:**
1. Drill into a student's attendance history and rate.
2. Review a teacher's session attendance overview.
**Expected Result:** Per-student and per-teacher attendance history — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-15-004 — No-show identification
**Type:** Positive
**Covers:** 4.1 → No-show identification
**Preconditions:** A session has enrolled students who never joined.
**Steps:**
1. View the session's attendance.
2. Verify no-shows (enrolled but never joined) are identified distinctly from late joiners.
**Expected Result:** No-show identification — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-15-005 — Rule: zero-enrolled session has no rate
**Type:** Edge
**Covers:** 4.1 → Rule: zero-enrolled handling
**Preconditions:** A session has zero enrolled students.
**Steps:**
1. View the session's attendance.
2. Verify no attendance rate is computed (no division by zero).
**Expected Result:** A session with zero enrolled has no rate — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-15-006 — Audit logging of attendance data access
**Type:** Positive
**Covers:** 4.1 → Audit logging
**Preconditions:** Attendance analytics have been accessed.
**Steps:**
1. Open the audit trail and filter by attendance data access.
2. Verify entries show the actor, the scope, and the timestamp.
**Expected Result:** Audit logging of attendance data access — delivered exactly as documented.
**Priority:** Critical

## 4.2 Engagement Metrics

### TC-SA-LS-16-001 — Average watch time and Q&A participation
**Type:** Positive
**Covers:** 4.2 → Watch time and Q&A participation
**Preconditions:** A completed session has engagement data.
**Steps:**
1. Open Session Analytics → Engagement for the session.
2. Verify average watch time and Q&A participation (questions, upvotes) are shown.
**Expected Result:** Average watch time and Q&A participation — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-16-002 — Whiteboard interaction and composite engagement score
**Type:** Positive
**Covers:** 4.2 → Whiteboard interaction and score
**Preconditions:** A completed session has whiteboard activity.
**Steps:**
1. Verify the whiteboard interaction count is shown.
2. Verify the composite engagement score is computed.
**Expected Result:** Whiteboard interaction and composite engagement score — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-16-003 — Engagement trend over time
**Type:** Positive
**Covers:** 4.2 → Engagement trend
**Preconditions:** Multiple sessions have engagement data over time.
**Steps:**
1. View the engagement trend over time.
2. Verify declining interest is visible in the trend.
**Expected Result:** Engagement trend over time — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-16-004 — Rule: score formula documented and stable
**Type:** Edge
**Covers:** 4.2 → Rule: formula stability
**Preconditions:** The engagement score formula is documented.
**Steps:**
1. Compute the score for a session using the documented formula.
2. Verify the displayed score matches and the formula is stable across sessions.
**Expected Result:** The engagement score formula is documented and stable — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-16-005 — Audit logging of engagement data access
**Type:** Positive
**Covers:** 4.2 → Audit logging
**Preconditions:** Engagement analytics have been accessed.
**Steps:**
1. Open the audit trail and filter by engagement data access.
2. Verify entries show the actor, the scope, and the timestamp.
**Expected Result:** Audit logging of engagement data access — delivered exactly as documented.
**Priority:** Critical

## 4.3 Recording Playback Stats

### TC-SA-LS-17-001 — Plays, completion rate, average watch time
**Type:** Positive
**Covers:** 4.3 → Core playback stats
**Preconditions:** A recording has playback data.
**Steps:**
1. Open Session Analytics → Recording Playback for the recording.
2. Verify plays, completion rate, and average watch time are shown.
**Expected Result:** Plays, completion rate, average watch time — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-17-002 — Re-watch behavior and playback trend
**Type:** Positive
**Covers:** 4.3 → Re-watch and trend
**Preconditions:** A recording has repeat plays over time.
**Steps:**
1. Verify re-watch behavior (repeat plays) is shown.
2. Verify the playback trend over time.
**Expected Result:** Re-watch behavior and playback trend — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-17-003 — Rule: zero-play recording has no completion rate
**Type:** Edge
**Covers:** 4.3 → Rule: zero-play handling
**Preconditions:** A recording has zero plays.
**Steps:**
1. View the recording's stats.
2. Verify no completion rate is computed (no division by zero).
**Expected Result:** A recording with zero plays has no rate — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-17-004 — Audit logging of playback data access
**Type:** Positive
**Covers:** 4.3 → Audit logging
**Preconditions:** Playback analytics have been accessed.
**Steps:**
1. Open the audit trail and filter by playback data access.
2. Verify entries show the actor, the scope, and the timestamp.
**Expected Result:** Audit logging of playback data access — delivered exactly as documented.
**Priority:** Critical

## 4.4 Session Quality Scores

### TC-SA-LS-18-001 — Quality score per session (composite)
**Type:** Positive
**Covers:** 4.4 → Quality score
**Preconditions:** A completed session has attendance, engagement, and feedback data.
**Steps:**
1. Open Session Analytics → Quality Scores for the session.
2. Verify the composite quality score is shown.
**Expected Result:** Quality score per session — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-18-002 — Feedback collection (post-session rating)
**Type:** Positive
**Covers:** 4.4 → Feedback collection
**Preconditions:** A session has ended and students submitted ratings.
**Steps:**
1. View the post-session student feedback.
2. Verify the feedback feeds the quality score.
**Expected Result:** Feedback collection — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-18-003 — Quality ranking and trend per teacher/subject
**Type:** Positive
**Covers:** 4.4 → Ranking and trend
**Preconditions:** Multiple sessions have quality scores.
**Steps:**
1. Rank sessions by quality.
2. Track the trend per teacher and per subject.
**Expected Result:** Quality ranking and trend — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-18-004 — Low-quality session flagging
**Type:** Positive
**Covers:** 4.4 → Low-quality flagging
**Preconditions:** A session's quality score is below the threshold.
**Steps:**
1. View the quality scores list.
2. Verify the low-quality session is flagged for review.
**Expected Result:** Low-quality session flagging — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-18-005 — Rule: no-feedback session still scores on attendance/engagement
**Type:** Edge
**Covers:** 4.4 → Rule: no-feedback scoring
**Preconditions:** A session has no student feedback.
**Steps:**
1. View the session's quality score.
2. Verify it still scores on attendance and engagement.
**Expected Result:** A session with no feedback still scores on attendance and engagement — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-18-006 — Audit logging of quality score access
**Type:** Positive
**Covers:** 4.4 → Audit logging
**Preconditions:** Quality score analytics have been accessed.
**Steps:**
1. Open the audit trail and filter by quality score access.
2. Verify entries show the actor, the scope, and the timestamp.
**Expected Result:** Audit logging of quality score access — delivered exactly as documented.
**Priority:** Critical
