import { b as ItemContext, h as VariableValue, R as ResponseInteraction, g as ResponseVariable, c as OutcomeVariable, V as VariableDeclaration, C as Calculate, B as BaseType, a as Cardinality, I as InterpolationTableEntry, T as TemplateVariable } from './item.types.d-DuVR0ZVK.js'; import * as lit from 'lit'; import { LitElement, PropertyValues, CSSResultGroup, PropertyValueMap } from 'lit'; import { a as RegisteredInteraction } from './interaction.interface.d-CvjHM2bi.js'; import { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback.d-DbzPSJuK.js'; import { b as QtiRuleBase } from './qti-rule-base.d-Bdzg8eGH.js'; /** * @summary The qti-assessment-item element contains all the other QTI 3 item structures. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj * * @dependency qti-feedback * @dependency qti-responseprocessing * * @event qti-item-context-updated - Emitted when through a user action the itemContext is updated, * typically on interaction with the interactions, or calling response processing. */ declare class QtiAssessmentItem extends LitElement { #private; identifier: string; adaptive: 'true' | 'false'; timeDependent: 'true' | 'false' | null; get title(): string; set title(value: string); /** * Locks the item, for example once it is submitted. Published in the item context, which the * interactions inside follow, so the item keeps no list of them to set it on. */ disabled: boolean; /** * Shows the item for reading only. Published in the item context, which the interactions inside * follow, so the item keeps no list of them to set it on. */ readonly: boolean; protected willUpdate(changed: PropertyValues): void; private _context; /** * Sets the identifier for the assessment item reference if this item is in a test. * * @param identifier - The identifier for the assessment item reference. */ set assessmentItemRefId(identifier: string); get assessmentItemRefId(): string; /** * The item's whole context, declarations included, for reading. `variables` is the trimmed view * for hosts; the test needs the declarations too, and used to reach for the private field. */ get itemContext(): Readonly; get variables(): VariableValue[]; set variables(value: VariableValue[]); get state(): ItemContext['state']; set state(value: ItemContext['state']); /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */ protected interactionElements: RegisteredInteraction[]; /** @deprecated use variables property instead */ set responses(myResponses: ResponseInteraction[]); render(): lit.TemplateResult<1>; connectedCallback(): void; disconnectedCallback(): void; processResponse(countNumAttempts?: boolean, reportValidityAfterScoring?: boolean): boolean; resetResponses(): void; protected getResponse(identifier: string): Readonly; getOutcome(identifier: string): Readonly; protected getVariable(identifier: string): Readonly>; /** Extension point for presentation packages reacting to a candidate response change. */ protected afterResponseVariableUpdated(): void; /** * Updates the response variable with the specified identifier to the given value. * * @protected * * This method is intended for internal use within the class and subclasses. * It should not be called externally by third parties. * * @param identifier - The identifier of the response variable to update. * @param value - The new value for the response variable. */ updateResponseVariable(identifier: string, value: string | string[] | undefined): void; /** * Updates the template variable with the specified identifier to the given value. */ updateTemplateVariable(identifier: string, value: string | string[] | undefined): void; /** * Updates the correct response for the specified response variable. */ updateCorrectResponse(identifier: string, value: string | string[] | undefined): void; setOutcomeVariable(identifier: string, value: string | string[] | undefined): void; /** * Updates the outcome variable with the specified identifier to the given value. * * @protected * * This method is intended for internal use within the class and subclasses. * It should not be called externally by third parties. * * @param identifier - The identifier of the response variable to update. * @param value - The new value for the response variable. */ updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void; validate(reportValidity?: boolean): boolean; reportValidity(): void; } declare global { interface HTMLElementTagNameMap { 'qti-assessment-item': QtiAssessmentItem; } } declare module '../../public-events' { interface PublicItemEventMap { /** The item rendered: its interactions are in the DOM and its validity is known. */ 'cito-item-rendered': CustomEvent; } } /** * @summary Root of a shared stimulus, placed as a whole wherever the stimulus is rendered. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info#Root_AssessmentStimulus * @status stable * @since 4.0 * * Generates no box of its own (`display: contents`), so the stimulus lays out as if only its * `qti-stimulus-body` were placed. It is kept in the DOM because it carries the stimulus' * `xml:lang` (transformed to `lang`): the content inherits its language from here, which is what * text-to-speech and screen readers use to pick a voice. * * Its QTI `title` is removed on connect: it names the stimulus for authors browsing a repository, * and as an HTML `title` it would show as a tooltip over the whole passage and be announced by * screen readers. * * @slot - stimulus content: `qti-stylesheet`, `qti-stimulus-body` and `qti-catalog-info` (hidden). */ declare class QtiAssessmentStimulus extends LitElement { static styles: CSSResultGroup; connectedCallback(): void; render(): lit.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'qti-assessment-stimulus': QtiAssessmentStimulus; } } declare class QtiAssessmentStimulusRefConnectedEvent extends Event { element: QtiAssessmentStimulusRef; item: QtiAssessmentItem; static eventName: string; constructor(element: QtiAssessmentStimulusRef, item: QtiAssessmentItem); } /** * Represents a custom element for referencing an assessment stimulus. */ declare class QtiAssessmentStimulusRef extends LitElement { identifier: string; href: string; /** * Lifecycle method called when the element is connected to the DOM. * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly. * If not found, delegates to the delivery platform via an event. */ connectedCallback(): Promise; /** * Loads and appends the stimulus to the specified element. * @param stimulusRef - The element to which the stimulus will be appended. */ updateStimulusRef(stimulusRef: Element): Promise; } declare global { interface HTMLElementTagNameMap { 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef; } } declare class QtiCompanionMaterialsInfo extends LitElement { } declare global { interface HTMLElementTagNameMap { 'qti-companion-materials-info': QtiCompanionMaterialsInfo; } } declare class QtiContentBody extends LitElement { #private; protected context?: ItemContext; render(): lit.TemplateResult<1>; connectedCallback(): void; protected updated(changedProperties: Map): void; } declare global { interface HTMLElementTagNameMap { 'qti-content-body': QtiContentBody; } } /** * @summary The qti-context-declaration element declares context variables for an item. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.qti-context-declaration */ declare class QtiContextDeclaration extends LitElement { identifier: string; cardinality: 'single' | 'multiple' | 'ordered' | 'record'; static styles: lit.CSSResult[]; render(): lit.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'qti-context-declaration': QtiContextDeclaration; } } /** * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw * * A custom operator is outside the QTI vocabulary, so what it does is supplied * by the delivery engine rather than by the item. Two ways to supply it: * * `definition` names an operator the host registered with * `registerCustomOperator`, or one of the built-ins (`Trim`, `ToAscii`, * `ParseCommaDecimal` under the `depcp:`, `questify:` and `qade:` prefixes). * The operator is handed the calculated values of the child expressions: * * ```xml * * * * ``` * * `class="js.org"` instead runs inline JavaScript out of a CDATA section: * * ```xml * * * * ``` * * `definition` is checked first; the two do not interact. */ declare class QtiCustomOperator extends LitElement implements Calculate { #private; private _context?; render(): lit.TemplateResult<1>; handleSlotChange(): void; calculate(): any; } declare global { interface HTMLElementTagNameMap { 'qti-custom-operator': QtiCustomOperator; } } declare class QtiFeedbackBlock extends QtiFeedback { static styles: lit.CSSResult; render(): lit.TemplateResult<1>; connectedCallback(): void; } declare global { interface HTMLElementTagNameMap { 'qti-feedback-block': QtiFeedbackBlock; } } declare class QtiFeedbackInline extends QtiFeedback { static styles: lit.CSSResult; render: () => lit.TemplateResult<1>; connectedCallback(): void; } declare global { interface HTMLElementTagNameMap { 'qti-feedback-inline': QtiFeedbackInline; } } /** * @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi * @status stable * @since 4.0 * * @slot - item body content. * @slot qti-rubric-block - the qti rubric block is placed above the item * @part qti-rubric-block - the qti rubric block part */ declare class QtiItemBody extends LitElement { static styles: CSSResultGroup; render(): lit.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'qti-item-body': QtiItemBody; } } declare class QtiModalFeedback extends QtiFeedback { static styles: lit.CSSResult; render(): lit.TemplateResult<1>; openFeedback(): void; closeFeedback(): void; connectedCallback(): void; protected updated(changedProperties: Map): void; } declare global { interface HTMLElementTagNameMap { 'qti-modal-feedback': QtiModalFeedback; } } declare class QtiOutcomeDeclaration extends QtiVariableDeclaration { baseType: BaseType; externalScored: 'human' | 'externalMachine' | null; identifier: string; cardinality: Cardinality; itemContext?: ItemContext; static styles: lit.CSSResult[]; render(): lit.TemplateResult<1>; /** * The entries of a `qti-interpolation-table`, in document order. * * Order is load-bearing: each entry's `source-value` is the lower bound of a * range, and the lookup takes the first entry whose bound the source value * clears. A Map keyed by source value cannot express that. */ get interpolationTable(): InterpolationTableEntry[] | null; /** * A qti-match-table maps a source value onto a target exactly, with no * boundaries and no interpolation. Targets keep their authored spelling * because a match table is not restricted to numeric outcomes. */ get matchTable(): Map | null; connectedCallback(): void; } declare global { interface HTMLElementTagNameMap { 'qti-outcome-declaration': QtiOutcomeDeclaration; } } declare class QtiResponseDeclaration extends QtiVariableDeclaration { #private; baseType: BaseType; identifier: string; cardinality: Cardinality; itemContext?: ItemContext; static styles: lit.CSSResult[]; render(): lit.TemplateResult<1>; connectedCallback(): void; } declare global { interface HTMLElementTagNameMap { 'qti-response-declaration': QtiResponseDeclaration; } } declare class QtiResponseProcessing extends LitElement { static styles: lit.CSSResult[]; render(): lit.TemplateResult<1>; process(): void; firstUpdated(_changedProperties: PropertyValueMap | Map): void; } declare global { interface HTMLElementTagNameMap { 'qti-response-processing': QtiResponseProcessing; } } declare class QtiRubricBlock extends LitElement { id: string; use: 'instructions' | 'scoring' | 'navigation'; view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor'; classNames: string; handleclassNamesChange(): void; static styles: lit.CSSResult; render(): lit.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'qti-rubric-block': QtiRubricBlock; } } declare class QtiStylesheet extends LitElement { #private; protected firstUpdated(_changedProperties: PropertyValueMap | Map): void; disconnectedCallback(): void; } declare global { interface HTMLElementTagNameMap { 'qti-stylesheet': QtiStylesheet; } } /** * @summary The qti-template-constraint element is a processing rule available only in Template Processing. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-constraint * * It terminates Template Processing and re-runs it from the beginning if the condition * specified in the template constraint is not satisfied. This can be used to iterate * the Template Processing with different randomly-generated values until a predetermined * condition is satisfied. */ declare class QtiTemplateConstraint extends LitElement implements QtiRuleBase { render(): lit.TemplateResult<1>; /** * Evaluates the constraint condition * @returns true if constraint is satisfied, false if template processing should restart */ calculate(): boolean; /** * Template constraints don't have sub-rules like conditions */ getSubRules(): QtiRuleBase[]; /** * Process the template constraint * @returns true if constraint is satisfied, false if template processing should restart */ process(): boolean; } declare global { interface HTMLElementTagNameMap { 'qti-template-constraint': QtiTemplateConstraint; } } /** * @summary The qti-template-declaration element declares template variables for item cloning. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration */ declare class QtiTemplateDeclaration extends LitElement { #private; identifier: string; cardinality: 'single' | 'multiple' | 'ordered' | 'record'; baseType: BaseType; mathVariable: boolean; paramVariable: boolean; static styles: lit.CSSResult[]; render(): lit.TemplateResult<1>; connectedCallback(): void; /** * Get the template variable definition */ getTemplateVariable(): TemplateVariable; } declare global { interface HTMLElementTagNameMap { 'qti-template-declaration': QtiTemplateDeclaration; } } /** * @summary The qti-template-processing element contains template processing rules. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing */ declare class QtiTemplateProcessing extends LitElement { #private; static styles: lit.CSSResult[]; render(): lit.TemplateResult<1>; /** * Process template rules to set template variable values */ process(): void; firstUpdated(_changedProperties: PropertyValueMap | Map): void; } declare global { interface HTMLElementTagNameMap { 'qti-template-processing': QtiTemplateProcessing; } } interface OutcomeChangedDetails { item: string; outcomeIdentifier: string; value: Readonly; } type InteractionChangedDetails = ResponseInteraction & { item: string; }; /** * The public events of the item. The name tells you it is public: everything declared here starts * with `cito-`; every other event is internal plumbing and may change in any release. * * Requests are verbs, notifications are past tense. All bubble and are composed. * * `deprecated` is the name the event had before it became public. `dispatchPublic` sends and * `listenPublic` handles both until the next major, then the field goes. */ interface PublicEventDeclaration { kind: 'request' | 'notification'; scope: 'test' | 'item'; /** The name before it was public. Dispatched and handled alongside the new one. */ deprecated?: string; } interface RubricPlacement { className: string; element: Element; } interface PublicItemEventMap { 'cito-item-response-changed': CustomEvent; 'cito-item-outcome-changed': CustomEvent; /** Cancelable: `preventDefault()` keeps the rubric block where it is. */ 'cito-item-rubric-placement': CustomEvent; } type PublicItemEventName = keyof PublicItemEventMap; declare const PUBLIC_ITEM_EVENTS: Record; declare global { interface HTMLElementEventMap extends PublicItemEventMap { } } /** * Dispatch `name` and its deprecated name with the same `detail` object, new name first. Returns * `false` when a listener of either cancelled the event. The detail is always an object. * Shared by the item and test tiers; use `dispatchPublic` (item) or the test's own wrapper. */ declare function dispatchDeclared(target: EventTarget, declarations: Record, name: string, detail: unknown, cancelable?: boolean): boolean; /** * Listen for `name` and its deprecated name. `dispatchDeclared` sends the old name straight after * the new one, synchronously, with the same `detail`: that one is skipped, so the handler runs * once. A host that sends only the old name is handled too, and warned once per name in the * console: only a sender outside our own components gets here without the new name before it. */ declare function listenDeclared(target: EventTarget, declarations: Record, name: string, handler: (e: Event) => void): void; declare function dispatchPublic(target: EventTarget, name: K, detail: PublicItemEventMap[K] extends CustomEvent ? D : never, cancelable?: boolean): boolean; declare function listenPublic(target: EventTarget, name: K, handler: (e: PublicItemEventMap[K]) => void): void; export { PUBLIC_ITEM_EVENTS, type PublicEventDeclaration, type PublicItemEventMap, type PublicItemEventName, QtiAssessmentItem, QtiAssessmentStimulus, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing, type RubricPlacement, dispatchDeclared, dispatchPublic, listenDeclared, listenPublic };