# 3. Smart Study Planner — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: smart_study_planner.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 |
|---------|--------------------|----------|
| 3.1 Scheduling Algorithm Configuration | Prioritization logic (deadline, importance, weakness) | TC-SA-AI-13-001 |
| 3.1 Scheduling Algorithm Configuration | Time-slot allocation (fixed, flexible) | TC-SA-AI-13-002 |
| 3.1 Scheduling Algorithm Configuration | Subject balancing and deadline awareness | TC-SA-AI-13-003 |
| 3.1 Scheduling Algorithm Configuration | Algorithm parameters (slot length, buffer, max subjects) | TC-SA-AI-13-004 |
| 3.1 Scheduling Algorithm Configuration | Rule: never exceeds max subjects per day | TC-SA-AI-13-005 |
| 3.1 Scheduling Algorithm Configuration | Rule: conflict resolved by priority, lower moved not dropped | TC-SA-AI-13-006 |
| 3.1 Scheduling Algorithm Configuration | Audit logging of scheduling algorithm configuration | TC-SA-AI-13-007 |
| 3.2 Pomodoro Technique Settings | Focus interval length | TC-SA-AI-14-001 |
| 3.2 Pomodoro Technique Settings | Short break and long break lengths | TC-SA-AI-14-002 |
| 3.2 Pomodoro Technique Settings | Sessions per long break | TC-SA-AI-14-003 |
| 3.2 Pomodoro Technique Settings | Per-grade-band Pomodoro profiles | TC-SA-AI-14-004 |
| 3.2 Pomodoro Technique Settings | Rule: no profile → global settings fallback | TC-SA-AI-14-005 |
| 3.2 Pomodoro Technique Settings | Rule: focus shorter than short break rejected | TC-SA-AI-14-006 |
| 3.2 Pomodoro Technique Settings | Audit logging of Pomodoro settings | TC-SA-AI-14-007 |
| 3.3 Time Budget Defaults | Daily study time budget per grade band | TC-SA-AI-15-001 |
| 3.3 Time Budget Defaults | Per-subject time allocation | TC-SA-AI-15-002 |
| 3.3 Time Budget Defaults | Weekly time budget | TC-SA-AI-15-003 |
| 3.3 Time Budget Defaults | Budget flexibility and per-plan budget | TC-SA-AI-15-004 |
| 3.3 Time Budget Defaults | Rule: plan total never exceeds weekly budget + flexibility | TC-SA-AI-15-005 |
| 3.3 Time Budget Defaults | Rule: per-subject allocation >100% rejected | TC-SA-AI-15-006 |
| 3.3 Time Budget Defaults | Audit logging of time budget defaults | TC-SA-AI-15-007 |
| 3.4 Distraction-Free Mode Rules | Mode triggers (auto, manual) | TC-SA-AI-16-001 |
| 3.4 Distraction-Free Mode Rules | Notifications suppressed | TC-SA-AI-16-002 |
| 3.4 Distraction-Free Mode Rules | Allowed interruptions (parent alert, emergency, break) | TC-SA-AI-16-003 |
| 3.4 Distraction-Free Mode Rules | Mode duration and reporting | TC-SA-AI-16-004 |
| 3.4 Distraction-Free Mode Rules | Rule: allowed interruption always breaks the mode | TC-SA-AI-16-005 |
| 3.4 Distraction-Free Mode Rules | Rule: suppressed notification queued, not lost | TC-SA-AI-16-006 |
| 3.4 Distraction-Free Mode Rules | Audit logging of distraction-free mode rules | TC-SA-AI-16-007 |
| 3.5 Dynamic Plan Adjustment Rules | Adjustment triggers (missed, early, deadline, performance) | TC-SA-AI-17-001 |
| 3.5 Dynamic Plan Adjustment Rules | Re-planning scope (remaining days, week, day) | TC-SA-AI-17-002 |
| 3.5 Dynamic Plan Adjustment Rules | Student confirmation (auto-apply, propose-and-confirm) | TC-SA-AI-17-003 |
| 3.5 Dynamic Plan Adjustment Rules | Adjustment limits and history | TC-SA-AI-17-004 |
| 3.5 Dynamic Plan Adjustment Rules | Rule: max reschedules → stop and flag for review | TC-SA-AI-17-005 |
| 3.5 Dynamic Plan Adjustment Rules | Rule: propose-and-confirm not applied until confirmed | TC-SA-AI-17-006 |
| 3.5 Dynamic Plan Adjustment Rules | Audit logging of dynamic plan adjustment rules | TC-SA-AI-17-007 |

## 3.1 Scheduling Algorithm Configuration

### TC-SA-AI-13-001 — Prioritization logic (deadline, importance, weakness)
**Type:** Positive
**Covers:** 3.1 → Prioritization logic
**Preconditions:** A Super Admin account is active; the smart study planner is enabled.
**Steps:**
1. As a Super Admin, open AI Feature Configuration → Smart Study Planner → Scheduling Algorithm and set the prioritization logic (deadline, importance, weakness-weighted).
2. Generate a plan and verify tasks are prioritized per the logic.
**Expected Result:** Prioritization logic — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-13-002 — Time-slot allocation (fixed, flexible)
**Type:** Positive
**Covers:** 3.1 → Time-slot allocation
**Preconditions:** The scheduling algorithm is configured.
**Steps:**
1. Set the time-slot allocation to fixed slots and verify the plan uses fixed slots.
2. Set it to flexible windows and verify the plan uses flexible windows.
**Expected Result:** Time-slot allocation — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-13-003 — Subject balancing and deadline awareness
**Type:** Positive
**Covers:** 3.1 → Subject balancing and deadlines
**Preconditions:** The scheduling algorithm is configured.
**Steps:**
1. Set the subject balancing (even distribution, weakness-first) and verify the plan balances subjects per the setting.
2. Enable deadline awareness and verify exam/assignment due dates are respected.
**Expected Result:** Subject balancing and deadline awareness — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-13-004 — Algorithm parameters (slot length, buffer, max subjects)
**Type:** Positive
**Covers:** 3.1 → Algorithm parameters
**Preconditions:** The scheduling algorithm is configured.
**Steps:**
1. Set the algorithm parameters (slot length, buffer time, max subjects per day).
2. Generate a plan and verify the parameters are applied.
**Expected Result:** Algorithm parameters — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-13-005 — Rule: never exceeds max subjects per day
**Type:** Negative
**Covers:** 3.1 → Rule: max subjects cap
**Preconditions:** The max-subjects-per-day parameter is set to 2; a plan has 3 subjects due.
**Steps:**
1. Generate the plan.
2. Verify no day schedules more than 2 subjects.
**Expected Result:** A plan never schedules more subjects per day than the max-subjects parameter allows — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-13-006 — Rule: conflict resolved by priority, lower moved not dropped
**Type:** Negative
**Covers:** 3.1 → Rule: conflict resolution
**Preconditions:** Two tasks compete for one slot.
**Steps:**
1. Generate the plan with the conflict.
2. Verify the higher-priority task keeps the slot and the lower-priority task is moved (not dropped).
**Expected Result:** A conflict is resolved by the prioritization logic; the lower-priority task is moved, not dropped — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-13-007 — Audit logging of scheduling algorithm configuration
**Type:** Positive
**Covers:** 3.1 → Audit logging
**Preconditions:** Scheduling algorithm changes have been made.
**Steps:**
1. Open the audit trail and filter by scheduling algorithm configuration.
2. Verify entries show the parameter, the change, and the timestamp.
**Expected Result:** Audit logging of scheduling algorithm configuration — delivered exactly as documented.
**Priority:** Critical

## 3.2 Pomodoro Technique Settings

### TC-SA-AI-14-001 — Focus interval length
**Type:** Positive
**Covers:** 3.2 → Focus interval
**Preconditions:** A Super Admin is configuring Pomodoro settings.
**Steps:**
1. Set the focus interval length (default 25 minutes).
2. Verify Pomodoro sessions use the configured focus interval.
**Expected Result:** Focus interval length — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-14-002 — Short break and long break lengths
**Type:** Positive
**Covers:** 3.2 → Break lengths
**Preconditions:** Pomodoro settings are being configured.
**Steps:**
1. Set the short break length (default 5 minutes) and the long break length (default 15 minutes).
2. Verify Pomodoro sessions use the configured break lengths.
**Expected Result:** Short break and long break lengths — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-14-003 — Sessions per long break
**Type:** Positive
**Covers:** 3.2 → Sessions per long break
**Preconditions:** Pomodoro settings are being configured.
**Steps:**
1. Set the sessions per long break (default 4).
2. Verify a long break is scheduled after the configured number of focus sessions.
**Expected Result:** Sessions per long break — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-14-004 — Per-grade-band Pomodoro profiles
**Type:** Positive
**Covers:** 3.2 → Per-grade-band profiles
**Preconditions:** Global Pomodoro settings are set.
**Steps:**
1. Define a per-grade-band Pomodoro profile (shorter intervals for younger students).
2. Verify a student in the band uses the band profile and others use the global settings.
**Expected Result:** Per-grade-band Pomodoro profiles — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-14-005 — Rule: no profile → global settings fallback
**Type:** Edge
**Covers:** 3.2 → Rule: profile fallback
**Preconditions:** A grade band has no specific Pomodoro profile.
**Steps:**
1. Start a Pomodoro session for a student in the band.
2. Verify the global Pomodoro settings are used.
**Expected Result:** A grade band with no specific profile uses the global Pomodoro settings — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-14-006 — Rule: focus shorter than short break rejected
**Type:** Negative
**Covers:** 3.2 → Rule: invalid profile
**Preconditions:** A Super Admin is configuring a Pomodoro profile.
**Steps:**
1. Enter a focus interval shorter than the short break.
2. Verify the profile is rejected (invalid profile).
**Expected Result:** A focus interval shorter than the short break is rejected — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-14-007 — Audit logging of Pomodoro settings
**Type:** Positive
**Covers:** 3.2 → Audit logging
**Preconditions:** Pomodoro setting changes have been made.
**Steps:**
1. Open the audit trail and filter by Pomodoro settings.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of Pomodoro settings — delivered exactly as documented.
**Priority:** Critical

## 3.3 Time Budget Defaults

### TC-SA-AI-15-001 — Daily study time budget per grade band
**Type:** Positive
**Covers:** 3.3 → Daily budget
**Preconditions:** A Super Admin is configuring time budgets.
**Steps:**
1. Set the daily study time budget (default per grade band).
2. Verify generated plans use the configured daily budget for the band.
**Expected Result:** Daily study time budget — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-15-002 — Per-subject time allocation
**Type:** Positive
**Covers:** 3.3 → Per-subject allocation
**Preconditions:** Time budgets are being configured.
**Steps:**
1. Set the per-subject time allocation (percentage or fixed minutes).
2. Verify generated plans allocate subject time per the setting.
**Expected Result:** Per-subject time allocation — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-15-003 — Weekly time budget
**Type:** Positive
**Covers:** 3.3 → Weekly budget
**Preconditions:** Time budgets are being configured.
**Steps:**
1. Set the weekly time budget (total study hours per week).
2. Verify generated plans respect the weekly budget.
**Expected Result:** Weekly time budget — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-15-004 — Budget flexibility and per-plan budget
**Type:** Positive
**Covers:** 3.3 → Flexibility and per-plan budget
**Preconditions:** Time budgets are being configured.
**Steps:**
1. Define the budget flexibility (over/under allowance percentage).
2. Set the per-plan budget (higher plans get more guided time) and verify it applies per plan.
**Expected Result:** Budget flexibility and per-plan budget — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-15-005 — Rule: plan total never exceeds weekly budget + flexibility
**Type:** Negative
**Covers:** 3.3 → Rule: weekly cap
**Preconditions:** A weekly budget and flexibility allowance are set.
**Steps:**
1. Generate a plan with heavy task load.
2. Verify the total scheduled time never exceeds the weekly budget plus the flexibility allowance.
**Expected Result:** A plan's total scheduled time never exceeds the weekly budget plus the flexibility allowance — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-15-006 — Rule: per-subject allocation >100% rejected
**Type:** Negative
**Covers:** 3.3 → Rule: allocation sum
**Preconditions:** A Super Admin is configuring per-subject allocations.
**Steps:**
1. Enter per-subject allocations that sum to more than 100%.
2. Verify the configuration is rejected with the reason.
**Expected Result:** A per-subject allocation that sums to more than 100% is rejected with the reason — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-15-007 — Audit logging of time budget defaults
**Type:** Positive
**Covers:** 3.3 → Audit logging
**Preconditions:** Time budget changes have been made.
**Steps:**
1. Open the audit trail and filter by time budget defaults.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of time budget defaults — delivered exactly as documented.
**Priority:** Critical

## 3.4 Distraction-Free Mode Rules

### TC-SA-AI-16-001 — Mode triggers (auto, manual)
**Type:** Positive
**Covers:** 3.4 → Mode triggers
**Preconditions:** A Super Admin is configuring distraction-free mode.
**Steps:**
1. Set the mode triggers to auto-on-focus-session-start and verify the mode activates automatically.
2. Set it to manual and verify the mode activates only on manual start.
**Expected Result:** Mode triggers — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-16-002 — Notifications suppressed
**Type:** Positive
**Covers:** 3.4 → Suppressed notifications
**Preconditions:** Distraction-free mode is active.
**Steps:**
1. Configure the notifications suppressed (non-critical app notifications, social).
2. Trigger a suppressed notification during the mode and verify it is suppressed.
**Expected Result:** Notifications suppressed — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-16-003 — Allowed interruptions (parent alert, emergency, break)
**Type:** Positive
**Covers:** 3.4 → Allowed interruptions
**Preconditions:** Distraction-free mode is active.
**Steps:**
1. Define the allowed interruptions (parent alert, emergency, scheduled break).
2. Trigger each allowed interruption and verify it breaks the mode.
**Expected Result:** Allowed interruptions — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-16-004 — Mode duration and reporting
**Type:** Positive
**Covers:** 3.4 → Duration and reporting
**Preconditions:** Distraction-free mode is configured.
**Steps:**
1. Set the mode duration (per focus session, per study block).
2. Enable the mode reporting and verify the distraction count and focus time preserved are reported.
**Expected Result:** Mode duration and reporting — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-16-005 — Rule: allowed interruption always breaks the mode
**Type:** Negative
**Covers:** 3.4 → Rule: interruption priority
**Preconditions:** Distraction-free mode is active; a parent alert fires.
**Steps:**
1. Trigger a parent alert during the mode.
2. Verify the alert breaks the mode (never suppressed).
**Expected Result:** An allowed interruption always breaks the distraction-free mode — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-16-006 — Rule: suppressed notification queued, not lost
**Type:** Negative
**Covers:** 3.4 → Rule: queueing
**Preconditions:** A non-critical notification is suppressed during the mode.
**Steps:**
1. Let the mode end.
2. Verify the suppressed notification is queued and delivered after the mode ends (not lost).
**Expected Result:** A suppressed notification is queued and delivered after the mode ends — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-16-007 — Audit logging of distraction-free mode rules
**Type:** Positive
**Covers:** 3.4 → Audit logging
**Preconditions:** Distraction-free mode rule changes have been made.
**Steps:**
1. Open the audit trail and filter by distraction-free mode rules.
2. Verify entries show the rule, the change, and the timestamp.
**Expected Result:** Audit logging of distraction-free mode rules — delivered exactly as documented.
**Priority:** Critical

## 3.5 Dynamic Plan Adjustment Rules

### TC-SA-AI-17-001 — Adjustment triggers (missed, early, deadline, performance)
**Type:** Positive
**Covers:** 3.5 → Adjustment triggers
**Preconditions:** A Super Admin is configuring dynamic adjustment.
**Steps:**
1. Set the adjustment triggers (missed session, completed early, new deadline, performance change).
2. Trigger each condition and verify a plan adjustment is initiated.
**Expected Result:** Adjustment triggers — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-17-002 — Re-planning scope (remaining days, week, day)
**Type:** Positive
**Covers:** 3.5 → Re-planning scope
**Preconditions:** Dynamic adjustment is configured.
**Steps:**
1. Set the re-planning scope to remaining days and verify the adjustment re-plans the remaining days.
2. Set it to current week and single day and verify the scope matches.
**Expected Result:** Re-planning scope — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-17-003 — Student confirmation (auto-apply, propose-and-confirm)
**Type:** Positive
**Covers:** 3.5 → Student confirmation
**Preconditions:** Dynamic adjustment is configured.
**Steps:**
1. Set the confirmation mode to auto-apply and verify adjustments apply automatically.
2. Set it to propose-and-confirm and verify adjustments are proposed for confirmation.
**Expected Result:** Student confirmation — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-17-004 — Adjustment limits and history
**Type:** Positive
**Covers:** 3.5 → Limits and history
**Preconditions:** Dynamic adjustment is configured.
**Steps:**
1. Set the adjustment limits (max reschedules per week, min task stability).
2. Enable the adjustment history and verify all changes are recorded with the trigger and reason.
**Expected Result:** Adjustment limits and history — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-17-005 — Rule: max reschedules → stop and flag for review
**Type:** Negative
**Covers:** 3.5 → Rule: reschedule cap
**Preconditions:** A plan reaches the max reschedules per week.
**Steps:**
1. Trigger further adjustment conditions.
2. Verify the plan stops auto-adjusting and is flagged for human review.
**Expected Result:** A plan exceeding the max reschedules per week stops auto-adjusting and flags for human review — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-17-006 — Rule: propose-and-confirm not applied until confirmed
**Type:** Negative
**Covers:** 3.5 → Rule: confirmation gate
**Preconditions:** The confirmation mode is propose-and-confirm; an adjustment is proposed.
**Steps:**
1. Leave the proposed adjustment unconfirmed past the window.
2. Verify the adjustment is not applied and expires if not confirmed within the window.
**Expected Result:** A propose-and-confirm adjustment is not applied until the student confirms — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-17-007 — Audit logging of dynamic plan adjustment rules
**Type:** Positive
**Covers:** 3.5 → Audit logging
**Preconditions:** Dynamic adjustment rule changes have been made.
**Steps:**
1. Open the audit trail and filter by dynamic plan adjustment rules.
2. Verify entries show the rule, the change, and the timestamp.
**Expected Result:** Audit logging of dynamic plan adjustment rules — delivered exactly as documented.
**Priority:** Critical
