import { analytics } from '../lib/analytics'; interface StoryGeneratedProps { story_id: string; theme: string; prompt: string; generation_time: number; word_count: number; student_id: string; class_id?: string; school_id?: string; } interface AudioRecordedProps { story_id: string; duration: number; file_size: number; student_id: string; page_number: number; device_type: string; recording_quality: string; } interface ExerciseCompletedProps { exercise_id: string; story_id: string; student_id: string; exercise_type: 'completion' | 'pronunciation' | 'word_formation'; score: number; time_spent: number; answers_correct?: number; answers_total?: number; words_attempted?: number; words_correct?: number; pronunciation_score?: number; fluency_score?: number; words_formed?: number; difficulty_level: string; } interface InterestActionProps { student_id: string; category: string; item: string; total_interests: number; interests_in_category: number; } export function useStudentTracking() { const trackStoryGenerated = (properties: StoryGeneratedProps) => { analytics.track('story_generated', { ...properties, }); }; const trackAudioRecorded = (properties: AudioRecordedProps) => { analytics.track('audio_recorded', { ...properties, }); }; const trackExerciseCompleted = (properties: ExerciseCompletedProps) => { analytics.track('exercise_completed', { ...properties, }); }; const trackInterestAdded = (properties: InterestActionProps) => { analytics.track('interest_added', { ...properties, }); }; const trackInterestRemoved = (properties: InterestActionProps) => { analytics.track('interest_removed', { ...properties, }); }; return { trackStoryGenerated, trackAudioRecorded, trackExerciseCompleted, trackInterestAdded, trackInterestRemoved }; }