@citolab/qti-components 8.0.1 → 8.0.2
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 +103 -103
- package/dist/base.d.ts +3 -3
- package/dist/base.js +1 -1
- package/dist/chunk-4DB4SC5K.js +100 -0
- package/dist/chunk-4DB4SC5K.js.map +1 -0
- package/dist/{chunk-WVVMNF74.js → chunk-7AVWRQIS.js} +188 -160
- package/dist/{chunk-WVVMNF74.js.map → chunk-7AVWRQIS.js.map} +1 -1
- package/dist/{chunk-CAO4JRLY.js → chunk-BQFWCZFH.js} +2 -2
- package/dist/{chunk-LVBIQDPM.js → chunk-CK7AV2UJ.js} +147 -101
- package/dist/chunk-CK7AV2UJ.js.map +1 -0
- package/dist/{chunk-7HC5SMCU.js → chunk-G6GFQDVN.js} +1 -96
- package/dist/chunk-G6GFQDVN.js.map +1 -0
- package/dist/{chunk-RXGDQDOV.js → chunk-HBSWJC3B.js} +478 -392
- package/dist/chunk-HBSWJC3B.js.map +1 -0
- package/dist/chunk-HQESINXH.js +834 -0
- package/dist/chunk-HQESINXH.js.map +1 -0
- package/dist/{chunk-XU7HNT4F.js → chunk-J5SQLKNP.js} +145 -119
- package/dist/{chunk-XU7HNT4F.js.map → chunk-J5SQLKNP.js.map} +1 -1
- package/dist/{chunk-V5G7X53Y.js → chunk-NJQHUUTN.js} +2 -2
- package/dist/{chunk-QECOPVPO.js → chunk-RSVRS5AK.js} +59 -58
- package/dist/chunk-RSVRS5AK.js.map +1 -0
- package/dist/{chunk-F4BNJWYN.js → chunk-TWPXES3S.js} +642 -673
- package/dist/chunk-TWPXES3S.js.map +1 -0
- package/dist/{chunk-NA2N2WSG.js → chunk-VAE6HBKR.js} +176 -152
- package/dist/{chunk-NA2N2WSG.js.map → chunk-VAE6HBKR.js.map} +1 -1
- package/dist/{chunk-3AJOQCDU.js → chunk-ZII6M3SN.js} +2 -2
- package/dist/{computed.types.d-rKLSPvVG.d.ts → computed.types.d-DpKIYO6e.d.ts} +2 -0
- package/dist/corrections.d.ts +12 -29
- package/dist/corrections.js +8 -9
- package/dist/elements.d.ts +86 -86
- package/dist/elements.js +4 -5
- package/dist/index.d.ts +6 -37
- package/dist/index.js +13 -14
- package/dist/{interaction.d-D4MstYRz.d.ts → interaction.d-CJiMv8H7.d.ts} +13 -2
- package/dist/interactions.d.ts +11 -1299
- package/dist/interactions.js +4 -5
- package/dist/item.d.ts +3 -3
- package/dist/item.js +5 -5
- package/dist/processing.js +2 -2
- package/dist/qti-components-jsx.d.ts +759 -739
- package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
- package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
- package/dist/test.d.ts +11 -678
- package/dist/test.js +6 -7
- package/package.json +8 -7
- package/dist/chunk-64XSIBGO.js +0 -241
- package/dist/chunk-64XSIBGO.js.map +0 -1
- package/dist/chunk-7HC5SMCU.js.map +0 -1
- package/dist/chunk-F4BNJWYN.js.map +0 -1
- package/dist/chunk-H3J7LFRO.js +0 -2243
- package/dist/chunk-H3J7LFRO.js.map +0 -1
- package/dist/chunk-LVBIQDPM.js.map +0 -1
- package/dist/chunk-QECOPVPO.js.map +0 -1
- package/dist/chunk-RXGDQDOV.js.map +0 -1
- package/dist/chunk-X3E5HXG2.js +0 -20
- package/dist/chunk-X3E5HXG2.js.map +0 -1
- /package/dist/{chunk-CAO4JRLY.js.map → chunk-BQFWCZFH.js.map} +0 -0
- /package/dist/{chunk-V5G7X53Y.js.map → chunk-NJQHUUTN.js.map} +0 -0
- /package/dist/{chunk-3AJOQCDU.js.map → chunk-ZII6M3SN.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../interactions/core/src/elements/qti-associable-hotspot/qti-associable-hotspot.styles.ts","../../interactions/core/src/elements/qti-associable-hotspot/qti-associable-hotspot.ts","../../interactions/core/src/elements/qti-gap/qti-gap.styles.ts","../../interactions/core/src/elements/qti-gap/qti-gap.ts","../../interactions/core/src/elements/qti-gap-img/qti-gap-img.styles.ts","../../interactions/core/src/elements/qti-gap-img/qti-gap-img.ts","../../interactions/core/src/elements/qti-inline-choice/qti-inline-choice.styles.ts","../../interactions/core/src/elements/qti-inline-choice/qti-inline-choice.ts","../../interactions/core/src/elements/qti-prompt/qti-prompt.styles.ts","../../interactions/core/src/elements/qti-prompt/qti-prompt.ts","../../interactions/custom-interaction/src/qti-custom-interaction.styles.ts","../../interactions/custom-interaction/src/qti-custom-interaction.ts","../../interactions/end-attempt-interaction/src/qti-end-attempt-interaction.styles.ts","../../interactions/end-attempt-interaction/src/qti-end-attempt-interaction.ts","../../interactions/media-interaction/src/qti-media-interaction.styles.ts","../../interactions/media-interaction/src/qti-media-interaction.ts","../../interactions/position-object-interaction/src/qti-position-object-interaction.styles.ts","../../interactions/position-object-interaction/src/qti-position-object-interaction.ts","../../interactions/position-object-interaction/src/qti-position-object-stage.styles.ts","../../interactions/position-object-interaction/src/qti-position-object-stage.ts","../../interactions/upload-interaction/src/qti-upload-interaction.styles.ts","../../interactions/upload-interaction/src/qti-upload-interaction.ts","../../interactions/core/src/elements/qti-associable-hotspot/elements.ts","../../interactions/core/src/elements/qti-gap/elements.ts","../../interactions/core/src/elements/qti-gap-img/elements.ts","../../interactions/core/src/elements/qti-gap-text/elements.ts","../../interactions/core/src/elements/qti-hotspot-choice/elements.ts","../../interactions/core/src/elements/qti-hottext/elements.ts","../../interactions/core/src/elements/qti-inline-choice/elements.ts","../../interactions/core/src/elements/qti-prompt/elements.ts","../../interactions/core/src/elements/qti-simple-associable-choice/elements.ts","../../interactions/core/src/elements/qti-simple-choice/elements.ts","../../interactions/core/src/elements.ts","../../interactions/custom-interaction/src/elements.ts","../../interactions/end-attempt-interaction/src/elements.ts","../../interactions/media-interaction/src/elements.ts","../../interactions/position-object-interaction/src/elements.ts","../../interactions/upload-interaction/src/elements.ts","../../qti-interactions/src/elements.ts","../../qti-interactions/src/register-all.ts","../../interactions/associate-interaction/src/register.ts","../../interactions/choice-interaction/src/register.ts","../../interactions/custom-interaction/src/register.ts","../../interactions/end-attempt-interaction/src/register.ts","../../interactions/extended-text-interaction/src/register.ts","../../interactions/gap-match-interaction/src/register.ts","../../interactions/graphic-associate-interaction/src/register.ts","../../interactions/graphic-gap-match-interaction/src/register.ts","../../interactions/graphic-order-interaction/src/register.ts","../../interactions/hotspot-interaction/src/register.ts","../../interactions/hottext-interaction/src/register.ts","../../interactions/inline-choice-interaction/src/register.ts","../../interactions/match-interaction/src/register.ts","../../interactions/media-interaction/src/register.ts","../../interactions/order-interaction/src/register.ts","../../interactions/portable-custom-interaction/src/register.ts","../../interactions/position-object-interaction/src/register.ts","../../interactions/select-point-interaction/src/register.ts","../../interactions/slider-interaction/src/register.ts","../../interactions/text-entry-interaction/src/register.ts","../../interactions/upload-interaction/src/register.ts"],"sourcesContent":["import { css } from 'lit';\n\nimport { boxSizing, dropRegion } from '@qti-components/base';\n\nexport default [\n boxSizing,\n dropRegion,\n css`\n /* A drop target — see qti-gap.styles.ts. The interaction publishes the chip measurements as\n custom properties on its host; the properties themselves live here. */\n :host {\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n position: absolute;\n min-height: var(--qti-dropzone-min-height, 0);\n min-width: var(--qti-dropzone-min-width, 0);\n }\n\n /* The hotspot's own box comes from its authored coords; the drop region simply fills it. */\n [part~='drop'] {\n width: 100%;\n height: 100%;\n }\n `\n];\n","import { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { consume } from '@lit/context';\n\nimport { dragDropContext } from '../../context/drag-drop.context';\nimport styles from './qti-associable-hotspot.styles';\n\nimport type { DragDropState } from '../../context/drag-drop.context';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * A drop target positioned over an image. Like `qti-gap`, it renders the chips it holds from\n * `dragDropContext` rather than having them appended into it.\n *\n * @csspart drop - The region a chip lands in.\n */\nexport class QtiAssociableHotspot extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n /** Carries `:state(filled)` while the hotspot holds a chip. */\n public internals: ElementInternals = this.attachInternals();\n\n /** Opt-in marker read by `DragDropSlottedMixin`; see qti-gap. */\n public readonly acceptsDeclarativeDrops = true;\n\n @property({ type: String, reflect: true }) identifier: string;\n\n @consume({ context: dragDropContext, subscribe: true })\n @state()\n private _dragDrop?: Readonly<DragDropState>;\n\n /** The chips this hotspot holds. Stable node references, cloned once at drop time. */\n public get drags(): readonly HTMLElement[] {\n return this._dragDrop?.nodesByTarget?.[this.identifier] ?? [];\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.dispatchEvent(\n new CustomEvent('qti-register-hotspot', {\n bubbles: true,\n composed: true,\n cancelable: false\n })\n );\n }\n\n override render() {\n return html`<div part=\"drop\">\n ${repeat(\n this.drags,\n node => node.getAttribute('identifier'),\n node => node\n )}\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-associable-hotspot': QtiAssociableHotspot;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing, dropRegion } from '@qti-components/base';\n\nexport default [\n boxSizing,\n dropRegion,\n css`\n /*\n * A drop target. The interaction measures its chips and publishes the result as custom\n * properties on its own host; the actual CSS properties live here, not in a style attribute.\n *\n * An authored data-choices-container-width takes the width axis: autoSizeDropzoneWidth goes\n * false and the mixin never publishes --qti-dropzone-min-width at all, so the fallback below\n * applies and the authored inline width is free to win. That works only because the token is\n * never declared globally — min-width beats width, so a declared floor would silently outrank\n * the author. See DROP-SIZING.md §2 and tools/stylelint/no-declared-measured-token.js.\n */\n /*\n * A gap sits in a line of prose, so it is inline-flex and rides the text baseline. All four of\n * these were in the theme, set on this host from the document — which also meant the\n * 'display: flex' this file declared never took effect.\n */\n :host {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: middle;\n user-select: none;\n }\n\n /*\n * The chip's box is reserved on the slot, not on the host.\n *\n * --qti-dropzone-min-* is the border-box of the widest and tallest chip, so whatever carries\n * that minimum must have no border or padding of its own — otherwise the theme's dashed gap\n * border eats into the reservation, the gap comes up short, and it grows the instant a chip\n * lands in it. That reflows the sentence and drags the neighbouring gaps sideways while the\n * user is still on their way to one.\n *\n * It cannot live on :host. A theme's universal reset matches the host element from the\n * document, and document rules outrank :host — so the host is border-box no matter what this\n * file says. This div is inside the shadow tree, out of the document's reach, and inherits\n * border-box harmlessly since it has no border or padding of its own.\n */\n [part~='drop'] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: var(--qti-dropzone-min-height, 0);\n min-width: var(--qti-dropzone-min-width, 0);\n }\n `\n];\n","import { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { consume } from '@lit/context';\n\nimport { dragDropContext } from '../../context/drag-drop.context';\nimport styles from './qti-gap.styles';\n\nimport type { DragDropState } from '../../context/drag-drop.context';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * A gap in the prose, and the first drop target to render its own chips.\n *\n * The interaction owns placement and publishes it on `dragDropContext`; this element subscribes and\n * renders what it holds. Nothing appends into it. That inverts the old flow, where `handleDrop` did\n * `cloneNode` + `appendChild` and the response was recovered afterwards by reading the DOM back\n * out — which is why placement and the response could ever disagree at all.\n *\n * The chips land in this shadow root rather than in the light DOM, so a theme reaches them as\n * `::part(drag)` — a bare `::part()` matches in any shadow root — instead of by tag. The gap's own\n * `:state(filled)` says whether it holds anything.\n *\n * @customElement qti-gap\n *\n * @attr {string} identifier - Required. Value recorded as the gap side of the response pair.\n * @attr {number} [match-max=1] - How many tokens this gap can hold; `0` means unlimited. Read\n * from the DOM by the drag-drop mixin.\n * @attr {number} [match-min=0] - Minimum tokens this gap must hold.\n * @attr {boolean} [required=false] - Not implemented. Whether this gap must be filled for the\n * response to be valid.\n * @attr {string} template-identifier - Not implemented. Identifier of a template variable\n * controlling this gap's visibility.\n * @attr {'show'|'hide'} [show-hide=show] - Not implemented. How `template-identifier` controls\n * visibility.\n *\n * @csspart drop - The region a chip lands in. Reserves the widest chip's box; see qti-gap.styles.\n */\nexport class QtiGap extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n /** Carries `:state(filled)` while the gap holds a chip. */\n public internals: ElementInternals = this.attachInternals();\n\n /**\n * Opt-in marker, read by `DragDropSlottedMixin`. While this is true the interaction keeps this\n * target's chips in its placement map and never touches this element's children.\n */\n public readonly acceptsDeclarativeDrops = true;\n\n @property({ type: Number, reflect: true }) tabindex: number | undefined = 0;\n @property({ type: String, reflect: true }) identifier: string;\n\n @consume({ context: dragDropContext, subscribe: true })\n @state()\n private _dragDrop?: Readonly<DragDropState>;\n\n /** The chips this gap holds. Stable node references, cloned once at drop time by the interaction. */\n public get drags(): readonly HTMLElement[] {\n return this._dragDrop?.nodesByTarget?.[this.identifier] ?? [];\n }\n\n override render() {\n // Lit renders a `Node` by reference, so a stable node is moved rather than recreated. Keyed by\n // identifier so `repeat` reorders instead of rebuilding.\n return html`<div part=\"drop\">\n ${repeat(\n this.drags,\n node => node.getAttribute('identifier'),\n node => node\n )}\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-gap': QtiGap;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n /* Centred, because a gap-img is a picture inside a drop the same size as it. Was in the theme's\n graphic-gap-match rules, on the host from the document. */\n :host {\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n }\n `\n];\n","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport styles from './qti-gap-img.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\nexport class QtiGapImg extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n @property({ type: Number, reflect: true }) tabindex: number | undefined = 0;\n\n /**\n * `qti-gap-img` is a draggable chip, so it needs ElementInternals to carry the drag states\n * (`dragging`, `placeholder`). It works without a shadow root.\n *\n * NOTE: this element never calls `super.connectedCallback()`, so Lit never enables updating\n * and it has no shadow root — which makes `qti-gap-img.styles.ts` dead code. Fixing that means\n * adding a `<slot>` to a `render()` first, otherwise the authored `<img>` child disappears.\n */\n public internals: ElementInternals = this.attachInternals();\n\n override connectedCallback() {\n this.setAttribute('slot', 'drags');\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-gap-img': QtiGapImg;\n }\n}\n","import { css } from 'lit';\n\nimport type { CSSResultGroup } from 'lit';\n\nconst styles: CSSResultGroup = css`\n /*\n * An option row: one line, clipped, with its text centred against the row's min-height. All four\n * were in the theme, set on this host from the document — which is also why the 'display: block'\n * this file declared never took effect.\n */\n :host {\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n }\n\n slot {\n display: inline;\n }\n`;\n\nexport default styles;\n","import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { ActiveElementMixin } from '../../mixins/active-element/active-element.mixin.js';\nimport styles from './qti-inline-choice.styles.js';\n\nimport type { CSSResultGroup } from 'lit';\nimport type { PropertyValues } from 'lit';\n/**\n * An option in the dropdown of `qti-inline-choice-interaction`.\n *\n * @customElement qti-inline-choice\n *\n * @attr {string} identifier - Required. Value recorded in the response when this option is\n * selected.\n * @attr {boolean} [fixed=false] - Pins this option in place when the interaction is shuffled.\n * @attr {string} template-identifier - Not implemented. Identifier of a template variable\n * controlling this option's visibility.\n * @attr {'show'|'hide'} [show-hide=show] - Not implemented. How `template-identifier` controls\n * visibility.\n */\nexport class QtiInlineChoice extends ActiveElementMixin(LitElement, 'qti-inline-choice') {\n static override styles: CSSResultGroup = styles;\n\n @property({ type: String })\n identifier: string;\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('click', this.#onSelectInlineChoice);\n\n this.dispatchEvent(\n new CustomEvent('qti-inline-choice-register', {\n bubbles: true,\n composed: true,\n cancelable: false\n })\n );\n }\n\n override disconnectedCallback() {\n this.removeEventListener('click', this.#onSelectInlineChoice);\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n\n #onSelectInlineChoice() {\n // if (this.disabled || this.readonly) return;\n\n this.dispatchEvent(\n new CustomEvent('qti-inline-choice-select', {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail: { identifier: this.identifier }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-inline-choice': QtiInlineChoice;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n :host {\n display: block;\n margin: var(--qti-gap) 0;\n width: 100%;\n }\n `\n];\n","import { html, LitElement } from 'lit';\n\nimport styles from './qti-prompt.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\nexport class QtiPrompt extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // if prompts are in interactions they should have a slot, so the prompt has to go there\n // if prompt is in the body, then just display the prompt there.\n // A better check would be the latter, but not can't get through the shadowroot to find the slot\n const inInteraction = this.parentElement?.tagName.endsWith('INTERACTION');\n if (inInteraction) {\n this.setAttribute('slot', 'prompt');\n }\n // const promptSlot = this.parentElement.shadowRoot.querySelector(\"[name='prompt']\");\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-prompt': QtiPrompt;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n :host {\n display: block;\n }\n `\n];\n","import { html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { Interaction, removeDoubleSlashes } from '@qti-components/base';\n\nimport styles from './qti-custom-interaction.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * CES (Custom Element Standard) Custom Interaction Support\n *\n * This component provides runtime support for legacy custom interactions that were built\n * for the CES player - the predecessor to what is now known as FACET and the Trifork QTI Player.\n *\n * These custom interactions use a specific API pattern:\n * - A manifest.json file that references script, style, and media files\n * - A bootstrap.js script that creates an iframe and loads the interaction's index.html\n * - A global CES object that provides: getMedia(), getResponse(), setResponse(), setStageHeight()\n *\n * The challenge is that when these interactions are embedded in iframes (especially those\n * created via document.write() which have about:blank origin), they cannot:\n * - Access the parent's global CES object (cross-origin restriction)\n * - Load external scripts via service workers (about:blank is not controlled)\n *\n * This implementation solves these problems by:\n * 1. Fetching the interaction's index.html from the main window (where service workers work)\n * 2. Injecting a CES proxy (registerCES) that uses postMessage to communicate with the parent\n * 3. Creating a blob URL for the modified HTML\n * 4. Using a simplified bootstrap (ciBootstrap) that loads the pre-created blob URL\n *\n * This approach is transparent - the original package files remain unchanged and the\n * transformation happens entirely at runtime within this web component.\n */\n\n// CES API proxy that gets injected into the index.html\n// This provides the CES object that the custom interaction expects,\n// but uses postMessage to communicate with the parent qti-custom-interaction component\nconst registerCES = `\nconst postToParentWindows = (type, data) => {\n window.top.postMessage(data ? { type, data } : { type }, '*');\n let w = window.parent;\n while (w) {\n if (w !== window.top) {\n w.postMessage({ type, data }, '*');\n }\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n};\n\nwindow.CES = {\n media: null,\n response: null,\n load: () => {\n let resolveCount = 0;\n\n const handleMessage = (event) => {\n if (event.data.type === \"mediaData\") {\n const media = event.data.data;\n CES.media = media;\n resolveCount++;\n } else if (event.data.type === \"responseData\") {\n const response = event.data.data;\n if (response && Array.isArray(response) && response.length > 0) {\n // state is stored in the first element of the array\n CES.response = response[0];\n // Wait a short moment to ensure CES.response is set\n setTimeout(() => {\n // Re-create the Controller instance if it exists\n if (typeof Controller === 'function') {\n console.log(\"Re-creating Controller instance\");\n ctrl = new Controller();\n }\n }, 50);\n } else { \n CES.response = response;\n }\n resolveCount++;\n }\n if (resolveCount === 2) {\n //window.removeEventListener(\"message\", handleMessage);\n }\n };\n window.addEventListener(\"message\", handleMessage);\n postToParentWindows(\"getMedia\");\n postToParentWindows(\"getResponse\");\n },\n setResponse: (data) => {\n postToParentWindows(\"setResponse\", data);\n },\n getResponse: () => {\n return CES.response;\n },\n getMedia: () => {\n return CES.media;\n },\n setStageHeight: () => {\n postToParentWindows(\"setStageHeight\");\n },\n};\nCES.load();\n`;\n\n// Simple bootstrap that just waits for the blob URL and creates the iframe\nconst ciBootstrap = `\n (function() {\n var blobUrlReceived = null;\n \n const createIframe = () => {\n if (!blobUrlReceived || !document.body) return;\n var n = document.createElement('iframe');\n n.frameBorder = '0';\n n.scrolling = 'no';\n n.src = blobUrlReceived;\n n.style.width = '100%';\n n.style.height = '100%';\n document.body.appendChild(n);\n };\n \n const handleMessage = (event) => {\n if (event.data.type === 'blobUrl') {\n blobUrlReceived = event.data.data;\n window.removeEventListener('message', handleMessage);\n createIframe();\n }\n };\n \n window.addEventListener('message', handleMessage);\n \n // Wait for document ready before requesting blobUrl\n const requestBlobUrl = () => {\n let w = window.parent;\n while (w) {\n w.postMessage({ type: 'getBlobUrl' }, '*');\n if (w !== w.parent) {\n w = w.parent;\n } else {\n w = null;\n }\n }\n };\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', requestBlobUrl);\n } else {\n requestBlobUrl();\n }\n })();\n`;\n\n/**\n * QTI Custom Interaction component for legacy CES-based interactions.\n *\n * This component implements support for custom interactions originally built for the CES\n * (Custom Element Standard) player - the predecessor to FACET and the Trifork QTI Player.\n *\n * @remarks\n * The interaction workflow:\n * 1. Fetch the CI manifest (JSON file with script, style, media references)\n * 2. Check if bootstrap.js uses the CES API\n * 3. If CES is used:\n * - Fetch index.html from main window (where service worker/fetch works)\n * - Inject registerCES proxy script for postMessage-based communication\n * - Create blob URL and pass it to ciBootstrap\n * 4. Create pciContainer iframe with style and bootstrap script\n * 5. Handle postMessage events for getMedia, getResponse, setResponse, getBlobUrl\n *\n * The postMessage bridge is necessary because:\n * - Iframes created via document.write() have about:blank origin\n * - They cannot access the parent's global CES object (cross-origin)\n * - Service workers don't control about:blank documents\n *\n * Messages are sent to all parent windows to support embedding scenarios like Storybook\n * where window.top might not be the actual host application.\n */\n\nexport class QtiCustomInteraction extends Interaction {\n #rawResponse: string | string[] = '';\n #manifestUrl: string = null;\n #resourceBaseUrl: string = null;\n static override styles: CSSResultGroup = styles;\n\n constructor() {\n super();\n this.handlePostMessage = this.handlePostMessage.bind(this);\n }\n\n @property({ type: String, attribute: 'data' })\n data: string;\n\n @property({ type: String, attribute: 'data-base-item' })\n baseItemUrl: string;\n\n @property({ type: String, attribute: 'data-base-ref' })\n baseRefUrl: string;\n\n @property({ type: String, attribute: 'id' })\n override id: string;\n\n @state()\n private _errorMessage: string = null;\n manifest: {\n script: string[];\n style: string[];\n media: string[];\n };\n // Pre-created blob URL for the index.html with injected CES proxy\n #contentBlobUrl: string = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n // Support two QTI formats:\n // 1. data attribute directly on qti-custom-interaction: <qti-custom-interaction data=\"manifest.json\">\n // 2. object child element: <qti-custom-interaction><object data=\"manifest.json\"></qti-custom-interaction>\n let manifestPath = this.data;\n\n if (!manifestPath) {\n // Try to get from child <object> element\n const objectEl = this.querySelector('object[data]');\n if (objectEl) {\n manifestPath = objectEl.getAttribute('data');\n // Also get width/height from the object element if available\n const width = objectEl.getAttribute('width');\n const height = objectEl.getAttribute('height');\n if (width) this.setAttribute('width', width);\n if (height) this.setAttribute('height', height);\n }\n }\n\n if (!manifestPath) {\n this._errorMessage = 'No manifest path found (neither data attribute nor object child)';\n return;\n }\n\n const uriToManifest =\n manifestPath.startsWith('http') || manifestPath.startsWith('blob')\n ? manifestPath\n : removeDoubleSlashes((this.baseItemUrl || '') + '/' + manifestPath);\n this.#manifestUrl = new URL(uriToManifest, window.location.href).toString();\n // fetch the json file located at the data attribute\n fetch(uriToManifest)\n .then(response => {\n return response.json();\n })\n .then(data => {\n this.manifest = data;\n this.setupCES();\n })\n .catch(err => {\n this._errorMessage = err;\n });\n }\n\n /**\n * Sets up the CES custom interaction by creating the iframe structure and\n * handling the CES API communication via postMessage.\n *\n * For interactions that use CES, this method:\n * 1. Fetches the original bootstrap.js and checks if it uses CES\n * 2. If CES is used, fetches index.html and injects the registerCES proxy\n * 3. Creates a blob URL for the modified HTML (stored in _contentBlobUrl)\n * 4. Replaces bootstrap.js with ciBootstrap that loads the blob URL\n * 5. Sets up postMessage listeners for CES API calls\n */\n async setupCES() {\n // Ensure the iframe exists and has a document before writing into it.\n // In some environments (e.g. Storybook/Vitest browser mode) the iframe can exist but its\n // `contentDocument` is still null momentarily, which would otherwise cause an unhandled rejection.\n await this.updateComplete;\n const iframe = this.shadowRoot?.querySelector('#pciContainer') as HTMLIFrameElement | null;\n if (!iframe) {\n this._errorMessage = 'pciContainer iframe not found';\n return;\n }\n\n if (!iframe.getAttribute('src')) {\n // Make sure the iframe navigates so we get a document we can write to.\n iframe.setAttribute('src', 'about:blank');\n }\n\n let iframeDoc = iframe.contentDocument ?? iframe.contentWindow?.document ?? null;\n if (!iframeDoc) {\n await new Promise<void>(resolve => iframe.addEventListener('load', () => resolve(), { once: true }));\n iframeDoc = iframe.contentDocument ?? iframe.contentWindow?.document ?? null;\n }\n if (!iframeDoc) {\n this._errorMessage = 'pciContainer iframe document not available';\n return;\n }\n\n if (!this.manifest.script || this.manifest.script.length === 0) {\n this._errorMessage = 'No script found in manifest';\n return;\n }\n if (!this.manifest.style || this.manifest.style.length === 0) {\n this._errorMessage = 'No style found in manifest';\n return;\n }\n const cssRef = this.manifest.style[0];\n\n const baseCandidates = this.#getBaseCandidates();\n\n const cssResolved = await this.#resolveResourceWithFallback(cssRef, baseCandidates);\n const cssUrl = cssResolved.url;\n if (cssResolved.baseUrl && !this.#resourceBaseUrl) {\n this.#resourceBaseUrl = cssResolved.baseUrl;\n }\n\n // Always use the built-in ciBootstrap instead of the package's bootstrap.js.\n // The package's bootstrap.js is the original CES version which doesn't work\n // in the iframe/postMessage setup. Our ciBootstrap handles this correctly.\n const usesCES = true;\n\n // If the original bootstrap.js uses CES, we need to:\n // 1. Fetch the index.html from here (main window, where service worker works)\n // 2. Inject the registerCES proxy script\n // 3. Create a blob URL and store it\n // 4. Use ciBootstrap to request and load the blob URL\n if (usesCES) {\n // Try to get index.html path from manifest.media, or construct it from the manifest path\n let indexUrl = '';\n if (this.manifest.media && this.manifest.media.length > 0) {\n const mediaRef = this.manifest.media[0];\n const indexResolved = await this.#resolveResourceWithFallback(mediaRef, baseCandidates, {\n returnText: true\n });\n indexUrl = indexResolved.url;\n if (indexResolved.baseUrl && !this.#resourceBaseUrl) {\n this.#resourceBaseUrl = indexResolved.baseUrl;\n }\n if (indexResolved.text) {\n let html = indexResolved.text;\n\n // Check if the HTML was already modified (e.g., by backend import process)\n // If it already has postToParentWindows or CES proxy, skip injection\n const alreadyModified = html.includes('postToParentWindows') || html.includes('window.CES');\n\n if (!alreadyModified) {\n // Inject the CES proxy script after <head>\n const cesScript = '<script>' + registerCES + '</' + 'script>';\n const headIndex = html.indexOf('<head>');\n if (headIndex !== -1) {\n html = html.slice(0, headIndex + 6) + cesScript + html.slice(headIndex + 6);\n } else {\n // If no <head>, prepend to document\n html = cesScript + html;\n }\n }\n\n // Create a blob URL for the modified HTML\n const blob = new Blob([html], { type: 'text/html' });\n this.#contentBlobUrl = URL.createObjectURL(blob);\n }\n } else {\n // If no media array, try to construct index.html path from the manifest location\n // Assume index.html is in the same directory as the manifest\n const manifestPath = this.data || 'manifest.json';\n const basePath = manifestPath.includes('/') ? manifestPath.substring(0, manifestPath.lastIndexOf('/')) : '';\n const indexPath = basePath ? `${basePath}/index.html` : 'index.html';\n const indexResolved = await this.#resolveResourceWithFallback(indexPath, baseCandidates, {\n returnText: true\n });\n indexUrl = indexResolved.url;\n if (indexResolved.baseUrl && !this.#resourceBaseUrl) {\n this.#resourceBaseUrl = indexResolved.baseUrl;\n }\n if (indexResolved.text) {\n let html = indexResolved.text;\n\n // Check if the HTML was already modified (e.g., by backend import process)\n const alreadyModified = html.includes('postToParentWindows') || html.includes('window.CES');\n\n if (!alreadyModified) {\n // Inject the CES proxy script after <head>\n const cesScript = '<script>' + registerCES + '</' + 'script>';\n const headIndex = html.indexOf('<head>');\n if (headIndex !== -1) {\n html = html.slice(0, headIndex + 6) + cesScript + html.slice(headIndex + 6);\n } else {\n // If no <head>, prepend to document\n html = cesScript + html;\n }\n }\n\n // Create a blob URL for the modified HTML\n const blob = new Blob([html], { type: 'text/html' });\n this.#contentBlobUrl = URL.createObjectURL(blob);\n }\n }\n\n if (indexUrl && !this.#contentBlobUrl) {\n try {\n const indexResponse = await fetch(indexUrl);\n if (indexResponse.ok) {\n let html = await indexResponse.text();\n\n // Check if the HTML was already modified (e.g., by backend import process)\n const alreadyModified = html.includes('postToParentWindows') || html.includes('window.CES');\n\n if (!alreadyModified) {\n // Inject the CES proxy script after <head>\n const cesScript = '<script>' + registerCES + '</' + 'script>';\n const headIndex = html.indexOf('<head>');\n if (headIndex !== -1) {\n html = html.slice(0, headIndex + 6) + cesScript + html.slice(headIndex + 6);\n } else {\n // If no <head>, prepend to document\n html = cesScript + html;\n }\n }\n\n // Create a blob URL for the modified HTML\n const blob = new Blob([html], { type: 'text/html' });\n this.#contentBlobUrl = URL.createObjectURL(blob);\n } else {\n console.error(`Failed to fetch index.html: ${indexResponse.status}`);\n }\n } catch (e) {\n console.error(`Error fetching index.html: ${e}`);\n }\n }\n }\n\n const inlineScript = `<script>${ciBootstrap}</` + 'script>';\n\n window.addEventListener('message', this.handlePostMessage);\n\n const htmlContent = `\n <!DOCTYPE html>\n <html>\n <head>\n ${cssUrl ? `<link href='${cssUrl}' rel=\"stylesheet\" />` : ''}\n ${inlineScript}\n </head>\n <body></body>\n </html>\n `;\n\n // Use srcdoc instead of document.write for better script execution\n iframe.srcdoc = htmlContent;\n }\n\n #getIFrames() {\n const iframesInShadowRoot = this.shadowRoot.querySelectorAll('iframe');\n const iframe = this.querySelectorAll('iframe');\n\n const outerIFrames = [...iframesInShadowRoot, ...iframe];\n for (const iframe of outerIFrames) {\n const iframeSrc = iframe.src;\n const isSameOrigin = new URL(iframeSrc, window.location.href).origin === window.location.origin;\n if (isSameOrigin) {\n try {\n const outerDoc = iframe.contentDocument || iframe.contentWindow.document;\n if (outerDoc) {\n this.#getInnerIFrames(outerDoc, outerIFrames);\n }\n } catch (e) {\n console.error('Error accessing nested iframe:', e);\n }\n }\n }\n // get only unique iframes\n outerIFrames.forEach((iframe, index) => {\n if (outerIFrames.indexOf(iframe) !== index) {\n outerIFrames.splice(index, 1);\n }\n });\n return outerIFrames;\n }\n\n #getInnerIFrames(iframeDocument: Document, iframes: HTMLIFrameElement[] = []) {\n // Get all iframes in the current document\n const currentIframes = iframeDocument.querySelectorAll('iframe');\n\n currentIframes.forEach(iframe => {\n // Add the current iframe to the list\n iframes.push(iframe);\n\n // Recursively get iframes within the current iframe\n // Check if the iframe src is from the same origin\n const iframeSrc = iframe.src;\n const isSameOrigin = new URL(iframeSrc, window.location.href).origin === window.location.origin;\n\n if (isSameOrigin) {\n try {\n const nestedDoc = iframe.contentDocument || iframe.contentWindow.document;\n this.#getInnerIFrames(nestedDoc, iframes);\n } catch (e) {\n console.error('Error accessing nested iframe:', e);\n }\n } else {\n console.warn('Skipped cross-origin iframe:', iframeSrc);\n }\n });\n\n return iframes;\n }\n\n #postToWindowAndIframes(type: string, data: any) {\n window.postMessage({ type, data }, '*');\n const iframes = this.#getIFrames();\n for (const iframe of iframes) {\n if (iframe.contentWindow) {\n iframe.contentWindow.postMessage({ type, data }, '*');\n }\n }\n }\n\n handlePostMessage(event: MessageEvent) {\n const { type, data } = event.data;\n switch (type) {\n case 'setResponse':\n if (data === null || !(Array.isArray(data) && data.length === 1 && data[0] === '')) {\n this.#rawResponse = data;\n this.saveResponse(data);\n }\n break;\n case 'getResponse': {\n this.#postToWindowAndIframes('responseData', this.#rawResponse);\n break;\n }\n case 'getBlobUrl': {\n // Send the pre-created blob URL to the requesting iframe\n if (this.#contentBlobUrl) {\n this.#postToWindowAndIframes('blobUrl', this.#contentBlobUrl);\n // Also respond directly to the source window if possible\n if (event.source && event.source !== window) {\n (event.source as Window).postMessage({ type: 'blobUrl', data: this.#contentBlobUrl }, '*');\n }\n }\n break;\n }\n case 'getMedia': {\n const baseCandidates = this.#getBaseCandidates();\n const mediaData = this.manifest.media.map(media => {\n if (media.startsWith('http') || media.startsWith('blob')) {\n return media;\n }\n const baseUrl = this.#resourceBaseUrl || baseCandidates[0];\n if (!baseUrl) {\n return media;\n }\n return new URL(media, baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`).toString();\n });\n this.#postToWindowAndIframes('mediaData', mediaData);\n break;\n }\n case 'setStageHeight':\n console.log('setStageHeight not implemented');\n break;\n }\n }\n\n validate(): boolean {\n if (!this.#rawResponse) {\n return false;\n }\n if (Array.isArray(this.#rawResponse)) {\n if (this.#rawResponse.length === 0) {\n return false;\n }\n // check if one of the values has a value\n for (const value of this.#rawResponse) {\n if (value !== '' && value !== null) {\n return true;\n }\n }\n }\n return true;\n }\n\n get response(): string | string[] | null {\n return (this.#rawResponse as string | string[]) || null;\n }\n\n set response(val: string | string[] | null) {\n if (typeof val === 'string') {\n this.#rawResponse = val;\n this.saveResponse(val);\n } else if (Array.isArray(val)) {\n this.#rawResponse = val;\n } else if (!val) {\n // do nothing\n } else {\n throw new Error('Value must be a string or an array of strings');\n }\n }\n\n override disconnectedCallback(): void {\n window.removeEventListener('message', this.handlePostMessage);\n super.disconnectedCallback();\n }\n\n override render() {\n return html`<iframe\n width=${this.getAttribute('width')}\n height=${this.getAttribute('height')}\n frameborder=\"0\"\n title=\"pciContainer\"\n id=\"pciContainer\"\n >\n </iframe>\n ${this._errorMessage &&\n html`<div style=\"color:red\">\n <h1>Error</h1>\n ${this._errorMessage}\n </div>`}`;\n }\n\n #getBaseCandidates(): string[] {\n const candidates = [this.#resourceBaseUrl, this.baseRefUrl, this.baseItemUrl, this.#getManifestBaseUrl()];\n const resolved = candidates.filter(Boolean).map(base => new URL(base, window.location.href).toString());\n\n // Also add the manifest's parent directory (e.g. go up from .../json/ to .../)\n const manifestParent = this.#getManifestParentBaseUrl();\n if (manifestParent) {\n resolved.push(manifestParent);\n }\n\n // Deduplicate\n return [...new Set(resolved)];\n }\n\n #getManifestBaseUrl(): string | null {\n if (!this.#manifestUrl) {\n return null;\n }\n return new URL('.', this.#manifestUrl).toString();\n }\n\n #getManifestParentBaseUrl(): string | null {\n if (!this.#manifestUrl) {\n return null;\n }\n // Go up one more level from the manifest directory (e.g. from .../json/ to .../)\n // This helps when manifest.json is in a subdirectory but resources are at the parent level\n return new URL('..', this.#manifestUrl).toString();\n }\n\n async #resolveResourceWithFallback(\n ref: string,\n baseCandidates: string[],\n options: { returnText?: boolean } = {}\n ): Promise<{ url: string; baseUrl: string | null; text?: string }> {\n if (!ref) {\n return { url: '', baseUrl: null };\n }\n if (ref.startsWith('http') || ref.startsWith('blob')) {\n return { url: ref, baseUrl: null };\n }\n\n for (const base of baseCandidates) {\n const baseUrl = new URL(base, window.location.href).toString();\n const url = new URL(ref, baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`).toString();\n try {\n const response = await fetch(url);\n if (response.ok) {\n if (options.returnText) {\n const text = await response.text();\n return { url, baseUrl, text };\n }\n return { url, baseUrl };\n }\n } catch (e) {\n // try next base\n }\n }\n\n return { url: '', baseUrl: null };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-custom-interaction': QtiCustomInteraction;\n }\n}\n","import { boxSizing } from '@qti-components/base';\n\nexport default [boxSizing];\n","import { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport styles from './qti-end-attempt-interaction.styles';\n\nimport type { CSSResultGroup } from 'lit';\n/**\n * A button that ends the current attempt.\n *\n * @csspart button - The end-attempt button element.\n */\nexport class QtiEndAttemptInteraction extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n @property({ type: String, attribute: 'response-identifier' }) responseIdentifier: string;\n\n @property({ reflect: true, type: Boolean }) disabled = false;\n\n /** Defines the number of attempts that a user can make using the 'endAttemptInteraction' mechanism (this can be used to limit the number of hints, etc.). [More information](https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#DataCharacteristic_EndAttemptInteraction.Attr_count-attempt) */\n @property({ type: String, attribute: 'count-attempt' })\n public countAttempt: 'true' | 'false' | null = null;\n\n @property({ type: String })\n public override title: string = 'end attempt';\n\n override render() {\n return html`<button ?disabled=${this.disabled} part=\"button\" @click=${this.endAttempt}>${this.title}</button>`;\n }\n public endAttempt(_: Event) {\n this.dispatchEvent(\n new CustomEvent('end-attempt', {\n bubbles: true,\n composed: true,\n detail: { responseIdentifier: this.responseIdentifier, countAttempt: this.countAttempt === 'true' }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-end-attempt-interaction': QtiEndAttemptInteraction;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n /* The box this element already had. See the note in qti-match-interaction.styles.ts. */\n :host {\n display: block;\n }\n `\n];\n","import { html } from 'lit';\n\nimport { Interaction } from '@qti-components/base';\n\nimport styles from './qti-media-interaction.styles';\n\nimport type { CSSResultGroup } from 'lit';\n/**\n * Media interaction: wraps an embedded media object (audio/video) and tracks play events.\n *\n * @slot prompt - The prompt shown above the media element.\n * @slot - Default slot for the embedded media element.\n */\nexport class QtiMediaInteraction extends Interaction {\n static override styles: CSSResultGroup = styles;\n\n #value: number = null;\n\n override reset() {\n this.#value = null;\n }\n validate(): boolean {\n return true;\n }\n\n get response(): string | null {\n return this.#value ? this.#value.toString() : null;\n }\n\n set response(val: string | null) {\n if (val) {\n const isNumber = !isNaN(parseInt(val?.toString()));\n if (isNumber) {\n this.#value = parseInt(val.toString());\n } else {\n throw new Error(`Value must be a number ${val}`);\n }\n }\n }\n\n static override get properties() {\n return {\n ...Interaction.properties,\n ...{\n step: {\n type: Number,\n attribute: 'step',\n default: 10\n }\n }\n };\n }\n\n override render() {\n return html` <slot name=\"prompt\"></slot>\n <slot></slot>`;\n }\n\n constructor() {\n super();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n // get audio, video of object tag.\n const mediaObject = this.querySelector('audio') || this.querySelector('video') || this.querySelector('object');\n if (mediaObject) {\n // listen to ended event\n mediaObject.addEventListener('ended', () => {\n // set value to 0\n // check if this.value is a number\n this.#value++;\n this.saveResponse(this.value);\n });\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-media-interaction': QtiMediaInteraction;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n :host {\n display: block;\n }\n ::slotted(img) {\n position: absolute;\n cursor: move;\n user-select: none;\n left: 50%;\n transform: translateX(-50%);\n }\n `\n];\n","import { LitElement, html } from 'lit';\n\nimport styles from './qti-position-object-interaction.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * Position-object interaction: candidates place draggable objects onto a stage image.\n *\n * @slot - Default slot for the object choices and stage.\n */\nexport class QtiPositionObjectInteraction extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n :host {\n display: inline-block;\n position: relative;\n }\n `\n];\n","import { LitElement, html } from 'lit';\n\nimport styles from './qti-position-object-stage.styles';\n\nimport type { CSSResultGroup, PropertyValueMap } from 'lit';\nexport class QtiPositionObjectStage extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n choiceOrdering: boolean;\n startX: any;\n startY: any;\n dragElement: any;\n\n override render() {\n return html`<slot></slot>`;\n }\n\n constructor() {\n super();\n this.removeMoveListener = this.removeMoveListener.bind(this);\n this.dragElementHandler = this.dragElementHandler.bind(this);\n }\n\n // Define a function to handle the mousemove event on the draggable element\n dragElementHandler(event: MouseEvent): void {\n event.preventDefault();\n\n // Calculate the distance the mouse has moved since the last event\n const deltaX: number = event.clientX - this.startX;\n const deltaY: number = event.clientY - this.startY;\n\n // Update the position of the draggable element\n this.dragElement.style.left = this.dragElement.offsetLeft + deltaX + 'px';\n this.dragElement.style.top = this.dragElement.offsetTop + deltaY + 'px';\n\n // Update the starting position of the mouse\n this.startX = event.clientX;\n this.startY = event.clientY;\n }\n\n override firstUpdated(a: PropertyValueMap<any>): void {\n super.firstUpdated(a);\n\n // Get the draggable and drop zone elements\n this.dragElement = this.querySelector('qti-position-object-interaction>img');\n // const canvasElement = document.getElementById('canvas');\n\n // Initialize variables for the starting position of the draggable element\n this.startX = 0;\n this.startY = 0;\n\n // Add a mousedown event listener to the draggable element\n this.dragElement.addEventListener('mousedown', (event: MouseEvent) => {\n // Save the starting position of the mouse\n this.startX = event.clientX;\n this.startY = event.clientY;\n\n // Add a mousemove event listener to the document\n document.addEventListener('mousemove', this.dragElementHandler, true);\n });\n document.addEventListener('mouseup', this.removeMoveListener);\n }\n\n removeMoveListener() {\n document.removeEventListener('mousemove', this.dragElementHandler, true);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('mousemove', this.dragElementHandler);\n document.removeEventListener('mouseup', this.removeMoveListener);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-position-object-stage': QtiPositionObjectStage;\n }\n}\n","import { css } from 'lit';\n\nimport { boxSizing } from '@qti-components/base';\n\nexport default [\n boxSizing,\n css`\n :host {\n display: block;\n margin: 1em 0;\n }\n input[type='file'] {\n display: block;\n margin-top: 0.5em;\n }\n `\n];\n","import { html } from 'lit';\n\nimport { Interaction } from '@qti-components/base';\n\nimport styles from './qti-upload-interaction.styles';\n\nimport type { CSSResultGroup } from 'lit';\n/**\n * Upload interaction: candidates attach a file as their response.\n *\n * @slot prompt - The prompt shown above the file input.\n */\nexport class QtiUploadInteraction extends Interaction {\n static override styles: CSSResultGroup = styles;\n\n #file: File | null = null;\n #base64: string | null = null;\n\n override reset() {\n this.#file = null;\n this.#base64 = null;\n this.saveResponse(null);\n }\n\n validate(): boolean {\n return this.#base64 !== null; // Ensure the Base64 string is set\n }\n\n get response(): string | null {\n return this.#base64; // Return the Base64 string\n }\n\n set response(base64: string | null) {\n if (typeof base64 === 'string') {\n this.#base64 = base64;\n this.saveResponse(base64); // Save Base64 string as the response\n } else if (base64 === null) {\n this.reset();\n } else {\n throw new Error('Value must be a Base64-encoded string or null');\n }\n }\n\n static override get properties() {\n return {\n ...Interaction.properties\n };\n }\n\n override render() {\n return html`\n <div>\n <slot name=\"prompt\"></slot>\n <input type=\"file\" @change=\"${this.#onFileChange}\" ?disabled=\"${this.disabled}\" ?readonly=\"${this.readonly}\" />\n </div>\n `;\n }\n\n async #onFileChange(event: Event) {\n const input = event.target as HTMLInputElement;\n if (input.files && input.files.length > 0) {\n this.#file = input.files[0];\n this.#base64 = await this.#convertToBase64(this.#file);\n this.saveResponse(this.#base64); // Save the Base64 string\n this.dispatchEvent(\n new CustomEvent('qti-interaction-response', {\n detail: { response: this.#base64 }\n })\n );\n }\n }\n\n #convertToBase64(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(reader.error);\n reader.readAsDataURL(file); // Converts to Base64\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-upload-interaction': QtiUploadInteraction;\n }\n}\n","import { QtiAssociableHotspot } from './qti-associable-hotspot';\n\nexport const elements = [{ tag: 'qti-associable-hotspot', ctor: QtiAssociableHotspot }] as const;\n\nexport { QtiAssociableHotspot };\n","import { QtiGap } from './qti-gap';\n\nexport const elements = [{ tag: 'qti-gap', ctor: QtiGap }] as const;\n\nexport { QtiGap };\n","import { QtiGapImg } from './qti-gap-img';\n\nexport const elements = [{ tag: 'qti-gap-img', ctor: QtiGapImg }] as const;\n\nexport { QtiGapImg };\n","import { QtiGapText } from './qti-gap-text';\n\nexport const elements = [{ tag: 'qti-gap-text', ctor: QtiGapText }] as const;\n\nexport { QtiGapText };\n","import { QtiHotspotChoice } from './qti-hotspot-choice';\n\nexport const elements = [{ tag: 'qti-hotspot-choice', ctor: QtiHotspotChoice }] as const;\n\nexport { QtiHotspotChoice };\n","import { QtiHottext } from './qti-hottext';\n\nexport const elements = [{ tag: 'qti-hottext', ctor: QtiHottext }] as const;\n\nexport { QtiHottext };\n","import { QtiInlineChoice } from './qti-inline-choice';\n\nexport const elements = [{ tag: 'qti-inline-choice', ctor: QtiInlineChoice }] as const;\n\nexport { QtiInlineChoice };\n","import { QtiPrompt } from './qti-prompt';\n\nexport const elements = [{ tag: 'qti-prompt', ctor: QtiPrompt }] as const;\n\nexport { QtiPrompt };\n","import { QtiSimpleAssociableChoice } from './qti-simple-associable-choice';\n\nexport const elements = [{ tag: 'qti-simple-associable-choice', ctor: QtiSimpleAssociableChoice }] as const;\n\nexport { QtiSimpleAssociableChoice };\n","import { QtiSimpleChoice } from './qti-simple-choice';\n\nexport const elements = [{ tag: 'qti-simple-choice', ctor: QtiSimpleChoice }] as const;\n\nexport { QtiSimpleChoice };\n","import { elements as qtiAssociableHotspotElements } from './elements/qti-associable-hotspot/elements';\nimport { elements as qtiGapElements } from './elements/qti-gap/elements';\nimport { elements as qtiGapImgElements } from './elements/qti-gap-img/elements';\nimport { elements as qtiGapTextElements } from './elements/qti-gap-text/elements';\nimport { elements as qtiHotspotChoiceElements } from './elements/qti-hotspot-choice/elements';\nimport { elements as qtiHottextElements } from './elements/qti-hottext/elements';\nimport { elements as qtiInlineChoiceElements } from './elements/qti-inline-choice/elements';\nimport { elements as qtiPromptElements } from './elements/qti-prompt/elements';\nimport { elements as qtiSimpleAssociableChoiceElements } from './elements/qti-simple-associable-choice/elements';\nimport { elements as qtiSimpleChoiceElements } from './elements/qti-simple-choice/elements';\n\nexport const qtiInteractionCoreElements = [\n ...qtiAssociableHotspotElements,\n ...qtiGapElements,\n ...qtiGapImgElements,\n ...qtiGapTextElements,\n ...qtiHotspotChoiceElements,\n ...qtiHottextElements,\n ...qtiInlineChoiceElements,\n ...qtiPromptElements,\n ...qtiSimpleAssociableChoiceElements,\n ...qtiSimpleChoiceElements\n] as const;\n","import { QtiCustomInteraction } from './qti-custom-interaction';\n\nexport const elements = [{ tag: 'qti-custom-interaction', ctor: QtiCustomInteraction }] as const;\n\nexport { QtiCustomInteraction };\n","import { QtiEndAttemptInteraction } from './qti-end-attempt-interaction';\n\nexport const elements = [{ tag: 'qti-end-attempt-interaction', ctor: QtiEndAttemptInteraction }] as const;\n\nexport { QtiEndAttemptInteraction };\n","import { QtiMediaInteraction } from './qti-media-interaction';\n\nexport const elements = [{ tag: 'qti-media-interaction', ctor: QtiMediaInteraction }] as const;\n\nexport { QtiMediaInteraction };\n","import { QtiPositionObjectInteraction } from './qti-position-object-interaction';\nimport { QtiPositionObjectStage } from './qti-position-object-stage';\n\nexport const elements = [\n { tag: 'qti-position-object-interaction', ctor: QtiPositionObjectInteraction },\n { tag: 'qti-position-object-stage', ctor: QtiPositionObjectStage }\n] as const;\n\nexport { QtiPositionObjectInteraction, QtiPositionObjectStage };\n","import { QtiUploadInteraction } from './qti-upload-interaction';\n\nexport const elements = [{ tag: 'qti-upload-interaction', ctor: QtiUploadInteraction }] as const;\n\nexport { QtiUploadInteraction };\n","import { qtiInteractionCoreElements } from '@qti-components/interactions-core/elements';\nimport { elements as associateInteractionElements } from '@qti-components/associate-interaction/elements';\nimport { elements as choiceInteractionElements } from '@qti-components/choice-interaction/elements';\nimport { elements as customInteractionElements } from '@qti-components/custom-interaction/elements';\nimport { elements as endAttemptInteractionElements } from '@qti-components/end-attempt-interaction/elements';\nimport { elements as extendedTextInteractionElements } from '@qti-components/extended-text-interaction/elements';\nimport { elements as gapMatchInteractionElements } from '@qti-components/gap-match-interaction/elements';\nimport { elements as graphicAssociateInteractionElements } from '@qti-components/graphic-associate-interaction/elements';\nimport { elements as graphicGapMatchInteractionElements } from '@qti-components/graphic-gap-match-interaction/elements';\nimport { elements as graphicOrderInteractionElements } from '@qti-components/graphic-order-interaction/elements';\nimport { elements as hotspotInteractionElements } from '@qti-components/hotspot-interaction/elements';\nimport { elements as hottextInteractionElements } from '@qti-components/hottext-interaction/elements';\nimport { elements as inlineChoiceInteractionElements } from '@qti-components/inline-choice-interaction/elements';\nimport { elements as matchInteractionElements } from '@qti-components/match-interaction/elements';\nimport { elements as mediaInteractionElements } from '@qti-components/media-interaction/elements';\nimport { elements as orderInteractionElements } from '@qti-components/order-interaction/elements';\nimport { elements as portableCustomInteractionElements } from '@qti-components/portable-custom-interaction/elements';\nimport { elements as positionObjectInteractionElements } from '@qti-components/position-object-interaction/elements';\nimport { elements as selectPointInteractionElements } from '@qti-components/select-point-interaction/elements';\nimport { elements as sliderInteractionElements } from '@qti-components/slider-interaction/elements';\nimport { elements as textEntryInteractionElements } from '@qti-components/text-entry-interaction/elements';\nimport { elements as uploadInteractionElements } from '@qti-components/upload-interaction/elements';\n\nexport const qtiInteractionElements = [\n ...qtiInteractionCoreElements,\n ...associateInteractionElements,\n ...choiceInteractionElements,\n ...customInteractionElements,\n ...endAttemptInteractionElements,\n ...extendedTextInteractionElements,\n ...gapMatchInteractionElements,\n ...graphicAssociateInteractionElements,\n ...graphicGapMatchInteractionElements,\n ...graphicOrderInteractionElements,\n ...hotspotInteractionElements,\n ...hottextInteractionElements,\n ...inlineChoiceInteractionElements,\n ...matchInteractionElements,\n ...mediaInteractionElements,\n ...orderInteractionElements,\n ...portableCustomInteractionElements,\n ...positionObjectInteractionElements,\n ...selectPointInteractionElements,\n ...sliderInteractionElements,\n ...textEntryInteractionElements,\n ...uploadInteractionElements\n] as const;\n","import { qtiInteractionElements } from './elements';\n\nfor (const { tag, ctor } of qtiInteractionElements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n","import { elements } from './elements';\n\nfor (const { tag, ctor } of elements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAA,wCAAe;EACb;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACUI,IAAO,uBAAP,cAAoCA,GAAU;EAApD,cAAA;;AAIS,SAAA,YAA8B,KAAK,gBAAe;AAGzC,SAAA,0BAA0B;EAiC5C;;AAvCkB,SAAA,SAAyB;EAAO;;EAehD,IAAW,QAAK;AACd,WAAO,KAAK,WAAW,gBAAgB,KAAK,UAAU,KAAK,CAAA;EAC7D;EAES,oBAAiB;AACxB,UAAM,kBAAiB;AACvB,SAAK,cACH,IAAI,YAAY,wBAAwB;MACtC,SAAS;MACT,UAAU;MACV,YAAY;KACb,CAAC;EAEN;EAES,SAAM;AACb,WAAO;QACHC,GACA,KAAK,OACL,UAAQ,KAAK,aAAa,YAAY,GACtC,UAAQ,IAAI,CACb;;EAEL;;AA9B2C,WAAA;EAA1C,EAAS,EAAE,MAAM,QAAQ,SAAS,KAAI,CAAE;;AAIjC,WAAA;EAFP,EAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAI,CAAE;EACrD,EAAK;;;;ACzBR,IAAA,yBAAe;EACb;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC+BI,IA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Ae,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;;;ACJA,WAAW,EAAE,KAAK,KAAI,KAAMC,YAAU;AACpC,MAAI,CAAC,eAAe,IAAI,GAAG,GAAG;AAC5B,mBAAe,OAAO,KAAK,IAAI;EACjC;AACF;","names":["i","c","i","c","__decorate","i","__decorate","i","__decorate","i","iframe","__decorate","i","__decorate","i","i","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements","elements"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../qti-item/src/components/item-container/item-container.ts","../../qti-item/src/components/item-print-variables/item-print-variables.ts","../../qti-item/src/components/qti-item/qti-item.ts","../../qti-item/src/elements.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { qtiContext } from '@qti-components/base';\nimport { watch } from '@qti-components/utilities';\nimport { qtiTransformItem } from '@qti-components/transformers';\n\n// eslint-disable-next-line import/no-relative-packages\nimport itemCss from '../../../../qti-theme/src/item.css?inline';\n\nimport type { QtiContext } from '@qti-components/base';\n\n/**\n * `<item-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-item` will be placed inside the shadow DOM of this element.\n * The element loads the item from the provided URL and renders it inside the shadow DOM.\n *\n * ### Styling\n * Add a class to the element for styling.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n\nexport class ItemContainer extends LitElement {\n /** Scoped registry used by the item shadow root. Must be set before connection. */\n @property({ attribute: false })\n customElementRegistry: CustomElementRegistry | null = null;\n\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n itemXML: string = null;\n\n @state()\n @consume({ context: qtiContext, subscribe: true })\n protected qtiContext: QtiContext = {\n QTI_CONTEXT: { testIdentifier: '', candidateIdentifier: '', environmentIdentifier: 'default' }\n };\n\n /** Template content if provided */\n #templateContent: unknown = null;\n #resolvedCustomElementRegistry: CustomElementRegistry | null = null;\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const registry = this.customElementRegistry;\n\n this.#resolvedCustomElementRegistry = registry;\n\n return (\n this.shadowRoot ??\n this.attachShadow({\n ...(this.constructor as typeof ItemContainer).shadowRootOptions,\n ...(registry ? { customElementRegistry: registry } : {})\n })\n );\n }\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const explicitSeed = this.qtiContext?.QTI_CONTEXT?.seed;\n const api = (await qtiTransformItem().load(this.itemURL)).shuffleInteractions(explicitSeed);\n this.itemDoc = api.htmlDoc(this.#resolvedCustomElementRegistry ?? undefined);\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('itemXML', { waitUntilFirstUpdate: true })\n protected handleItemXMLChange() {\n if (!this.itemXML) return;\n try {\n this.itemDoc = qtiTransformItem()\n .parse(this.itemXML)\n .htmlDoc(this.#resolvedCustomElementRegistry ?? undefined);\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.#initializeTemplateContent();\n this.#applyStyles();\n if (this.itemURL) {\n this.handleItemURLChange();\n }\n if (this.itemXML) {\n this.handleItemXMLChange();\n }\n }\n\n #initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.#templateContent = template ? template.content : html``;\n }\n\n #applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n override render() {\n return html`\n ${this.#templateContent}\n <slot></slot>\n ${until(this.itemDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-container': ItemContainer;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\n\nexport class ItemPrintVariables extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n protected computedContext?: ComputedItemContext;\n\n static override styles = css`\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n `;\n\n override render() {\n const activeItem = this.computedContext;\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const responseVariables: ResponseVariable[] = activeItem.variables.filter(v => v.type === 'response');\n const outcomeVariables = activeItem.variables.filter(v => v.type === 'outcome');\n\n const renderTable = (variables: ResponseVariable[], title: string) => html`\n <h3>${title}</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ${variables.map(v => {\n const correctResponse = v.correctResponse\n ? Array.isArray(v.correctResponse)\n ? v.correctResponse.join(', ')\n : v.correctResponse\n : '';\n\n const mapEntries = v.mapping?.mapEntries?.map(m => `${m.mapKey}=${m.mappedValue}pt`).join(', ') || '';\n\n const areaMapEntries =\n v.areaMapping?.areaMapEntries?.map(m => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(', ') || '';\n\n return html`\n <tr>\n <td>${v.identifier}</td>\n <td>${Array.isArray(v.value) ? v.value.join(', ') : v.value}</td>\n <td>${v.cardinality}</td>\n <td>${v.baseType}</td>\n <td>${correctResponse || mapEntries || areaMapEntries}</td>\n </tr>\n `;\n })}\n </tbody>\n </table>\n `;\n\n return html`\n ${renderTable(responseVariables, 'Response Variables')} ${renderTable(outcomeVariables, 'Outcome Variables')}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-print-variables': ItemPrintVariables;\n }\n}\n","import { provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\n\nimport { computedItemContext } from '@qti-components/base';\nimport { configContext } from '@qti-components/base';\nimport { qtiContext } from '@qti-components/base';\n\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { ConfigContext } from '@qti-components/base';\nimport type { QtiContext } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\nimport type { VariableDeclaration } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\n\n/**\n * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.\n * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.\n * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.\n * See `<item-container>` for more details.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n\nexport class QtiItem extends LitElement {\n @state()\n @provide({ context: computedItemContext })\n public computedContext: ComputedItemContext;\n protected assessmentItem?: QtiAssessmentItem;\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n /**\n * Provided so that descendants (e.g. `<item-container>`) can read the QTI runtime\n * context for standalone item delivery, including the optional shuffle `seed`.\n */\n @state()\n @provide({ context: qtiContext })\n public qtiContext: QtiContext = {\n QTI_CONTEXT: {\n testIdentifier: '',\n candidateIdentifier: '',\n environmentIdentifier: 'default'\n }\n };\n\n // Store event handlers as instance properties\n #onItemContextChanged = this.#handleItemContextChanged.bind(this);\n #onAssessmentItemConnected = this.#handleAssessmentItemConnected.bind(this);\n\n constructor() {\n super();\n this.addEventListener('qti-item-context-updated', this.#onItemContextChanged);\n this.addEventListener('qti-assessment-item-connected', this.#onAssessmentItemConnected);\n }\n\n #handleItemContextChanged(e: CustomEvent<{ itemContext: ItemContext }>) {\n this.#updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);\n }\n\n #handleAssessmentItemConnected(e: CustomEvent<QtiAssessmentItem>) {\n const fullVariables = (e.detail as any)._context.variables;\n this.assessmentItem = e.detail;\n this.computedContext =\n this.computedContext?.identifier === this.assessmentItem.identifier\n ? { ...this.computedContext, title: this.assessmentItem.title }\n : ({\n identifier: this.assessmentItem.identifier,\n title: this.assessmentItem.title,\n adaptive: this.assessmentItem.getAttribute('adaptive')?.toLowerCase() === 'true' || false,\n variables: fullVariables\n } as ComputedItemContext);\n this.#updateItemVariablesInTestContext(this.assessmentItem.identifier, fullVariables || []);\n }\n\n #updateItemVariablesInTestContext(\n identifier: string,\n variables: readonly VariableDeclaration<string | string[] | null>[]\n ): void {\n const rawscore = variables?.find(vr => vr.identifier == 'SCORE')?.value;\n const score = parseFloat(rawscore?.toString());\n const completionStatus = variables?.find(v => v.identifier === 'completionStatus')?.value;\n\n const correct = score !== undefined && !isNaN(score) && score > 0;\n const incorrect = score !== undefined && !isNaN(score) && score <= 0;\n const completed = completionStatus === 'completed';\n this.computedContext = {\n ...this.computedContext,\n identifier,\n correct,\n incorrect,\n completed,\n variables\n };\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-item-context-changed', this.#onItemContextChanged);\n this.removeEventListener('qti-assessment-item-connected', this.#onAssessmentItemConnected);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n","import { ItemContainer } from './components/item-container/item-container';\nimport { ItemPrintVariables } from './components/item-print-variables/item-print-variables';\nimport { QtiItem } from './components/qti-item/qti-item';\n\nexport { ItemContainer, ItemPrintVariables, QtiItem };\n\nexport const qtiItemElements = [\n { tag: 'item-container', ctor: ItemContainer },\n { tag: 'item-print-variables', ctor: ItemPrintVariables },\n { tag: 'qti-item', ctor: QtiItem }\n] as const;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BM,IAAO,gBAAP,cAA6BA,GAAU;EAA7C,cAAA;;AAGE,SAAA,wBAAsD;AAItD,SAAA,UAAkB;AAIlB,SAAA,UAA4B;AAI5B,SAAA,UAAkB;AAIR,SAAA,aAAyB;MACjC,aAAa,EAAE,gBAAgB,IAAI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