Skip to main content

Overview

Sunschool’s adaptive learning system analyzes learner performance in real-time and adjusts content difficulty, recommends subjects, and identifies areas needing reinforcement.

Performance Tracking

Subject-Level Performance

The system tracks performance across all subjects:
// From server/services/subject-recommendation.ts:157
export function updateSubjectPerformance(
  profile: LearnerProfile,
  lesson: Lesson
): Record<string, any> {
  const performances = profile.subjectPerformance || {};
  const current = performances[lesson.subject] || {
    score: 0,
    lessonCount: 0,
    lastAttempted: new Date().toISOString(),
    masteryLevel: 'beginner'
  };
  
  // Calculate new average score
  const newLessonCount = current.lessonCount + 1;
  const newScore = Math.round(
    (current.score * current.lessonCount + lesson.score) / newLessonCount
  );
  
  // Determine mastery level
  let masteryLevel = 'beginner';
  if (newScore >= 85 && newLessonCount >= 5) {
    masteryLevel = 'advanced';
  } else if (newScore >= 70 && newLessonCount >= 3) {
    masteryLevel = 'intermediate';
  }
  
  performances[lesson.subject] = {
    score: newScore,
    lessonCount: newLessonCount,
    lastAttempted: new Date().toISOString(),
    masteryLevel
  };
  
  return performances;
}

Mastery Levels

1

Beginner

Less than 70% average or fewer than 3 lessons completed
2

Intermediate

70-84% average with at least 3 lessons completed
3

Advanced

85%+ average with at least 5 lessons completed

Identifying Struggling Areas

The system automatically detects subjects where learners need additional support:
// From server/services/subject-recommendation.ts:84
export function identifyStrugglingAreas(lessonHistory: Lesson[]): string[] {
  const subjectScores: Record<string, { total: number, count: number }> = {};
  
  // Only consider completed lessons with scores
  const completedLessons = lessonHistory.filter(
    lesson => lesson.status === 'DONE' && lesson.score !== null
  );
  
  // Group scores by subject
  for (const lesson of completedLessons) {
    if (!lesson.subject || lesson.score === null) continue;
    
    if (!subjectScores[lesson.subject]) {
      subjectScores[lesson.subject] = { total: 0, count: 0 };
    }
    
    subjectScores[lesson.subject].total += lesson.score;
    subjectScores[lesson.subject].count += 1;
  }
  
  // Find subjects with average score below 70%
  const strugglingSubjects = Object.entries(subjectScores)
    .filter(([_, stats]) => (stats.total / stats.count) < 70)
    .map(([subject, _]) => subject);
  
  return strugglingSubjects;
}
A subject is marked as “struggling” when the learner’s average score falls below 70%. This triggers additional practice recommendations.

Subject Recommendations

Grade-Appropriate Subjects

Each grade level has a curated list of appropriate subjects:
// From server/services/subject-recommendation.ts:4
export const gradeSubjects: Record<number, string[]> = {
  0: ['Alphabet', 'Numbers', 'Colors', 'Shapes', 'Basic Vocabulary', 'Social Skills'],
  1: ['Reading', 'Writing', 'Basic Math', 'Science', 'Art', 'Social Studies'],
  2: ['Reading', 'Writing', 'Math', 'Science', 'Art', 'Social Studies', 'Health'],
  3: ['Reading', 'Writing', 'Math', 'Science', 'Social Studies', 'Art', 'Health', 'Geography'],
  4: ['Reading', 'Writing', 'Math', 'Science', 'Social Studies', 'Geography', 'Art', 'Music'],
  5: ['Reading', 'Literature', 'Writing', 'Math', 'Science', 'History', 'Geography', 'Art'],
  6: ['Literature', 'Writing', 'Pre-Algebra', 'Earth Science', 'World History', 'Geography'],
  7: ['Literature', 'Writing', 'Algebra', 'Life Science', 'History', 'Geography', 'Foreign Language'],
  8: ['Literature', 'Writing', 'Algebra', 'Physical Science', 'History', 'Civics', 'Foreign Language'],
  9: ['Literature', 'Composition', 'Geometry', 'Biology', 'World History', 'Foreign Language'],
  10: ['Literature', 'Composition', 'Algebra II', 'Chemistry', 'History', 'Foreign Language'],
  11: ['American Literature', 'Composition', 'Precalculus', 'Physics', 'US History'],
  12: ['British Literature', 'Research Writing', 'Calculus', 'Advanced Science', 'Government']
};

Recommendation Algorithm

The system recommends new subjects based on multiple factors:
// From server/services/subject-recommendation.ts:119
export function recommendSubjects(
  profile: LearnerProfile,
  lessonHistory: Lesson[]
): string[] {
  // Get appropriate subjects for the grade level
  const gradeAppropriate = getSubjectsForGradeLevel(profile.gradeLevel);
  
  // Get subjects the learner is currently using
  const currentSubjects = profile.subjects || [];
  
  // Get subjects the learner is struggling with
  const strugglingSubjects = identifyStrugglingAreas(lessonHistory);
  
  // Find subjects that are appropriate but not yet assigned
  const potentialNewSubjects = gradeAppropriate.filter(
    subject => !currentSubjects.includes(subject)
  );
  
  // Recommend up to 3 new subjects
  const recommendations = potentialNewSubjects.slice(0, 3);
  
  // Add struggling subjects to work on if there's room
  for (const subject of strugglingSubjects) {
    if (recommendations.length < 3 && !recommendations.includes(subject)) {
      recommendations.push(subject);
    }
  }
  
  return recommendations;
}

Subject Categories

Subjects are organized into broader categories for better organization:

Language Arts

Reading, Writing, Literature, Composition, Alphabet, Basic Vocabulary

Mathematics

Numbers, Basic Math, Pre-Algebra, Algebra, Geometry, Calculus

Science

Earth Science, Life Science, Physical Science, Biology, Chemistry, Physics

Social Studies

History, World History, US History, Government, Economics, Geography

Arts

Art, Music, Drama, Painting, Drawing

Life Skills

Health, Physical Education, Social Skills, Financial Literacy

World Languages

Spanish, French, German, Mandarin, Latin

Technology

Computer Science, Programming, Digital Media, Robotics

Difficulty Adjustment

Lessons can be generated at three difficulty levels:
  • Simplified vocabulary
  • Concrete examples
  • Step-by-step explanations
  • More practice problems

Personalized Learning Paths

The adaptive system creates personalized learning paths by:
1

Analyze Performance

Review all completed lessons and quiz scores
2

Identify Gaps

Detect concepts and subjects below mastery threshold
3

Recommend Content

Suggest new lessons in struggling areas and new grade-appropriate subjects
4

Adjust Difficulty

Automatically set difficulty level based on recent performance
5

Track Progress

Continuously monitor and update mastery levels

Performance Metrics

The system tracks multiple metrics for adaptation:
MetricPurposeThreshold
Average ScoreOverall subject mastery70% for proficiency
Lesson CountExperience level3+ for intermediate, 5+ for advanced
Recent TrendCurrent trajectoryLast 5 lessons
Concept MasterySpecific skill tracking70% per concept
Time to CompleteEngagement indicatorCompared to grade average

Integration with Other Features

Best Practices for Parents

Check the reports page regularly to see which subjects need additional support. The system automatically identifies these, but parent involvement helps.
Learners should experience both challenge and success. If scores are consistently too high (>95%) or too low (<60%), consider adjusting the subject selection.
The system’s subject recommendations are based on grade-level standards and performance data. Following them helps maintain a balanced curriculum.
Use the mastery level progression (Beginner → Intermediate → Advanced) to celebrate milestones.