import * as react_jsx_runtime from 'react/jsx-runtime'; import { e as DisplayBlock, k as DisplayItem, a as AssessmentStimulus } from './schema-DSKqO7r8.js'; /** Theme options for the QTI renderer */ type QTITheme = "duolingo" | "neobrutalist" | (string & {}); /** Feedback result for a single response */ interface ResponseFeedback { isCorrect: boolean; messageHtml?: string; } /** Correctness info for selected choices */ interface ChoiceCorrectness { id: string; isCorrect: boolean; } /** * Props for the QTIRenderer component. * * This is a **controlled, display-only component**. It renders the question * and captures user input, but does NOT include submit buttons or flow logic. * The consuming app is responsible for: * - Providing responses state * - Handling submission * - Providing feedback after validation * - Rendering buttons (Check, Try Again, Continue, etc.) */ interface QTIRendererProps { /** * The display-safe item to render. * Use `buildDisplayModel()` to create this from a parsed AssessmentItem. */ item: DisplayItem; /** * Current user responses, keyed by response identifier. * This is a controlled component - you must manage this state. * @example { "RESPONSE": "A" } or { "RESPONSE": ["A", "C"] } */ responses: Record; /** * Callback fired when user selects/changes an answer. * Update your responses state in this callback. */ onResponseChange: (responseId: string, value: string | string[]) => void; /** * Theme to apply. Defaults to "duolingo". * Available themes: "duolingo", "neobrutalist", or any custom theme * defined via `[data-qti-theme="your-theme"]` CSS. */ theme?: QTITheme; /** * Whether to show feedback states (correct/incorrect styling). * Set to true after validation to display results. */ showFeedback?: boolean; /** * Whether to disable all interactions. * Typically set to true when showFeedback is true. */ disabled?: boolean; /** * Per-choice correctness for highlighting selected answers. * Keyed by response identifier. */ choiceCorrectness?: Record; /** * Per-response feedback messages to display. * Keyed by response identifier. */ responseFeedback?: Record; /** * Overall feedback to display at the end of the question. */ overallFeedback?: ResponseFeedback; /** * Additional CSS class for the container. */ className?: string; } interface ContentBlockRendererProps { /** The content block to render */ block: DisplayBlock; /** Current user responses */ responses?: Record; /** Callback when user selects an answer */ onAnswerSelect?: (responseIdentifier: string, value: string | string[]) => void; /** Whether to show feedback */ showFeedback?: boolean; /** Whether to disable interactions */ disabled?: boolean; /** Selected-only correctness mapping for this render pass */ selectedChoicesByResponse?: Record>; /** Optional per-response feedback messages from server */ perResponseFeedback?: Record; } /** * Renders a single content block (stimulus or interaction) */ declare function ContentBlockRenderer({ block, responses, onAnswerSelect, showFeedback, disabled, selectedChoicesByResponse, perResponseFeedback }: ContentBlockRendererProps): react_jsx_runtime.JSX.Element | null; /** * A controlled, display-only component for rendering QTI assessment items. * * **This component does NOT include buttons or submission logic.** * The consuming app is responsible for: * - Managing `responses` state * - Rendering Check/Submit/Try Again buttons * - Calling validation APIs * - Providing feedback data after validation * * @example * ```tsx * const [responses, setResponses] = useState({}) * const [feedback, setFeedback] = useState(null) * * setResponses(prev => ({ ...prev, [id]: value }))} * theme="neobrutalist" * showFeedback={!!feedback} * responseFeedback={feedback?.perResponse} * overallFeedback={feedback?.overall} * disabled={!!feedback} * /> * * * ``` */ declare function QTIRenderer({ item, responses, onResponseChange, theme, showFeedback, disabled, choiceCorrectness, responseFeedback, overallFeedback, className }: QTIRendererProps): react_jsx_runtime.JSX.Element; /** * Props for the QTIStimulusRenderer component. * * This is a simple, display-only component for rendering QTI Assessment Stimuli * (reading materials, passages, articles). * It does not handle interactions. */ type QTIStimulusRendererProps = { /** * The parsed stimulus to render. * Use `parseAssessmentStimulusXml()` to create this from raw XML. */ stimulus: AssessmentStimulus; /** * Additional CSS class for the container. */ className?: string; }; /** * Renders a QTI 3.0 Assessment Stimulus (reading material). * * Assessment Stimuli are standalone content (articles, passages, etc.) * that provide context for assessment items. This component renders * the stimulus body HTML with proper support for: * * - Standard HTML elements (headings, lists, paragraphs, tables) * - Images with responsive sizing * - MathML mathematical expressions * - Figures and figcaptions * - Links and text formatting * - Collapsible details/summary sections * * @example * ```tsx * import { parseAssessmentStimulusXml, QTIStimulusRenderer } from "@superbuilders/incept-renderer" * * const stimulus = parseAssessmentStimulusXml(xmlString) * * ``` */ declare function QTIStimulusRenderer({ stimulus, className }: QTIStimulusRendererProps): react_jsx_runtime.JSX.Element; export { type ChoiceCorrectness as C, type QTIRendererProps as Q, type ResponseFeedback as R, type ContentBlockRendererProps as a, type QTIStimulusRendererProps as b, type QTITheme as c, ContentBlockRenderer as d, QTIRenderer as e, QTIStimulusRenderer as f };