Overview
Sunschool’s achievement system recognizes learner milestones with special badges and bonus points. Achievements celebrate progress and motivate continued learning.Achievement Types
The system currently tracks several achievement types:Available Achievements
First Steps
Trigger: Complete your very first lessonIcon: awardPoints: 100 bonus points
Learning Explorer
Trigger: Complete 5 lessonsIcon: book-openPoints: 250 bonus points
Perfect Score
Trigger: Get 100% on any quizIcon: starPoints: 50 bonus pointsNote: Repeatable - earned each time you get a perfect score
Achievement Checking Logic
Achievements are checked automatically after lesson completion:First Steps Achievement
This achievement triggers only when the count of completed lessons (
status === "DONE") equals exactly 1.Learning Explorer Achievement
Perfect Score Achievement
Achievement Structure
Each achievement follows this structure:Example Achievement Data
One-Time vs. Repeatable
- One-Time Achievements
- Repeatable Achievements
These achievements can only be earned once:
- First Steps: First lesson completed
- Learning Explorer: 5 lessons completed
=== 1, === 5) to ensure they only trigger once.Token Rewards
When an achievement is unlocked, bonus points are awarded:| Achievement | Points | Type |
|---|---|---|
| First Steps | 100 | One-time |
| Learning Explorer | 250 | One-time |
| Perfect Score | 50 | Repeatable |
Achievement points are awarded through the Points System with source type
ACHIEVEMENT.Visual Presentation
When achievements are earned, they’re displayed with:- Confetti Animation: Celebratory visual effect
- Badge Display: Icon, title, and description
- Point Award Notification: Shows bonus points earned
- Sound Effect (optional): Audio feedback
AchievementBadge Component
The UI displays achievements using a dedicated component:AchievementUnlock Animation
When unlocked, achievements display with:Checking for Achievements
Achievements are checked after lesson completion:Achievement History
All earned achievements are stored in the learner’s profile:Querying Achievements
To get a learner’s achievements:Future Achievement Ideas
Lesson Streak
Lesson Streak
Complete lessons on consecutive days
- 3 day streak: 75 points
- 7 day streak: 200 points
- 30 day streak: 1000 points
Subject Master
Subject Master
Reach “Advanced” mastery level in any subject
- One subject: 150 points
- Three subjects: 500 points
- Five subjects: 1200 points
Quiz Champion
Quiz Champion
Perfect scores in a row
- 3 perfect scores: 100 points
- 5 perfect scores: 250 points
- 10 perfect scores: 750 points
Knowledge Builder
Knowledge Builder
Master a certain number of concepts
- 10 concepts: 100 points
- 25 concepts: 300 points
- 50 concepts: 750 points
Rapid Learner
Rapid Learner
Complete lessons quickly without sacrificing accuracy
- First fast completion: 100 points
- 5 fast completions: 300 points
Implementation Example
Here’s how to add a new achievement:Best Practices
Clear Criteria
Achievement requirements should be crystal clear and easy to verify
Attainable Goals
Balance challenge with achievability — make milestones motivating, not discouraging
Progressive Difficulty
Start with easy achievements, then introduce harder ones
Meaningful Rewards
Point rewards should reflect the difficulty and importance of the achievement
Parent Dashboard
Parents can view all achievements their learner has earned:- Achievement Gallery: Visual display of all earned badges
- Progress Tracking: Shows which milestones are close to unlocking
- Timeline: When each achievement was earned
- Point Breakdown: How much each achievement contributed