# 1. Gamification Configuration

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

---

## 1. Gamification Configuration

### 1.1 Point System Rules
**What it does:** Defines the point system: the point values for each earning action (watching videos, completing assessments, daily login streaks, study consistency, helping peers), point expiry, and point display rules.

**Sub-features:**
- Point value per earning action (video watched, assessment completed, daily login streak, study consistency, peer help)
- Bonus point rules (assessment bonus, streak bonus)
- Point expiry policy (rolling period or none)
- Point display rules (visible to self, visible to others)
- Point ledger per student (earnings, expiries, balance)
- Available on web
- Event logging (action performed)
- Audit logging of point system configuration

**Super Admin User Journey:**
1. Super Admin opens Gamification → Point System and sets the point value for each earning action.
2. Defines the bonus point rules (assessment bonus, streak bonus).
3. Sets the point expiry policy and the point display rules.
4. Saves; the rules apply to all subsequent point-earning events.
5. Reviews a student's point ledger: earnings, expiries, balance.
6. Each configuration change is event-logged and audit-logged.

**Rules & Edge Cases:**
- Point values are applied at the time of the earning event; a later rule change does not retroactively revalue past events.
- A point expiry removes points after the rolling period; the expiry is recorded in the ledger.
- Configuration changes are audit-logged with the rule, the change, and the timestamp.

### 1.2 Badge & Achievement Definitions
**What it does:** Defines badges and achievements: subject mastery badges, streak milestones (7, 30, 100 days), challenge completion badges, top performer recognition, and special seasonal badges, with the criteria and unlock conditions for each.

**Sub-features:**
- Badge creation: name, icon, description, criteria
- Badge categories: subject mastery, streak milestones, challenge completion, top performer, seasonal
- Unlock conditions (metric thresholds, time windows)
- Badge visibility (self, class, public)
- Badge revocation (for criteria no longer met or misconduct)
- Available on web
- Event logging (action performed)
- Audit logging of badge definitions

**Super Admin User Journey:**
1. Super Admin opens Gamification → Badges & Achievements and creates a badge: name, icon, description, criteria.
2. Assigns the badge to a category (subject mastery, streak, challenge, top performer, seasonal).
3. Defines the unlock conditions and visibility.
4. Publishes the badge; it unlocks for students meeting the criteria.
5. For a badge that must be withdrawn, Super Admin revokes it with a reason.
6. Each badge action is event-logged and audit-logged.

**Rules & Edge Cases:**
- A badge unlocks only when all of its criteria are met; partial criteria do not unlock it.
- A revoked badge is removed from the student's profile with the reason recorded.
- Streak milestone badges (7, 30, 100 days) unlock at the exact milestone, not before.
- Badge actions are audit-logged with the badge, the action, and the timestamp.

### 1.3 Leaderboard Settings
**What it does:** Configures leaderboards: class/grade level rankings, subject-specific leaderboards, weekly/monthly/all-time periods, anonymous or opt-in display, and filtering by friends/connections.

**Sub-features:**
- Leaderboard scope: class, grade, subject
- Period: weekly, monthly, all-time
- Display mode: anonymous or opt-in (name shown only with consent)
- Filtering by friends/connections
- Leaderboard metric (points, streak, accuracy)
- School Admin dependency flag (leaderboards enabled per school policy)
- Available on web
- Event logging (action performed)
- Audit logging of leaderboard settings

**Super Admin User Journey:**
1. Super Admin opens Gamification → Leaderboards and creates a leaderboard: scope (class/grade/subject), period, metric.
2. Sets the display mode (anonymous or opt-in) and the friends/connections filtering.
3. Sets the School Admin dependency flag where the leaderboard is school-policy dependent.
4. Saves; the leaderboard is computed and displayed per the settings.
5. Reviews the leaderboards list: scope, period, active status.
6. Each configuration change is event-logged and audit-logged.

**Rules & Edge Cases:**
- In opt-in display mode, a student's name is shown only with their consent; otherwise they appear anonymously.
- A leaderboard with the School Admin dependency flag is only active where the school policy enables it.
- Period rollover (weekly/monthly) resets the period leaderboard; all-time is cumulative.
- Configuration changes are audit-logged with the leaderboard, the change, and the timestamp.

### 1.4 Challenges & Competitions Management
**What it does:** Manages challenges and competitions: weekly subject challenges, quiz competitions with prizes, collaborative group challenges, seasonal tournaments, and real-world rewards (certificates, merchandise).

**Sub-features:**
- Challenge creation: title, type (weekly subject, quiz competition, group, seasonal), duration
- Entry rules (eligibility, max entries)
- Scoring rules (points, accuracy, speed)
- Prize/reward configuration (certificates, merchandise, points)
- Challenge lifecycle: draft → active → completed
- Winner determination and reward issuance
- Available on web
- Event logging (action performed)
- Audit logging of challenges & competitions

**Super Admin User Journey:**
1. Super Admin opens Gamification → Challenges & Competitions and creates a challenge: title, type, duration.
2. Sets the entry rules and scoring rules.
3. Configures the prizes/rewards (certificates, merchandise, points).
4. Publishes the challenge (draft → active); students enter per the rules.
5. On completion, the platform determines the winners; Super Admin issues the rewards.
6. Reviews the challenges list: status, entries, winners, rewards issued.
7. Each challenge action is event-logged and audit-logged.

**Rules & Edge Cases:**
- A challenge in draft is not visible to students; only active challenges accept entries.
- Entry rules are enforced: ineligible students cannot enter; max entries are capped.
- Winner determination uses the defined scoring rules; ties are handled per the documented tie-break.
- Reward issuance is recorded; an unissued reward is flagged.
- Challenge actions are audit-logged with the challenge, the action, and the timestamp.
