'''
Created on 30-Dec-2024

@author: b thakur
'''
from sympy import symbols, Eq, solve, Symbol, latex, sqrt, UnevaluatedExpr
from xv.km.ui import SvgHelper  
import matplotlib.pyplot as plt

import random
import inspect
import traceback

from ..helper import BaseHelper

from xv.km.managers import BaseManager
from xv.km.kelements import KProblemTemplate
from xv.util import list_to_str
        
# _irodov_manager
# IrodovManager
   
class IrodovManager(BaseManager):
    '''
    IrodovManager
    Example:
        ke = IrodovManager()
        ke.getRandomProblem()
        ke.getRandomProblem(problem_type = 0)
        ...
        
        ke.printProblem()
        ke.printAnswer()
        ke.printSolution()
        
        ke.printProblemTypes()
        
    '''    
    
    def __new__(cls, *args, **kwargs):
        instance = super(IrodovManager, cls).__new__(cls, *args, **kwargs)
        for base_class in IrodovManager.__bases__:
            base_class.__init__(instance, *args, **kwargs)
        return instance
    
    def __init__(self, *args, **kwargs):
        self.base_helper = BaseHelper(**kwargs)
        pass

    def _init_problem_types(self, *args, **kwargs):
        self._append_problem_types([
            
            '_problem_irodov_maxwells_equations',
            '_problem_irodov_electrodynamics',
            '_problem_irodov_dynamics_of_solid_body',
            '_problem_irodov_equation_of_the_gas_state_processes',
            '_problem_irodov_laws_of_conservation_of_energy_momentum_and_angular_momentum',
            '_problem_irodov_universal_gravitation',
            '_problem_irodov_kinematics',
            
            
            ])
        pass
    

    def _problem_irodov_maxwells_equations(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_maxwells_equations.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)



    def _problem_irodov_electrodynamics(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_electrodynamics.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)

    def _problem_irodov_dynamics_of_solid_body(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_dynamics_of_solid_body.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)

    def _problem_irodov_equation_of_the_gas_state_processes(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_equation_of_the_gas_state_processes.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)

    def _problem_irodov_laws_of_conservation_of_energy_momentum_and_angular_momentum(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_laws_of_conservation_of_energy_momentum_and_angular_momentum.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)

    def _problem_irodov_universal_gravitation(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_universal_gravitation.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)

    def _problem_irodov_kinematics(self, *args, **kwargs):
        """
        
        """
        
        folder_path = "question_bank/physics/irodov/problems_in_general_physics_by_i_e_irodov"
        search_file_paths = [
                "irodov_kinematics.txt"
            ]
        
        
        file_paths = self.get_q_bank_factory().search_question_bank_files(folder_path, search_file_paths)
        return self.get_q_bank_factory().PROBLEM_TEMPLATE_Q_BANK_RANDOM_QUESTION(file_paths, *args, **kwargs)


    pass

