Creates a new ExerciseUsageService instance
Initialized Prisma client for database operations
Retrieves comprehensive usage statistics for a specific exercise.
Provides detailed information about which lessons use the exercise, including the complete hierarchical context (course → level → section → module → lesson). Calculates usage frequency and tracks when the exercise was last used.
The unique exercise identifier
Promise resolving to comprehensive usage statistics
Analyzes the impact of deleting an exercise on the content system.
Provides comprehensive analysis of what would be affected if the exercise is deleted, including warnings about lessons that would lose content and recommendations for content creators.
The unique exercise identifier
Promise resolving to impact analysis
Creates a duplicate of an existing exercise with optional modifications.
Allows content creators to create variations of existing exercises by duplicating the exercise data and applying modifications. Useful for creating difficulty variations or similar exercises with different content.
The unique identifier of the exercise to duplicate
Duplication configuration options
Promise resolving to the created duplicate exercise
Retrieves comprehensive analytics for a specific exercise.
Provides detailed analytics including usage statistics, performance metrics, and usage trends over time. Useful for content creators to understand how their exercises are being used and performing.
The unique exercise identifier
Promise resolving to comprehensive analytics
Retrieves usage statistics for multiple exercises in batch.
Efficiently retrieves usage statistics for multiple exercises at once, useful for dashboard views and bulk operations.
Array of exercise identifiers
Promise resolving to array of usage statistics
Service class for comprehensive exercise usage tracking and management operations.
Provides complete functionality for exercise usage analytics, cascade delete impact analysis, exercise duplication, and performance metrics collection. Handles complex business logic including usage frequency calculation, lesson assignment tracking, and exercise variation management.