Skip to main content

Achievement System Overview

Sunschool rewards learners with achievements (also called “trophies” or “badges”) for reaching milestones and demonstrating excellence. Achievements provide motivation and celebrate progress.

Types of Achievements

Achievements are awarded automatically when learners meet specific criteria.

Milestone Achievements

First Steps

FIRST_LESSONEarned after completing your very first lesson. Celebrates the beginning of the learning journey.

Learning Explorer

FIVE_LESSONSAwarded when a learner completes 5 total lessons. Shows commitment to learning.

Perfect Score!

PERFECT_SCOREGiven when a learner gets 100% on any quiz. Recognizes excellence and mastery.

Perfect Score Achievement

Perfect Score achievements can be earned multiple times - once for each quiz where the learner answers every question correctly.

Achievement Database Schema

Achievement Fields

How to Earn Badges

Achievements are checked and awarded automatically after quiz completion:

Earning Flow

1

Complete a Lesson

Learner reads through all sections of a lesson
2

Take the Quiz

Submit answers to all quiz questions
3

Server Checks Criteria

Backend runs checkForAchievements() function
4

Achievements Awarded

Matching achievements are created in the database
5

Notification Shown

Learner sees achievement unlock animation

Achievement Notifications

When achievements are earned, learners see an exciting unlock animation.

Unlock Modal

Notification Timing

Achievement notifications appear 1.5 seconds after quiz results, giving learners time to see their score first.

Visual Presentation

Viewing Trophy Collection

Learners can view all their earned achievements from the dashboard.

Recent Achievements Display

Achievement Cards

Display Features

  • Shows 3 most recent achievements
  • Horizontal scroll for easy browsing
  • “See All” link to full collection
  • Empty state with encouragement if none yet

Achievement API Endpoints

Get Achievements

Authorization checks:
  • Learners can view their own achievements
  • Parents can view their children’s achievements
  • Admins can view all achievements

Parent View

Parents can see all achievements their children have earned:
Parents see:
  • Total achievement count in learner reports
  • Full achievement list with dates earned
  • Achievement types and descriptions
  • Progress over time

Next Steps

Earn Points

Learn how achievements connect to the rewards system

Track Progress

See how achievements reflect learning progress