Skip to main content

Overview

The mastery system calculates how well a learner understands each concept based on quiz performance. Mastery levels range from 0-100% and determine when concepts need reinforcement.

Mastery Calculation

Formula

Mastery level is calculated as a simple percentage:
Mastery Level = (Correct Answers / Total Attempts) × 100This is rounded to the nearest integer for storage.

Example Calculations

Concept: Addition
  • Correct: 18
  • Total: 20
  • Mastery: 90%
✅ Above threshold (70%) — concept mastered

Mastery Threshold

Concepts are considered “mastered” at 70% or higher accuracy.

Threshold Rationale

70% is chosen as a balance between:
  • Too Low (e.g., 50%): Learner may have significant gaps
  • Too High (e.g., 90%): Unrealistic expectation, may discourage learners
70% indicates solid understanding while allowing room for growth.

Updating Mastery

Mastery is updated after each quiz question:
1

Question Answered

Quiz answer is submitted with concept tags
2

Check Existing Mastery

Look for existing mastery record for this learner + concept + subject
3

Update or Create

If exists, update counts and recalculate masteryIf new, create record with 100% (correct) or 0% (wrong)
4

Flag for Reinforcement

Set needs_reinforcement = true if mastery < 70%
5

Update Timestamp

Record when the concept was last tested

Bulk Updates from Quiz

After a full quiz, update mastery for all concepts at once:

Retrieving Learner Mastery

Get All Mastery Records

Get Concepts Needing Reinforcement

Results are sorted by:
  1. Lowest mastery level first (most struggling)
  2. Oldest last_tested first (hasn’t practiced recently)
This prioritizes concepts that are both low-performing and haven’t been reviewed recently.

Mastery Summary

Get an overview of all mastery data for a learner:
Example response:

Mastery Decay (Future Enhancement)

Not yet implemented — but planned for future releases.
Mastery decay will reduce mastery levels over time if concepts aren’t practiced:

Planned Decay Algorithm

1

Calculate Days Since Last Test

daysSince = (NOW - last_tested) / 86400
2

Calculate Decay Amount

decay = daysSince * decayRate
3

Apply Decay

newMastery = max(decayThreshold, currentMastery - decay)
4

Update Record

Save new mastery level and set needs_reinforcement if below threshold

Example Decay Scenario

  • Concept: Multiplication
  • Current Mastery: 85%
  • Last Tested: 30 days ago
  • Decay: 30 days × 0.5% = 15%
  • New Mastery: 85% - 15% = 70%

Spaced Repetition (Future Enhancement)

Planned integration with spaced repetition algorithm:
Concepts are grouped into “boxes” based on mastery:
  • Box 1 (0-40%): Review daily
  • Box 2 (41-60%): Review every 3 days
  • Box 3 (61-80%): Review weekly
  • Box 4 (81-100%): Review monthly
When a concept is answered correctly, it moves up a box. When wrong, it moves down.
More sophisticated algorithm that calculates optimal review intervals based on:
  • Number of repetitions
  • Ease factor (how easy the concept is for this learner)
  • Time since last review
  • Answer quality
Interval = previous_interval × ease_factor

Data Structure

Visual Mastery Indicators

🔴 Red — Priority for immediate practice

Best Practices

Regular Practice

Concepts should be tested regularly, ideally every few days, to maintain mastery and provide accurate data.

Balanced Coverage

Ensure learners practice both new concepts and review older ones to prevent mastery decay.

Celebrate Milestones

When a concept crosses 70% threshold, celebrate! When it reaches 90%, extra recognition.

Address Struggles Early

Concepts below 50% should get immediate attention before gaps widen.

API Examples

Check Mastery for a Concept

Get Top Priority Concepts

Generate Mastery Report

Concept Tracking

How concepts are identified and tracked

Adaptive Learning

Using mastery data for personalized content

Reports

Visual mastery analytics for parents