# 1. Gamification Configuration — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: gamification_configuration.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 |
|---------|--------------------|----------|
| 1.1 Point System Rules | Point value per earning action | TC-SA-SL-1-001 |
| 1.1 Point System Rules | Bonus point rules (assessment, streak) | TC-SA-SL-1-002 |
| 1.1 Point System Rules | Point expiry policy | TC-SA-SL-1-003 |
| 1.1 Point System Rules | Point display rules and per-student ledger | TC-SA-SL-1-004 |
| 1.1 Point System Rules | Rule: rule change does not retroactively revalue past events | TC-SA-SL-1-005 |
| 1.1 Point System Rules | Audit logging of point system configuration | TC-SA-SL-1-006 |
| 1.2 Badge & Achievement Definitions | Badge creation (name, icon, description, criteria) | TC-SA-SL-2-001 |
| 1.2 Badge & Achievement Definitions | Badge categories (mastery, streak, challenge, top performer, seasonal) | TC-SA-SL-2-002 |
| 1.2 Badge & Achievement Definitions | Unlock conditions and visibility | TC-SA-SL-2-003 |
| 1.2 Badge & Achievement Definitions | Badge revocation with reason | TC-SA-SL-2-004 |
| 1.2 Badge & Achievement Definitions | Rule: badge unlocks only when all criteria met | TC-SA-SL-2-005 |
| 1.2 Badge & Achievement Definitions | Rule: streak milestone badges unlock at exact milestone | TC-SA-SL-2-006 |
| 1.2 Badge & Achievement Definitions | Audit logging of badge definitions | TC-SA-SL-2-007 |
| 1.3 Leaderboard Settings | Leaderboard scope (class, grade, subject) and period | TC-SA-SL-3-001 |
| 1.3 Leaderboard Settings | Display mode: anonymous or opt-in | TC-SA-SL-3-002 |
| 1.3 Leaderboard Settings | Filtering by friends/connections and metric | TC-SA-SL-3-003 |
| 1.3 Leaderboard Settings | Rule: opt-in shows name only with consent | TC-SA-SL-3-004 |
| 1.3 Leaderboard Settings | Rule: period rollover resets period leaderboard | TC-SA-SL-3-005 |
| 1.3 Leaderboard Settings | Audit logging of leaderboard settings | TC-SA-SL-3-006 |
| 1.4 Challenges & Competitions Management | Challenge creation (title, type, duration) | TC-SA-SL-4-001 |
| 1.4 Challenges & Competitions Management | Entry rules and scoring rules | TC-SA-SL-4-002 |
| 1.4 Challenges & Competitions Management | Prize/reward configuration | TC-SA-SL-4-003 |
| 1.4 Challenges & Competitions Management | Challenge lifecycle (draft → active → completed) | TC-SA-SL-4-004 |
| 1.4 Challenges & Competitions Management | Rule: draft challenge not visible to students | TC-SA-SL-4-005 |
| 1.4 Challenges & Competitions Management | Rule: winner determination and reward issuance recorded | TC-SA-SL-4-006 |
| 1.4 Challenges & Competitions Management | Audit logging of challenges & competitions | TC-SA-SL-4-007 |

## 1.1 Point System Rules

### TC-SA-SL-1-001 — Point value per earning action
**Type:** Positive
**Covers:** 1.1 → Point value per earning action
**Preconditions:** A Super Admin account is active.
**Steps:**
1. As a Super Admin, set the point value for each earning action (video watched, assessment completed, daily login streak, study consistency, peer help).
2. Trigger each action as a student and verify the points awarded match the configured values.
**Expected Result:** Point value per earning action — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-1-002 — Bonus point rules (assessment, streak)
**Type:** Positive
**Covers:** 1.1 → Bonus point rules
**Preconditions:** Point values are configured.
**Steps:**
1. Define the bonus point rules (assessment bonus, streak bonus).
2. Trigger a bonus-eligible event and verify the bonus is awarded.
**Expected Result:** Bonus point rules — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-1-003 — Point expiry policy
**Type:** Positive
**Covers:** 1.1 → Point expiry policy
**Preconditions:** A rolling point expiry period is set.
**Steps:**
1. Set the point expiry policy (rolling period).
2. Verify points expire after the period and the expiry is recorded in the ledger.
**Expected Result:** Point expiry policy — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-1-004 — Point display rules and per-student ledger
**Type:** Positive
**Covers:** 1.1 → Display rules and ledger
**Preconditions:** A student has earned points.
**Steps:**
1. Set the point display rules (visible to self, visible to others).
2. Verify the student's point ledger shows earnings, expiries, and balance.
**Expected Result:** Point display rules and per-student ledger — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-1-005 — Rule: rule change does not retroactively revalue past events
**Type:** Negative
**Covers:** 1.1 → Rule: no retroactive revaluation
**Preconditions:** A student earned points under the old rule set.
**Steps:**
1. Change the point value for an earning action.
2. Verify the student's past points are not revalued; only new events use the new value.
**Expected Result:** A later rule change does not retroactively revalue past events — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-1-006 — Audit logging of point system configuration
**Type:** Positive
**Covers:** 1.1 → Audit logging
**Preconditions:** Point system configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by point system configuration.
2. Verify entries show the rule, the change, and the timestamp.
**Expected Result:** Audit logging of point system configuration — delivered exactly as documented.
**Priority:** Critical

## 1.2 Badge & Achievement Definitions

### TC-SA-SL-2-001 — Badge creation (name, icon, description, criteria)
**Type:** Positive
**Covers:** 1.2 → Badge creation
**Preconditions:** A Super Admin account is active.
**Steps:**
1. As a Super Admin, create a badge with name, icon, description, and criteria.
2. Verify the badge is saved with all fields.
**Expected Result:** Badge creation — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-2-002 — Badge categories
**Type:** Positive
**Covers:** 1.2 → Badge categories
**Preconditions:** Badges exist.
**Steps:**
1. Assign badges to categories: subject mastery, streak milestones, challenge completion, top performer, seasonal.
2. Verify each badge appears under its category.
**Expected Result:** Badge categories — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-2-003 — Unlock conditions and visibility
**Type:** Positive
**Covers:** 1.2 → Unlock conditions and visibility
**Preconditions:** A badge is created with criteria.
**Steps:**
1. Define the unlock conditions (metric thresholds, time windows) and visibility (self, class, public).
2. Verify a student meeting the criteria unlocks the badge with the set visibility.
**Expected Result:** Unlock conditions and visibility — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-2-004 — Badge revocation with reason
**Type:** Negative
**Covers:** 1.2 → Badge revocation
**Preconditions:** A student holds a badge that must be withdrawn.
**Steps:**
1. Revoke the badge with a reason.
2. Verify the badge is removed from the student's profile and the reason is recorded.
**Expected Result:** Badge revocation — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-2-005 — Rule: badge unlocks only when all criteria met
**Type:** Negative
**Covers:** 1.2 → Rule: all-criteria unlock
**Preconditions:** A badge has multiple criteria; a student meets only some.
**Steps:**
1. Verify the badge does not unlock while any criterion is unmet.
2. Complete the remaining criteria and verify the badge unlocks.
**Expected Result:** A badge unlocks only when all of its criteria are met — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-2-006 — Rule: streak milestone badges unlock at exact milestone
**Type:** Edge
**Covers:** 1.2 → Rule: exact milestone unlock
**Preconditions:** Streak milestone badges (7, 30, 100 days) are defined.
**Steps:**
1. Reach day 6 of a streak and verify the 7-day badge is not yet unlocked.
2. Reach day 7 and verify the badge unlocks exactly at the milestone.
**Expected Result:** Streak milestone badges unlock at the exact milestone, not before — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-2-007 — Audit logging of badge definitions
**Type:** Positive
**Covers:** 1.2 → Audit logging
**Preconditions:** Badge actions have been performed.
**Steps:**
1. Open the audit trail and filter by badge definitions.
2. Verify entries show the badge, the action, and the timestamp.
**Expected Result:** Audit logging of badge definitions — delivered exactly as documented.
**Priority:** Critical

## 1.3 Leaderboard Settings

### TC-SA-SL-3-001 — Leaderboard scope and period
**Type:** Positive
**Covers:** 1.3 → Scope and period
**Preconditions:** A Super Admin is configuring leaderboards.
**Steps:**
1. Create leaderboards with scope (class/grade/subject) and period (weekly, monthly, all-time).
2. Verify each leaderboard is computed for its scope and period.
**Expected Result:** Leaderboard scope and period — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-3-002 — Display mode: anonymous or opt-in
**Type:** Positive
**Covers:** 1.3 → Display mode
**Preconditions:** A leaderboard exists.
**Steps:**
1. Set the display mode to anonymous and verify names are hidden.
2. Set the display mode to opt-in and verify names show only with consent.
**Expected Result:** Display mode — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-3-003 — Filtering by friends/connections and metric
**Type:** Positive
**Covers:** 1.3 → Filtering and metric
**Preconditions:** A leaderboard exists with connected students.
**Steps:**
1. Enable filtering by friends/connections and verify the filtered view.
2. Set the metric (points, streak, accuracy) and verify ranking by metric.
**Expected Result:** Filtering by friends/connections and metric — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-3-004 — Rule: opt-in shows name only with consent
**Type:** Negative
**Covers:** 1.3 → Rule: consent enforcement
**Preconditions:** A leaderboard is in opt-in mode; a student has not consented.
**Steps:**
1. View the leaderboard as another student.
2. Verify the non-consenting student appears anonymously.
**Expected Result:** In opt-in display mode, a student's name is shown only with their consent — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-3-005 — Rule: period rollover resets period leaderboard
**Type:** Edge
**Covers:** 1.3 → Rule: period rollover
**Preconditions:** A weekly leaderboard has entries.
**Steps:**
1. Let the week roll over.
2. Verify the weekly leaderboard resets and the all-time leaderboard remains cumulative.
**Expected Result:** Period rollover resets the period leaderboard; all-time is cumulative — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-3-006 — Audit logging of leaderboard settings
**Type:** Positive
**Covers:** 1.3 → Audit logging
**Preconditions:** Leaderboard configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by leaderboard settings.
2. Verify entries show the leaderboard, the change, and the timestamp.
**Expected Result:** Audit logging of leaderboard settings — delivered exactly as documented.
**Priority:** Critical

## 1.4 Challenges & Competitions Management

### TC-SA-SL-4-001 — Challenge creation (title, type, duration)
**Type:** Positive
**Covers:** 1.4 → Challenge creation
**Preconditions:** A Super Admin account is active.
**Steps:**
1. As a Super Admin, create a challenge: title, type (weekly subject, quiz competition, group, seasonal), duration.
2. Verify the challenge is saved with all fields.
**Expected Result:** Challenge creation — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-4-002 — Entry rules and scoring rules
**Type:** Positive
**Covers:** 1.4 → Entry and scoring rules
**Preconditions:** A challenge is created.
**Steps:**
1. Set the entry rules (eligibility, max entries) and scoring rules (points, accuracy, speed).
2. Verify entries and scoring behave per the rules.
**Expected Result:** Entry rules and scoring rules — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-4-003 — Prize/reward configuration
**Type:** Positive
**Covers:** 1.4 → Prize/reward configuration
**Preconditions:** A challenge is created.
**Steps:**
1. Configure the prizes/rewards (certificates, merchandise, points).
2. Verify the rewards are attached to the challenge.
**Expected Result:** Prize/reward configuration — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-4-004 — Challenge lifecycle (draft → active → completed)
**Type:** Positive
**Covers:** 1.4 → Challenge lifecycle
**Preconditions:** A challenge is in draft.
**Steps:**
1. Publish the challenge (draft → active) and verify it accepts entries.
2. Let it complete and verify the completed state.
**Expected Result:** Challenge lifecycle — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-4-005 — Rule: draft challenge not visible to students
**Type:** Negative
**Covers:** 1.4 → Rule: draft visibility
**Preconditions:** A challenge is in draft.
**Steps:**
1. View the challenges list as a student.
2. Verify the draft challenge is not visible.
**Expected Result:** A challenge in draft is not visible to students — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-4-006 — Rule: winner determination and reward issuance recorded
**Type:** Negative
**Covers:** 1.4 → Rule: winners and rewards
**Preconditions:** A challenge has completed with entries.
**Steps:**
1. Verify the platform determines the winners using the scoring rules.
2. Issue the rewards and verify the issuance is recorded; verify an unissued reward is flagged.
**Expected Result:** Winner determination uses the scoring rules and reward issuance is recorded — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-4-007 — Audit logging of challenges & competitions
**Type:** Positive
**Covers:** 1.4 → Audit logging
**Preconditions:** Challenge actions have been performed.
**Steps:**
1. Open the audit trail and filter by challenges & competitions.
2. Verify entries show the challenge, the action, and the timestamp.
**Expected Result:** Audit logging of challenges & competitions — delivered exactly as documented.
**Priority:** Critical
