# 3. AI Study Plan Generation

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 3. AI Study Plan Generation

### 3.1 Plan Creation Rules
**What it does:** Configures the rules the AI uses to generate a study plan for a target exam.
**Sub-features:**
- Plan inputs (exam date, current level, identified gaps).
- Coverage rule (all mapped topics covered before the exam date).
- Gap-first rule (weakest topics scheduled first).
- Plan horizon (full exam period, rolling weekly).
- available on web
- event logging (action performed)
- Audit logging of plan creation rules
**Super Admin User Journey:**
1. Open Target Exam Management → AI Study Plan → Creation Rules.
2. Set the plan inputs (exam date, current level, gaps).
3. Configure the coverage and gap-first rules.
4. Set the plan horizon.
5. Generate a test plan and verify the rules are applied.
**Rules & Edge Cases:**
- A plan that cannot cover all topics before the exam date is flagged (overloaded).
- A student with no gap data gets a coverage-based plan (no gap-first ordering).
- A plan horizon of rolling weekly regenerates the next week each cycle.
- A plan for a disabled exam type is not generated.

### 3.2 Task Breakdown Templates
**What it does:** Defines the templates used to break a study plan into tasks.
**Sub-features:**
- Task types (learn, practice, revise, mock test).
- Task duration defaults (per task type, per grade band).
- Task ordering rules (learn → practice → revise).
- Task granularity (per topic, per sub-topic).
- available on web
- event logging (action performed)
- Audit logging of task breakdown templates
**Super Admin User Journey:**
1. Open AI Study Plan → Task Breakdown.
2. Define the task types and duration defaults.
3. Set the task ordering rules.
4. Choose the task granularity.
5. Generate a plan and verify the tasks follow the template.
**Rules & Edge Cases:**
- A task with no duration default uses the global default.
- A task ordering violation (practice before learn) is not generated.
- A granularity of per sub-topic produces more tasks (capped per day).
- A task template change applies to newly generated plans only.

### 3.3 Revision Cycle Configuration
**What it does:** Configures the revision cycles within a study plan (aligned with spaced repetition).
**Sub-features:**
- Revision intervals (aligned with SRS intervals).
- Revision task types (flashcards, quick quiz, summary review).
- Revision frequency per topic importance.
- Final revision window (intensive revision before the exam).
- available on web
- event logging (action performed)
- Audit logging of revision cycle configuration
**Super Admin User Journey:**
1. Open AI Study Plan → Revision Cycles.
2. Set the revision intervals (aligned with SRS).
3. Choose the revision task types.
4. Set the revision frequency per importance level.
5. Define the final revision window.
**Rules & Edge Cases:**
- A revision interval shorter than the SRS minimum is clamped to the SRS minimum.
- A high-importance topic gets more revision cycles than a low-importance topic.
- A final revision window overlapping the exam date is truncated to end before the exam.
- A revision task for a topic not yet learned is not scheduled.

### 3.4 Milestone Celebration Triggers
**What it does:** Configures the milestones that trigger celebrations in the study plan.
**Sub-features:**
- Milestone types (topic completed, phase completed, mock test passed, streak).
- Celebration types (badge, confetti, message, reward).
- Milestone thresholds (e.g., 25/50/75/100% coverage).
- Milestone notification (to student, to parent).
- available on web
- event logging (action performed)
- Audit logging of milestone celebration triggers
**Super Admin User Journey:**
1. Open AI Study Plan → Milestones.
2. Define the milestone types and thresholds.
3. Choose the celebration types.
4. Set the milestone notifications.
5. Trigger a milestone and verify the celebration fires.
**Rules & Edge Cases:**
- A milestone fires only once per student per plan (no re-celebration).
- A milestone threshold of 100% fires only on full completion.
- A celebration type of reward requires a reward to be configured (else message only).
- A parent notification for a milestone respects the parent's notification preferences.

### 3.5 Plan Adherence Tracking
**What it does:** Tracks how well students follow their generated study plans.
**Sub-features:**
- Adherence metrics (tasks completed on time, slippage days).
- Adherence thresholds (on-track, at-risk, off-track).
- Slippage detection (tasks pushed beyond the planned date).
- Adherence alerts (to student, to parent, to mentor).
- available on web
- event logging (action performed)
- Audit logging of plan adherence tracking
**Super Admin User Journey:**
1. Open AI Study Plan → Adherence.
2. Set the adherence metrics and thresholds.
3. Configure the slippage detection.
4. Set the adherence alerts.
5. Review a student's adherence and verify the status.
**Rules & Edge Cases:**
- A task completed late counts as slipped (not on-time) for adherence.
- A student at the at-risk threshold gets an alert (not off-track yet).
- An adherence alert fires at most once per threshold crossing per day.
- A plan with no tasks yet (just generated) shows "not started" (not off-track).
