@citolab/qti-components 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +288 -182
- package/dist/base.d.ts +5 -5
- package/dist/base.js +1 -1
- package/dist/{chunk-TXIB3SKC.js → chunk-3MQNPN7A.js} +3 -3
- package/dist/{chunk-6V3A7NQP.js → chunk-3NPCS4IT.js} +2 -2
- package/dist/{chunk-MK2I3MQB.js → chunk-3VQSUWCK.js} +175 -15
- package/dist/chunk-3VQSUWCK.js.map +1 -0
- package/dist/{chunk-4XR2JHCP.js → chunk-5BXJRO5O.js} +1816 -551
- package/dist/chunk-5BXJRO5O.js.map +1 -0
- package/dist/{chunk-NZLW6EX7.js → chunk-DXEWBTJB.js} +2 -2
- package/dist/{chunk-Q52IJELT.js → chunk-GBDTBHUQ.js} +602 -263
- package/dist/chunk-GBDTBHUQ.js.map +1 -0
- package/dist/chunk-KCK27QBP.js +11 -0
- package/dist/chunk-KCK27QBP.js.map +1 -0
- package/dist/chunk-MKZ374OJ.js +179 -0
- package/dist/chunk-MKZ374OJ.js.map +1 -0
- package/dist/{chunk-3IACYIU2.js → chunk-RT6WZ3P7.js} +2 -2
- package/dist/chunk-TLTYXWW7.js +7 -0
- package/dist/chunk-TLTYXWW7.js.map +1 -0
- package/dist/{chunk-EKXZI26R.js → chunk-WCWJPIUQ.js} +58 -6
- package/dist/chunk-WCWJPIUQ.js.map +1 -0
- package/dist/{chunk-6XJUP55A.js → chunk-WKWCOV5P.js} +3 -3
- package/dist/chunk-WKWCOV5P.js.map +1 -0
- package/dist/{chunk-CF3DXJWM.js → chunk-WTV7NQHO.js} +731 -715
- package/dist/chunk-WTV7NQHO.js.map +1 -0
- package/dist/{computed.types.d-DpKIYO6e.d.ts → computed.types.d-CJarqC6s.d.ts} +12 -0
- package/dist/corrections.d.ts +14 -4
- package/dist/corrections.js +82 -7
- package/dist/corrections.js.map +1 -1
- package/dist/elements.d.ts +1 -1
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +26 -24
- package/dist/interactions.js +14 -15
- package/dist/item.css +81 -0
- package/dist/item.d.ts +1 -1
- package/dist/item.js +4 -4
- package/dist/loader.d.ts +1 -1
- package/dist/processing.d.ts +29 -3
- package/dist/processing.js +3 -2
- package/dist/qti-components-jsx.d.ts +7883 -7250
- package/dist/{qti-condition-expression.d-aMvBvpc6.d.ts → qti-condition-expression.d-CYwXOUb1.d.ts} +1 -1
- package/dist/{qti-expression.d-BietT_8b.d.ts → qti-expression.d-B_-m9emA.d.ts} +11 -1
- package/dist/{qti-feedback.d-DZbad0RN.d.ts → qti-feedback.d-B1EIF-fU.d.ts} +1 -0
- package/dist/{qti-test.d-_YAlhDbt.d.ts → qti-test.d-C6lCEMRB.d.ts} +38 -3
- package/dist/test.d.ts +5 -5
- package/dist/test.js +7 -5
- package/package.json +9 -9
- package/dist/chunk-4XR2JHCP.js.map +0 -1
- package/dist/chunk-6XJUP55A.js.map +0 -1
- package/dist/chunk-CF3DXJWM.js.map +0 -1
- package/dist/chunk-EKXZI26R.js.map +0 -1
- package/dist/chunk-IXPDMYKH.js +0 -1420
- package/dist/chunk-IXPDMYKH.js.map +0 -1
- package/dist/chunk-IYC7LZV6.js +0 -7
- package/dist/chunk-IYC7LZV6.js.map +0 -1
- package/dist/chunk-MK2I3MQB.js.map +0 -1
- package/dist/chunk-Q52IJELT.js.map +0 -1
- /package/dist/{chunk-TXIB3SKC.js.map → chunk-3MQNPN7A.js.map} +0 -0
- /package/dist/{chunk-6V3A7NQP.js.map → chunk-3NPCS4IT.js.map} +0 -0
- /package/dist/{chunk-NZLW6EX7.js.map → chunk-DXEWBTJB.js.map} +0 -0
- /package/dist/{chunk-3IACYIU2.js.map → chunk-RT6WZ3P7.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../qti-elements/src/components/qti-assessment-item/qti-assessment-item.ts","../../qti-elements/src/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts","../../qti-elements/src/components/qti-companion-materials-info/qti-companion-materials-info.ts","../../qti-elements/src/components/qti-content-body/qti-content-body.ts","../../qti-elements/src/components/qti-context-declaration/qti-context-declaration.ts","../../qti-elements/src/components/qti-custom-operator/qti-custom-operator.ts","../../qti-elements/src/components/qti-feedback-block/qti-feedback-block.ts","../../qti-elements/src/components/qti-feedback-inline/qti-feedback-inline.ts","../../qti-elements/src/components/qti-item-body/qti-item-body.ts","../../qti-elements/src/components/qti-item-body/qti-item-body.styles.ts","../../qti-elements/src/components/qti-modal-feedback/qti-modal-feedback.ts","../../qti-elements/src/components/qti-outcome-declaration/qti-outcome-declaration.ts","../../qti-elements/src/components/qti-response-declaration/qti-response-declaration.ts","../../qti-elements/src/components/qti-response-processing/qti-response-processing.ts","../../qti-elements/src/internal/template-strings.ts","../../qti-elements/src/components/qti-rubric-block/qti-rubric-block.ts","../../qti-elements/src/components/qti-stylesheet/qti-stylesheet.ts","../../qti-elements/src/components/qti-template-constraint/qti-template-constraint.ts","../../qti-elements/src/components/qti-template-declaration/qti-template-declaration.ts","../../qti-elements/src/components/qti-template-processing/qti-template-processing.ts","../../qti-elements/src/elements.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { itemContext, itemContextVariables } from '@qti-components/base';\nimport { watch } from '@qti-components/utilities';\n\nimport type { QtiTemplateProcessing } from '../qti-template-processing/qti-template-processing.js';\nimport type { InteractionChangedDetails, OutcomeChangedDetails } from '../../internal/event-types.ts';\nimport type { QtiFeedback, ResponseInteraction } from '@qti-components/base';\nimport type { RegisteredInteraction } from '@qti-components/base';\nimport type { VariableDeclaration, VariableValue } from '@qti-components/base';\nimport type { OutcomeVariable, ResponseVariable, TemplateVariable } from '@qti-components/base';\nimport type { QtiResponseProcessing } from '../qti-response-processing/qti-response-processing.ts';\nimport type QtiRegisterVariable from '../../internal/events/qti-register-variable.ts';\nimport type { ItemContext } from '@qti-components/base';\n\n/**\n * @summary The qti-assessment-item element contains all the other QTI 3 item structures.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj\n *\n * @dependency qti-feedback\n * @dependency qti-responseprocessing\n *\n * @event qti-item-context-updated - Emitted when through a user action the itemContext is updated,\n * typically on interaction with the interactions, or calling response processing.\n */\n\nexport class QtiAssessmentItem extends LitElement {\n #itemTitle: string | undefined;\n #templateProcessing: QtiTemplateProcessing | null = null;\n\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) adaptive: 'true' | 'false' = 'false';\n @property({ type: String }) timeDependent: 'true' | 'false' | null = null;\n\n @property({ type: String })\n override get title(): string {\n return this.#itemTitle;\n }\n override set title(value: string) {\n this.#itemTitle = value;\n this.removeAttribute('title');\n this.setAttribute('data-title', value);\n }\n\n @property({ type: Boolean }) disabled: boolean;\n @watch('disabled', { waitUntilFirstUpdate: true })\n protected _handleDisabledChange = (_: boolean, disabled: boolean) => {\n this.interactionElements.forEach(ch => (ch.disabled = disabled));\n };\n\n @property({ type: Boolean }) readonly: boolean;\n @watch('readonly', { waitUntilFirstUpdate: true })\n protected _handleReadonlyChange = (_: boolean, readonly: boolean) =>\n this.interactionElements.forEach(ch => (ch.readonly = readonly));\n\n @provide({ context: itemContext })\n private _context: ItemContext = {\n variables: itemContextVariables\n };\n\n /**\n * Sets the identifier for the assessment item reference if this item is in a test.\n *\n * @param identifier - The identifier for the assessment item reference.\n */\n public set assessmentItemRefId(identifier: string) {\n this._context = { ...this._context, identifier };\n }\n\n public get assessmentItemRefId(): string {\n return this._context.identifier;\n }\n\n public get variables(): VariableValue<string | string[] | null>[] {\n return this._context.variables.map(v => ({\n identifier: v.identifier,\n value: v.value,\n type: v.type,\n // add externalscored, a fixed prop to the test, so the testcontext can read and decide how to score this item\n ...(v.type === 'outcome' && v.identifier === 'SCORE'\n ? { externalScored: (v as OutcomeVariable).externalScored }\n : {})\n }));\n }\n\n public set variables(value: VariableValue<string | string[] | null>[]) {\n if (!Array.isArray(value) || value.some(v => !('identifier' in v))) {\n console.warn('variables property should be an array of VariableDeclaration');\n return;\n }\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n const matchingValue = value.find(v => v.identifier === variable.identifier);\n if (matchingValue) {\n return {\n ...variable,\n ...matchingValue,\n interpolationTable: (variable as OutcomeVariable).interpolationTable\n };\n }\n return variable;\n })\n };\n\n this._context.variables.forEach(variable => {\n if (variable.type === 'response') {\n const interactionElement = this.interactionElements.find(\n (el: RegisteredInteraction) => el.responseIdentifier === variable.identifier\n );\n if (interactionElement) {\n interactionElement.response = variable.value as string | string[];\n }\n }\n });\n\n this.variables.forEach(variable => {\n if (variable.type === 'outcome') {\n this.#feedbackElements.forEach(fe => fe.checkShowFeedback(variable.identifier));\n }\n });\n }\n\n public get state(): ItemContext['state'] {\n return this._context.state;\n }\n\n public set state(value: ItemContext['state']) {\n this._context = {\n ...this._context,\n state: value ? { ...value } : undefined\n };\n }\n\n #initialContext: Readonly<ItemContext> = { ...this._context, variables: this._context.variables };\n #feedbackElements: QtiFeedback[] = [];\n /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */\n protected interactionElements: RegisteredInteraction[] = [];\n\n /** @deprecated use variables property instead */\n set responses(myResponses: ResponseInteraction[]) {\n if (myResponses) {\n for (const response of myResponses) {\n const responseVariable = this.getResponse(response.responseIdentifier);\n if (responseVariable) {\n this.updateResponseVariable(response.responseIdentifier, response.response);\n }\n\n const interaction: RegisteredInteraction | undefined = this.interactionElements.find(\n i => i.getAttribute('response-identifier') === response.responseIdentifier\n );\n if (interaction) {\n interaction.response = response.response;\n }\n }\n }\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n this.#attachEventListeners();\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.dispatchEvent(\n new CustomEvent<QtiAssessmentItem>('qti-assessment-item-connected', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n this.#processTemplates();\n });\n }\n\n override disconnectedCallback(): void {\n this.#removeEventListeners();\n super.disconnectedCallback();\n }\n\n #attachEventListeners() {\n this.addEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.addEventListener('qti-register-feedback', this.#handleRegisterFeedback);\n this.addEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.addEventListener('end-attempt', this.#handleEndAttempt);\n this.addEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.addEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.addEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.addEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #removeEventListeners() {\n this.removeEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.removeEventListener('qti-register-feedback', this.#handleRegisterFeedback);\n this.removeEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.removeEventListener('end-attempt', this.#handleEndAttempt);\n this.removeEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.removeEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.removeEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.removeEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #handleRegisterVariable = (e: QtiRegisterVariable) => {\n e.stopImmediatePropagation();\n this._context = { ...this._context, variables: [...this._context.variables, e.detail.variable] };\n this.#initialContext = this._context;\n e.stopPropagation();\n };\n\n #handleRegisterFeedback = (e: CustomEvent<QtiFeedback>) => {\n e.stopImmediatePropagation();\n const feedbackElement = e.detail;\n this.#feedbackElements.push(feedbackElement);\n const numAttempts = Number(this._context.variables.find(v => v.identifier === 'numAttempts')?.value) || 0;\n if (numAttempts > 0) {\n feedbackElement.checkShowFeedback(feedbackElement.outcomeIdentifier);\n }\n };\n\n #handleRegisterInteraction = (e: CustomEvent<{ interaction: string; interactionElement: RegisteredInteraction }>) => {\n e.stopImmediatePropagation();\n this.interactionElements.push(e.detail.interactionElement);\n };\n\n #handleEndAttempt = (e: CustomEvent<{ responseIdentifier: string; countAttempt: boolean }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, countAttempt } = e.detail;\n this.validate();\n this.updateResponseVariable(responseIdentifier, 'true');\n this.processResponse(countAttempt);\n };\n\n #handleSetOutcomeValue = (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n e.stopImmediatePropagation();\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n };\n\n #handleSetTemplateValue = (e: CustomEvent<{ templateIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { templateIdentifier, value } = e.detail;\n this.updateTemplateVariable(templateIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleSetCorrectResponse = (e: CustomEvent<{ responseIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, value } = e.detail;\n this.updateCorrectResponse(responseIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleUpdateResponseVariable = (e: CustomEvent<ResponseInteraction>) => {\n e.stopImmediatePropagation();\n\n const { responseIdentifier, response, state } = e.detail;\n this.updateResponseVariable(responseIdentifier, response);\n if (state !== undefined) {\n this._context = {\n ...this._context,\n state: {\n ...(this._context.state || {}),\n [responseIdentifier]: state\n }\n };\n }\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n };\n\n async #processTemplates(): Promise<void> {\n const templateDeclarations = Array.from(this.querySelectorAll<LitElement>('qti-template-declaration'));\n if (templateDeclarations.length > 0) {\n await Promise.all(templateDeclarations.map(declaration => declaration.updateComplete));\n await Promise.resolve();\n }\n\n this.#templateProcessing = this.querySelector<QtiTemplateProcessing>('qti-template-processing');\n if (this.#templateProcessing) {\n // Run template processing before first presentation\n this.#templateProcessing.process();\n this.#initialContext = { ...this._context, variables: this._context.variables };\n }\n }\n\n public processResponse(countNumAttempts = true, reportValidityAfterScoring = true): boolean {\n this.validate(reportValidityAfterScoring);\n\n if (countNumAttempts) {\n this.updateOutcomeVariable(\n 'numAttempts',\n (+this._context.variables.find(v => v.identifier === 'numAttempts')?.value + 1).toString()\n );\n }\n\n if (this.adaptive === 'false') {\n this.#resetOutcomeVariablesBeforeResponseProcessing();\n }\n\n const responseProcessor = this.querySelector<QtiResponseProcessing>('qti-response-processing');\n const canProcess = !!(responseProcessor && typeof responseProcessor.process === 'function');\n if (canProcess) {\n responseProcessor.process();\n }\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n\n return canProcess;\n }\n\n public resetResponses() {\n this._context = this.#initialContext;\n }\n\n protected getResponse(identifier: string): Readonly<ResponseVariable> {\n return this.getVariable(identifier) as ResponseVariable;\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n\n protected getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this._context.variables.find(v => v.identifier === identifier) || null;\n }\n\n /** Extension point for presentation packages reacting to a candidate response change. */\n protected afterResponseVariableUpdated(): void {}\n\n // saving privates here: ------------------------------------------------------------------------------\n\n /**\n * Updates the response variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateResponseVariable(identifier: string, value: string | string[] | undefined) {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => (v.identifier !== identifier ? v : { ...v, value: value }))\n };\n\n this.afterResponseVariableUpdated();\n\n this.dispatchEvent(\n new CustomEvent<InteractionChangedDetails>('qti-interaction-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n responseIdentifier: identifier,\n response: Array.isArray(value) ? [...value] : value\n }\n })\n );\n\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n }\n\n /**\n * Updates the template variable with the specified identifier to the given value.\n */\n public updateTemplateVariable(identifier: string, value: string | string[] | undefined) {\n const templateVariable = this._context.variables.find(v => v.identifier === identifier && v.type === 'template') as\n | TemplateVariable\n | undefined;\n\n if (!templateVariable) {\n console.warn(`Can not set qti-template-identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n templateVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n value: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the correct response for the specified response variable.\n */\n public updateCorrectResponse(identifier: string, value: string | string[] | undefined) {\n const responseVariable = this.getResponse(identifier);\n\n if (!responseVariable) {\n console.warn(`Can not set correct response for identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n responseVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n correctResponse: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n public setOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n this.updateOutcomeVariable(identifier, value);\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the outcome variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : Array.isArray(value) ? value : [value]\n };\n })\n };\n this.#feedbackElements.forEach(fe => fe.checkShowFeedback(identifier));\n\n this.dispatchEvent(\n new CustomEvent<OutcomeChangedDetails>('qti-outcome-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n outcomeIdentifier: identifier,\n value: this._context.variables.find(v => v.identifier === identifier)?.value\n }\n })\n );\n }\n\n public validate(reportValidity = true): boolean {\n const isValid = this.interactionElements.every(interactionElement => interactionElement.validate());\n\n if (reportValidity) {\n this.reportValidity();\n }\n\n return isValid;\n }\n\n public reportValidity() {\n for (const interactionElement of this.interactionElements) {\n interactionElement.reportValidity();\n }\n }\n\n #getCompletionStatus(): 'completed' | 'incomplete' | 'not_attempted' | 'unknown' {\n const valid = this.validate(false);\n if (valid === true) return 'completed';\n if (valid === false) return 'incomplete';\n return 'not_attempted';\n }\n\n #resetOutcomeVariablesBeforeResponseProcessing(): void {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n if (variable.type !== 'outcome') {\n return variable;\n }\n\n const hasDefaultValue = 'defaultValue' in variable;\n const declaredDefault = hasDefaultValue ? variable.defaultValue : null;\n\n let value = declaredDefault ?? null;\n if (\n (value === null || value === undefined) &&\n (variable.baseType === 'integer' || variable.baseType === 'float')\n ) {\n value = '0';\n }\n\n return {\n ...variable,\n value\n };\n })\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item': QtiAssessmentItem;\n }\n}\n","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { qtiTransformItem } from '@qti-components/transformers';\n\nimport type { QtiAssessmentItem } from '../qti-assessment-item/qti-assessment-item';\n\nexport class QtiAssessmentStimulusRefConnectedEvent extends Event {\n public static eventName = 'qti-assessment-stimulus-ref-connected';\n constructor(\n public element: QtiAssessmentStimulusRef,\n public item: QtiAssessmentItem\n ) {\n super(QtiAssessmentStimulusRefConnectedEvent.eventName, { bubbles: true, composed: true, cancelable: true });\n }\n}\n\n/**\n * Represents a custom element for referencing an assessment stimulus.\n */\n\nexport class QtiAssessmentStimulusRef extends LitElement {\n @property({ type: String }) identifier = '';\n @property({ type: String }) href = '';\n\n /**\n * Lifecycle method called when the element is connected to the DOM.\n * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.\n * If not found, delegates to the delivery platform via an event.\n */\n public override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n // VERY important to wait for updateComplete to ensure that the stimulusRef is connected after item\n // for the test-navigation to correctly process everything in order\n await this.updateComplete;\n\n const item = this.closest<QtiAssessmentItem>('qti-assessment-item');\n\n const event = new QtiAssessmentStimulusRefConnectedEvent(this, item);\n this.dispatchEvent(event);\n\n const stimulusRef = item?.querySelector(`[data-stimulus-idref=\"${this.identifier}\"]`);\n if (!event.defaultPrevented && stimulusRef) {\n await this.updateStimulusRef(stimulusRef);\n }\n }\n\n /**\n * Loads and appends the stimulus to the specified element.\n * @param stimulusRef - The element to which the stimulus will be appended.\n */\n public async updateStimulusRef(stimulusRef: Element) {\n const stimulus = await qtiTransformItem()\n .load(this.href)\n .then(api => api.htmlDoc());\n if (stimulus) {\n const elements = stimulus.querySelectorAll('qti-stimulus-body, qti-stylesheet');\n stimulusRef.innerHTML = '';\n stimulusRef.append(...elements);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;\n }\n}\n","import { LitElement } from 'lit';\n\nexport class QtiCompanionMaterialsInfo extends LitElement {\n // static override styles = css`\n // slot {\n // display: hidden;\n // }\n // `;\n // override render() {\n // return html` <slot></slot> `;\n // }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-companion-materials-info': QtiCompanionMaterialsInfo;\n }\n}\n","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\n\nimport type { ItemContext, TemplateVariable } from '@qti-components/base';\n\nexport class QtiContentBody extends LitElement {\n @consume({ context: itemContext, subscribe: true })\n @state()\n protected context?: ItemContext;\n\n override render() {\n return html`<slot @slotchange=${this.#expandMathVariables}></slot>`;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => this.#expandMathVariables());\n }\n\n protected override updated(changedProperties: Map<string | number | symbol, unknown>): void {\n if (changedProperties.has('context')) {\n this.#expandMathVariables();\n }\n }\n\n #expandMathVariables(): void {\n const mathVariables = new Map<string, string>();\n const templateVariables = (this.context?.variables ?? []).filter(variable => variable.type === 'template');\n\n for (const variable of templateVariables) {\n const templateVariable = variable as TemplateVariable;\n if (\n templateVariable.mathVariable !== true ||\n templateVariable.value === null ||\n templateVariable.value === undefined\n ) {\n continue;\n }\n\n mathVariables.set(templateVariable.identifier, this.#stringifyValue(templateVariable.value));\n }\n\n if (mathVariables.size === 0) {\n return;\n }\n\n const mathIdentifiers = Array.from(this.querySelectorAll('*')).filter(\n element => element.localName.toLowerCase() === 'mi' || element.localName.toLowerCase() === 'mn'\n );\n\n for (const element of mathIdentifiers) {\n const identifier = element.getAttribute('data-qti-math-variable-source') ?? element.textContent?.trim() ?? '';\n const value = mathVariables.get(identifier);\n\n if (!value) {\n continue;\n }\n\n if (element.localName.toLowerCase() === 'mn') {\n element.textContent = value;\n element.setAttribute('data-qti-math-variable-source', identifier);\n continue;\n }\n\n const replacement = document.createElement('mn');\n replacement.textContent = value;\n replacement.setAttribute('data-qti-math-variable-source', identifier);\n element.replaceWith(replacement);\n }\n }\n\n #stringifyValue(value: string | readonly string[] | number | boolean | null): string {\n if (Array.isArray(value)) {\n return value.join(' ');\n }\n\n return value?.toString() ?? '';\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-content-body': QtiContentBody;\n }\n}\n","import { css, LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\n/**\n * @summary The qti-context-declaration element declares context variables for an item.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.qti-context-declaration\n */\n\nexport class QtiContextDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'record';\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-context-declaration': QtiContextDeclaration;\n }\n}\n","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { Calculate } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\n\n/**\n * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw\n * <qti-custom-operator class=\"js.org\">\n <qti-base-value base-type=\"string\"><![CDATA[\n console.log(context.variables);\n return 'B'\n document.querySelector('qti-end-attempt-interaction').disabled = true;\n ]]></qti-base-value>\n </qti-custom-operator>\n </qti-set-outcome-value>\n */\n\nexport class QtiCustomOperator extends LitElement implements Calculate {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n #operatorFunction: Function;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n private _context?: ItemContext;\n\n override render() {\n return html`<slot @slotchange=${this.handleSlotChange}></slot>`;\n }\n\n handleSlotChange() {\n // expecting <[!CDATA[ ... ]]> is converted into <!-- ... --> with qti-transform: cDataToComment\n const commentNode = Array.from(this.firstElementChild?.childNodes ?? []).find(\n node => node.nodeType === Node.COMMENT_NODE\n );\n try {\n this.#operatorFunction = new Function('context', 'fn', 'item', commentNode?.textContent ?? '');\n } catch (e) {\n console.error('custom-operator contains invalid javascript code', e);\n }\n }\n\n public calculate() {\n const fn = {\n variable: (responseIdentifier: string) =>\n this._context?.variables.find(v => v.identifier === responseIdentifier)?.value ?? '',\n correct: (responseIdentifier: string) =>\n (this._context?.variables.find(v => v.identifier === responseIdentifier) as ResponseVariable)\n ?.correctResponse ?? ''\n };\n const item = {\n getVariable: (variableIdentifier: string) =>\n this._context?.variables.find(v => v.identifier === variableIdentifier),\n updateOutcomeVariable: (outcomeIdentifier: string, value: string | string[]) => {\n this.dispatchEvent(\n new CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>('qti-set-outcome-value', {\n bubbles: true,\n composed: true,\n detail: {\n outcomeIdentifier,\n value\n }\n })\n );\n },\n updateResponseVariable: (responseIdentifier: string, response: string | string[]) => {\n this.dispatchEvent(\n new CustomEvent<{ responseIdentifier: string; response: string | string[] }>('qti-interaction-response', {\n bubbles: true,\n composed: true,\n detail: {\n responseIdentifier,\n response\n }\n })\n );\n }\n };\n\n return this.#operatorFunction(this._context, fn, item);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-custom-operator': QtiCustomOperator;\n }\n}\n","import { css, html } from 'lit';\n\nimport { QtiFeedback } from '@qti-components/base';\n\nexport class QtiFeedbackBlock extends QtiFeedback {\n static override styles = css`\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n `;\n\n override render() {\n return html` <slot part=\"feedback\" class=\"feedback ${this.showStatus}\"></slot> `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.checkShowFeedback(this.outcomeIdentifier);\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-feedback-block': QtiFeedbackBlock;\n }\n}\n","import { css, html } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { QtiFeedback } from '@qti-components/base';\n\nexport class QtiFeedbackInline extends QtiFeedback {\n static override styles = css`\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n `;\n\n override render = () => html` <slot part=\"feedback\" class=\"${ifDefined(this.showStatus)}\"></slot> `;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.checkShowFeedback(this.outcomeIdentifier);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-feedback-inline': QtiFeedbackInline;\n }\n}\n","import { html, LitElement } from 'lit';\n\nimport styles from './qti-item-body.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @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.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi\n * @status stable\n * @since 4.0\n *\n * @slot - item body content.\n * @slot qti-rubric-block - the qti rubric block is placed above the item\n * @part qti-rubric-block - the qti rubric block part\n */\n\nexport class QtiItemBody extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n override render() {\n return html`<slot part=\"qti-rubric-blocks\" name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item-body': QtiItemBody;\n }\n}\n","import { css } from 'lit';\n\nexport default css`\n :host {\n display: block;\n }\n`;\n","import { css, html } from 'lit';\n\nimport { QtiFeedback } from '@qti-components/base';\n\nexport class QtiModalFeedback extends QtiFeedback {\n static override styles = css`\n .cito-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-box);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-box);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n /* Inlined from --qti-disabled-bg / --qti-disabled-color, which this button was the only reader\n of anywhere in the repo. They were named as a global disabled vocabulary but no interaction\n ever used them: the theme's disabled treatment is cursor only (see the note in qti-mixins.css). */\n .button:disabled {\n background-color: transparent;\n color: var(--qti-fg);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n `;\n\n override render() {\n return html`\n <dialog class=\"cito-dialog\" part=\"feedback\" ?open=\"${this.showStatus === 'on'}\">\n <slot></slot>\n <div style=\"margin-top: var(--qti-gap); text-align: center;\">\n <button class=\"button close-button\" @click=\"${this.closeFeedback}\">Close</button>\n </div>\n </dialog>\n `;\n }\n\n openFeedback() {\n const dialog = this.shadowRoot?.querySelector('dialog') as HTMLDialogElement | null;\n if (dialog && !dialog.open) {\n dialog.showModal();\n }\n }\n\n closeFeedback() {\n const dialog = this.shadowRoot?.querySelector('dialog') as HTMLDialogElement | null;\n if (dialog && dialog.open) {\n dialog.close();\n this.showStatus = 'off';\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (this.showStatus === 'on') {\n this.openFeedback();\n }\n }\n\n protected override updated(changedProperties: Map<string | number | symbol, unknown>): void {\n if (changedProperties.has('showStatus')) {\n if (this.showStatus === 'on') {\n this.openFeedback();\n } else {\n this.closeFeedback();\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-modal-feedback': QtiModalFeedback;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\nimport { QtiVariableDeclaration } from '@qti-components/base';\n\nimport type { BaseType, Cardinality } from '@qti-components/base';\nimport type { OutcomeVariable } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\n\nexport class QtiOutcomeDeclaration extends QtiVariableDeclaration {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType;\n @property({ type: String, attribute: 'external-scored' }) externalScored: 'human' | 'externalMachine' | null = null;\n @property({ type: String }) identifier: string;\n @property({ type: String }) cardinality: Cardinality;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n public itemContext?: ItemContext;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n const value = this.itemContext?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n get interpolationTable(): Map<number, number> | null {\n const table = this.querySelector('qti-interpolation-table');\n if (table) {\n const entries = new Map<number, number>();\n for (const entry of table.querySelectorAll('qti-interpolation-table-entry')) {\n if (!entry.getAttribute('source-value') && entry.getAttribute('target-value')) {\n console.error('source-value or target-value is missing in qti-interpolation-table-entry');\n }\n const sourceValue = parseFloat(entry.getAttribute('source-value'));\n const targetValue = parseFloat(entry.getAttribute('target-value'));\n if (isNaN(sourceValue) || isNaN(targetValue)) {\n console.error('source-value or target-value is not a number in qti-interpolation-table-entry');\n }\n entries.set(sourceValue, targetValue);\n }\n return entries;\n }\n return null;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n\n const defaultValue = this.defaultValues(this.cardinality);\n\n const outcomeVariable: OutcomeVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: defaultValue,\n type: 'outcome',\n value: null,\n interpolationTable: this.interpolationTable,\n externalScored: this.externalScored\n };\n // At runtime, outcome variables are instantiated as part of an item session.\n // Their values may be initialized with a default value and/or set during response processing.\n // If no default value is given in the declaration then the outcome variable is initialized to NULL unless the outcome is of a numeric type (integer or float) in which case it is initialized to 0.\n outcomeVariable.value = defaultValue;\n if (\n (outcomeVariable.value === null || outcomeVariable.value == undefined) &&\n (outcomeVariable.baseType === 'integer' || outcomeVariable.baseType === 'float')\n ) {\n outcomeVariable.value = '0';\n }\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable: outcomeVariable }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-outcome-declaration': QtiOutcomeDeclaration;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\nimport { QtiVariableDeclaration } from '@qti-components/base';\n\nimport type { QtiAreaMapping } from '@qti-components/base';\nimport type { BaseType, Cardinality } from '@qti-components/base';\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { QtiMapping } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\n\nexport class QtiResponseDeclaration extends QtiVariableDeclaration {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType;\n\n @property({ type: String }) identifier: string;\n\n @property({ type: String }) cardinality: Cardinality;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n public itemContext?: ItemContext;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n const value = this.itemContext?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n const defaultValue = this.defaultValues(this.cardinality);\n\n const responseVariable: ResponseVariable = {\n baseType: this.baseType,\n identifier: this.identifier,\n correctResponse: this.#correctResponse,\n cardinality: this.cardinality || 'single',\n mapping: this.#mapping,\n defaultValue,\n areaMapping: this.#areaMapping,\n value: null,\n type: 'response',\n candidateResponse: null\n };\n responseVariable.value = defaultValue;\n\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable: responseVariable }\n })\n );\n }\n\n get #correctResponse(): string | string[] {\n let result: string | string[];\n const correctResponse = this.querySelector('qti-correct-response');\n if (correctResponse) {\n const values = correctResponse.querySelectorAll('qti-value');\n if (this.cardinality === 'single' && values.length > 0) {\n result = values[0].textContent.trim();\n values[0].remove();\n } else if (this.cardinality !== 'single') {\n result = [];\n for (let i = 0; i < values.length; i++) {\n result.push(values[i].textContent.trim());\n values[i].remove();\n }\n }\n }\n return result;\n }\n\n get #mapping(): QtiMapping {\n const mappingElement = this.querySelector('qti-mapping');\n const lowerBound = parseFloat(mappingElement?.getAttribute('lower-bound'));\n const uppperBound = parseFloat(mappingElement?.getAttribute('upper-bound'));\n const mappingValue = {\n defaultValue: Number(mappingElement?.getAttribute('default-value')) || 0,\n lowerBound: isNaN(lowerBound) ? null : lowerBound,\n upperBound: isNaN(uppperBound) ? null : uppperBound,\n mapEntries: Array.from(mappingElement?.querySelectorAll('qti-map-entry') || []).map(el => ({\n mapKey: el.getAttribute('map-key') || '',\n mappedValue: Number(el.getAttribute('mapped-value')) || 0,\n caseSensitive: el.hasAttribute('case-sensitive') ? el.getAttribute('case-sensitive') !== 'false' : false\n }))\n };\n return mappingValue;\n }\n\n get #areaMapping(): QtiAreaMapping {\n const areaMappingElement = this.querySelector('qti-area-mapping') as HTMLElement;\n\n const defaultValue = Number(areaMappingElement?.getAttribute('default-value')) || 0;\n const lowerBound = parseFloat(areaMappingElement?.getAttribute('lower-bound'));\n const uppperBound = parseFloat(areaMappingElement?.getAttribute('upper-bound'));\n\n const areaMapEntries = Array.from(areaMappingElement?.querySelectorAll('qti-area-map-entry') || []).map(\n (el: HTMLElement) => ({\n shape: (el.getAttribute('shape') as 'default' | 'circle' | 'rect' | 'ellipse' | 'poly') || 'default',\n coords: el.getAttribute('coords') || '',\n mappedValue: Number(el.getAttribute('mapped-value')) || 0,\n defaultValue: Number(el.getAttribute('default-value')) || 0\n })\n );\n\n return {\n defaultValue,\n lowerBound: isNaN(lowerBound) ? null : lowerBound,\n upperBound: isNaN(uppperBound) ? null : uppperBound,\n areaMapEntries\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-response-declaration': QtiResponseDeclaration;\n }\n}\n","import { css, html, LitElement } from 'lit';\n\nimport { type QtiRuleBase } from '@qti-components/base';\n\nimport { mapResponse, mapResponsePoint, matchCorrect } from '../../internal/template-strings';\n\nimport type { PropertyValueMap } from 'lit';\n\n/** The response processing templates we substitute for, keyed by the file name in `template`. */\nconst responseProcessingTemplates: Record<string, string> = {\n map_response: mapResponse,\n map_response_point: mapResponsePoint,\n match_correct: matchCorrect\n};\n\nexport class QtiResponseProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n public process() {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) return;\n const rules = [...this.children] as unknown as QtiRuleBase[];\n for (const rule of rules) {\n rule.process();\n }\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n const template = this.getAttribute('template');\n if (!template) return;\n\n const templateName = template.split('/').pop()!.replace('.xml', '');\n const rules = responseProcessingTemplates[templateName];\n // Leave an unknown template's authored children alone; there is nothing to substitute.\n if (!rules) return;\n\n // Parsed through this element's own `innerHTML` rather than a fragment created off `document`:\n // the HTML fragment parsing algorithm takes its custom element registry from the context\n // element, so the rules are upgraded with the registry this element lives in. A fragment from\n // `document.createRange()` is parsed against the global registry, which leaves every rule an\n // unupgraded HTMLElement when the item was rendered into a scoped registry.\n this.innerHTML = rules;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-response-processing': QtiResponseProcessing;\n }\n}\n","export const matchCorrect = `<qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n <qti-correct identifier=\"RESPONSE\"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>`;\n\nexport const mapResponse = `<qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response identifier=\"RESPONSE\"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>`;\n\nexport const mapResponsePoint = `<qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response-point identifier=\"RESPONSE\"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>`;\n","import { LitElement, css, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { watch } from '@qti-components/utilities';\n\nexport class QtiRubricBlock extends LitElement {\n @property({ type: String }) override id: string; // =\"qtiAspectInhoudRubricBlock\"\n\n @property({ type: String }) use: 'instructions' | 'scoring' | 'navigation'; // = \"scoring\"\n\n @property({ type: String }) view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';\n\n @property({ type: String, attribute: 'class' }) classNames: string;\n @watch('classNames', { waitUntilFirstUpdate: true })\n handleclassNamesChange() {\n const classNames = this.classNames.split(' ');\n classNames.forEach((className: string) => {\n switch (className) {\n case 'qti-rubric-discretionary-placement':\n {\n const event = new CustomEvent('qti-rubric:discretionary-placement', {\n detail: { className, element: this },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n const notCancelled = this.dispatchEvent(event);\n if (!notCancelled) return;\n this.setAttribute('slot', 'qti-rubric-block');\n }\n break;\n case 'qti-rubric-inline':\n this.setAttribute('slot', '');\n break;\n default:\n break;\n }\n });\n }\n\n static override styles = css`\n :host {\n display: block;\n }\n `;\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-rubric-block': QtiRubricBlock;\n }\n}\n","import { LitElement } from 'lit';\n\nimport type { PropertyValueMap } from 'lit';\n\nexport class QtiStylesheet extends LitElement {\n #styleElement: HTMLStyleElement | null = null;\n\n protected override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n super.firstUpdated(_changedProperties);\n\n const link = this.getAttribute('href');\n\n if (link !== null) {\n // Fetch the stylesheet content\n fetch(link)\n .then(response => response.text())\n .then(cssContent => {\n // Minify the CSS content by removing whitespace and comments\n const minifiedCss = this.#minifyCss(cssContent);\n\n // Create a <style> element with @scope surrounding the minified CSS\n this.#styleElement = document.createElement('style');\n this.#styleElement.media = 'screen';\n this.#styleElement.textContent = `@scope {${minifiedCss}}`;\n\n // Append the style element to the parent element of this component\n if (this.parentElement) {\n this.parentElement.appendChild(this.#styleElement);\n } else {\n console.warn('No parent element to append the scoped stylesheet to.');\n }\n })\n .catch(error => {\n console.error('Failed to load stylesheet:', error);\n });\n }\n\n if (this.textContent !== null && this.textContent.trim() !== '') {\n // Minify the inline CSS content\n const minifiedCss = this.#minifyCss(this.textContent);\n\n // Directly create a <style> element with the @scope surrounding the minified inline styles\n this.#styleElement = document.createElement('style');\n this.#styleElement.media = 'screen';\n this.#styleElement.textContent = `@scope {${minifiedCss}}`;\n\n // Append the style element to the parent element of this component\n if (this.parentElement) {\n this.parentElement.appendChild(this.#styleElement);\n } else {\n console.warn('No parent element to append the scoped stylesheet to.');\n }\n }\n }\n\n #minifyCss(cssContent: string): string {\n // Remove comments, whitespace, and newline characters\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '') // Remove comments\n .replace(/\\s+/g, ' ') // Collapse whitespace\n .replace(/\\s*([{}:;])\\s*/g, '$1') // Remove spaces around {}, :, ;\n .trim(); // Trim leading/trailing whitespace\n }\n\n override disconnectedCallback() {\n if (this.#styleElement) {\n try {\n this.#styleElement.remove();\n } catch (error) {\n console.error('Could not remove stylesheet:', error);\n }\n }\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-stylesheet': QtiStylesheet;\n }\n}\n","import { LitElement, html } from 'lit';\n\nimport type { QtiExpression } from '@qti-components/base';\nimport type { QtiRuleBase } from '@qti-components/base';\n\n/**\n * @summary The qti-template-constraint element is a processing rule available only in Template Processing.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-constraint\n *\n * It terminates Template Processing and re-runs it from the beginning if the condition\n * specified in the template constraint is not satisfied. This can be used to iterate\n * the Template Processing with different randomly-generated values until a predetermined\n * condition is satisfied.\n */\n\nexport class QtiTemplateConstraint extends LitElement implements QtiRuleBase {\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Evaluates the constraint condition\n * @returns true if constraint is satisfied, false if template processing should restart\n */\n public calculate(): boolean {\n const expressions = [...this.children] as QtiExpression<boolean>[];\n\n if (expressions.length !== 1) {\n console.error('qti-template-constraint must have exactly one child expression');\n return true; // Don't restart on error\n }\n\n try {\n const result = expressions[0].calculate();\n return Boolean(result);\n } catch (error) {\n console.error('Error evaluating template constraint:', error);\n return true; // Don't restart on error\n }\n }\n\n /**\n * Template constraints don't have sub-rules like conditions\n */\n public getSubRules(): QtiRuleBase[] {\n return [];\n }\n\n /**\n * Process the template constraint\n * @returns true if constraint is satisfied, false if template processing should restart\n */\n public process(): boolean {\n const constraintSatisfied = this.calculate();\n\n if (!constraintSatisfied) {\n console.debug('Template constraint not satisfied, restarting template processing');\n }\n\n return constraintSatisfied;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-constraint': QtiTemplateConstraint;\n }\n}\n","import { css, LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport type { TemplateVariable } from '@qti-components/base';\nimport type { BaseType } from '@qti-components/base';\n\n/**\n * @summary The qti-template-declaration element declares template variables for item cloning.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration\n */\n\nexport class QtiTemplateDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'single';\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType = 'string';\n @property({ type: Boolean, attribute: 'math-variable' }) mathVariable: boolean = false;\n @property({ type: Boolean, attribute: 'param-variable' }) paramVariable: boolean = false;\n\n #defaultValue: any = null;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.#processDefaultValue();\n this.#registerTemplateVariable();\n });\n }\n\n /**\n * Process qti-default-value to extract the default value\n */\n #processDefaultValue(): void {\n const defaultValueElement = this.querySelector('qti-default-value');\n if (!defaultValueElement) {\n return;\n }\n\n // For now, just get the text content - this could be enhanced to handle expressions\n const textContent = defaultValueElement.textContent?.trim() || '';\n this.#defaultValue = this.#convertValue(textContent);\n }\n\n /**\n * Convert string value based on base-type\n */\n #convertValue(value: string): any {\n if (!value) return null;\n\n switch (this.baseType) {\n case 'integer':\n return parseInt(value, 10);\n case 'float':\n case 'duration':\n return parseFloat(value);\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'string':\n default:\n return value;\n }\n }\n\n /**\n * Register this template variable with the assessment item\n */\n #registerTemplateVariable(): void {\n const templateVariable: TemplateVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: this.#defaultValue,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n\n // Dispatch event to register the variable\n\n // value must string or string[]\n const variable = { ...templateVariable, value: this.#defaultValue?.toString() || '' };\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable }\n })\n );\n }\n\n /**\n * Get the template variable definition\n */\n public getTemplateVariable(): TemplateVariable {\n return {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-declaration': QtiTemplateDeclaration;\n }\n}\n","import { css, html, LitElement } from 'lit';\n\nimport type { QtiRuleBase } from '@qti-components/base';\nimport type { QtiTemplateConstraint } from '../qti-template-constraint/qti-template-constraint';\nimport type { PropertyValueMap } from 'lit';\n\n/**\n * @summary The qti-template-processing element contains template processing rules.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing\n */\n\nexport class QtiTemplateProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n #maxIterations = 100; // Prevent infinite loops in template constraints\n\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Process template rules to set template variable values\n */\n public process(): void {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) {\n console.warn('qti-template-processing must be inside qti-assessment-item');\n return;\n }\n\n let iterations = 0;\n let shouldReprocess = false;\n\n do {\n shouldReprocess = false;\n iterations++;\n\n if (iterations > this.#maxIterations) {\n console.error('Template processing exceeded maximum iterations. Possible infinite loop.');\n break;\n }\n\n try {\n const rules = [...this.children] as unknown as (Element & QtiRuleBase)[];\n for (const rule of rules) {\n // Check if this is a template constraint that failed\n if (rule.tagName.toLowerCase() === 'qti-template-constraint') {\n const constraintResult = (rule as QtiTemplateConstraint).calculate();\n if (constraintResult === false) {\n // Template constraint failed, restart processing\n shouldReprocess = true;\n break;\n }\n } else {\n rule.process();\n }\n }\n } catch (error) {\n console.error('Error during template processing:', error);\n break;\n }\n } while (shouldReprocess);\n\n // Dispatch event that template processing is complete\n this.dispatchEvent(\n new CustomEvent('qti-template-processing-complete', {\n bubbles: true,\n composed: true,\n detail: { iterations }\n })\n );\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n // Template processing doesn't typically use external templates like response processing\n // But we could add support for common template processing patterns here if needed\n if (this.getAttribute('template')) {\n console.info('Template processing with external template not yet implemented');\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-processing': QtiTemplateProcessing;\n }\n}\n","import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';\nimport { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nimport { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';\nimport { QtiContentBody } from './components/qti-content-body/qti-content-body';\nimport { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';\nimport { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';\nimport { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';\nimport { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';\nimport { QtiItemBody } from './components/qti-item-body/qti-item-body';\nimport { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';\nimport { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';\nimport { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';\nimport { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';\nimport { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';\nimport { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';\nimport { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';\nimport { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';\nimport { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';\n\nexport {\n QtiAssessmentItem,\n QtiAssessmentStimulusRef,\n QtiCompanionMaterialsInfo,\n QtiContentBody,\n QtiContextDeclaration,\n QtiCustomOperator,\n QtiFeedbackBlock,\n QtiFeedbackInline,\n QtiItemBody,\n QtiModalFeedback,\n QtiOutcomeDeclaration,\n QtiResponseDeclaration,\n QtiResponseProcessing,\n QtiRubricBlock,\n QtiStylesheet,\n QtiTemplateConstraint,\n QtiTemplateDeclaration,\n QtiTemplateProcessing\n};\n\nexport const qtiContentElements = [\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },\n { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },\n { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },\n { tag: 'qti-content-body', ctor: QtiContentBody },\n { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },\n { tag: 'qti-custom-operator', ctor: QtiCustomOperator },\n { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },\n { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },\n { tag: 'qti-item-body', ctor: QtiItemBody },\n { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },\n { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },\n { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },\n { tag: 'qti-response-processing', ctor: QtiResponseProcessing },\n { tag: 'qti-rubric-block', ctor: QtiRubricBlock },\n { tag: 'qti-stylesheet', ctor: QtiStylesheet },\n { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },\n { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },\n { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }\n] as const;\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,YAAY,YAAY;A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K,QAAO;UACd;QACF;MACF,SAAS,OAAO;AACd,gBAAQ,MAAM,qCAAqC,KAAK;AACxD;MACF;IACF,SAAS;AAGT,SAAK,cACH,IAAI,YAAY,oCAAoC;MAClD,SAAS;MACT,UAAU;MACV,QAAQ,EAAE,WAAU;KACrB,CAAC;EAEN;EAEgB,aAAa,oBAAqE;AAGhG,QAAI,KAAK,aAAa,UAAU,GAAG;AACjC,cAAQ,KAAK,gEAAgE;IAC/E;EACF;;;;AC7CK,IAAM,qBAAqB;EAChC,EAAE,KAAK,uBAAuB,MAAM,kBAAiB;EACrD,EAAE,KAAK,+BAA+B,MAAM,yBAAwB;EACpE,EAAE,KAAK,gCAAgC,MAAM,0BAAyB;EACtE,EAAE,KAAK,oBAAoB,MAAM,eAAc;EAC/C,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,uBAAuB,MAAM,kBAAiB;EACrD,EAAE,KAAK,sBAAsB,MAAM,iBAAgB;EACnD,EAAE,KAAK,uBAAuB,MAAM,kBAAiB;EACrD,EAAE,KAAK,iBAAiB,MAAM,YAAW;EACzC,EAAE,KAAK,sBAAsB,MAAM,iBAAgB;EACnD,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,4BAA4B,MAAM,uBAAsB;EAC/D,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,oBAAoB,MAAM,eAAc;EAC/C,EAAE,KAAK,kBAAkB,MAAM,cAAa;EAC5C,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,4BAA4B,MAAM,uBAAsB;EAC/D,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;;","names":["state","LitElement","property","LitElement","__decorate","property","LitElement","LitElement","html","LitElement","html","__decorate","LitElement","html","property","__decorate","consume","LitElement","html","state","LitElement","html","__decorate","consume","state","css","html","css","html","css","html","html","css","html","LitElement","css","LitElement","html","css","html","css","html","consume","css","html","property","state","css","html","__decorate","property","consume","state","consume","css","html","property","state","css","html","__decorate","property","consume","state","css","html","LitElement","LitElement","css","html","LitElement","css","html","property","LitElement","css","html","__decorate","property","LitElement","LitElement","html","css","LitElement","html","property","__decorate","css","html","LitElement"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../qti-corrections/src/mixins/correct-response.mixin.ts","../../qti-corrections/src/styles/correction.styles.ts","../../qti-corrections/src/mixins/candidate-correction.mixin.ts","../../qti-corrections/src/mixins/choice-correction.mixin.ts","../../qti-corrections/src/elements/qti-gap-text-correction.ts","../../qti-corrections/src/mixins/active-element-correction.mixin.ts","../../qti-corrections/src/elements/qti-hotspot-choice-correction.ts","../../qti-corrections/src/elements/qti-hottext-correction.ts","../../qti-corrections/src/elements/qti-simple-associable-choice-correction.ts","../../qti-corrections/src/elements/qti-simple-choice-correction.ts","../../qti-corrections/src/components/qti-assessment-item-correction.ts","../../qti-corrections/src/components/qti-item-correction.ts","../../qti-corrections/src/components/test-correction-elements.ts","../../qti-corrections/src/components/item-correct-response-mode/item-correct-response-mode.ts","../../qti-corrections/src/components/item-show-candidate-correction/item-show-candidate-correction.ts","../../qti-corrections/src/components/styles.ts","../../qti-corrections/src/components/item-show-correct-response/item-show-correct-response.ts","../../qti-corrections/src/components/test-show-correct-response/test-show-correct-response.ts","../../qti-corrections/src/mixins/drag-drop-correction.mixin.ts","../../qti-corrections/src/interactions/qti-associate-interaction-correction.ts","../../qti-corrections/src/interactions/qti-choice-interaction-correction.ts","../../qti-corrections/src/interactions/qti-extended-text-interaction-correction.ts","../../qti-corrections/src/interactions/shared.ts","../../qti-corrections/src/interactions/qti-gap-match-interaction-correction.ts","../../qti-corrections/src/interactions/qti-graphic-associate-interaction-correction.ts","../../qti-corrections/src/interactions/qti-graphic-gap-match-interaction-correction.ts","../../qti-corrections/src/interactions/qti-graphic-order-interaction-correction.ts","../../qti-corrections/src/interactions/qti-hotspot-interaction-correction.ts","../../qti-corrections/src/interactions/qti-hottext-interaction-correction.ts","../../qti-corrections/src/interactions/qti-inline-choice-interaction-correction.ts","../../qti-corrections/src/interactions/qti-match-interaction-correction.ts","../../qti-corrections/src/utils/longest-increasing-subsequence.ts","../../qti-corrections/src/interactions/qti-order-interaction-correction.ts","../../qti-corrections/src/interactions/qti-portable-custom-interaction-correction.ts","../../qti-corrections/src/interactions/qti-select-point-interaction-correction.ts","../../qti-corrections/src/interactions/qti-slider-interaction-correction.ts","../../qti-corrections/src/interactions/qti-text-entry-interaction-correction.ts"],"sourcesContent":["import { property, state } from 'lit/decorators.js';\n\nimport { watch } from '@qti-components/utilities';\nimport { responseAttributeConverter, type Interaction, type ResponseValue } from '@qti-components/base';\n\nimport type { CorrectionConfig } from '../context/correction-config';\n\ntype AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport enum Correctness {\n Correct = 'correct',\n PartiallyCorrect = 'partially-correct',\n Incorrect = 'incorrect'\n}\n\n/**\n * Adds correct-response and full-correct-response behaviour\n * on top of any `Interaction` subclass.\n *\n * Usage:\n * ```ts\n * export abstract class CorrectableInteraction extends CorrectResponseMixin(Interaction) {}\n * ```\n *\n * Interactions that genuinely have no correct-response concept\n * (extended-text, upload, media) should extend `Interaction` directly\n * and omit this mixin.\n */\nexport const CorrectResponseMixin = <T extends AbstractConstructor<Interaction>>(superClass: T) => {\n abstract class CorrectResponseMixinClass extends superClass {\n // ─── Correct-response attribute ──────────────────────────────────────────\n\n /**\n * The correct response for this interaction. Can be set as a comma-separated\n * string via attribute or as string/string[] via property.\n *\n * @example\n * ```html\n * <qti-choice-interaction correct-response=\"A,B\">\n * ```\n */\n @property({\n attribute: 'correct-response',\n reflect: true,\n converter: responseAttributeConverter({ emptyAs: null })\n })\n set correctResponseAttr(val: ResponseValue) {\n this._correctResponse = val;\n }\n\n get correctResponseAttr(): ResponseValue {\n return this._correctResponse;\n }\n\n // ─── Show-correct-response ────────────────────────────────────────────────\n\n @property({ type: Boolean, attribute: 'show-correct-response', reflect: true })\n showCorrectResponse = false;\n\n @watch('showCorrectResponse', { waitUntilFirstUpdate: true })\n protected _handleShowCorrectResponseChange = (_: boolean, show: boolean) => {\n this.toggleInternalCorrectResponse(show);\n };\n\n // ─── Show-full-correct-response ───────────────────────────────────────────\n\n @property({ type: Boolean, attribute: 'show-full-correct-response', reflect: true })\n showFullCorrectResponse = false;\n\n @watch('showFullCorrectResponse', { waitUntilFirstUpdate: true })\n protected _handleShowFullCorrectResponseChange = (_: boolean, show: boolean) => {\n this.toggleFullCorrectResponse(show);\n };\n\n // ─── Show-candidate-correction ────────────────────────────────────────────\n\n @property({ type: Boolean, attribute: 'show-candidate-correction', reflect: true })\n showCandidateCorrection = false;\n\n @watch('showCandidateCorrection', { waitUntilFirstUpdate: true })\n protected _handleShowCandidateCorrectionChange = (_: boolean, show: boolean) => {\n this.toggleCandidateCorrection(show);\n };\n\n // ─── isFullCorrectResponse ────────────────────────────────────────────────\n\n @state()\n protected _isFullCorrectResponse: boolean;\n\n get isFullCorrectResponse(): boolean {\n return this._isFullCorrectResponse;\n }\n\n protected override get registersWithItem(): boolean {\n return !this.isFullCorrectResponse && super.registersWithItem;\n }\n\n set isFullCorrectResponse(val: boolean) {\n this._isFullCorrectResponse = val;\n if (val) {\n // `inert` already makes the answer-key clone non-interactive. Do NOT also set `disabled`:\n // it would mark every choice `:state(disabled)`, which the theme dims (opacity), fading the\n // answer key that is meant to be crisp. inert is enough.\n this.setAttribute('inert', '');\n this.setAttribute('response-identifier', this.responseIdentifier + '_cr');\n // An answer key shows the answer, not the means of giving one, so every drag-drop\n // interaction hides its chip bank here. Each one does that in its own stylesheet, keyed on\n // this attribute — hiding removes a box from the flow, which makes it layout, and layout is\n // not the theme's to declare (CONTRACT.md §7).\n //\n // The class the theme used instead, `.full-correct-response`, is on the wrapper *around*\n // this element, so only a document selector could see it. This attribute is on the clone\n // itself, which is what a shadow root can reach.\n this.setAttribute('answer-key', '');\n }\n }\n\n // ─── correctResponse property ─────────────────────────────────────────────\n\n @state()\n protected _correctResponse: string | string[] | null = null;\n\n get correctResponse(): Readonly<string | string[] | null> {\n const responseVariable = this.responseVariable;\n if (responseVariable?.correctResponse) {\n return responseVariable.correctResponse;\n }\n return this._correctResponse;\n }\n\n set correctResponse(val: Readonly<string | string[] | null>) {\n const oldVal = this._correctResponse;\n this._correctResponse = val as string | string[] | null;\n if (val === null || val === undefined) {\n this.removeAttribute('correct-response');\n } else {\n this.setAttribute('correct-response', Array.isArray(val) ? val.join(',') : (val as string));\n }\n this.requestUpdate('_correctResponse', oldVal);\n }\n\n // ─── correctness getter ───────────────────────────────────────────────────\n\n get correctness(): Readonly<Correctness | null> {\n const correctResponse = this.correctResponse;\n if (!correctResponse) return null;\n\n const currentResponse = this.response;\n if (\n currentResponse === null ||\n currentResponse === undefined ||\n currentResponse === '' ||\n (Array.isArray(currentResponse) && currentResponse.length === 0)\n ) {\n return null;\n }\n\n const correctArr = Array.isArray(correctResponse) ? correctResponse : [correctResponse];\n const responseArr = Array.isArray(currentResponse) ? currentResponse : [currentResponse];\n const filteredResponseArr = responseArr.filter(r => r !== '');\n if (filteredResponseArr.length === 0) return null;\n\n const correctCount = filteredResponseArr.filter(r => correctArr.includes(r)).length;\n const incorrectCount = filteredResponseArr.filter(r => !correctArr.includes(r)).length;\n\n if (\n correctCount === correctArr.length &&\n incorrectCount === 0 &&\n filteredResponseArr.length === correctArr.length\n ) {\n return Correctness.Correct;\n }\n\n if (correctCount > 0 && (correctCount < correctArr.length || incorrectCount > 0)) {\n return Correctness.PartiallyCorrect;\n }\n\n return Correctness.Incorrect;\n }\n\n // ─── correctionPart ───────────────────────────────────────────────────────\n\n public get correctionPart(): string {\n return 'correction';\n }\n\n // ─── toggle methods ───────────────────────────────────────────────────────\n\n public toggleCorrectResponse(show: boolean): void {\n const correctionConfig = this.configContext as CorrectionConfig | undefined;\n const correctResponseMode = correctionConfig?.correctResponseMode || 'internal';\n\n if (correctResponseMode === 'full') {\n this.toggleFullCorrectResponse(show);\n } else {\n this.toggleInternalCorrectResponse(show);\n }\n }\n\n /**\n * Whether the full correct response is withheld from a candidate who is already correct.\n *\n * Withheld by default, unless the item configures `fullCorrectResponseOnlyWhenIncorrect: false`\n * — the behaviour `show-full-correct-response` has always had, on the reasoning that a correct\n * answer already *is* the key.\n *\n * An interaction that routes its internal mode here overrides this to false: there, the caller\n * asked to show the correct response, and silently showing nothing is worse than showing the\n * candidate the answer they already gave.\n */\n protected get withholdsFullCorrectResponseWhenCorrect(): boolean {\n return (this.configContext as CorrectionConfig | undefined)?.fullCorrectResponseOnlyWhenIncorrect !== false;\n }\n\n protected async toggleFullCorrectResponse(show: boolean): Promise<void> {\n const nextSibling = this.nextSibling;\n const nextSiblingIsFullCorrectResponse =\n nextSibling instanceof HTMLDivElement && nextSibling?.classList.contains('full-correct-response');\n\n const correctResponse = this.correctResponse;\n\n if (!correctResponse) {\n return;\n }\n\n const showFullCorrectResponse =\n show && (!this.withholdsFullCorrectResponseWhenCorrect || this.correctness !== Correctness.Correct);\n\n if (!showFullCorrectResponse) {\n if (!nextSiblingIsFullCorrectResponse) {\n return;\n }\n this.parentElement?.removeChild(nextSibling);\n return;\n }\n\n if (nextSiblingIsFullCorrectResponse) {\n return;\n }\n\n const clone = this.cloneNode(true) as Interaction & CorrectResponseMixinClass;\n\n clone.removeAttribute('show-full-correct-response');\n clone.removeAttribute('show-correct-response');\n clone.removeAttribute('show-candidate-correction');\n\n const containerDiv = document.createElement('div');\n containerDiv.classList.add('full-correct-response');\n if (this.isInline) {\n containerDiv.classList.add('full-correct-response-inline');\n } else {\n containerDiv.classList.add('full-correct-response-block');\n }\n containerDiv.role = 'full-correct-response';\n containerDiv.appendChild(clone);\n\n clone.isFullCorrectResponse = true;\n\n this.parentElement?.insertBefore(containerDiv, this.nextSibling);\n await clone.updateComplete;\n\n clone.response = Array.isArray(correctResponse)\n ? ([...correctResponse] as string[])\n : (correctResponse as string);\n }\n\n public toggleInternalCorrectResponse(show: boolean): void {\n this._internals.states.delete('show-correct-response');\n if (show && this.correctResponse) {\n this._internals.states.add('show-correct-response');\n }\n }\n\n public toggleCandidateCorrection(show: boolean): void {\n if (!show) {\n return;\n }\n }\n\n // ─── Lifecycle ────────────────────────────────────────────────────────────\n\n protected override firstUpdated(): void {\n super.firstUpdated();\n\n if (this.isFullCorrectResponse) {\n return;\n }\n\n if (this.showCorrectResponse) {\n this.toggleInternalCorrectResponse(true);\n }\n if (this.showFullCorrectResponse) {\n this.toggleFullCorrectResponse(true);\n }\n }\n }\n\n // Cast strips the anonymous class type so TypeScript can generate clean .d.ts\n // for any named class that extends this mixin (avoids TS4094).\n return CorrectResponseMixinClass as unknown as AbstractConstructor<CorrectResponseInterface> & T;\n};\n\n/** Public type surface exposed by `CorrectResponseMixin`. */\nexport interface CorrectResponseInterface {\n correctResponseAttr: ResponseValue;\n showCorrectResponse: boolean;\n showFullCorrectResponse: boolean;\n showCandidateCorrection: boolean;\n isFullCorrectResponse: boolean;\n correctResponse: Readonly<string | string[] | null>;\n readonly correctness: Readonly<Correctness | null>;\n readonly correctionPart: string;\n toggleCorrectResponse(show: boolean): void;\n toggleCandidateCorrection(show: boolean): void;\n /** Protected at runtime; exposed here so subclasses can call `super.toggleInternalCorrectResponse()`. */\n toggleInternalCorrectResponse(show: boolean): void;\n /** Protected at runtime. */\n toggleFullCorrectResponse(show: boolean): Promise<void>;\n /** Protected at runtime; declared here so a subclass can `override` it. */\n readonly withholdsFullCorrectResponseWhenCorrect: boolean;\n}\n","import { css } from 'lit';\n\n/**\n * The candidate-correction badge shared by correction-package elements.\n *\n * The component decides where the badge sits in the markup — last, after the label — and how big\n * its box is. It decides nothing about how it looks. The disc, the tick, the cross, and whether it\n * is lifted out of flow at all are the theme's, keyed on ::part(correction-correct) /\n * ::part(correction-incorrect).\n *\n * It replaces six implementations of one idea: four ::after glyph blocks in kennisnet, an\n * ::before/::after pair in order-interaction, and a .correct-option span that gap-match and match\n * built in JavaScript with inline styles. Several of those set margin-left and width inside a\n * :state(candidate-*) rule — a transient state doing layout, which is the bug this contract exists\n * to prevent.\n *\n * Reachable everywhere. A chip has three homes, and inside a drop target's shadow root the document\n * cannot see its badge: parts do not chain, so ::part(drag)::part(correction) is inert. A part\n * token survives exportparts, so one bare ::part(correction-correct) reaches the badge in the drag\n * bank, on the floating clone, and inside a gap. Verified in Chromium.\n *\n * Deliberately not anchored, and not absolutely positioned. Both were tried; both left\n * qti-choice-interaction unable to reach layout stability, and the VRT stability detector spent 20\n * seconds waiting before capturing a half-settled frame. A theme that wants a corner badge can\n * position ::part(correction-correct) itself — it is a part, that is the point.\n */\nexport const correctionPart = css`\n /* Nothing at all until the item judges this element. */\n [part~='correction'] {\n display: none;\n }\n\n [part~='correction-correct'],\n [part~='correction-incorrect'],\n [part~='correction-partially-correct'] {\n display: inline-flex;\n flex: 0 0 auto;\n\n /*\n * The badge aligns ITSELF, and that is the whole of the vertical story.\n *\n * It is a flex item with a definite height, so left alone its cross-axis position is decided by\n * whatever its host says — and the hosts disagree: qti-simple-associable-choice defaults to\n * align-items: normal, and qti-gap-text gates center behind :not([part~='drag']), so the\n * same chip centred its badge in the bank and top-aligned it once placed. align-self settles it\n * from the badge's side, in one line, without touching a single container.\n *\n * This replaces an align-items/justify-content: center pair that had never done anything: the\n * badge is empty — a mask painted over a background — so centring its CONTENTS centres nothing.\n */\n align-self: center;\n\n box-sizing: border-box;\n width: var(--qti-correction-size, 1em);\n height: var(--qti-correction-size, 1em);\n margin-left: var(--qti-glyph-gap, 0.5em);\n\n pointer-events: none;\n }\n`;\n","import { state } from 'lit/decorators.js';\n\nimport { CorrectResponseMixin, Correctness, type CorrectResponseInterface } from './correct-response.mixin';\n\nimport type { Interaction } from '@qti-components/base';\n\ntype AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport const CandidateCorrectionMixin = <T extends AbstractConstructor<Interaction>>(superClass: T) => {\n abstract class CandidateCorrectionMixinClass extends CorrectResponseMixin(superClass) {\n @state() private _candidateCorrection: 'correct' | 'incorrect' | 'partially-correct' | null = null;\n\n public override get correctionPart(): string {\n return this._candidateCorrection ? `correction correction-${this._candidateCorrection}` : 'correction';\n }\n\n public override toggleCandidateCorrection(show: boolean): void {\n if (this.showCandidateCorrection !== show) {\n this.showCandidateCorrection = show;\n }\n\n super.toggleCandidateCorrection(show);\n\n const internals = (this as unknown as { _internals: ElementInternals })._internals;\n\n internals.states.delete('candidate-correct');\n internals.states.delete('candidate-partially-correct');\n internals.states.delete('candidate-incorrect');\n\n let verdict: 'correct' | 'incorrect' | 'partially-correct' | null = null;\n\n if (show) {\n if (this.correctness === Correctness.Correct) {\n internals.states.add('candidate-correct');\n verdict = 'correct';\n }\n if (this.correctness === Correctness.PartiallyCorrect) {\n internals.states.add('candidate-partially-correct');\n verdict = 'partially-correct';\n }\n if (this.correctness === Correctness.Incorrect) {\n internals.states.add('candidate-incorrect');\n verdict = 'incorrect';\n }\n }\n\n if (this._candidateCorrection !== verdict) {\n this._candidateCorrection = verdict;\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback?.();\n\n queueMicrotask(() => {\n if (!this.isConnected || this.isFullCorrectResponse) {\n return;\n }\n if (this.showCandidateCorrection) {\n this.toggleCandidateCorrection(true);\n }\n });\n }\n }\n\n return CandidateCorrectionMixinClass as unknown as AbstractConstructor<CorrectResponseInterface> & T;\n};\n","import { CandidateCorrectionMixin } from './candidate-correction.mixin';\n\nimport type { Interaction } from '@qti-components/base';\nimport type { CorrectResponseInterface } from './correct-response.mixin';\n\ntype AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;\n\ntype CorrectableChoice = HTMLElement & {\n identifier: string;\n internals: ElementInternals;\n candidateCorrection: 'correct' | 'incorrect' | 'partially-correct' | null;\n};\n\ntype ChoicesCorrectionBase = Interaction & {\n readonly response: string | string[] | null;\n readonly internals: ElementInternals;\n};\n\n/** Adds per-choice candidate marking to interactions built on `ChoicesMixin`. */\nexport const ChoiceCorrectionMixin = <T extends AbstractConstructor<ChoicesCorrectionBase>>(superClass: T) => {\n abstract class ChoiceCorrectionMixinClass extends CandidateCorrectionMixin(superClass) {\n declare protected _choiceElements: CorrectableChoice[];\n\n public override toggleInternalCorrectResponse(show: boolean): void {\n super.toggleInternalCorrectResponse(show);\n\n const correctResponse = this.correctResponse;\n const correctResponses = correctResponse\n ? Array.isArray(correctResponse)\n ? correctResponse\n : [correctResponse]\n : [];\n\n for (const choice of this._choiceElements) {\n choice.internals.states.delete('correct-response');\n choice.internals.states.delete('incorrect-response');\n if (show && correctResponses.length > 0) {\n choice.internals.states.add(\n correctResponses.includes(choice.identifier) ? 'correct-response' : 'incorrect-response'\n );\n }\n }\n }\n\n public override toggleCandidateCorrection(show: boolean): void {\n super.toggleCandidateCorrection(show);\n\n for (const choice of this._choiceElements) {\n choice.candidateCorrection = null;\n }\n\n if (!show || !this.correctResponse) {\n return;\n }\n\n const correctResponses = Array.isArray(this.correctResponse) ? this.correctResponse : [this.correctResponse];\n const candidateResponses = Array.isArray(this.response) ? this.response : this.response ? [this.response] : [];\n\n for (const choice of this._choiceElements) {\n if (!candidateResponses.includes(choice.identifier)) {\n continue;\n }\n choice.candidateCorrection = correctResponses.includes(choice.identifier) ? 'correct' : 'incorrect';\n }\n }\n }\n\n return ChoiceCorrectionMixinClass as unknown as AbstractConstructor<CorrectResponseInterface> & T;\n};\n","import { html } from 'lit';\n\nimport { QtiGapText } from '@qti-components/interactions-core/elements/qti-gap-text';\n\nimport { ActiveElementCorrectionMixin } from '../mixins/active-element-correction.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nexport class QtiGapTextCorrection extends ActiveElementCorrectionMixin(QtiGapText) {\n static override styles = [QtiGapText.styles, correctionPart];\n\n override render() {\n return html`<div part=\"control\"></div>\n <slot part=\"label\"></slot>\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>`;\n }\n}\n","type AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport type CandidateCorrection = 'correct' | 'incorrect' | 'partially-correct' | null;\n\nexport interface ActiveElementCorrectionInterface {\n candidateCorrection: CandidateCorrection;\n readonly correctionPart: string;\n}\n\ntype ActiveElement = HTMLElement & {\n readonly internals: ElementInternals;\n requestUpdate(name?: PropertyKey, oldValue?: unknown): unknown;\n};\n\n/** Adds candidate-verdict state to a lean choice/chip element. */\nexport const ActiveElementCorrectionMixin = <T extends AbstractConstructor<ActiveElement>>(superClass: T) => {\n abstract class ActiveElementCorrectionMixinClass extends superClass {\n #candidateCorrection: CandidateCorrection = null;\n\n public get candidateCorrection(): CandidateCorrection {\n return this.#candidateCorrection;\n }\n\n public set candidateCorrection(value: CandidateCorrection) {\n if (this.#candidateCorrection === value) return;\n const previous = this.#candidateCorrection;\n this.#candidateCorrection = value;\n\n const states = this.internals.states;\n states.delete('candidate-correct');\n states.delete('candidate-incorrect');\n states.delete('candidate-partially-correct');\n if (value) states.add(`candidate-${value}`);\n this.requestUpdate('candidateCorrection', previous);\n }\n\n public get correctionPart(): string {\n return this.#candidateCorrection ? `correction correction-${this.#candidateCorrection}` : 'correction';\n }\n }\n\n return ActiveElementCorrectionMixinClass as unknown as AbstractConstructor<ActiveElementCorrectionInterface> & T;\n};\n","import { property } from 'lit/decorators.js';\n\nimport { QtiHotspotChoice } from '@qti-components/interactions-core/elements/qti-hotspot-choice';\n\nimport { ActiveElementCorrectionMixin } from '../mixins/active-element-correction.mixin';\n\nexport class QtiHotspotChoiceCorrection extends ActiveElementCorrectionMixin(QtiHotspotChoice) {\n @property({ attribute: 'aria-ordercorrectvalue', type: Number, reflect: true })\n orderCorrect: number | null = null;\n}\n","import { html } from 'lit';\n\nimport { QtiHottext } from '@qti-components/interactions-core/elements/qti-hottext';\n\nimport { ActiveElementCorrectionMixin } from '../mixins/active-element-correction.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nexport class QtiHottextCorrection extends ActiveElementCorrectionMixin(QtiHottext) {\n static override styles = [QtiHottext.styles, correctionPart];\n\n override render() {\n return html`<div part=\"control\"><div part=\"control-mark\"></div></div>\n <slot part=\"label\"></slot>\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>`;\n }\n}\n","import { html } from 'lit';\nimport { repeat } from 'lit/directives/repeat.js';\n\nimport { QtiSimpleAssociableChoice } from '@qti-components/interactions-core/elements/qti-simple-associable-choice';\n\nimport { ActiveElementCorrectionMixin } from '../mixins/active-element-correction.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nexport class QtiSimpleAssociableChoiceCorrection extends ActiveElementCorrectionMixin(QtiSimpleAssociableChoice) {\n static override styles = [QtiSimpleAssociableChoice.styles, correctionPart];\n\n override render() {\n return html`\n <div part=\"control\"></div>\n <slot part=\"label\"></slot>\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>\n <div part=\"drop\">\n ${repeat(\n this.drags,\n node => node.getAttribute('identifier'),\n node => node\n )}\n </div>\n `;\n }\n}\n","import { html, nothing } from 'lit';\n\nimport { QtiSimpleChoice } from '@qti-components/interactions-core/elements/qti-simple-choice';\n\nimport { ActiveElementCorrectionMixin } from '../mixins/active-element-correction.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nexport class QtiSimpleChoiceCorrection extends ActiveElementCorrectionMixin(QtiSimpleChoice) {\n static override styles = [QtiSimpleChoice.styles, correctionPart];\n\n override render() {\n return html`<div part=\"control\" tabindex=\"0\"><div part=\"control-mark\"></div></div>\n ${this.marker ? html`<div id=\"label\" part=\"marker\">${this.marker}</div>` : nothing}\n <slot part=\"label\"></slot>\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>`;\n }\n}\n","import { QtiAssessmentItem } from '@qti-components/elements/elements';\n\ntype CorrectionInteraction = {\n toggleCorrectResponse(show: boolean): void;\n toggleCandidateCorrection(show: boolean): void;\n};\n\n/** Assessment-item extension that coordinates correction-capable interactions. */\nexport class QtiAssessmentItemCorrection extends QtiAssessmentItem {\n public showCorrectResponse(show: boolean): void {\n for (const interaction of this.interactionElements) {\n (interaction as unknown as Partial<CorrectionInteraction>).toggleCorrectResponse?.(show);\n }\n\n this.updateControlState('item-show-correct-response', show);\n }\n\n public showCandidateCorrection(show: boolean): void {\n for (const interaction of this.interactionElements) {\n (interaction as unknown as Partial<CorrectionInteraction>).toggleCandidateCorrection?.(show);\n }\n\n this.updateControlState('item-show-candidate-correction', show);\n }\n\n protected override afterResponseVariableUpdated(): void {\n this.showCandidateCorrection(false);\n }\n\n private updateControlState(selector: string, shown: boolean): void {\n let root = this.getRootNode();\n while (true) {\n (root as ParentNode)\n .querySelectorAll<HTMLElement & { shown: boolean }>(selector)\n .forEach(control => (control.shown = shown));\n\n if (!(root instanceof ShadowRoot)) return;\n root = root.host.getRootNode();\n }\n }\n}\n","import { QtiItem } from '@qti-components/item/elements';\n\nimport type { CorrectResponseMode } from '../context/correction-config';\n\ntype CorrectionAssessmentItem = {\n showCorrectResponse(show: boolean): void;\n showCandidateCorrection(show: boolean): void;\n};\n\n/** Item host extension that handles correction controls and mode changes. */\nexport class QtiItemCorrection extends QtiItem {\n readonly #onShowCorrectResponse = (event: Event) => {\n const show = (event as CustomEvent<boolean>).detail;\n (this.assessmentItem as unknown as Partial<CorrectionAssessmentItem>)?.showCorrectResponse?.(show);\n this.updateControlState('item-show-correct-response', show);\n };\n\n readonly #onShowCandidateCorrection = (event: Event) => {\n const show = (event as CustomEvent<boolean>).detail;\n (this.assessmentItem as unknown as Partial<CorrectionAssessmentItem>)?.showCandidateCorrection?.(show);\n this.updateControlState('item-show-candidate-correction', show);\n };\n\n readonly #onSwitchCorrectResponseMode = (event: Event) => {\n (this.assessmentItem as unknown as Partial<CorrectionAssessmentItem>)?.showCorrectResponse?.(false);\n this.configContext = {\n ...this.configContext,\n correctResponseMode: (event as CustomEvent<CorrectResponseMode>).detail\n } as typeof this.configContext;\n };\n\n constructor() {\n super();\n this.addEventListener('item-show-correct-response', this.#onShowCorrectResponse);\n this.addEventListener('item-show-candidate-correction', this.#onShowCandidateCorrection);\n this.addEventListener('item-switch-correct-response-mode', this.#onSwitchCorrectResponseMode);\n }\n\n private updateControlState(selector: string, shown: boolean): void {\n this.querySelectorAll<HTMLElement & { shown: boolean }>(selector).forEach(control => (control.shown = shown));\n }\n\n override disconnectedCallback(): void {\n this.removeEventListener('item-show-correct-response', this.#onShowCorrectResponse);\n this.removeEventListener('item-show-candidate-correction', this.#onShowCandidateCorrection);\n this.removeEventListener('item-switch-correct-response-mode', this.#onSwitchCorrectResponseMode);\n super.disconnectedCallback();\n }\n}\n","import { QtiTest, TestCheckItem, TestNavigation } from '@qti-components/test/elements';\n\nimport type { View } from '@qti-components/base';\nimport type { QtiAssessmentItem } from '@qti-components/elements';\n\ntype CorrectionAssessmentItem = QtiAssessmentItem & {\n showCorrectResponse(show: boolean): void;\n showCandidateCorrection(show: boolean): void;\n};\n\n/** Test navigation extension that routes correction controls to the active item. */\nexport class TestNavigationCorrection extends TestNavigation {\n readonly #onShowCorrectResponse = (event: Event) => {\n (this.activeAssessmentItem as Partial<CorrectionAssessmentItem> | undefined)?.showCorrectResponse?.(\n (event as CustomEvent<boolean>).detail\n );\n };\n\n readonly #onShowCandidateCorrection = (event: Event) => {\n (this.activeAssessmentItem as Partial<CorrectionAssessmentItem> | undefined)?.showCandidateCorrection?.(\n (event as CustomEvent<boolean>).detail\n );\n };\n\n constructor() {\n super();\n this.addEventListener('test-show-correct-response', this.#onShowCorrectResponse);\n this.addEventListener('test-show-candidate-correction', this.#onShowCandidateCorrection);\n }\n\n override disconnectedCallback(): void {\n this.removeEventListener('test-show-correct-response', this.#onShowCorrectResponse);\n this.removeEventListener('test-show-candidate-correction', this.#onShowCandidateCorrection);\n super.disconnectedCallback();\n }\n}\n\n/** Test host extension that shows correct responses in scorer view. */\nexport class QtiTestCorrection extends QtiTest {\n public override updateAssessmentItemView(assessmentItem: QtiAssessmentItem, view: View): void {\n (assessmentItem as Partial<CorrectionAssessmentItem>).showCorrectResponse?.(view === 'scorer');\n }\n}\n\n/** Check-item extension that reveals the correct response after scoring. */\nexport class TestCheckItemCorrection extends TestCheckItem {\n constructor() {\n super();\n this.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('test-show-correct-response', { detail: true, bubbles: true }));\n });\n }\n}\n","import { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { configContext } from '@qti-components/base';\n\nimport type { ConfigContext } from '@qti-components/base';\nimport type { CorrectionConfig, CorrectResponseMode } from '../../context/correction-config';\n\nexport class ItemCorrectResponseMode extends LitElement {\n @consume({ context: configContext, subscribe: true })\n private itemContext: ConfigContext & CorrectionConfig;\n\n @property({ type: String })\n label = 'Correct response mode';\n\n @state()\n private _options = {\n internal: 'Internal',\n full: 'Full (copy)'\n };\n\n #switchMode(view: CorrectResponseMode) {\n this.dispatchEvent(\n new CustomEvent('item-switch-correct-response-mode', {\n detail: view,\n bubbles: true\n })\n );\n }\n\n override render() {\n return html`\n <label part=\"label\" for=\"modeSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"modeSelect\"\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this.#switchMode(el.value as CorrectResponseMode);\n }}\n >\n ${Object.keys(this._options).map(\n value =>\n html`<option value=\"${value}\" ?selected=${value === this.itemContext?.correctResponseMode}>\n ${this._options[value as keyof typeof this._options]}\n </option>`\n )}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-correct-response-mode': ItemCorrectResponseMode;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedItemContext } from '@qti-components/base';\n\nexport class ItemShowCandidateCorrection extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCandidateCorrectionText = 'Show candidate correction';\n @property({ type: String }) hideCandidateCorrectionText = 'Hide candidate correction';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n #hasCorrectResponse = false; // correct response is removed on certain point\n #previousActiveItem = ''; // Store previous active item reference\n\n constructor() {\n super();\n }\n\n override updated() {\n if (!this.#hasCorrectResponse || this.#previousActiveItem !== this.computedContext?.identifier) {\n this.#previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => (v as any)['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.#hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this.#hasCorrectResponse;\n }\n\n #toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-candidate-correction', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n #getDisplayedText(): string {\n return this.disabled\n ? this.noCorrectResponseText\n : this.shown\n ? this.hideCandidateCorrectionText\n : this.showCandidateCorrectionText;\n }\n\n override render() {\n return html` <div @click=\"${this.#toggleState}\">${this.#getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-candidate-correction': ItemShowCandidateCorrection;\n }\n}\n","import { css } from 'lit';\n\nexport const form = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n`;\n\nexport const btn = css`\n background-color: lightgray;\n ${form};\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.8;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n","import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedItemContext } from '@qti-components/base';\n\nexport class ItemShowCorrectResponse extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n #hasCorrectResponse = false; // correct response is removed on certain point\n #previousActiveItem = ''; // Store previous active item reference\n\n override updated() {\n if (!this.#hasCorrectResponse || this.#previousActiveItem !== this.computedContext?.identifier) {\n this.#previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => (v as any)['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.#hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this.#hasCorrectResponse;\n }\n\n #toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-correct-response', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n #getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n override render() {\n return html` <div @click=\"${this.#toggleState}\">${this.#getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-correct-response': ItemShowCorrectResponse;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedContext } from '@qti-components/base';\n\n/**\n * @deprecated test-show-correct-response is deprecated and will be removed in the future.\n */\n\nexport class TestShowCorrectResponse extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n #previousActiveItem?: unknown; // Store previous active item reference\n\n override willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n // If active item changed, reset shown before the update\n if (this.#previousActiveItem !== activeItem) {\n this.shown = false;\n this.#previousActiveItem = activeItem; // Update previous active item\n }\n\n if (activeItem) {\n const containsCorrectResponse = !!activeItem?.variables?.some(v => (v as any)['correctResponse']);\n const containsMapping = !!activeItem?.variables?.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.disabled = !containsCorrectResponse && !containsMapping;\n } else {\n this.disabled = true;\n }\n }\n #toggleState() {\n if (this.disabled) return;\n this.shown = !this.shown;\n\n this.dispatchEvent(\n new CustomEvent('test-show-correct-response', {\n detail: this.shown,\n bubbles: true\n })\n );\n }\n\n #getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n override render() {\n return html` <div @click=\"${this.#toggleState}\">${this.#getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-show-correct-response': TestShowCorrectResponse;\n }\n}\n","import { CandidateCorrectionMixin } from './candidate-correction.mixin';\n\nimport type { Interaction } from '@qti-components/base';\nimport type { CorrectResponseInterface } from './correct-response.mixin';\n\ntype AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;\n\ntype DragDropInteraction = Interaction & {\n afterCache(): void;\n};\n\n/** Adds correction lifecycle behavior shared by drag-and-drop interactions. */\nexport const DragDropCorrectionMixin = <T extends AbstractConstructor<DragDropInteraction>>(superClass: T) => {\n abstract class DragDropCorrectionMixinClass extends CandidateCorrectionMixin(superClass) {\n public override toggleInternalCorrectResponse(show: boolean): void {\n if (!this.showFullCorrectResponse) {\n this.toggleFullCorrectResponse(show);\n }\n }\n\n public override afterCache(): void {\n super.afterCache();\n if (this.showCorrectResponse) this.toggleInternalCorrectResponse(true);\n if (this.showCandidateCorrection) this.toggleCandidateCorrection(true);\n if (this.showFullCorrectResponse) this.toggleFullCorrectResponse(true);\n }\n }\n\n return DragDropCorrectionMixinClass as unknown as AbstractConstructor<CorrectResponseInterface> & T;\n};\n","import { QtiAssociateInteraction } from '@qti-components/associate-interaction/elements';\n\nimport { DragDropCorrectionMixin } from '../mixins/drag-drop-correction.mixin';\n\nexport class QtiAssociateInteractionCorrection extends DragDropCorrectionMixin(QtiAssociateInteraction) {}\n","import { QtiChoiceInteraction } from '@qti-components/choice-interaction/elements';\n\nimport { ChoiceCorrectionMixin } from '../mixins/choice-correction.mixin';\n\n/**\n * Correction-capable `qti-choice-interaction` implementation.\n *\n * It is registered under the standard tag only inside a correction registry;\n * the standard package constructor remains correction-free.\n */\nexport class QtiChoiceInteractionCorrection extends ChoiceCorrectionMixin(QtiChoiceInteraction) {}\n","import { css, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { QtiExtendedTextInteraction } from '@qti-components/extended-text-interaction/elements';\n\nimport { ActiveElementCorrectionMixin } from '../mixins/active-element-correction.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nimport type { CandidateCorrection } from '../mixins/active-element-correction.mixin';\n\n/**\n * Extended-text, judged from OUTSIDE.\n *\n * Every other correction class in this folder derives its verdict: it is handed a `correct-response`\n * and compares. Extended-text cannot — the response is free prose, there is nothing to compare it\n * to, and that is exactly why the base component extends `Interaction` directly and carries no\n * correction machinery (correct-response.mixin.ts says so for extended-text, upload and media).\n *\n * But an extended-text answer is still judged; just not here. A teacher, a marking service, or an app\n * that already knows the score decides, and then has to tell the component. This class is that\n * channel and nothing more: it computes no correctness, it only accepts one.\n *\n * Hence `ActiveElementCorrectionMixin` rather than `CandidateCorrectionMixin`. The two are otherwise\n * the same bookkeeping — clear the three `candidate-*` states, add one, expose `correctionPart` — but\n * `CandidateCorrectionMixin` sits on top of `CorrectResponseMixin` and drives everything off a\n * computed `correctness` getter with no setter. `ActiveElementCorrectionMixin` is the settable one,\n * written for chips whose parent interaction pushes a verdict into them. An externally-graded essay\n * is the same shape: something else knows the answer.\n *\n * Two consequences worth knowing:\n *\n * - The `item-show-candidate-correction` button will not drive this. It disables itself unless a\n * response variable declares a correctResponse / mapping / areaMapping, which a prose item never\n * does. Correct: the verdict comes from the host application, which sets the attribute.\n * - The verdict survives typing. It is a property, not the `showCandidateCorrection` toggle, so\n * `afterResponseVariableUpdated()` does not clear it. If a stale grade should be dropped when the\n * candidate edits their answer, that is an explicit decision for the host app to make.\n */\nexport class QtiExtendedTextInteractionCorrection extends ActiveElementCorrectionMixin(QtiExtendedTextInteraction) {\n static override styles = [\n QtiExtendedTextInteraction.styles,\n correctionPart,\n css`\n /*\n * Placement only — the glyph itself is the theme's, keyed on ::part(correction-*). That split\n * is the contract in correction.styles.ts, which deliberately leaves the shared badge in flow\n * and invites a component to lift it out if it wants a corner badge.\n *\n * A textarea is a box the candidate writes in, so the badge goes over its top-left corner\n * rather than trailing the text the way a chip's does, and the theme reserves the gutter for it\n * (padding-left on ::part(textarea)).\n *\n * Anchored to the TEXTAREA, not to the host. The badge's containing block is :host, and the\n * host also contains the prompt slot — so a plain top: 0.85rem measured from the host lands on\n * the prompt and the badge floats above the field, which is exactly what it did. Only the\n * vertical offset needs anchoring: the textarea spans the host's full width, so the left\n * offset is the same measured from either.\n */\n [part~='textarea'] {\n anchor-name: --qti-extended-text-field;\n }\n\n [part~='correction'] {\n position: absolute;\n position-anchor: --qti-extended-text-field;\n margin: 0;\n width: var(--qti-correction-size);\n\n /*\n * One FIELD line tall, not square — this is what puts the glyph on the text rather than near\n * it. The mask is drawn center / contain, so in a box exactly one line high it centres itself\n * on that line while the width still governs the glyph's size.\n *\n * Not 1lh: that unit resolves against the BADGE's own inherited line-height (measured 18.4px),\n * not the textarea's (24px), so it landed a third of a line low. --qti-field-line-height is\n * the same number @mixin field-typography gives the field, so the two cannot drift.\n */\n height: calc(var(--qti-correction-size) * var(--qti-field-line-height));\n\n /* Inset exactly as the text is: the same trailing token the two field-shaped interactions\n use, read here as a LEADING inset because this badge lives in a left gutter. */\n left: var(--qti-correction-inset);\n\n /* Anchored to the field's first line: its top edge plus the field's own padding-top. */\n top: calc(anchor(top) + var(--qti-spacing));\n }\n\n /*\n * Fallback for engines without anchor positioning, where the top above does not parse and the\n * badge would fall to its static position below the field. The bottom of the gutter needs no\n * knowledge of where the field starts, and the gutter runs the full height, so the badge still\n * clears the text.\n *\n * Scoped by @supports rather than declared alongside. Both were set at first, on the assumption\n * that top + height over-constrains the box and bottom is ignored — it is not: measured, the\n * bottom won and put the badge on the third line.\n */\n @supports not (anchor-name: --probe) {\n [part~='correction'] {\n top: auto;\n bottom: var(--qti-correction-inset);\n }\n }\n `\n ];\n\n /**\n * The verdict, pushed in from outside: `correct`, `partially-correct`, `incorrect`, or absent.\n *\n * `noAccessor` because the mixin already owns the accessor — its setter is what writes the\n * `:state(candidate-*)` custom states — and Lit would otherwise replace it with a generated one and\n * silently drop that bookkeeping. Same pattern as the `response` attribute on\n * qti-inline-choice-interaction and qti-slider-interaction.\n */\n @property({ attribute: 'candidate-correction', reflect: true, noAccessor: true })\n declare candidateCorrection: CandidateCorrection;\n\n /** The badge goes between the field and the validation message; everything else is the base's. */\n override render() {\n return html`${this.renderPrompt()}${this.renderTextarea()}\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>\n ${this.renderValidationMessage()}`;\n }\n}\n","/** Helpers shared by more than one correction interaction. */\n\n/** A choice element that can carry a per-candidate correction verdict. */\nexport type CorrectableChoice = HTMLElement & {\n identifier: string;\n candidateCorrection: 'correct' | 'incorrect' | 'partially-correct' | null;\n};\n\n/** Splits a `\"source target\"` correct-response into its pairs. */\nexport const parsePairs = (response: Readonly<string | string[] | null>): Array<{ source: string; target: string }> => {\n if (!response) return [];\n const entries = Array.isArray(response) ? response : [response];\n return entries.map(entry => {\n const [source, target] = entry.split(' ');\n return { source, target };\n });\n};\n","import { QtiGapMatchInteraction } from '@qti-components/gap-match-interaction/elements';\n\nimport { DragDropCorrectionMixin } from '../mixins/drag-drop-correction.mixin';\nimport { parsePairs, type CorrectableChoice } from './shared';\n\nexport class QtiGapMatchInteractionCorrection extends DragDropCorrectionMixin(QtiGapMatchInteraction) {\n public override toggleCandidateCorrection(show: boolean): void {\n super.toggleCandidateCorrection(show);\n const matches = parsePairs(this.correctResponse);\n\n for (const target of this.querySelectorAll('qti-gap')) {\n const targetId = target.getAttribute('identifier');\n const selectedChoices = (target as unknown as HTMLElement & { drags: readonly CorrectableChoice[] }).drags;\n for (const choice of selectedChoices) {\n choice.candidateCorrection = null;\n if (show && matches.some(match => match.source === choice.identifier && match.target === targetId)) {\n choice.candidateCorrection = 'correct';\n } else if (show) {\n choice.candidateCorrection = 'incorrect';\n }\n }\n }\n }\n}\n","import { svg } from 'lit';\nimport { repeat } from 'lit/directives/repeat.js';\n\nimport { QtiGraphicAssociateInteraction } from '@qti-components/graphic-associate-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\n\nexport class QtiGraphicAssociateInteractionCorrection extends CandidateCorrectionMixin(QtiGraphicAssociateInteraction) {\n #correctLines: string[] = [];\n\n public override toggleInternalCorrectResponse(show: boolean): void {\n super.toggleInternalCorrectResponse(show);\n const response = this.correctResponse;\n const previous = this.#correctLines;\n this.#correctLines = show && response ? (Array.isArray(response) ? [...response] : [response]) : [];\n this.requestUpdate('correctLines', previous);\n }\n\n protected override renderSupplementalLines(): unknown {\n return repeat(\n this.#correctLines,\n line => line,\n line => svg`\n <line\n part=\"correct-line\"\n x1=${parseInt(this.querySelector<SVGLineElement>(`[identifier=${line.split(' ')[0]}]`)!.style.left)}\n y1=${parseInt(this.querySelector<SVGLineElement>(`[identifier=${line.split(' ')[0]}]`)!.style.top)}\n x2=${parseInt(this.querySelector<SVGLineElement>(`[identifier=${line.split(' ')[1]}]`)!.style.left)}\n y2=${parseInt(this.querySelector<SVGLineElement>(`[identifier=${line.split(' ')[1]}]`)!.style.top)}\n stroke=\"var(--qti-correct)\"\n stroke-width=\"3\"\n stroke-dasharray=\"5,5\"\n />\n `\n );\n }\n}\n","import { QtiGraphicGapMatchInteraction } from '@qti-components/graphic-gap-match-interaction/elements';\n\nimport { DragDropCorrectionMixin } from '../mixins/drag-drop-correction.mixin';\n\nexport class QtiGraphicGapMatchInteractionCorrection extends DragDropCorrectionMixin(QtiGraphicGapMatchInteraction) {}\n","import { QtiGraphicOrderInteraction } from '@qti-components/graphic-order-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\n\nimport type { Choice } from '@qti-components/interactions-core/mixins/choices/choices.mixin';\n\ntype OrderedHotspot = Choice & { order: number | null };\n\ntype CorrectableOrderedHotspot = OrderedHotspot & {\n candidateCorrection: 'correct' | 'incorrect' | 'partially-correct' | null;\n orderCorrect: number | null;\n};\n\nexport class QtiGraphicOrderInteractionCorrection extends CandidateCorrectionMixin(QtiGraphicOrderInteraction) {\n protected override resolvePinColor(choice: OrderedHotspot): string {\n const correctableChoice = choice as CorrectableOrderedHotspot;\n if (correctableChoice.matches(':state(candidate-incorrect)')) return 'var(--qti-incorrect)';\n if (correctableChoice.matches(':state(candidate-correct)')) return 'var(--qti-correct)';\n if (correctableChoice.matches(':state(correct-response)')) return 'var(--qti-answer-border)';\n return super.resolvePinColor(choice);\n }\n\n public override toggleInternalCorrectResponse(show: boolean): void {\n super.toggleInternalCorrectResponse(show);\n const response = this.correctResponse;\n const correctOrder = response ? (Array.isArray(response) ? response : [response]) : [];\n for (const hotspot of this._choiceElements as CorrectableOrderedHotspot[]) {\n const index = correctOrder.indexOf(hotspot.identifier);\n hotspot.orderCorrect = show && index >= 0 ? index + 1 : null;\n }\n this.refreshLocatorPins();\n }\n\n public override toggleCandidateCorrection(show: boolean): void {\n super.toggleCandidateCorrection(show);\n const response = this.correctResponse;\n const correctOrder = response ? (Array.isArray(response) ? response : [response]) : [];\n for (const hotspot of this._choiceElements as CorrectableOrderedHotspot[]) {\n hotspot.candidateCorrection = null;\n if (show && hotspot.order != null) {\n hotspot.candidateCorrection = correctOrder[hotspot.order - 1] === hotspot.identifier ? 'correct' : 'incorrect';\n }\n }\n this.refreshLocatorPins();\n }\n}\n","import { QtiHotspotInteraction } from '@qti-components/hotspot-interaction/elements';\n\nimport { ChoiceCorrectionMixin } from '../mixins/choice-correction.mixin';\n\nexport class QtiHotspotInteractionCorrection extends ChoiceCorrectionMixin(QtiHotspotInteraction) {}\n","import { QtiHottextInteraction } from '@qti-components/hottext-interaction/elements';\n\nimport { ChoiceCorrectionMixin } from '../mixins/choice-correction.mixin';\n\nexport class QtiHottextInteractionCorrection extends ChoiceCorrectionMixin(QtiHottextInteraction) {}\n","import { css, html } from 'lit';\n\nimport { QtiInlineChoiceInteraction } from '@qti-components/inline-choice-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nexport class QtiInlineChoiceInteractionCorrection extends CandidateCorrectionMixin(QtiInlineChoiceInteraction) {\n static override get styles() {\n return [\n QtiInlineChoiceInteraction.styles,\n correctionPart,\n css`\n /*\n * Only the TRAILING inset — the leading gap is the shared --qti-glyph-gap, like every other\n * badge. This used to set both margins to --qti-gap (1rem), twice everyone else's 0.5em, on\n * the one token qti-variables.css calls \"the page's rhythm … an order of magnitude too wide\n * for a glyph sitting inside a line\".\n *\n * The trailing inset is needed here, and in text-entry, because these two put the field's box\n * on the HOST while its padding sits on an inner element (::part(trigger), ::part(input)) —\n * so a badge that is a child of the host falls outside that padding and lands on the border.\n * Chips, choices and hottext carry their padding on the host, so their badge is already inset\n * by it and needs nothing.\n */\n [part~='correction'] {\n margin-inline-end: var(--qti-correction-inset);\n }\n `\n ];\n }\n\n /**\n * Internal mode defers to the full correct response, exactly as text-entry does.\n *\n * There is no room beside a dropdown for an answer key: the interaction sits inside a line of\n * running text, so a marker next to the field competes with the sentence around it, and when the\n * candidate happened to pick the correct option it printed the same word twice. The full variant\n * puts the key in a `div.full-correct-response-inline` after the field instead — one already-themed\n * presentation for both inline interactions rather than a second one only these two use.\n *\n * `super` is deliberately not called: its `show-correct-response` host state paints the dashed\n * outline in qti-states.css, and this element is no longer the thing presenting the key — the\n * wrapper beside it is. Leaving the state off keeps internal mode looking identical to an item\n * authored with `show-full-correct-response`.\n *\n * The guard stops the two entry points rendering two wrappers: `showFullCorrectResponse` has its\n * own watcher, so with both flags set this would otherwise run a second time.\n */\n public override toggleInternalCorrectResponse(show: boolean): void {\n if (!this.showFullCorrectResponse) this.toggleFullCorrectResponse(show);\n }\n\n /**\n * The key is shown whether or not the candidate was right.\n *\n * The base withholds it from a correct candidate, on the reasoning that their answer already is\n * the key. That reasoning does not survive contact with this element: asking for the correct\n * response and being shown nothing is indistinguishable from the feature being broken, and it is\n * the only inline interaction where the answer and the key are the same short phrase, so there is\n * no visual clue either. Show it, and let the correctness badge say who was right.\n */\n public override get withholdsFullCorrectResponseWhenCorrect(): boolean {\n return false;\n }\n\n /** The badge trails the validation message; everything else is the base's. */\n override render() {\n return html`\n ${this.renderTrigger()} ${this.renderMenu()} ${this.renderValidationMessage()}\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>\n `;\n }\n}\n","import { QtiMatchInteraction } from '@qti-components/match-interaction/elements';\n\nimport { DragDropCorrectionMixin } from '../mixins/drag-drop-correction.mixin';\nimport { parsePairs, type CorrectableChoice } from './shared';\n\nexport class QtiMatchInteractionCorrection extends DragDropCorrectionMixin(QtiMatchInteraction) {\n #correctPairs = new Set<string>();\n\n public override toggleCandidateCorrection(show: boolean): void {\n super.toggleCandidateCorrection(show);\n const matches = parsePairs(this.correctResponse);\n this.#correctPairs = show ? new Set(matches.map(match => `${match.source} ${match.target}`)) : new Set();\n\n for (const target of this.targetChoices) {\n const targetId = target.getAttribute('identifier');\n const selectedChoices = (target as unknown as { drags: readonly CorrectableChoice[] }).drags;\n for (const choice of selectedChoices) {\n choice.candidateCorrection = null;\n if (show) {\n choice.candidateCorrection = this.#correctPairs.has(`${choice.identifier} ${targetId}`)\n ? 'correct'\n : 'incorrect';\n }\n }\n }\n this.requestUpdate();\n }\n\n protected override getCellStateVariant(value: string, checked: boolean): string {\n if (!this.showCandidateCorrection || !checked) return '';\n return this.#correctPairs.has(value) ? 'correct' : 'incorrect';\n }\n}\n","/**\n * Numeric core: indices of the chosen longest increasing subsequence within a\n * sequence of distinct numbers.\n *\n * Tiebreaker: strict `>` comparisons keep the smallest predecessor index when\n * lengths tie, and the smallest ending index is picked when multiple indices\n * achieve the maximum length. This is equivalent to \"the first LIS found when\n * iterating left-to-right\".\n */\nexport function findLongestIncreasingSubsequenceIndices(sequence: number[]): Set<number> {\n if (sequence.length === 0) {\n return new Set();\n }\n\n const lengthEndingAt: number[] = new Array(sequence.length).fill(1);\n const predecessorIndex: number[] = new Array(sequence.length).fill(-1);\n\n for (let currentIndex = 0; currentIndex < sequence.length; currentIndex++) {\n for (let previousIndex = 0; previousIndex < currentIndex; previousIndex++) {\n if (\n sequence[previousIndex] < sequence[currentIndex] &&\n lengthEndingAt[previousIndex] + 1 > lengthEndingAt[currentIndex]\n ) {\n lengthEndingAt[currentIndex] = lengthEndingAt[previousIndex] + 1;\n predecessorIndex[currentIndex] = previousIndex;\n }\n }\n }\n\n let bestEndIndex = 0;\n for (let index = 1; index < sequence.length; index++) {\n if (lengthEndingAt[index] > lengthEndingAt[bestEndIndex]) {\n bestEndIndex = index;\n }\n }\n\n const resultIndices = new Set<number>();\n for (let index = bestEndIndex; index !== -1; index = predecessorIndex[index]) {\n resultIndices.add(index);\n }\n\n return resultIndices;\n}\n\n/**\n * Domain wrapper: identifiers of candidate-placed choices counted as\n * correctly placed, i.e. the longest run of choices whose relative order\n * matches the correct order.\n *\n * Assumes identifiers are unique within both arrays (guaranteed by QTI).\n * Identifiers not present in `correctOrder` are foreign to the response and\n * are never included in the result.\n */\nexport function findCorrectlyPlacedIdentifiers(candidateOrder: string[], correctOrder: string[]): Set<string> {\n const rankByIdentifier = new Map<string, number>(correctOrder.map((identifier, position) => [identifier, position]));\n\n const knownIdentifiers = candidateOrder.filter(identifier => rankByIdentifier.has(identifier));\n const rankSequence = knownIdentifiers.map(identifier => rankByIdentifier.get(identifier));\n\n const winningIndices = findLongestIncreasingSubsequenceIndices(rankSequence);\n\n const result = new Set<string>();\n winningIndices.forEach(index => result.add(knownIdentifiers[index]));\n return result;\n}\n","import { QtiOrderInteraction } from '@qti-components/order-interaction/elements';\n\nimport { DragDropCorrectionMixin } from '../mixins/drag-drop-correction.mixin';\nimport { findCorrectlyPlacedIdentifiers } from '../utils/longest-increasing-subsequence';\nimport { type CorrectableChoice } from './shared';\n\nexport class QtiOrderInteractionCorrection extends DragDropCorrectionMixin(QtiOrderInteraction) {\n public override toggleCandidateCorrection(show: boolean): void {\n super.toggleCandidateCorrection(show);\n\n const dropTargets = Array.from(this.shadowRoot!.querySelectorAll<HTMLElement>(`[part~='drop']`));\n const placedChoices = dropTargets.flatMap(drop => this.chipsIn(drop) as CorrectableChoice[]);\n for (const choice of placedChoices) choice.candidateCorrection = null;\n if (!show) return;\n\n const response = this.correctResponse;\n const entries = response ? (Array.isArray(response) ? response : [response]) : [];\n const correctOrder = entries\n .map((entry, index) => {\n const [identifier, dropId] = entry.split(' ');\n const parsed = dropId?.startsWith('droplist') ? parseInt(dropId.slice('droplist'.length), 10) : index;\n return { identifier, dropIndex: Number.isNaN(parsed) ? index : parsed };\n })\n .filter(entry => entry.identifier)\n .sort((a, b) => a.dropIndex - b.dropIndex)\n .map(entry => entry.identifier);\n if (correctOrder.length === 0) return;\n\n const placedEntries = placedChoices\n .map(choice => ({ choice, identifier: choice.getAttribute('identifier') }))\n .filter((entry): entry is { choice: CorrectableChoice; identifier: string } => Boolean(entry.identifier));\n const correctlyPlaced = findCorrectlyPlacedIdentifiers(\n placedEntries.map(entry => entry.identifier),\n correctOrder\n );\n for (const { choice, identifier } of placedEntries) {\n choice.candidateCorrection = correctlyPlaced.has(identifier) ? 'correct' : 'incorrect';\n }\n }\n}\n","import { QtiPortableCustomInteraction } from '@qti-components/portable-custom-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\n\nimport type { BaseType, Cardinality } from '@qti-components/base';\n\nexport class QtiPortableCustomInteractionCorrection extends CandidateCorrectionMixin(QtiPortableCustomInteraction) {\n public override toggleInternalCorrectResponse(show: boolean): void {\n super.toggleInternalCorrectResponse(show);\n const responseVariable = this.responseVariable;\n const sourceResponse = responseVariable?.correctResponse ?? this.correctResponse;\n this.correctResponse = show ? sourceResponse : responseVariable?.cardinality === 'single' ? '' : [];\n\n const containerId = `correct-response-container-${this.responseIdentifier}`;\n this.parentElement?.querySelectorAll(`#${containerId}`).forEach(element => element.remove());\n\n if (!show) {\n this.enable();\n return;\n }\n this.disable();\n if (!this.correctResponse) return;\n\n const container = document.createElement('div');\n container.id = containerId;\n container.className = 'pci-correct-response-container';\n Object.assign(container.style, {\n position: 'relative',\n marginTop: '20px',\n border: '2px solid green',\n padding: '16px',\n borderRadius: '4px',\n backgroundColor: 'rgba(0, 128, 0, 0.05)'\n });\n\n const label = document.createElement('div');\n label.textContent = 'Correct Response:';\n Object.assign(label.style, { fontWeight: 'bold', marginBottom: '10px', color: 'green' });\n container.append(label);\n\n // `cloneNode(false)`, not `document.createElement`: a shallow clone is created in the same\n // custom element registry as this element, so the viewer is still upgraded when the item was\n // rendered into a scoped registry. It carries the attributes over and none of the children.\n const viewer = this.cloneNode(false) as QtiPortableCustomInteractionCorrection;\n // Two elements in one tree cannot share an id, and the flags would have the viewer show a\n // correction of its own.\n viewer.removeAttribute('id');\n viewer.removeAttribute('show-correct-response');\n viewer.removeAttribute('show-full-correct-response');\n viewer.removeAttribute('show-candidate-correction');\n viewer.isFullCorrectResponse = true;\n const originalResponseId = this.responseIdentifier;\n viewer.responseIdentifier = `${originalResponseId}-correct`;\n\n // Only the authored light DOM — modules, markup, properties, stylesheets. The runtime's own\n // children must not come along: the PCI appends its iframe to itself, and the `disable()` above\n // has just added the review overlay. A cloned iframe never loads, so the viewer would paint a\n // dead frame above the live one.\n for (const child of Array.from(this.children)) {\n if (child.tagName.startsWith('QTI-')) viewer.append(child.cloneNode(true));\n }\n\n const correctResponse = this.correctResponse as string | string[];\n const cardinality: Cardinality =\n responseVariable?.cardinality ?? (Array.isArray(correctResponse) ? 'multiple' : 'single');\n const baseType: BaseType = responseVariable?.baseType ?? 'string';\n\n // The standards-conformant handoff, for a PCI that implements the solution use case: it reads\n // the key out of its own `getInstance` configuration rather than having a response pushed at it.\n // Set explicitly because the viewer has no response declaration to derive one from — it is not a\n // registered interaction, so `responseVariable` is undefined and the derived getter returns null.\n // See https://github.com/1EdTech/qti-project-management/issues/210\n viewer.status = 'solution';\n viewer.responseDeclaration = {\n baseType,\n cardinality,\n correctResponse: { value: correctResponse }\n };\n\n // The push below stays for PCIs that do NOT implement the solution use case: those only know how\n // to render a response bound to them. It goes out once the viewer's own iframe has finished its\n // handshake — listened for rather than hooked into `connectedCallback`, since custom element\n // reactions are looked up on the prototype when the element is defined, so an instance-level\n // override of it is never read.\n viewer.addEventListener(\n 'qti-portable-custom-interaction-loaded',\n () => {\n const value = viewer.responseVariablesToQtiVariableJSON(correctResponse, cardinality, baseType);\n viewer.sendMessageToIframe('setBoundTo', { [originalResponseId]: value });\n viewer.sendMessageToIframe('setState', { state: 'review' });\n },\n { once: true }\n );\n viewer.style.pointerEvents = 'none';\n container.append(viewer);\n this.after(container);\n }\n}\n","import { css, html } from 'lit';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nimport { ScoringHelper } from '@qti-components/base';\nimport { QtiSelectPointInteraction } from '@qti-components/select-point-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\n\nimport type { QtiAreaMapEntry } from '@qti-components/base';\n\nexport class QtiSelectPointInteractionCorrection extends CandidateCorrectionMixin(QtiSelectPointInteraction) {\n #correctAreas: Array<{ shape: string; coords: string }> = [];\n\n #responseCorrection: boolean[] = [];\n\n static override styles = [\n QtiSelectPointInteraction.styles,\n css`\n [part~='correct'] {\n --qti-select-point-marker-color: var(--qti-correct);\n }\n [part~='incorrect'] {\n --qti-select-point-marker-color: var(--qti-incorrect);\n }\n `\n ];\n\n public override toggleCandidateCorrection(show: boolean): void {\n super.toggleCandidateCorrection(show);\n const previous = this.#responseCorrection;\n this.#responseCorrection = [];\n if (!show) {\n this.requestUpdate('responseCorrection', previous);\n return;\n }\n\n const areaEntries = this._effectiveAreaEntries;\n const baseType = this.responseVariable?.baseType;\n const response = this.correctResponse;\n for (const point of this.responsePoints) {\n let correct = areaEntries.some(area =>\n ScoringHelper.isPointInArea(`${point.x} ${point.y}`, `${area.shape},${area.coords}`, baseType)\n );\n if (!areaEntries.length && response) {\n const expected = Array.isArray(response) ? response : [response];\n correct = expected.some(entry => {\n const [x, y] = entry.split(' ').map(Number);\n return Number.isFinite(x) && Number.isFinite(y) && Math.hypot(point.x - x, point.y - y) <= 10;\n });\n }\n this.#responseCorrection.push(correct);\n }\n this.requestUpdate('responseCorrection', previous);\n }\n\n public override toggleInternalCorrectResponse(show: boolean): void {\n super.toggleInternalCorrectResponse(show);\n if (!show) {\n const previous = this.#correctAreas;\n this.#correctAreas = [];\n this.requestUpdate('correctAreas', previous);\n return;\n }\n\n let entries: QtiAreaMapEntry[] = this._effectiveAreaEntries;\n if (!entries.length) {\n const response = this.correctResponse;\n const values = response ? (Array.isArray(response) ? response : [response]) : [];\n if (values.some(value => value.split(' ').length < 2)) {\n console.error('No valid correct responses found.');\n return;\n }\n entries = values.map(value => ({\n shape: 'circle',\n coords: `${value.split(' ').join(',')},10`,\n defaultValue: 1,\n mappedValue: 1\n }));\n }\n const previous = this.#correctAreas;\n this.#correctAreas = entries.map(entry => ({ shape: entry.shape, coords: entry.coords }));\n this.requestUpdate('correctAreas', previous);\n }\n\n protected override pointPart(_point: string, index: number): string {\n const verdict = this.#responseCorrection[index];\n return verdict === undefined ? 'point' : `point ${verdict ? 'correct' : 'incorrect'}`;\n }\n\n protected override renderSupplementalLayer(): unknown {\n return repeat(\n this.#correctAreas,\n area => `${area.shape}:${area.coords}`,\n (area, index) =>\n html`<div\n style=${styleMap({\n position: 'absolute',\n pointerEvents: 'none',\n backgroundColor: 'var(--qti-correct)',\n opacity: '0.5'\n })}\n data-correction-area\n data-coord=${area.coords}\n data-shape=${area.shape}\n alt=${`correct-response-${index + 1}`}\n ></div>`\n );\n }\n\n protected override updated(changedProperties: Map<string | number | symbol, unknown>): void {\n super.updated(changedProperties);\n if (changedProperties.has('correctAreas' as never)) {\n this.positionOverlayElements(this.shadowRoot!.querySelectorAll<HTMLElement>('[data-correction-area]'));\n }\n }\n}\n","import { css, html, nothing } from 'lit';\n\nimport { QtiSliderInteraction } from '@qti-components/slider-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\n\nexport class QtiSliderInteractionCorrection extends CandidateCorrectionMixin(QtiSliderInteraction) {\n #correctResponseNumber: number | null = null;\n\n static override styles = [\n QtiSliderInteraction.styles,\n css`\n [part='knob-correct'] {\n background-color: var(--qti-correct-light);\n border: 2px solid var(--qti-correct);\n position: relative;\n height: 1rem;\n width: 1rem;\n transform-origin: center;\n transform: translateX(-50%);\n cursor: pointer;\n border-radius: 9999px;\n left: var(--value-percentage-correct);\n }\n `\n ];\n\n public override toggleInternalCorrectResponse(show: boolean): void {\n super.toggleInternalCorrectResponse(show);\n const response = this.correctResponse;\n const raw = Array.isArray(response) ? response[0] : response;\n const value = show && raw ? parseFloat(raw) : NaN;\n const previous = this.#correctResponseNumber;\n this.#correctResponseNumber = Number.isFinite(value) ? value : null;\n if (this.#correctResponseNumber !== null) {\n const percentage = ((this.#correctResponseNumber - this.min) / (this.max - this.min)) * 100;\n this.style.setProperty('--value-percentage-correct', `${percentage}%`);\n } else {\n this.style.removeProperty('--value-percentage-correct');\n }\n this.requestUpdate('correctResponseNumber', previous);\n }\n\n protected override renderRailSupplement(): unknown {\n return this.#correctResponseNumber === null\n ? nothing\n : html`<div id=\"knob-correct\" part=\"knob-correct\">\n <div id=\"value\" part=\"value\">${this.#correctResponseNumber}</div>\n </div>`;\n }\n}\n","import { css, html } from 'lit';\n\nimport { QtiTextEntryInteraction } from '@qti-components/text-entry-interaction/elements';\n\nimport { CandidateCorrectionMixin } from '../mixins/candidate-correction.mixin';\nimport { Correctness } from '../mixins/correct-response.mixin';\nimport { correctionPart } from '../styles/correction.styles';\n\nexport class QtiTextEntryInteractionCorrection extends CandidateCorrectionMixin(QtiTextEntryInteraction) {\n static override styles = [\n QtiTextEntryInteraction.styles,\n correctionPart,\n css`\n /*\n * The trailing inset only — size and leading gap come from the shared sheet.\n *\n * This block used to also set position: static; translate: none (dead: nothing positions this\n * badge) and size it with --qti-control-size, the radio/checkbox token — 1rem, absolute, where\n * every other badge is 1em and scales with the text it annotates. The two agreed only while the\n * item's font-size happened to equal the root's.\n *\n * The inset is needed because the field's box is the HOST while its padding is on ::part(input),\n * so the badge — a child of the host — falls outside that padding and lands flush on the border.\n * Measured at 0px from the border, against 16px for a choice and 12.8px for a chip.\n */\n [part~='correction'] {\n margin-inline-end: var(--qti-correction-inset);\n }\n :host {\n position: relative;\n anchor-name: --text-entry-host, --qti-correction-anchor;\n }\n [part='correct'] {\n position: absolute;\n position-anchor: --text-entry-host;\n position-area: top span-right;\n margin-bottom: 0.25rem;\n padding: var(--qti-padding-box);\n background-color: var(--qti-bg);\n white-space: nowrap;\n }\n `\n ];\n\n public override get correctness(): Readonly<Correctness | null> {\n const variable = this.responseVariable;\n if (!variable) return super.correctness;\n if (variable.value === null) return Correctness.Incorrect;\n\n if (variable.mapping) {\n const maxScore = variable.mapping.mapEntries.reduce((maximum, entry) => Math.max(entry.mappedValue, maximum), 0);\n for (const entry of variable.mapping.mapEntries) {\n let expected = entry.mapKey;\n let actual = variable.value as string;\n if (!entry.caseSensitive) {\n expected = expected.toLowerCase();\n actual = actual.toLowerCase();\n }\n if (expected !== actual) continue;\n if (entry.mappedValue === maxScore) return Correctness.Correct;\n if (entry.mappedValue <= (variable.mapping.defaultValue || 0)) return Correctness.Incorrect;\n return Correctness.PartiallyCorrect;\n }\n }\n\n return variable.correctResponse === variable.value ? Correctness.Correct : Correctness.Incorrect;\n }\n\n public override toggleInternalCorrectResponse(show: boolean): void {\n if (!this.showFullCorrectResponse) this.toggleFullCorrectResponse(show);\n }\n\n /** The badge goes between the field and the validation message; everything else is the base's. */\n override render() {\n return html`\n ${this.renderAnswer()} ${this.renderInput()}\n <span part=${this.correctionPart} aria-hidden=\"true\"></span>\n ${this.renderValidationMessage()}\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,UAAU,aAAa;;;;;;;AAShC,IAAY;CAAZ,SAAYA,cAAW;AACrB,EAAAA,aAAA,SAAA,IAAA;AACA,EAAAA,aAAA,kBAAA,IAAA;AACA,EAAAA,aAAA,WAAA,IAAA;AACF,GAJY,gBAAA,cAAW,CAAA,EAAA;AAmBhB,IAAM,uBAAuB,CAA6C,eAAiB;EAChG,MAAe,kCAAkC,WAAU;IAA3D,cAAA;;AA4BE,WAAA,sBAAsB;AAGZ,WAAA,mCAAmC,CAAC,GAAY,SAAiB;AACzE,aAAK,8BAA8B,IAAI;MACzC;AAKA,WAAA,0BAA0B;AAGhB,WAAA,uCAAu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AK,YAAW,CAAE;mBAC9B,KAAK,cAAc;QAC9B,KAAK,wBAAuB,CAAE;;EAEpC;;","names":["Correctness","state","__decorate","state","property","__decorate","property","html","html","html","html","html","html","html","property","state","html","__decorate","property","state","css","html","LitElement","property","consume","css","LitElement","css","html","__decorate","consume","property","css","html","LitElement","property","consume","LitElement","css","html","__decorate","consume","property","css","html","LitElement","property","consume","LitElement","css","html","__decorate","consume","property","css","html","property","css","html","__decorate","property","repeat","repeat","css","html","css","html","css","html","repeat","css","previous","repeat","html","css","html","nothing","css","nothing","html","css","html","css","html"]}
|