# 2. Badges & Achievements — Test Cases

User Type: **Student**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: badges_achievements.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature, expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 2.1 Badge System | Badges for milestones (first exam, perfect quiz) | TC-ST-09-02-001 |
| 2.1 Badge System | Badges for streak milestones | TC-ST-09-02-002 |
| 2.1 Badge System | Badges for subject mastery | TC-ST-09-02-003 |
| 2.1 Badge System | Badges for special challenges | TC-ST-09-02-004 |
| 2.1 Badge System | Badge collection on the profile | TC-ST-09-02-005 |
| 2.1 Badge System | Badge earned celebration (notification) | TC-ST-09-02-006 |
| 2.1 Badge System | Badge detail (criteria, date earned) | TC-ST-09-02-007 |
| 2.1 Badge System | Locked vs unlocked badges shown | TC-ST-09-02-008 |
| 2.1 Badge System | Badge event logging (earned, badge) | TC-ST-09-02-009 |
| 2.1 Badge System | Audit logging of the badge system | TC-ST-09-02-010 |
| 2.1 Badge System | Rule: A badge is awarded when its criteria are met. | TC-ST-09-02-001 |
| 2.1 Badge System | Rule: A badge is awarded once; re-earning is not duplicated. | TC-ST-09-02-002 |
| 2.1 Badge System | Rule: Locked badges show their criteria so the Student knows what to do. | TC-ST-09-02-003 |
| 2.1 Badge System | Rule: A badge earned celebration is sent as a notification. | TC-ST-09-02-004 |
| 2.1 Badge System | Rule: Badge events (earned, badge) are logged with the badge and the timestamp. | TC-ST-09-02-005 |
| 2.1 Badge System | Rule: The badge system is audit-logged with the account, the badge, and the timestamp. | TC-ST-09-02-006 |
| 2.2 Achievement Tracking | Achievements for completed courses | TC-ST-09-02-011 |
| 2.2 Achievement Tracking | Achievements for exams passed | TC-ST-09-02-012 |
| 2.2 Achievement Tracking | Achievements for total study hours | TC-ST-09-02-013 |
| 2.2 Achievement Tracking | Lifetime accomplishments summary | TC-ST-09-02-014 |
| 2.2 Achievement Tracking | Achievement progress (what is next to unlock) | TC-ST-09-02-015 |
| 2.2 Achievement Tracking | Achievements on the profile | TC-ST-09-02-016 |
| 2.2 Achievement Tracking | Achievements update in real time | TC-ST-09-02-017 |
| 2.2 Achievement Tracking | Achievement event logging (unlocked, achievement) | TC-ST-09-02-018 |
| 2.2 Achievement Tracking | Audit logging of the achievement tracking | TC-ST-09-02-019 |
| 2.2 Achievement Tracking | Rule: An achievement is unlocked when its criteria are met. | TC-ST-09-02-011 |
| 2.2 Achievement Tracking | Rule: The lifetime summary aggregates the Student's accomplishments. | TC-ST-09-02-012 |
| 2.2 Achievement Tracking | Rule: "Next to unlock" shows the progress toward the next achievement. | TC-ST-09-02-013 |
| 2.2 Achievement Tracking | Rule: Achievements update in real time. | TC-ST-09-02-014 |
| 2.2 Achievement Tracking | Rule: Achievement events (unlocked, achievement) are logged with the achievement and the timestamp. | TC-ST-09-02-015 |
| 2.2 Achievement Tracking | Rule: The achievement tracking is audit-logged with the account, the achievement, and the timestamp. | TC-ST-09-02-016 |
| 2.3 Badge and Achievement Sharing | Share a badge to the profile | TC-ST-09-02-020 |
| 2.3 Badge and Achievement Sharing | Share an achievement with a linked parent | TC-ST-09-02-021 |
| 2.3 Badge and Achievement Sharing | Public badge display option | TC-ST-09-02-022 |
| 2.3 Badge and Achievement Sharing | Milestone celebration | TC-ST-09-02-023 |
| 2.3 Badge and Achievement Sharing | Share status visible | TC-ST-09-02-024 |
| 2.3 Badge and Achievement Sharing | Unshare a badge or achievement | TC-ST-09-02-025 |
| 2.3 Badge and Achievement Sharing | Share event logging (shared, unshared) | TC-ST-09-02-026 |
| 2.3 Badge and Achievement Sharing | Audit logging of the badge and achievement sharing | TC-ST-09-02-027 |
| 2.3 Badge and Achievement Sharing | Rule: Sharing a badge makes it visible per the Student's choice. | TC-ST-09-02-020 |
| 2.3 Badge and Achievement Sharing | Rule: Sharing with a parent requires a linked parent account. | TC-ST-09-02-021 |
| 2.3 Badge and Achievement Sharing | Rule: A milestone celebration is shown at defined thresholds. | TC-ST-09-02-022 |
| 2.3 Badge and Achievement Sharing | Rule: Unsharing removes the public display. | TC-ST-09-02-023 |
| 2.3 Badge and Achievement Sharing | Rule: Share events (shared, unshared) are logged with the badge/achievement and the timestamp. | TC-ST-09-02-024 |
| 2.3 Badge and Achievement Sharing | Rule: The badge and achievement sharing is audit-logged with the account, the badge/achievement, and the timestamp. | TC-ST-09-02-025 |

## 2.1 Badge System

### TC-ST-09-02-001 — Badges for milestones (first exam, perfect quiz)
**Type:** Positive
**Covers:** 2.1 → Badges for milestones (first exam, perfect quiz); Rule: A badge is awarded when its criteria are met.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badges for milestones (first exam.
2. Observe the result and verify the full behavior: Badges for milestones (first exam, perfect quiz).
**Expected Result:** Badges for milestones (first exam, perfect quiz) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-09-02-002 — Badges for streak milestones
**Type:** Positive
**Covers:** 2.1 → Badges for streak milestones; Rule: A badge is awarded once; re-earning is not duplicated.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badges for streak milestones.
2. Observe the result and verify the full behavior: Badges for streak milestones.
**Expected Result:** Badges for streak milestones — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-003 — Badges for subject mastery
**Type:** Positive
**Covers:** 2.1 → Badges for subject mastery; Rule: Locked badges show their criteria so the Student knows what to do.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badges for subject mastery.
2. Observe the result and verify the full behavior: Badges for subject mastery.
**Expected Result:** Badges for subject mastery — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-004 — Badges for special challenges
**Type:** Positive
**Covers:** 2.1 → Badges for special challenges; Rule: A badge earned celebration is sent as a notification.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badges for special challenges.
2. Observe the result and verify the full behavior: Badges for special challenges.
**Expected Result:** Badges for special challenges — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-005 — Badge collection on the profile
**Type:** Positive
**Covers:** 2.1 → Badge collection on the profile; Rule: Badge events (earned, badge) are logged with the badge and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badge collection on the profile.
2. Observe the result and verify the full behavior: Badge collection on the profile.
**Expected Result:** Badge collection on the profile — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-006 — Badge earned celebration (notification)
**Type:** Positive
**Covers:** 2.1 → Badge earned celebration (notification); Rule: The badge system is audit-logged with the account, the badge, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badge earned celebration (notification).
2. Observe the result and verify the full behavior: Badge earned celebration (notification).
**Expected Result:** Badge earned celebration (notification) — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-007 — Badge detail (criteria, date earned)
**Type:** Positive
**Covers:** 2.1 → Badge detail (criteria, date earned)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badge detail (criteria.
2. Observe the result and verify the full behavior: Badge detail (criteria, date earned).
**Expected Result:** Badge detail (criteria, date earned) — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-008 — Locked vs unlocked badges shown
**Type:** Positive
**Covers:** 2.1 → Locked vs unlocked badges shown
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Locked vs unlocked badges shown.
2. Observe the result and verify the full behavior: Locked vs unlocked badges shown.
**Expected Result:** Locked vs unlocked badges shown — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-009 — Badge event logging (earned, badge)
**Type:** Positive
**Covers:** 2.1 → Badge event logging (earned, badge)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Badge event logging (earned.
2. Observe the result and verify the full behavior: Badge event logging (earned, badge).
**Expected Result:** Badge event logging (earned, badge) — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-010 — Audit logging of the badge system
**Type:** Positive
**Covers:** 2.1 → Audit logging of the badge system
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the badge system.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 2.2 Achievement Tracking

### TC-ST-09-02-011 — Achievements for completed courses
**Type:** Positive
**Covers:** 2.2 → Achievements for completed courses; Rule: An achievement is unlocked when its criteria are met.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievements for completed courses.
2. Observe the result and verify the full behavior: Achievements for completed courses.
**Expected Result:** Achievements for completed courses — delivered exactly as documented.
**Priority:** Critical

### TC-ST-09-02-012 — Achievements for exams passed
**Type:** Positive
**Covers:** 2.2 → Achievements for exams passed; Rule: The lifetime summary aggregates the Student's accomplishments.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievements for exams passed.
2. Observe the result and verify the full behavior: Achievements for exams passed.
**Expected Result:** Achievements for exams passed — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-013 — Achievements for total study hours
**Type:** Positive
**Covers:** 2.2 → Achievements for total study hours; Rule: "Next to unlock" shows the progress toward the next achievement.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievements for total study hours.
2. Observe the result and verify the full behavior: Achievements for total study hours.
**Expected Result:** Achievements for total study hours — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-014 — Lifetime accomplishments summary
**Type:** Positive
**Covers:** 2.2 → Lifetime accomplishments summary; Rule: Achievements update in real time.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Lifetime accomplishments summary.
2. Observe the result and verify the full behavior: Lifetime accomplishments summary.
**Expected Result:** Lifetime accomplishments summary — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-015 — Achievement progress (what is next to unlock)
**Type:** Positive
**Covers:** 2.2 → Achievement progress (what is next to unlock); Rule: Achievement events (unlocked, achievement) are logged with the achievement and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievement progress (what is next to unlock).
2. Observe the result and verify the full behavior: Achievement progress (what is next to unlock).
**Expected Result:** Achievement progress (what is next to unlock) — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-016 — Achievements on the profile
**Type:** Positive
**Covers:** 2.2 → Achievements on the profile; Rule: The achievement tracking is audit-logged with the account, the achievement, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievements on the profile.
2. Observe the result and verify the full behavior: Achievements on the profile.
**Expected Result:** Achievements on the profile — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-017 — Achievements update in real time
**Type:** Positive
**Covers:** 2.2 → Achievements update in real time
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievements update in real time.
2. Observe the result and verify the full behavior: Achievements update in real time.
**Expected Result:** Achievements update in real time — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-018 — Achievement event logging (unlocked, achievement)
**Type:** Positive
**Covers:** 2.2 → Achievement event logging (unlocked, achievement)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Achievement event logging (unlocked.
2. Observe the result and verify the full behavior: Achievement event logging (unlocked, achievement).
**Expected Result:** Achievement event logging (unlocked, achievement) — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-019 — Audit logging of the achievement tracking
**Type:** Positive
**Covers:** 2.2 → Audit logging of the achievement tracking
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the achievement tracking.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 2.3 Badge and Achievement Sharing

### TC-ST-09-02-020 — Share a badge to the profile
**Type:** Positive
**Covers:** 2.3 → Share a badge to the profile; Rule: Sharing a badge makes it visible per the Student's choice.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Share a badge to the profile.
2. Observe the result and verify the full behavior: Share a badge to the profile.
**Expected Result:** Share a badge to the profile — delivered exactly as documented.
**Priority:** Critical

### TC-ST-09-02-021 — Share an achievement with a linked parent
**Type:** Positive
**Covers:** 2.3 → Share an achievement with a linked parent; Rule: Sharing with a parent requires a linked parent account.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Share an achievement with a linked parent.
2. Observe the result and verify the full behavior: Share an achievement with a linked parent.
**Expected Result:** Share an achievement with a linked parent — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-022 — Public badge display option
**Type:** Positive
**Covers:** 2.3 → Public badge display option; Rule: A milestone celebration is shown at defined thresholds.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Public badge display option.
2. Observe the result and verify the full behavior: Public badge display option.
**Expected Result:** Public badge display option — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-023 — Milestone celebration
**Type:** Positive
**Covers:** 2.3 → Milestone celebration; Rule: Unsharing removes the public display.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Milestone celebration.
2. Observe the result and verify the full behavior: Milestone celebration.
**Expected Result:** Milestone celebration — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-024 — Share status visible
**Type:** Positive
**Covers:** 2.3 → Share status visible; Rule: Share events (shared, unshared) are logged with the badge/achievement and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Share status visible.
2. Observe the result and verify the full behavior: Share status visible.
**Expected Result:** Share status visible — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-025 — Unshare a badge or achievement
**Type:** Positive
**Covers:** 2.3 → Unshare a badge or achievement; Rule: The badge and achievement sharing is audit-logged with the account, the badge/achievement, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Unshare a badge or achievement.
2. Observe the result and verify the full behavior: Unshare a badge or achievement.
**Expected Result:** Unshare a badge or achievement — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-026 — Share event logging (shared, unshared)
**Type:** Positive
**Covers:** 2.3 → Share event logging (shared, unshared)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Share event logging (shared.
2. Observe the result and verify the full behavior: Share event logging (shared, unshared).
**Expected Result:** Share event logging (shared, unshared) — delivered exactly as documented.
**Priority:** High

### TC-ST-09-02-027 — Audit logging of the badge and achievement sharing
**Type:** Positive
**Covers:** 2.3 → Audit logging of the badge and achievement sharing
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the badge and achievement sharing.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical
