/** * Mastery Estimation Engine * * Unified engine for estimating and tracking learner mastery. * Combines multiple evidence sources: * - Bayesian Knowledge Tracing (BKT) for skill-level mastery * - Item Response Theory (IRT) for ability estimation * - Response patterns for confidence calibration * - Time-based decay for forgetting * * @packageDocumentation */ import type { SkillId } from '../types/skill.js'; import type { BKTParameters, BKTState, IRTParameters, LearningEvidence, EvidenceSource, EvidenceSummary, MasteryState, ResponseRecord } from '../types/index.js'; /** * Mastery engine configuration */ export interface MasteryEngineConfig { /** Use BKT for skill-level tracking */ useBKT?: boolean; /** Use IRT for ability estimation */ useIRT?: boolean; /** Apply time-based forgetting */ applyForgetting?: boolean; /** Forgetting rate (per day) */ forgettingRate?: number; /** Mastery threshold */ masteryThreshold?: number; /** BKT parameters */ bktParams?: BKTParameters; /** Weights for evidence sources */ evidenceWeights?: Partial>; } /** * Default engine configuration */ export declare const MASTERY_ENGINE_DEFAULTS: Required; /** * Mastery update event */ export interface MasteryUpdate { /** Skill ID */ skillId: SkillId; /** Previous mastery level */ previousMastery: number; /** New mastery level */ newMastery: number; /** Change in mastery */ delta: number; /** Update reason */ reason: 'response' | 'evidence' | 'decay' | 'reset'; /** Timestamp */ timestamp: Date; } /** * Learner profile for the mastery engine */ export interface LearnerMasteryProfile { /** Learner identifier */ learnerId: string; /** BKT states per skill */ bktStates: Map; /** Mastery levels per skill */ masteryLevels: Map; /** IRT ability estimate */ abilityEstimate?: number; /** Evidence by skill */ evidence: Map; /** Response history */ responseHistory: ResponseRecord[]; /** Last activity timestamp */ lastActivity: Date; /** Update history */ updateHistory: MasteryUpdate[]; } /** * Mastery Estimation Engine * * Provides a unified interface for tracking learner mastery across skills. * * @example * ```typescript * const engine = new MasteryEngine(); * * // Initialize a learner profile * const profile = engine.createProfile('learner-1'); * * // Record a response * const updated = engine.recordResponse(profile, 'skill-1', true); * console.log(`Mastery: ${engine.getMastery(updated, 'skill-1')}`); * * // Check if skill is mastered * console.log(`Mastered: ${engine.isMastered(updated, 'skill-1')}`); * ``` */ export declare class MasteryEngine { private readonly config; private readonly bktEngine; private readonly irtEstimator; constructor(config?: MasteryEngineConfig); /** * Create a new learner profile */ createProfile(learnerId: string): LearnerMasteryProfile; /** * Get or initialize BKT state for a skill */ private getOrCreateBKTState; /** * Record a learner response and update mastery */ recordResponse(profile: LearnerMasteryProfile, skillId: SkillId, correct: boolean, responseTime?: number, itemParams?: IRTParameters): LearnerMasteryProfile; /** * Record multiple responses at once */ recordResponses(profile: LearnerMasteryProfile, responses: Array<{ skillId: SkillId; correct: boolean; responseTime?: number; }>): LearnerMasteryProfile; /** * Add learning evidence */ addEvidence(profile: LearnerMasteryProfile, evidence: LearningEvidence): LearnerMasteryProfile; /** * Get current mastery level for a skill */ getMastery(profile: LearnerMasteryProfile, skillId: SkillId): number; /** * Get mastery for multiple skills */ getMasteryMap(profile: LearnerMasteryProfile, skillIds: SkillId[]): Map; /** * Check if a skill is mastered */ isMastered(profile: LearnerMasteryProfile, skillId: SkillId): boolean; /** * Get skills that are mastered */ getMasteredSkills(profile: LearnerMasteryProfile): SkillId[]; /** * Calculate mastery combining all evidence sources */ private calculateMastery; /** * Apply time-based forgetting */ private applyForgetting; /** * Update IRT ability estimate */ private updateAbility; /** * Reset mastery for a skill */ resetMastery(profile: LearnerMasteryProfile, skillId: SkillId): LearnerMasteryProfile; /** * Get evidence summary for a skill */ getEvidenceSummary(profile: LearnerMasteryProfile, skillId: SkillId): EvidenceSummary | null; /** * Predict probability of correct response */ predictCorrect(profile: LearnerMasteryProfile, skillId: SkillId): number; /** * Estimate opportunities until mastery */ estimateOpportunitiesToMastery(profile: LearnerMasteryProfile, skillId: SkillId): number | null; /** * Convert profile to MasteryState map for integration */ toMasteryStates(profile: LearnerMasteryProfile, skillIds?: SkillId[]): Map; } /** * Create a mastery engine with default configuration */ export declare function createMasteryEngine(config?: MasteryEngineConfig): MasteryEngine; //# sourceMappingURL=mastery-engine.d.ts.map