Overview
Sunschool uses a comprehensive points economy to motivate and reward learners. Points are earned through learning activities and can be saved toward parent-defined rewards.Point Sources
Learners earn points from multiple sources:Quiz Questions
Points per correct answer
Lesson Completion
Bonus for finishing lessons
Achievements
Special milestone rewards
Points Ledger
Every point transaction is recorded in a permanent ledger:Ledger Fields
| Field | Type | Description |
|---|---|---|
learner_id | integer | Who earned/spent the points |
amount | integer | Points earned (positive) or spent (negative) |
source_type | enum | Type of transaction |
source_id | string | Reference to lesson, achievement, etc. |
description | text | Human-readable description |
created_at | timestamp | When the transaction occurred |
The ledger provides a complete audit trail of all point transactions. Parents can review the full history to understand how points were earned.
Awarding Points
The service ensures transactional integrity when awarding points:Balance Tracking
Each learner has three balance metrics:Getting Current Balance
If a learner has never earned points,
getBalance() returns 0 rather than throwing an error.Transaction History
Parents and learners can view recent point transactions:Integration with Rewards
Points can be saved toward specific rewards (see Rewards System):Double-or-Loss Mode
An optional high-stakes mode for advanced learners:Typical Point Values
- Quiz Answers
- Lessons
- Achievements
- Correct answer: 5-10 points (configurable)
- Double-or-loss correct: 10-20 points (2x)
- Double-or-loss wrong: -1 point
API Examples
Award Points
Check Balance
View History
Parent Controls
Parents can:View Full History
See every point transaction with timestamps and descriptions
Manual Adjustments
Award or deduct points with
ADMIN_ADJUST source typeEnable Double-or-Loss
Turn on high-stakes mode per learner
Create Rewards
Define point costs for real-world rewards
Related Features
Rewards System
How learners redeem points for rewards
Achievements
Special milestone bonuses
Reports
Visual analytics of point earning patterns