# 2. Badges & Achievements

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

---

## 2. Badges & Achievements

### 2.1 Badge System
**What it does:** Awards the Student badges for milestones and accomplishments: first exam, perfect quiz, streak milestones, subject mastery, and special challenges. Badges are displayed on the Student's profile and in a badge collection. Earning a badge is celebrated with a notification.

**Sub-features:**
- Badges for milestones (first exam, perfect quiz)
- Badges for streak milestones
- Badges for subject mastery
- Badges for special challenges
- Badge collection on the profile
- Badge earned celebration (notification)
- Badge detail (criteria, date earned)
- Locked vs unlocked badges shown
- Badge event logging (earned, badge)
- Audit logging of the badge system

**Student User Journey:**
1. Student takes their first exam and earns the "First Steps" badge.
2. A celebration notification is shown.
3. Student opens their profile and sees the badge in the collection.
4. Student opens the badge detail (criteria, date earned).
5. Locked badges are shown with their criteria.
6. Student earns a subject mastery badge for Mathematics.
7. Student opens Profile → "Activity" and confirms the badge events are recorded.

**Rules & Edge Cases:**
- A badge is awarded when its criteria are met.
- A badge is awarded once; re-earning is not duplicated.
- Locked badges show their criteria so the Student knows what to do.
- A badge earned celebration is sent as a notification.
- Badge events (earned, badge) are logged with the badge and the timestamp.
- The badge system is audit-logged with the account, the badge, and the timestamp.

### 2.2 Achievement Tracking
**What it does:** Tracks the Student's achievements beyond badges: completed courses, exams passed, total study hours, and other lifetime accomplishments. The Student sees their achievement progress and what is next to unlock. Achievements summarize the Student's journey.

**Sub-features:**
- Achievements for completed courses
- Achievements for exams passed
- Achievements for total study hours
- Lifetime accomplishments summary
- Achievement progress (what is next to unlock)
- Achievements on the profile
- Achievements update in real time
- Achievement event logging (unlocked, achievement)
- Audit logging of the achievement tracking

**Student User Journey:**
1. Student opens "Gamification" → "Achievements".
2. The lifetime summary shows courses completed and exams passed.
3. The total study hours achievement is at 80%.
4. The "next to unlock" shows the remaining hours needed.
5. Student completes a course and the achievement updates.
6. The achievements are shown on the profile.
7. Student opens Profile → "Activity" and confirms the achievement events are recorded.

**Rules & Edge Cases:**
- An achievement is unlocked when its criteria are met.
- The lifetime summary aggregates the Student's accomplishments.
- "Next to unlock" shows the progress toward the next achievement.
- Achievements update in real time.
- Achievement events (unlocked, achievement) are logged with the achievement and the timestamp.
- The achievement tracking is audit-logged with the account, the achievement, and the timestamp.

### 2.3 Badge and Achievement Sharing
**What it does:** Lets the Student share their badges and achievements. The Student can share a badge or achievement to their profile publicly or with a linked parent, and celebrate milestones. Sharing supports motivation and the parent-student collaboration.

**Sub-features:**
- Share a badge to the profile
- Share an achievement with a linked parent
- Public badge display option
- Milestone celebration
- Share status visible
- Unshare a badge or achievement
- Share event logging (shared, unshared)
- Audit logging of the badge and achievement sharing

**Student User Journey:**
1. Student earns a subject mastery badge and taps "Share".
2. The badge is displayed publicly on the profile.
3. Student shares an achievement with their linked parent.
4. The parent sees the achievement in their dashboard.
5. A milestone celebration is shown.
6. Student unshares a badge; it is no longer public.
7. Student opens Profile → "Activity" and confirms the share events are recorded.

**Rules & Edge Cases:**
- Sharing a badge makes it visible per the Student's choice.
- Sharing with a parent requires a linked parent account.
- A milestone celebration is shown at defined thresholds.
- Unsharing removes the public display.
- Share events (shared, unshared) are logged with the badge/achievement and the timestamp.
- The badge and achievement sharing is audit-logged with the account, the badge/achievement, and the timestamp.
