"""
Timeback QTI Client

A Python client for QTI assessment item and test operations.

Example:
    ```python
    from timeback_qti import QtiClient

    async def main():
        client = QtiClient(
            env="staging",
            client_id="your-client-id",
            client_secret="your-client-secret",
        )

        # List assessment items
        items = await client.assessment_items.list()

        # Create from QTI XML
        item = await client.assessment_items.create_from_xml({
            "format": "xml",
            "xml": "<qti-assessment-item>...</qti-assessment-item>",
        })

        # Validate QTI XML
        result = await client.validate.validate({
            "schema": "item",
            "xml": "<qti-assessment-item>...</qti-assessment-item>",
        })

        await client.close()
    ```
"""

from importlib.metadata import PackageNotFoundError, version

try:
    __version__ = version("timeback-qti")
except PackageNotFoundError:
    __version__ = "0.0.0"

from .client import QtiClient
from .exceptions import (
    APIError,
    AuthenticationError,
    ForbiddenError,
    InputValidationError,
    NotFoundError,
    QtiError,
    RateLimitError,
    ServerError,
    TimebackError,
    ValidationError,
    ValidationIssue,
    create_input_validation_error,
)
from .parse import (
    ParsedQtiItem,
    QtiChoice,
    QtiInlineFeedback,
    QtiInteractionAttributes,
    QtiModalFeedback,
    QtiResponseDeclaration,
    extract_choices,
    extract_correct_response,
    extract_feedback,
    extract_interaction_attributes,
    extract_modal_feedback,
    extract_prompt,
    extract_response_declaration,
    parse_qti_xml,
)
from .types import (
    AssessmentItem,
    AssessmentItemRef,
    AssessmentItemRefInput,
    AssessmentItemType,
    AssessmentSection,
    AssessmentSectionInput,
    AssessmentTest,
    BaseType,
    BatchValidationResult,
    Cardinality,
    CatalogInfo,
    CatalogInfoInput,
    CorrectResponse,
    CorrectResponseInput,
    CreateAssessmentItemInput,
    CreateAssessmentItemMetadataInput,
    CreateAssessmentItemXmlInput,
    CreateAssessmentTestInput,
    CreateStimulusInput,
    DefaultValueInput,
    DeleteResponse,
    Difficulty,
    FeedbackBlock,
    FeedbackBlockInput,
    FeedbackInline,
    FeedbackInlineInput,
    FeedbackType,
    Grade,
    InlineFeedbackConfig,
    InlineFeedbackConfigInput,
    ItemMetadata,
    ItemMetadataInput,
    LearningObjectiveSet,
    LearningObjectiveSetInput,
    LessonFeedback,
    ListParams,
    ListResponse,
    ModalFeedback,
    ModalFeedbackInput,
    NavigationMode,
    OutcomeDeclaration,
    OutcomeDeclarationInput,
    ProcessResponseFeedback,
    ProcessResponseInput,
    ProcessResponseResult,
    QuestionReference,
    QuestionsResponse,
    QuestionWithItem,
    ReorderItemsInput,
    ResponseDeclaration,
    ResponseDeclarationInput,
    ResponseProcessing,
    ResponseProcessingInput,
    ShowHide,
    SortOrder,
    Stimulus,
    Stylesheet,
    StylesheetInput,
    SubmissionMode,
    SubmitLessonFeedbackInput,
    TestOutcomeDeclaration,
    TestOutcomeDeclarationInput,
    TestPart,
    TestPartInput,
    UpdateAssessmentItemInput,
    UpdateAssessmentTestInput,
    UpdateStimulusInput,
    UpdateTestMetadataInput,
    ValidateBatchInput,
    ValidateInput,
    ValidationResult,
    ValidationSchema,
)

__all__ = [
    "APIError",
    "AssessmentItem",
    "AssessmentItemRef",
    "AssessmentItemRefInput",
    "AssessmentItemType",
    "AssessmentSection",
    "AssessmentSectionInput",
    "AssessmentTest",
    "AuthenticationError",
    "BaseType",
    "BatchValidationResult",
    "Cardinality",
    "CatalogInfo",
    "CatalogInfoInput",
    "CorrectResponse",
    "CorrectResponseInput",
    "CreateAssessmentItemInput",
    "CreateAssessmentItemMetadataInput",
    "CreateAssessmentItemXmlInput",
    "CreateAssessmentTestInput",
    "CreateStimulusInput",
    "DefaultValueInput",
    "DeleteResponse",
    "Difficulty",
    "FeedbackBlock",
    "FeedbackBlockInput",
    "FeedbackInline",
    "FeedbackInlineInput",
    "FeedbackType",
    "ForbiddenError",
    "Grade",
    "InlineFeedbackConfig",
    "InlineFeedbackConfigInput",
    "InputValidationError",
    "ItemMetadata",
    "ItemMetadataInput",
    "LearningObjectiveSet",
    "LearningObjectiveSetInput",
    "LessonFeedback",
    "ListParams",
    "ListResponse",
    "ModalFeedback",
    "ModalFeedbackInput",
    "NavigationMode",
    "NotFoundError",
    "OutcomeDeclaration",
    "OutcomeDeclarationInput",
    "ParsedQtiItem",
    "ProcessResponseFeedback",
    "ProcessResponseInput",
    "ProcessResponseResult",
    "QtiChoice",
    "QtiClient",
    "QtiError",
    "QtiInlineFeedback",
    "QtiInteractionAttributes",
    "QtiModalFeedback",
    "QtiResponseDeclaration",
    "QuestionReference",
    "QuestionWithItem",
    "QuestionsResponse",
    "RateLimitError",
    "ReorderItemsInput",
    "ResponseDeclaration",
    "ResponseDeclarationInput",
    "ResponseProcessing",
    "ResponseProcessingInput",
    "ServerError",
    "ShowHide",
    "SortOrder",
    "Stimulus",
    "Stylesheet",
    "StylesheetInput",
    "SubmissionMode",
    "SubmitLessonFeedbackInput",
    "TestOutcomeDeclaration",
    "TestOutcomeDeclarationInput",
    "TestPart",
    "TestPartInput",
    "TimebackError",
    "UpdateAssessmentItemInput",
    "UpdateAssessmentTestInput",
    "UpdateStimulusInput",
    "UpdateTestMetadataInput",
    "ValidateBatchInput",
    "ValidateInput",
    "ValidationError",
    "ValidationIssue",
    "ValidationResult",
    "ValidationSchema",
    "__version__",
    "create_input_validation_error",
    "extract_choices",
    "extract_correct_response",
    "extract_feedback",
    "extract_interaction_attributes",
    "extract_modal_feedback",
    "extract_prompt",
    "extract_response_declaration",
    "parse_qti_xml",
]
