Skip to main content

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

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:
1

Validate Amount

Ensure points to award is a positive number
2

Start Transaction

Begin database transaction for atomicity
3

Record in Ledger

Insert permanent record of the transaction
4

Update Balance

Update current balance and total earned
5

Commit

Commit transaction if all steps succeed
6

Rollback on Error

Undo all changes if any step fails

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:
Example response:

Integration with Rewards

Points can be saved toward specific rewards (see Rewards System):
1

Earn Points

Learner completes lessons and quizzes to earn points
2

Delegate to Goal

Learner chooses a reward and delegates points from general balance to that goal
3

Request Redemption

When goal is reached, learner requests the reward
4

Parent Approval

Parent approves or rejects the redemption
5

Points Reset

On approval, saved points reset to 0 (reward is repeatable)

Double-or-Loss Mode

An optional high-stakes mode for advanced learners:
Double-or-Loss Mode is a special feature where:
  • Correct answers earn 2x points
  • Wrong answers deduct 1 point from balance
  • Balance never goes below 0
This mode should only be enabled for learners who are comfortable with the added pressure.

Typical Point Values

  • 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 type

Enable Double-or-Loss

Turn on high-stakes mode per learner

Create Rewards

Define point costs for real-world rewards

Rewards System

How learners redeem points for rewards

Achievements

Special milestone bonuses

Reports

Visual analytics of point earning patterns