/**
 * ExerciseModuleInterface - Standard interface for all exercise modules
 * All exercise modules must implement these methods
 */

class ExerciseModuleInterface {
    /**
     * Check if module can run with current prerequisites
     * @param {Array} prerequisites - List of learned vocabulary/concepts
     * @param {Object} chapterContent - Full chapter content
     * @returns {boolean} - True if module can run
     */
    canRun(prerequisites, chapterContent) {
        throw new Error('ExerciseModuleInterface.canRun() must be implemented by subclass');
    }

    /**
     * Present exercise UI and content
     * @param {HTMLElement} container - DOM container to render into
     * @param {Object} exerciseData - Specific exercise data to present
     * @returns {Promise<void>}
     */
    async present(container, exerciseData) {
        throw new Error('ExerciseModuleInterface.present() must be implemented by subclass');
    }

    /**
     * Validate user input with LLM
     * @param {string} userInput - User's response
     * @param {Object} context - Exercise context and expected answer
     * @returns {Promise<ValidationResult>} - Validation result with score and feedback
     */
    async validate(userInput, context) {
        throw new Error('ExerciseModuleInterface.validate() must be implemented by subclass');
    }

    /**
     * Get current progress data
     * @returns {ProgressData} - Progress information for this module
     */
    getProgress() {
        throw new Error('ExerciseModuleInterface.getProgress() must be implemented by subclass');
    }

    /**
     * Clean up and prepare for unloading
     */
    cleanup() {
        throw new Error('ExerciseModuleInterface.cleanup() must be implemented by subclass');
    }

    /**
     * Get module metadata
     * @returns {Object} - Module information
     */
    getMetadata() {
        throw new Error('ExerciseModuleInterface.getMetadata() must be implemented by subclass');
    }
}

export default ExerciseModuleInterface;