All files / web/src/lib/curriculum/config session-timing.ts

100% Statements 58/58
100% Branches 0/0
100% Functions 0/0
100% Lines 58/58

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 592x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x  
/**
 * Session Timing Configuration
 *
 * Controls timing-related parameters for practice sessions.
 * Adjust these to tune pacing and session management.
 */
 
/**
 * Default seconds per problem if no student history exists.
 * Used for initial session planning before we have timing data.
 */
export const DEFAULT_SECONDS_PER_PROBLEM = 45
 
/**
 * Minimum seconds per problem for session planning.
 *
 * Even if a student's historical average is faster, we clamp to this minimum
 * to prevent generating an excessive number of problems. This guards against:
 * - Data anomalies (e.g., session timing bugs)
 * - Students who rush through problems without learning
 * - Unrealistic session lengths that overwhelm students
 *
 * A 5-minute session with 10 sec/problem = 30 problems (reasonable)
 * A 5-minute session with 2 sec/problem = 150 problems (too many!)
 */
export const MIN_SECONDS_PER_PROBLEM = 10
 
/**
 * Maximum seconds per problem for session planning (sanity ceiling).
 *
 * The robust pace estimator (`timing/pace-estimation.ts`) clamps its output to
 * this ceiling so a right-skewed history — or a residual outlier that slipped
 * past Tier-1 quarantine — can never balloon a student's expected per-problem
 * time and shrink sessions to a couple of problems. Mirrors the 120s
 * convention already used in `skill-metrics.ts`.
 */
export const MAX_SECONDS_PER_PROBLEM = 120
 
/**
 * How long before an inactive session is auto-abandoned (hours).
 * Sessions older than this are cleaned up when the student returns.
 */
export const SESSION_TIMEOUT_HOURS = 24
 
/**
 * Spaced repetition intervals for skill review.
 *
 * - mastered: How often to revisit mastered skills (days)
 * - practicing: How often to revisit skills being learned (days)
 */
export const REVIEW_INTERVAL_DAYS = {
  /** Days between reviews for mastered skills */
  mastered: 7,
  /** Days between reviews for skills still being practiced */
  practicing: 3,
} as const
 
export type ReviewIntervalDays = typeof REVIEW_INTERVAL_DAYS