@citolab/qti-components 7.1.4 → 7.1.6

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.
Files changed (235) hide show
  1. package/cdn/chunks/chunk-24FGNKCD.js +1007 -0
  2. package/cdn/chunks/chunk-2GQCYBJ3.js +5 -0
  3. package/cdn/chunks/chunk-2OZT6A22.js +5 -0
  4. package/cdn/chunks/chunk-3AJ3S2FB.js +23 -0
  5. package/cdn/chunks/chunk-3M6EKDMW.js +1 -0
  6. package/cdn/chunks/chunk-3QCUKN7V.js +1 -0
  7. package/cdn/chunks/chunk-4LPUHBZG.js +5 -0
  8. package/cdn/chunks/chunk-5UN2ELTW.js +23 -0
  9. package/cdn/chunks/chunk-5VTVIA6M.js +23 -0
  10. package/cdn/chunks/chunk-6JHIITOD.js +1 -0
  11. package/cdn/chunks/chunk-7UDDUERA.js +1007 -0
  12. package/cdn/chunks/chunk-7ZNR6KCO.js +5 -0
  13. package/cdn/chunks/chunk-AAOFOYWA.js +5 -0
  14. package/cdn/chunks/chunk-AJMJQJUQ.js +5 -0
  15. package/cdn/chunks/chunk-CY2CQDCJ.js +5 -0
  16. package/cdn/chunks/chunk-D2GQ4BES.js +1 -0
  17. package/cdn/chunks/chunk-D3C4N6YO.js +8 -0
  18. package/cdn/chunks/chunk-D6WQKU5P.js +5 -0
  19. package/cdn/chunks/chunk-DMIFXRAW.js +5 -0
  20. package/cdn/chunks/chunk-DQ7GTTCX.js +5 -0
  21. package/cdn/chunks/chunk-DVRZBFAS.js +5 -0
  22. package/cdn/chunks/chunk-E6M5VAZC.js +1007 -0
  23. package/cdn/chunks/chunk-EJDPW23L.js +5 -0
  24. package/cdn/chunks/chunk-FWCOZSKN.js +5 -0
  25. package/cdn/chunks/chunk-G24US7VC.js +23 -0
  26. package/cdn/chunks/chunk-HCWGJCF3.js +1007 -0
  27. package/cdn/chunks/chunk-IUEV6I3Y.js +5 -0
  28. package/cdn/chunks/chunk-J4CI5WG7.js +23 -0
  29. package/cdn/chunks/chunk-JEZ3FDS2.js +1007 -0
  30. package/cdn/chunks/chunk-L7FX2BSJ.js +1007 -0
  31. package/cdn/chunks/chunk-L7G3YUQJ.js +23 -0
  32. package/cdn/chunks/chunk-LKOMJADF.js +5 -0
  33. package/cdn/chunks/chunk-M2YVQSR3.js +5 -0
  34. package/cdn/chunks/chunk-MADHY2TG.js +5 -0
  35. package/cdn/chunks/chunk-MCE2HPAI.js +23 -0
  36. package/cdn/chunks/chunk-MPVVJRN5.js +5 -0
  37. package/cdn/chunks/chunk-MYK3AVE5.js +5 -0
  38. package/cdn/chunks/chunk-NQUXPDU3.js +1 -0
  39. package/cdn/chunks/chunk-O64TZW6N.js +5 -0
  40. package/cdn/chunks/chunk-OM6BKR6U.js +5 -0
  41. package/cdn/chunks/chunk-PTEZUFUL.js +5 -0
  42. package/cdn/chunks/chunk-Q3MPB5OG.js +23 -0
  43. package/cdn/chunks/chunk-RC3C5C7I.js +5 -0
  44. package/cdn/chunks/chunk-RDREFUYQ.js +1007 -0
  45. package/cdn/chunks/chunk-RPBLXGHD.js +5 -0
  46. package/cdn/chunks/chunk-RWCWDO5R.js +5 -0
  47. package/cdn/chunks/chunk-SEJ6XHOU.js +1 -0
  48. package/cdn/chunks/chunk-SHZ5UCLJ.js +5 -0
  49. package/cdn/chunks/chunk-SRXFURHS.js +5 -0
  50. package/cdn/chunks/chunk-TJWJV2U3.js +5 -0
  51. package/cdn/chunks/chunk-URO7DOBX.js +1 -0
  52. package/cdn/chunks/chunk-UVCZCMPG.js +5 -0
  53. package/cdn/chunks/chunk-V2HYQXWT.js +1007 -0
  54. package/cdn/chunks/chunk-V6VPFEQB.js +1 -0
  55. package/cdn/chunks/chunk-V7S5DVXO.js +5 -0
  56. package/cdn/chunks/chunk-VAKXKPIY.js +1007 -0
  57. package/cdn/chunks/chunk-VCATS6AD.js +5 -0
  58. package/cdn/chunks/chunk-VGBHSWOI.js +5 -0
  59. package/cdn/chunks/chunk-VTBQWQOW.js +23 -0
  60. package/cdn/chunks/chunk-W567D2AF.js +1 -0
  61. package/cdn/chunks/chunk-WQFK6JFL.js +5 -0
  62. package/cdn/chunks/chunk-WRAB6IVU.js +5 -0
  63. package/cdn/chunks/chunk-WWNOVLDK.js +23 -0
  64. package/cdn/chunks/chunk-XJHAZYHN.js +1007 -0
  65. package/cdn/chunks/chunk-YCTL45GB.js +1 -0
  66. package/cdn/chunks/chunk-ZRWDLR2Y.js +5 -0
  67. package/cdn/index.global.js +1 -1
  68. package/cdn/index.js +1 -1
  69. package/cdn/qti-components/index.js +1 -1
  70. package/cdn/qti-item/components/item-container.js +1 -1
  71. package/cdn/qti-item/core/index.js +1 -1
  72. package/cdn/qti-loader/index.js +1 -1
  73. package/cdn/qti-test/components/index.js +1 -1
  74. package/cdn/qti-test/components/test-container.js +1 -1
  75. package/cdn/qti-test/components/test-show-correct-response.js +1 -1
  76. package/cdn/qti-test/core/index.js +1 -1
  77. package/cdn/qti-transformers/index.js +1 -1
  78. package/dist/chunks/chunk-2IXFDXDW.js +646 -0
  79. package/dist/chunks/chunk-2IXFDXDW.js.map +1 -0
  80. package/dist/chunks/chunk-2RRW2DFF.js +31 -0
  81. package/dist/chunks/chunk-2RRW2DFF.js.map +1 -0
  82. package/dist/chunks/chunk-2SENMECZ.js +383 -0
  83. package/dist/chunks/chunk-2SENMECZ.js.map +1 -0
  84. package/dist/chunks/chunk-2YIXNTLW.js +31 -0
  85. package/dist/chunks/chunk-2YIXNTLW.js.map +1 -0
  86. package/dist/chunks/chunk-323JSMZF.js +6888 -0
  87. package/dist/chunks/chunk-323JSMZF.js.map +1 -0
  88. package/dist/chunks/chunk-334SZRIZ.js +627 -0
  89. package/dist/chunks/chunk-334SZRIZ.js.map +1 -0
  90. package/dist/chunks/chunk-42QJNL24.js +383 -0
  91. package/dist/chunks/chunk-42QJNL24.js.map +1 -0
  92. package/dist/chunks/chunk-4QHU4ILT.js +627 -0
  93. package/dist/chunks/chunk-4QHU4ILT.js.map +1 -0
  94. package/dist/chunks/chunk-5LEN6QDS.js +31 -0
  95. package/dist/chunks/chunk-5LEN6QDS.js.map +1 -0
  96. package/dist/chunks/chunk-5QMNVSHC.js +94 -0
  97. package/dist/chunks/chunk-5QMNVSHC.js.map +1 -0
  98. package/dist/chunks/chunk-5WS6ZWUN.js +374 -0
  99. package/dist/chunks/chunk-5WS6ZWUN.js.map +1 -0
  100. package/dist/chunks/chunk-673CG4KG.js +94 -0
  101. package/dist/chunks/chunk-673CG4KG.js.map +1 -0
  102. package/dist/chunks/chunk-6VFH66FM.js +94 -0
  103. package/dist/chunks/chunk-6VFH66FM.js.map +1 -0
  104. package/dist/chunks/chunk-6YED6PQC.js +6888 -0
  105. package/dist/chunks/chunk-6YED6PQC.js.map +1 -0
  106. package/dist/chunks/chunk-75QW5V24.js +6888 -0
  107. package/dist/chunks/chunk-75QW5V24.js.map +1 -0
  108. package/dist/chunks/chunk-A5W753FL.js +92 -0
  109. package/dist/chunks/chunk-A5W753FL.js.map +1 -0
  110. package/dist/chunks/chunk-AVDZJOCT.js +400 -0
  111. package/dist/chunks/chunk-AVDZJOCT.js.map +1 -0
  112. package/dist/chunks/chunk-BCMG64M3.js +94 -0
  113. package/dist/chunks/chunk-BCMG64M3.js.map +1 -0
  114. package/dist/chunks/chunk-CHFTTHPJ.js +383 -0
  115. package/dist/chunks/chunk-CHFTTHPJ.js.map +1 -0
  116. package/dist/chunks/chunk-DT72VPM7.js +32 -0
  117. package/dist/chunks/chunk-DT72VPM7.js.map +1 -0
  118. package/dist/chunks/chunk-E2WYWXM3.js +6888 -0
  119. package/dist/chunks/chunk-E2WYWXM3.js.map +1 -0
  120. package/dist/chunks/chunk-E4XNZM6H.js +383 -0
  121. package/dist/chunks/chunk-E4XNZM6H.js.map +1 -0
  122. package/dist/chunks/chunk-ECTDE6XC.js +646 -0
  123. package/dist/chunks/chunk-ECTDE6XC.js.map +1 -0
  124. package/dist/chunks/chunk-EN7ICTLG.js +94 -0
  125. package/dist/chunks/chunk-EN7ICTLG.js.map +1 -0
  126. package/dist/chunks/chunk-EV2QQBO6.js +94 -0
  127. package/dist/chunks/chunk-EV2QQBO6.js.map +1 -0
  128. package/dist/chunks/chunk-FJI6VGC6.js +94 -0
  129. package/dist/chunks/chunk-FJI6VGC6.js.map +1 -0
  130. package/dist/chunks/chunk-FKUTUG6E.js +94 -0
  131. package/dist/chunks/chunk-FKUTUG6E.js.map +1 -0
  132. package/dist/chunks/chunk-FOAIUAWY.js +627 -0
  133. package/dist/chunks/chunk-FOAIUAWY.js.map +1 -0
  134. package/dist/chunks/chunk-GR52YZQB.js +31 -0
  135. package/dist/chunks/chunk-GR52YZQB.js.map +1 -0
  136. package/dist/chunks/chunk-GRT2RDCX.js +6888 -0
  137. package/dist/chunks/chunk-GRT2RDCX.js.map +1 -0
  138. package/dist/chunks/chunk-GT4B3SMY.js +94 -0
  139. package/dist/chunks/chunk-GT4B3SMY.js.map +1 -0
  140. package/dist/chunks/chunk-I6JSNAIT.js +627 -0
  141. package/dist/chunks/chunk-I6JSNAIT.js.map +1 -0
  142. package/dist/chunks/chunk-IKNXVVXK.js +32 -0
  143. package/dist/chunks/chunk-IKNXVVXK.js.map +1 -0
  144. package/dist/chunks/chunk-KJ5Y7Q3K.js +94 -0
  145. package/dist/chunks/chunk-KJ5Y7Q3K.js.map +1 -0
  146. package/dist/chunks/chunk-KNV7LPEA.js +94 -0
  147. package/dist/chunks/chunk-KNV7LPEA.js.map +1 -0
  148. package/dist/chunks/chunk-LCYRSF7H.js +6888 -0
  149. package/dist/chunks/chunk-LCYRSF7H.js.map +1 -0
  150. package/dist/chunks/chunk-LLVJY74K.js +373 -0
  151. package/dist/chunks/chunk-LLVJY74K.js.map +1 -0
  152. package/dist/chunks/chunk-LOCV27GA.js +31 -0
  153. package/dist/chunks/chunk-LOCV27GA.js.map +1 -0
  154. package/dist/chunks/chunk-LVPRIPTY.js +94 -0
  155. package/dist/chunks/chunk-LVPRIPTY.js.map +1 -0
  156. package/dist/chunks/chunk-MHPLSF7C.js +645 -0
  157. package/dist/chunks/chunk-MHPLSF7C.js.map +1 -0
  158. package/dist/chunks/chunk-MWVK6TYO.js +94 -0
  159. package/dist/chunks/chunk-MWVK6TYO.js.map +1 -0
  160. package/dist/chunks/chunk-NC7KY56H.js +627 -0
  161. package/dist/chunks/chunk-NC7KY56H.js.map +1 -0
  162. package/dist/chunks/chunk-O55K2M54.js +94 -0
  163. package/dist/chunks/chunk-O55K2M54.js.map +1 -0
  164. package/dist/chunks/chunk-PEV4JLKR.js +374 -0
  165. package/dist/chunks/chunk-PEV4JLKR.js.map +1 -0
  166. package/dist/chunks/chunk-POTLDXHV.js +627 -0
  167. package/dist/chunks/chunk-POTLDXHV.js.map +1 -0
  168. package/dist/chunks/chunk-QA5CX4HN.js +94 -0
  169. package/dist/chunks/chunk-QA5CX4HN.js.map +1 -0
  170. package/dist/chunks/chunk-QCZ76WFB.js +6888 -0
  171. package/dist/chunks/chunk-QCZ76WFB.js.map +1 -0
  172. package/dist/chunks/chunk-QS6VHKJL.js +94 -0
  173. package/dist/chunks/chunk-QS6VHKJL.js.map +1 -0
  174. package/dist/chunks/chunk-RVZE4R2K.js +400 -0
  175. package/dist/chunks/chunk-RVZE4R2K.js.map +1 -0
  176. package/dist/chunks/chunk-SGUZHURT.js +94 -0
  177. package/dist/chunks/chunk-SGUZHURT.js.map +1 -0
  178. package/dist/chunks/chunk-SJYWAAZE.js +31 -0
  179. package/dist/chunks/chunk-SJYWAAZE.js.map +1 -0
  180. package/dist/chunks/chunk-STQBRYLA.js +31 -0
  181. package/dist/chunks/chunk-STQBRYLA.js.map +1 -0
  182. package/dist/chunks/chunk-TAO7UEFH.js +400 -0
  183. package/dist/chunks/chunk-TAO7UEFH.js.map +1 -0
  184. package/dist/chunks/chunk-TC3OIHDQ.js +6888 -0
  185. package/dist/chunks/chunk-TC3OIHDQ.js.map +1 -0
  186. package/dist/chunks/chunk-TOJHUALI.js +646 -0
  187. package/dist/chunks/chunk-TOJHUALI.js.map +1 -0
  188. package/dist/chunks/chunk-TPAA44Y7.js +31 -0
  189. package/dist/chunks/chunk-TPAA44Y7.js.map +1 -0
  190. package/dist/chunks/chunk-TRYCV7IM.js +31 -0
  191. package/dist/chunks/chunk-TRYCV7IM.js.map +1 -0
  192. package/dist/chunks/chunk-TVNMKAMJ.js +645 -0
  193. package/dist/chunks/chunk-TVNMKAMJ.js.map +1 -0
  194. package/dist/chunks/chunk-U4RFKBRP.js +94 -0
  195. package/dist/chunks/chunk-U4RFKBRP.js.map +1 -0
  196. package/dist/chunks/chunk-UGLQ4IE6.js +94 -0
  197. package/dist/chunks/chunk-UGLQ4IE6.js.map +1 -0
  198. package/dist/chunks/chunk-UJFRZXCT.js +647 -0
  199. package/dist/chunks/chunk-UJFRZXCT.js.map +1 -0
  200. package/dist/chunks/chunk-UMF3ZNLB.js +627 -0
  201. package/dist/chunks/chunk-UMF3ZNLB.js.map +1 -0
  202. package/dist/chunks/chunk-UPOAW5KH.js +6888 -0
  203. package/dist/chunks/chunk-UPOAW5KH.js.map +1 -0
  204. package/dist/chunks/chunk-UYO3TSPZ.js +373 -0
  205. package/dist/chunks/chunk-UYO3TSPZ.js.map +1 -0
  206. package/dist/chunks/chunk-VDCLAPUT.js +627 -0
  207. package/dist/chunks/chunk-VDCLAPUT.js.map +1 -0
  208. package/dist/chunks/chunk-WEBEBLJU.js +94 -0
  209. package/dist/chunks/chunk-WEBEBLJU.js.map +1 -0
  210. package/dist/chunks/chunk-WWFGVIQF.js +627 -0
  211. package/dist/chunks/chunk-WWFGVIQF.js.map +1 -0
  212. package/dist/chunks/chunk-XBCKVU3I.js +94 -0
  213. package/dist/chunks/chunk-XBCKVU3I.js.map +1 -0
  214. package/dist/chunks/chunk-XOKC45VV.js +631 -0
  215. package/dist/chunks/chunk-XOKC45VV.js.map +1 -0
  216. package/dist/chunks/chunk-YHEITHMB.js +6888 -0
  217. package/dist/chunks/chunk-YHEITHMB.js.map +1 -0
  218. package/dist/chunks/chunk-YSGGRW2E.js +6888 -0
  219. package/dist/chunks/chunk-YSGGRW2E.js.map +1 -0
  220. package/dist/chunks/chunk-ZLOEM737.js +94 -0
  221. package/dist/chunks/chunk-ZLOEM737.js.map +1 -0
  222. package/dist/index.js +7 -7
  223. package/dist/qti-components/index.js +2 -2
  224. package/dist/qti-components-jsx.d.ts +8 -10
  225. package/dist/qti-item/components/item-container.js +2 -2
  226. package/dist/qti-item/core/index.js +2 -2
  227. package/dist/qti-loader/index.js +2 -2
  228. package/dist/qti-test/components/index.js +3 -3
  229. package/dist/qti-test/components/test-container.js +2 -2
  230. package/dist/qti-test/components/test-show-correct-response.js +1 -1
  231. package/dist/qti-test/core/index.js +3 -3
  232. package/dist/qti-transformers/index.d.ts +3 -14
  233. package/dist/qti-transformers/index.js +1 -1
  234. package/dist/vscode.html-custom-data.json +7 -8
  235. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/core/qti-test.ts","../../src/lib/qti-test/core/mixins/test-loader.mixin.ts","../../src/lib/qti-test/core/mixins/test-navigation.mixin.ts","../../src/lib/qti-test/core/mixins/test-view.mixin.ts","../../src/lib/qti-test/core/test-base.ts","../../src/lib/qti-test/core/mixins/test-processing.mixin.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-assessment-item-ref.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-assessment-section.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-assessment-test.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-test-part.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-test-feedback.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { TestLoaderMixin, TestNavigationMixin, TestViewMixin } from './mixins';\nimport { TestBase } from './test-base';\nimport { TestProcessingMixin } from './mixins/test-processing.mixin';\n\n/**\n * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n *\n * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n *\n * ### Example Usage\n *\n * Minimal example including navigation:\n *\n * ```html\n * <qti-test>\n * <test-navigation>\n * <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n * <nav class=\"flex\">\n * <test-prev></test-prev>\n * <test-next></test-next>\n * </nav>\n * </test-navigation>\n * </qti-test>\n * ```\n *\n * Use the following file structure\n * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n *\n * ```plaintext\n * Root/\n * ├── index.html\n * └── /assets/api/examples/\n * ├── assessmenttest.xml\n * └── imsmanifest.xml\n *\n * ```\n *\n * ### Test components\n *\n * Use test components inside the qti-test component for added functionality.\n * ### Test next\n * `<test-next> | TestNext`\n *\n * ### Test prev\n *\n * `<test-prev> | TestPrev`\n * ### Test components\n *\n * You can use normal class names to style the elements.\n * And you can use the `test-prev` and `test-next` elements to navigate through the test.\n *\n */\n@customElement('qti-test')\nexport class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestBase)))) {\n // export class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {\n /**\n * Renders the component's template.\n * Provides a default `<slot>` for content projection.\n */\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(new CustomEvent('qti-test-connected', { detail: this }));\n }\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test': QtiTest;\n }\n}\n","import { property } from 'lit/decorators.js';\n\nimport { qtiTransformItem } from '../../../qti-transformers';\n\n// import type { TestContext } from '..';\nimport type { TestBase } from '../test-base';\n\n// const setSessionData = <T>(key: string, value?: T): void => sessionStorage.setItem(key, JSON.stringify(value));\n// const getSessionData = <T>(key: string): T | null =>\n// sessionStorage.getItem(key) ? JSON.parse(sessionStorage.getItem(key)!) : null;\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestLoaderInterface {}\nexport const TestLoaderMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestLoaderClass extends superClass {\n /** Items will be scored on everyinteraction when `qti-assessment-item` is not set to adaptive, and the `SCORE` outcome identifier is not set to be \"human\" | \"externalMachine\" */\n\n /** TestContext will be stored in sessionStorage with given attribute value if provided */\n // @property({ type: String, attribute: 'store-session' }) storeSession: string | null = null;\n\n @property({ type: Boolean, attribute: 'cache-transform' }) cacheTransform: boolean = false;\n\n constructor(...args: any[]) {\n super(...args);\n\n this.addEventListener('qti-load-item-request' /* 5. Request the item */, ({ detail }: CustomEvent) => {\n detail.promise = (async () => {\n const api = await qtiTransformItem(this.cacheTransform).load(detail.href, detail.cancelPreviousRequest);\n return api.htmlDoc();\n })();\n });\n\n // this.addEventListener('qti-assessment-test-connected', () => {\n // if (this.storeSession) {\n // const testContext = getSessionData<TestContext>(this.storeSession);\n // if (testContext) {\n // requestAnimationFrame(() => {\n // this.testContext = testContext;\n // });\n // }\n // }\n // });\n }\n\n // willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n // if (changedProperties.has('testContext')) {\n // if (this.storeSession) {\n // setSessionData<Readonly<TestContext>>(this.storeSession, this.testContext);\n // }\n // }\n // }\n }\n\n return TestLoaderClass as Constructor<TestLoaderInterface> & T;\n};\n","import { property } from 'lit/decorators.js';\n\nimport type { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest } from '../qti-assessment-test';\nimport type { TestBase } from '../test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestNavigationInterface {}\nexport const TestNavigationMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass {\n @property({ type: String }) navigate: 'item' | 'section' = 'item';\n\n protected _testElement: QtiAssessmentTest;\n\n constructor(...args: any[]) {\n super(...args);\n\n this.addEventListener(\n 'qti-request-navigation',\n async ({ detail }: CustomEvent<{ type: 'item' | 'section'; id: string }>) => {\n if (!detail?.id) return;\n\n if (detail.type === 'item') {\n await this._loadItems([detail.id]);\n\n const navItemId = detail.id;\n const itemRefEl = this._testElement?.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${detail.id}\"]`\n );\n const navPartId = itemRefEl.closest('qti-test-part')?.identifier;\n const navSectionId = itemRefEl.closest('qti-assessment-section')?.identifier;\n\n this.sessionContext = { ...this.sessionContext, navPartId, navSectionId, navItemId, navItemLoading: false };\n } else if (detail.type === 'section') {\n const itemIds = this._getSectionItemIds(detail.id);\n await this._loadItems(itemIds);\n\n const navSectionId = detail.id;\n const sectionRefEl = this._testElement?.querySelector<QtiAssessmentSection>(\n `qti-assessment-section[identifier=\"${navSectionId}\"]`\n );\n const navPartId = sectionRefEl.closest('qti-test-part')?.identifier;\n\n this.sessionContext = {\n ...this.sessionContext,\n navPartId,\n navSectionId,\n navItemId: null,\n navItemLoading: false\n };\n }\n }\n );\n\n this.addEventListener('qti-assessment-test-connected', (e: CustomEvent<QtiAssessmentTest>) => {\n this._testElement = e.detail;\n let id: string | undefined;\n\n if (this.navigate === 'section') {\n id = this._testElement.querySelector<QtiAssessmentSection>('qti-assessment-section')?.identifier;\n } else {\n id =\n this.sessionContext.navItemId ??\n this._testElement.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref')?.identifier;\n }\n\n if (id) {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n detail: { type: this.navigate === 'section' ? 'section' : 'item', id },\n bubbles: true,\n composed: true\n })\n );\n }\n });\n }\n\n private async _loadItems(itemIds: string[]): Promise<void> {\n let results;\n if (!this._testElement || itemIds.length === 0) return;\n\n const itemRefEls = itemIds.map(id =>\n this._testElement!.querySelector<QtiAssessmentItemRef>(`qti-assessment-item-ref[identifier=\"${id}\"]`)\n );\n\n if (itemRefEls.includes(null)) {\n console.warn(`One or more items not found: ${itemIds}`);\n return;\n }\n\n this._clearLoadedItems();\n this.sessionContext = { ...this.sessionContext, navItemLoading: true };\n\n const itemLoadPromises = itemRefEls.map(async itemRef => {\n if (!itemRef) return null;\n return { itemRef, doc: await this._loadItemRequest(itemRef.href, itemRef.identifier) };\n });\n\n try {\n results = await Promise.all(itemLoadPromises);\n\n results.forEach(({ itemRef, doc }) => {\n if (itemRef && doc) itemRef.xmlDoc = doc;\n });\n\n requestAnimationFrame(() => {\n this.dispatchEvent(\n new CustomEvent('qti-test-connected', {\n detail: results.map(({ itemRef }) => ({ identifier: itemRef?.identifier, element: itemRef })),\n bubbles: true,\n composed: true\n })\n );\n });\n } catch (error) {\n console.error('Error loading items:', error);\n }\n return results;\n }\n\n private _getSectionItemIds(navSectionId: string): string[] {\n const sectionRefEl = this._testElement?.querySelector<QtiAssessmentSection>(\n `qti-assessment-section[identifier=\"${navSectionId}\"]`\n );\n\n if (!sectionRefEl) {\n console.warn(`Section with identifier \"${navSectionId}\" not found.`);\n return [];\n }\n\n return Array.from(\n this._testElement!.querySelectorAll<QtiAssessmentItemRef>(\n `qti-assessment-section[identifier=\"${navSectionId}\"] > qti-assessment-item-ref`\n )\n ).map(itemRef => itemRef.identifier);\n }\n\n private _clearLoadedItems(): void {\n const itemRefEls = this._testElement?.querySelectorAll<QtiAssessmentItemRef>(\n `qti-assessment-test qti-assessment-item-ref`\n );\n Array.from(itemRefEls || []).forEach(itemElement => {\n itemElement.xmlDoc = null;\n });\n }\n\n private _loadItemRequest(href: string, identifier: string): Promise<DocumentFragment> {\n const event = new CustomEvent('qti-load-item-request', {\n bubbles: true,\n composed: true,\n detail: { href, identifier, promise: null }\n });\n this.dispatchEvent(event);\n return event.detail.promise;\n }\n }\n\n return TestNavigationClass as Constructor<TestNavigationInterface> & T;\n};\n","import type { QtiAssessmentItem } from '../../../qti-components';\nimport type { TestBase } from '../test-base';\n\nexport type View = 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor' | '';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestViewInterface {}\n\nexport const TestViewMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestViewClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n this.sessionContext = { ...this.sessionContext, view: 'candidate' };\n\n this.addEventListener('on-test-switch-view', (e: CustomEvent<View>) => {\n this.sessionContext = { ...this.sessionContext, view: e.detail };\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-test-connected', () => {\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent) => {\n this._updateElementView();\n this._setCorrectResponseVisibility(e.detail);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('sessionContext')) {\n // if (previousContext && previousContext.view !== this.sessionContext.view) {\n this._updateElementView();\n // }\n }\n }\n\n // Method to handle view updates for elements based on the current context view\n private _updateElementView() {\n if (this._testElement && this._testElement) {\n const viewElements = Array.from(this._testElement.querySelectorAll('[view]'));\n\n viewElements.forEach((element: HTMLElement) => {\n element.classList.toggle('show', element.getAttribute('view') === this.sessionContext.view);\n });\n\n const assessmentItem = this._testElement.querySelector<QtiAssessmentItem>(\n `qti-assessment-item[identifier=\"${this.sessionContext.navItemId}\"]`\n );\n if (assessmentItem) {\n assessmentItem.showCorrectResponse(this.sessionContext.view === 'scorer');\n }\n }\n }\n\n // Event handler for connected QTI assessment items\n private _setCorrectResponseVisibility(assessmentItem: QtiAssessmentItem): void {\n assessmentItem.showCorrectResponse(this.sessionContext.view === 'scorer');\n }\n }\n\n return TestViewClass as Constructor<TestViewInterface> & T;\n};\n","import { provide } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { INITIAL_TEST_CONTEXT, testContext } from '../../exports/test.context';\nimport { INITIAL_SESSION_CONTEXT, type SessionContext, sessionContext } from '../../exports/session.context';\n\nimport type { ItemContext } from '../../exports/item.context';\nimport type { TestContext } from '../../exports/test.context';\nimport type { QtiAssessmentTest } from './qti-assessment-test';\nimport type { QtiAssessmentItem } from '../../qti-components/';\nimport type { OutcomeVariable, VariableDeclaration } from '../../exports/variables';\n\nexport abstract class TestBase extends LitElement {\n @property({ attribute: false, type: Object })\n @provide({ context: testContext })\n public testContext: Readonly<TestContext> = INITIAL_TEST_CONTEXT;\n\n @property({ attribute: false, type: Object })\n @provide({ context: sessionContext })\n public sessionContext: Readonly<SessionContext> = INITIAL_SESSION_CONTEXT;\n\n protected _testElement: QtiAssessmentTest;\n\n constructor() {\n super();\n\n /**\n * When the test is connected, the items are updated in the test context.\n * An existing context item is updated with the itemRef properties if nessesary.\n */\n this.addEventListener('qti-assessment-test-connected', (e: CustomEvent<QtiAssessmentTest>) => {\n this.testContext = INITIAL_TEST_CONTEXT; // new test, new test context!\n this.sessionContext = INITIAL_SESSION_CONTEXT; // new test, new session context!\n if (this.testContext && this.testContext.items.length > 0) return;\n\n this._testElement = e.detail;\n const items = Array.from(this._testElement.querySelectorAll('qti-assessment-item-ref')).map(itemRef => {\n return {\n href: itemRef.href,\n identifier: itemRef.identifier,\n category: itemRef.category,\n variables: [\n {\n identifier: 'completionStatus',\n value: 'not_attempted',\n type: 'outcome'\n } as OutcomeVariable\n ]\n };\n });\n this.testContext = { ...this.testContext, items };\n });\n\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent<QtiAssessmentItem>) => {\n const assessmentItem = e.detail as QtiAssessmentItem;\n const assessmentRefId = assessmentItem.closest('qti-assessment-item-ref')?.identifier;\n if (assessmentRefId) {\n assessmentItem.assessmentItemRefId = assessmentRefId;\n }\n this._updateItemInTestContext(e.detail);\n });\n\n this.addEventListener('qti-item-context-updated', (e: CustomEvent<{ itemContext: ItemContext }>) => {\n // const assessmentitem = e.composedPath()[0] as QtiAssessmentItem;\n this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail.itemContext.variables);\n });\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: readonly VariableDeclaration<string | string[] | null>[]\n ): void {\n // Update the test context with modified variables for the specified item\n this.testContext = {\n ...this.testContext, // Spread existing test context properties\n items: this.testContext.items.map(itemContext => {\n // If the item identifier doesn't match, keep it unchanged\n if (itemContext.identifier !== identifier) {\n return itemContext;\n }\n\n // Update the matching item with new variables\n return {\n ...itemContext, // Keep other properties of the item context\n variables: variables.map(variable => {\n // Find a matching variable in the current item context\n const matchingVariable = itemContext.variables.find(v => v.identifier === variable.identifier);\n\n // Merge matching variable with the new one, or use the new variable if no match\n return matchingVariable ? { ...matchingVariable, ...variable } : variable;\n })\n };\n })\n };\n this.dispatchEvent(\n new CustomEvent('qti-test-context-updated', { detail: this.testContext, bubbles: false, composed: false })\n );\n }\n\n /**\n * Updates the variables of an assessment item in the test context.\n * - Matches the assessment item with the corresponding test context item.\n * - If the item is not found, logs a warning.\n * - Updates variables in the test context if exactly one variable exists.\n * - Otherwise, syncs the assessment item's variables with the test context.\n *\n * @param assessmentItem - The assessment item to update.\n */\n private _updateItemInTestContext = (assessmentItem: QtiAssessmentItem): void => {\n const context = (assessmentItem as any)._context;\n const identifier = context.identifier;\n const fullVariables = context.variables;\n\n // console.log(this._testContext);\n // Find the corresponding item in the test context by identifier\n const itemContext = this.testContext.items.find(i => i?.identifier === identifier);\n\n if (!itemContext) {\n console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);\n return;\n }\n\n // Update variables in the test context or sync them to the assessment item\n if (itemContext.variables?.length === 1) {\n // The loaded qti-assessment-item itself has variables which are not in test context yet.\n this._updateItemVariablesInTestContext(identifier, fullVariables);\n } else {\n // Sync the assessment item's variables with the test context\n assessmentItem.variables = [...(itemContext.variables || [])];\n }\n };\n}\n","import type { OutcomeVariable, VariableDeclaration } from '../../../exports/variables';\nimport type { QtiOutcomeProcessing } from '../../../qti-components';\nimport type { TestBase } from '../test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestProcessingInterface {\n updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;\n getOutcome(identifier: string): Readonly<OutcomeVariable>;\n getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;\n outcomeProcessing(): boolean;\n}\nexport const TestProcessingMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestProcessingElement extends superClass {\n constructor(...args: any[]) {\n super(...args);\n this.addEventListener('qti-register-variable', (e: CustomEvent<{ variable: any }>) => {\n this.testContext = {\n ...this.testContext,\n testOutcomeVariables: [...(this.testContext.testOutcomeVariables || []), e.detail.variable]\n };\n e.stopPropagation();\n });\n // wordt aangeroepen vanuit de processingtemplate\n this.addEventListener(\n 'qti-set-outcome-value',\n (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n }\n );\n }\n\n outcomeProcessing(): boolean {\n const outcomeProcessor = this.querySelector('qti-outcome-processing') as unknown as QtiOutcomeProcessing;\n if (!outcomeProcessor) return false;\n outcomeProcessor?.process();\n return true;\n }\n\n /* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */\n\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n this.testContext = {\n ...this.testContext,\n testOutcomeVariables: this.testContext.testOutcomeVariables?.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : [...v.value, value as string]\n };\n })\n };\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n public getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this.testContext.testOutcomeVariables?.find(v => v.identifier === identifier) || null;\n }\n /* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */\n }\n\n return TestProcessingElement as Constructor<TestProcessingInterface> & T;\n};\n","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\n\nimport type { TemplateFunction } from 'stampino';\nimport type { QtiAssessmentItem } from '../../../qti-components';\n\n// Converter function to interpret \"true\" and \"false\" as booleans\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\n// @customElement('qti-assessment-item-ref')\nexport class QtiAssessmentItemRef extends LitElement {\n @property({ type: String }) category?: string;\n @property({ type: String }) identifier?: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) required?: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed?: boolean;\n @property({ type: String }) href?: string;\n\n // @consume({ context: computedContext, subscribe: true })\n // private computedContext: ComputedContext;\n\n weigths: Map<string, number> = new Map();\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n myTemplate: TemplateFunction;\n\n async connectedCallback(): Promise<void> {\n // debugger;\n super.connectedCallback();\n\n const templateElement = ((this.getRootNode() as any).host as HTMLElement)\n .closest('qti-test')\n .querySelector<HTMLTemplateElement>('template[item-ref]');\n\n if (templateElement) this.myTemplate = prepareTemplate(templateElement);\n\n await this.updateComplete;\n\n this.dispatchEvent(\n new CustomEvent('qti-assessment-item-ref-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href, category: this.category }\n })\n );\n }\n\n render() {\n return this.myTemplate ? this.myTemplate({ xmlDoc: this.xmlDoc }) : this.xmlDoc;\n }\n}\n\nif (!customElements.get('qti-assessment-item-ref')) {\n customElements.define('qti-assessment-item-ref', QtiAssessmentItemRef);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item-ref': QtiAssessmentItemRef;\n }\n}\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { testContext } from '../../../exports/test.context';\n\nimport type { TestContext } from '../../../exports/test.context';\n\n// https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection\n\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\nexport class QtiAssessmentSection extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) required: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed: boolean;\n @property({ type: String }) title: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) visible: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' }) keepTogether: boolean;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-assessment-section-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-assessment-section')) {\n customElements.define('qti-assessment-section', QtiAssessmentSection);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-section': QtiAssessmentSection;\n }\n}\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { testContext } from '../../../exports/test.context';\n\nimport type { TestContext } from '../../../exports/test.context';\n\n@customElement('qti-assessment-test')\nexport class QtiAssessmentTest extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) title: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-test-connected', {\n detail: this,\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-test': QtiAssessmentTest;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n@customElement('qti-test-part')\nexport class QtiTestPart extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) title: string = '';\n @property({ type: String }) class: string = '';\n\n @property({ type: String, attribute: 'navigation-mode' })\n NavigationMode: 'linear' | 'nonlinear' = 'nonlinear';\n\n @property({ type: String, attribute: 'submission-mode' })\n submissionMode: 'individual' | 'simultaneous' = 'individual';\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-test-part-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-test-part')) {\n customElements.define('qti-test-part', QtiTestPart);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-part': QtiTestPart;\n }\n}\n","import { customElement } from 'lit/decorators.js';\nimport { css, html } from 'lit';\n\nimport { QtiModalFeedback } from '../../../qti-components';\n\n@customElement('qti-test-feedback')\nexport class QtiTestFeedback extends QtiModalFeedback {\n static styles = css`\n :host {\n color: gray;\n }\n `;\n override render() {\n return html``;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-feedback': QtiTestFeedback;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;;;ACD9B,SAAS,gBAAgB;AAclB,IAAM,kBAAkB,CAAkC,eAAkB;AAAA,EACjF,MAAe,wBAAwB,WAAW;AAAA,IAQhD,eAAe,MAAa;AAC1B,YAAM,GAAG,IAAI;AAH4C,4BAA0B;AAKnF,WAAK,iBAAiB,yBAAmD,CAAC,EAAE,OAAO,MAAmB;AACpG,eAAO,WAAW,YAAY;AAC5B,gBAAM,MAAM,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A,GACvB;;;ACTb,SAAS,QAAAC,OAAM,cAAAC,mBAAkB;AACjC,SAAS,iBAAAC,gBAAe,YAAAC,iBAAgB;AAEjC,IAAM,cAAN,cAA0BC,YAAW;AAAA,EAArC;AAAA;AACuB,sBAAqB;AACrB,iBAAgB;AAChB,iBAAgB;AAG5C,0BAAyC;AAGzC,0BAAgD;AAAA;AAAA,EAEhD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,MAAM,2BAA2B;AAAA,QACnC,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAOC;AAAA,EACT;AACF;AAxB8B;AAAA,EAA3BC,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,YACiB;AACA;AAAA,EAA3BA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,YAEiB;AACA;AAAA,EAA3BA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAHf,YAGiB;AAG5B;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAL7C,YAMX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAR7C,YASX;AATW,cAAN;AAAA,EADNC,eAAc,eAAe;AAAA,GACjB;AA2Bb,IAAI,CAAC,eAAe,IAAI,eAAe,GAAG;AACxC,iBAAe,OAAO,iBAAiB,WAAW;AACpD;;;AChCA,SAAS,iBAAAC,sBAAqB;AAC9B,SAAS,KAAK,QAAAC,aAAY;AAKnB,IAAM,kBAAN,cAA8B,iBAAiB;AAAA,EAM3C,SAAS;AAChB,WAAOC;AAAA,EACT;AACF;AATa,gBACJ,SAAS;AAAA;AAAA;AAAA;AAAA;AADL,kBAAN;AAAA,EADNC,eAAc,mBAAmB;AAAA,GACrB;","names":["property","property","property","property","LitElement","property","LitElement","property","html","LitElement","property","stringToBooleanConverter","LitElement","html","property","consume","html","LitElement","customElement","property","LitElement","html","property","consume","customElement","html","LitElement","customElement","property","LitElement","html","property","customElement","customElement","html","html","customElement"]}
@@ -0,0 +1,31 @@
1
+ import {
2
+ qtiTransformItem,
3
+ qtiTransformManifest,
4
+ qtiTransformTest
5
+ } from "./chunk-5WS6ZWUN.js";
6
+
7
+ // src/lib/qti-loader/qti-loader.ts
8
+ var getManifestInfo = async (manifestURL) => {
9
+ const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf("/"));
10
+ const test = await qtiTransformManifest().load(`${manifestURL}`).then((api) => api.assessmentTest());
11
+ const testHTMLDoc = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.htmlDoc());
12
+ const items = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.items());
13
+ const testURL = `${baseURI}/${test.href}`;
14
+ const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf("/"))}`;
15
+ return {
16
+ testHTMLDoc,
17
+ testURI,
18
+ testURL,
19
+ items,
20
+ testIdentifier: test.identifier
21
+ };
22
+ };
23
+ var getItemByUri = async (itemUri) => {
24
+ return qtiTransformItem().load(itemUri).then((api) => api.htmlDoc().firstElementChild);
25
+ };
26
+
27
+ export {
28
+ getManifestInfo,
29
+ getItemByUri
30
+ };
31
+ //# sourceMappingURL=chunk-5LEN6QDS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AACrE;","names":[]}
@@ -0,0 +1,94 @@
1
+ import {
2
+ item_default
3
+ } from "./chunk-NQPY5GBW.js";
4
+ import {
5
+ watch
6
+ } from "./chunk-ELDMXTUQ.js";
7
+ import {
8
+ qtiTransformItem
9
+ } from "./chunk-CHFTTHPJ.js";
10
+ import {
11
+ __decorateClass
12
+ } from "./chunk-H2JE6IVU.js";
13
+
14
+ // src/lib/qti-item/components/item-container.ts
15
+ import { LitElement, html } from "lit";
16
+ import { customElement, property, state } from "lit/decorators.js";
17
+ import { until } from "lit/directives/until.js";
18
+ var ItemContainer = class extends LitElement {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.itemURL = null;
22
+ this.itemDoc = null;
23
+ this.itemXML = null;
24
+ /** Template content if provided */
25
+ this.templateContent = null;
26
+ }
27
+ async handleItemURLChange() {
28
+ if (!this.itemURL) return;
29
+ try {
30
+ const api = await qtiTransformItem().load(this.itemURL);
31
+ this.itemDoc = api.htmlDoc();
32
+ } catch (error) {
33
+ console.error("Error loading or parsing XML:", error);
34
+ }
35
+ }
36
+ handleItemXMLChange() {
37
+ if (!this.itemXML) return;
38
+ try {
39
+ this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();
40
+ } catch (error) {
41
+ console.error("Error parsing XML:", error);
42
+ }
43
+ }
44
+ async connectedCallback() {
45
+ super.connectedCallback();
46
+ this.initializeTemplateContent();
47
+ this.applyStyles();
48
+ if (this.itemURL) {
49
+ this.handleItemURLChange();
50
+ }
51
+ if (this.itemXML) {
52
+ this.handleItemXMLChange();
53
+ }
54
+ }
55
+ initializeTemplateContent() {
56
+ const template = this.querySelector("template");
57
+ this.templateContent = template ? template.content : html``;
58
+ }
59
+ applyStyles() {
60
+ const sheet = new CSSStyleSheet();
61
+ sheet.replaceSync(item_default);
62
+ this.shadowRoot.adoptedStyleSheets = [sheet];
63
+ }
64
+ render() {
65
+ return html`
66
+ ${this.templateContent}
67
+ <slot></slot>
68
+ ${until(this.itemDoc, html`<span>Loading...</span>`)}
69
+ `;
70
+ }
71
+ };
72
+ __decorateClass([
73
+ property({ type: String, attribute: "item-url" })
74
+ ], ItemContainer.prototype, "itemURL", 2);
75
+ __decorateClass([
76
+ state()
77
+ ], ItemContainer.prototype, "itemDoc", 2);
78
+ __decorateClass([
79
+ state()
80
+ ], ItemContainer.prototype, "itemXML", 2);
81
+ __decorateClass([
82
+ watch("itemURL", { waitUntilFirstUpdate: true })
83
+ ], ItemContainer.prototype, "handleItemURLChange", 1);
84
+ __decorateClass([
85
+ watch("itemXML", { waitUntilFirstUpdate: true })
86
+ ], ItemContainer.prototype, "handleItemXMLChange", 1);
87
+ ItemContainer = __decorateClass([
88
+ customElement("item-container")
89
+ ], ItemContainer);
90
+
91
+ export {
92
+ ItemContainer
93
+ };
94
+ //# sourceMappingURL=chunk-5QMNVSHC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-item/components/item-container.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { watch } from '../../decorators/watch';\nimport itemCss from '../../../item.css?inline';\nimport { qtiTransformItem } from '../../qti-transformers';\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@customElement('item-container')\nexport class ItemContainer extends LitElement {\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 /** Template content if provided */\n private templateContent = null;\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const api = await qtiTransformItem().load(this.itemURL);\n this.itemDoc = api.htmlDoc();\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().parse(this.itemXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n 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 private initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.templateContent = template ? template.content : html``;\n }\n\n private applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n 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"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,YAAY,YAAY;AACjC,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,aAAa;AAqBf,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC;AAAA;AAGL,mBAAkB;AAIlB,mBAA4B;AAI5B,mBAAkB;AAGlB;AAAA,SAAQ,kBAAkB;AAAA;AAAA,EAG1B,MAAgB,sBAAsB;AACpC,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,YAAM,MAAM,MAAM,iBAAiB,EAAE,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C,gBAAN;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB;","names":[]}
@@ -0,0 +1,374 @@
1
+ // src/lib/qti-transformers/qti-transformers.ts
2
+ var xml = String.raw;
3
+ var xmlToHTML = xml`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
+ <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
5
+ <xsl:template match="@*|node()">
6
+ <xsl:copy>
7
+ <xsl:apply-templates select="@*|node()"/>
8
+ </xsl:copy>
9
+ </xsl:template>
10
+
11
+ <!-- remove existing namespaces -->
12
+ <xsl:template match="*">
13
+ <!-- remove element prefix -->
14
+ <xsl:element name="{local-name()}">
15
+ <!-- process attributes -->
16
+ <xsl:for-each select="@*">
17
+ <!-- remove attribute prefix -->
18
+ <xsl:attribute name="{local-name()}">
19
+ <xsl:value-of select="."/>
20
+ </xsl:attribute>
21
+ </xsl:for-each>
22
+ <xsl:apply-templates/>
23
+ </xsl:element>
24
+ </xsl:template>
25
+ </xsl:stylesheet>`;
26
+ function extendElementName(xmlFragment, tagName, extension) {
27
+ xmlFragment.querySelectorAll(tagName).forEach((element) => {
28
+ const newTagName = `${tagName}-${extension}`;
29
+ const newElement = createElementWithNewTagName(element, newTagName);
30
+ element.replaceWith(newElement);
31
+ });
32
+ }
33
+ function extendElementsWithClass(xmlFragment, classNamePattern) {
34
+ xmlFragment.querySelectorAll("*").forEach((element) => {
35
+ const classList = element.classList;
36
+ if (classList) {
37
+ classList.forEach((className) => {
38
+ if (className.startsWith(`${classNamePattern}:`)) {
39
+ const suffix = className.slice(`${classNamePattern}:`.length);
40
+ const newTagName = `${element.nodeName}-${suffix}`;
41
+ const newElement = createElementWithNewTagName(element, newTagName);
42
+ element.replaceWith(newElement);
43
+ }
44
+ });
45
+ }
46
+ });
47
+ }
48
+ function createElementWithNewTagName(element, newTagName) {
49
+ const newElement = document.createElement(newTagName);
50
+ for (const attr of element.attributes) {
51
+ newElement.setAttribute(attr.name, attr.value);
52
+ }
53
+ while (element.firstChild) {
54
+ newElement.appendChild(element.firstChild);
55
+ }
56
+ return newElement;
57
+ }
58
+ function itemsFromTest(xmlFragment) {
59
+ const items = [];
60
+ xmlFragment.querySelectorAll("qti-assessment-item-ref").forEach((el) => {
61
+ const identifier = el.getAttribute("identifier");
62
+ const href = el.getAttribute("href");
63
+ const category = el.getAttribute("category");
64
+ items.push({ identifier, href, category });
65
+ });
66
+ return items;
67
+ }
68
+ var currentRequest = null;
69
+ function loadXML(url, cancelPreviousRequest = false) {
70
+ if (cancelPreviousRequest && currentRequest !== null) {
71
+ currentRequest.abort();
72
+ }
73
+ return new Promise((resolve, reject) => {
74
+ const xhr = new XMLHttpRequest();
75
+ currentRequest = xhr;
76
+ xhr.open("GET", url, true);
77
+ xhr.responseType = "document";
78
+ xhr.onload = () => {
79
+ if (xhr.status >= 200 && xhr.status < 300) {
80
+ resolve(xhr.responseXML);
81
+ } else {
82
+ reject(xhr.statusText);
83
+ }
84
+ };
85
+ xhr.onerror = () => {
86
+ reject(xhr.statusText);
87
+ };
88
+ xhr.send();
89
+ });
90
+ }
91
+ function parseXML(xmlDocument) {
92
+ const parser = new DOMParser();
93
+ const xmlFragment = parser.parseFromString(xmlDocument, "text/xml");
94
+ return xmlFragment;
95
+ }
96
+ function toHTML(xmlFragment) {
97
+ const processor = new XSLTProcessor();
98
+ const xsltDocument = new DOMParser().parseFromString(xmlToHTML, "text/xml");
99
+ processor.importStylesheet(xsltDocument);
100
+ const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);
101
+ return itemHTMLFragment;
102
+ }
103
+ function setLocation(xmlFragment, location) {
104
+ if (!location.endsWith("/")) {
105
+ location += "/";
106
+ }
107
+ xmlFragment.querySelectorAll("[src],[href],[primary-path]").forEach((elWithSrc) => {
108
+ let attr = "";
109
+ if (elWithSrc.getAttribute("src")) {
110
+ attr = "src";
111
+ }
112
+ if (elWithSrc.getAttribute("href")) {
113
+ attr = "href";
114
+ }
115
+ if (elWithSrc.getAttribute("primary-path")) {
116
+ attr = "primary-path";
117
+ }
118
+ const attrValue = elWithSrc.getAttribute(attr)?.trim();
119
+ if (!attrValue.startsWith("data:") && !attrValue.startsWith("http")) {
120
+ const newSrcValue = location + encodeURI(attrValue);
121
+ elWithSrc.setAttribute(attr, newSrcValue);
122
+ }
123
+ });
124
+ }
125
+ function convertCDATAtoComment(xmlFragment) {
126
+ const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value');
127
+ cdataElements.forEach((element) => {
128
+ const commentText = document.createComment(element.textContent);
129
+ element.replaceChild(commentText, element.firstChild);
130
+ });
131
+ }
132
+ function stripStyleSheets(xmlFragment) {
133
+ xmlFragment.querySelectorAll("qti-stylesheet").forEach((stylesheet) => stylesheet.remove());
134
+ }
135
+ function getShuffleQuerySelectorByTagName(tagName) {
136
+ switch (tagName) {
137
+ case "qti-choice-interaction":
138
+ case "qti-order-interaction":
139
+ return "qti-simple-choice";
140
+ case "qti-inline-choice-interaction":
141
+ return "qti-inline-choice";
142
+ case "qti-match-interaction":
143
+ return [
144
+ "qti-simple-match-set:first-of-type qti-simple-associable-choice",
145
+ "qti-simple-match-set:last-of-type > qti-simple-associable-choice"
146
+ ];
147
+ case "qti-gap-match-interaction":
148
+ return "qti-gap-text";
149
+ case "qti-associate-interaction":
150
+ return "qti-simple-associable-choice";
151
+ default:
152
+ }
153
+ }
154
+
155
+ // src/lib/qti-transformers/qti-transform-item.ts
156
+ var qtiTransformItem = (cache = false) => {
157
+ let xmlFragment;
158
+ const api = {
159
+ async load(uri, cancelPreviousRequest = false) {
160
+ const fullKey = encodeURI(uri);
161
+ if (cache) {
162
+ if (sessionStorage.getItem(fullKey)) {
163
+ return Promise.resolve(api.parse(sessionStorage.getItem(fullKey)));
164
+ }
165
+ }
166
+ return new Promise((resolve) => {
167
+ loadXML(uri, cancelPreviousRequest).then((xml2) => {
168
+ xmlFragment = xml2;
169
+ api.shuffleInteractions().api.path(uri.substring(0, uri.lastIndexOf("/")));
170
+ if (cache) sessionStorage.setItem(fullKey, new XMLSerializer().serializeToString(xmlFragment));
171
+ return resolve(api);
172
+ });
173
+ });
174
+ },
175
+ parse(xmlString) {
176
+ xmlFragment = parseXML(xmlString);
177
+ return api;
178
+ },
179
+ path: (location) => {
180
+ setLocation(xmlFragment, location);
181
+ return api;
182
+ },
183
+ fn(fn) {
184
+ fn(xmlFragment);
185
+ return api;
186
+ },
187
+ pciHooks(uri) {
188
+ const attributes = ["hook", "module"];
189
+ const documentPath = uri.substring(0, uri.lastIndexOf("/"));
190
+ for (const attribute of attributes) {
191
+ const srcAttributes = xmlFragment.querySelectorAll("[" + attribute + "]");
192
+ srcAttributes.forEach((node) => {
193
+ const srcValue = node.getAttribute(attribute);
194
+ if (!srcValue.startsWith("data:") && !srcValue.startsWith("http")) {
195
+ node.setAttribute("base-url", uri);
196
+ node.setAttribute(
197
+ "module",
198
+ documentPath + "/" + encodeURI(srcValue + (srcValue.endsWith(".js") ? "" : ".js"))
199
+ );
200
+ }
201
+ });
202
+ }
203
+ return api;
204
+ },
205
+ shuffleInteractions() {
206
+ const shuffleElements = xmlFragment.querySelectorAll(`[shuffle="true"]`);
207
+ const shuffleInteractions = Array.from(shuffleElements).filter(
208
+ (e) => e.tagName?.toLowerCase().endsWith("-interaction")
209
+ );
210
+ const shuffelResults = [];
211
+ for (const shuffleInteraction of shuffleInteractions) {
212
+ const query = getShuffleQuerySelectorByTagName(shuffleInteraction.tagName.toLowerCase());
213
+ const queries = Array.isArray(query) ? query : [query];
214
+ for (const q of queries) {
215
+ const choices = Array.from(shuffleInteraction.querySelectorAll(q));
216
+ const fixedChoices = choices.map((choice, originalOrder2) => ({
217
+ element: choice,
218
+ fixed: choice.hasAttribute("fixed") && choice.getAttribute("fixed") === "true",
219
+ originalOrder: originalOrder2
220
+ })).filter((choice) => choice.fixed);
221
+ const nonFixedChoices = choices.filter(
222
+ (choice) => !choice.hasAttribute("fixed") || choice.getAttribute("fixed") !== "true"
223
+ );
224
+ if (nonFixedChoices.length <= 1) {
225
+ console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");
226
+ return { api, result: void 0 };
227
+ }
228
+ const originalOrder = [...nonFixedChoices];
229
+ let shuffled = false;
230
+ let attempts = 0;
231
+ while (!shuffled && attempts < 20) {
232
+ attempts++;
233
+ for (let i = nonFixedChoices.length - 1; i > 0; i--) {
234
+ const j = Math.floor(Math.random() * (i + 1));
235
+ [nonFixedChoices[i], nonFixedChoices[j]] = [nonFixedChoices[j], nonFixedChoices[i]];
236
+ }
237
+ shuffled = !nonFixedChoices.every((choice, index) => choice === originalOrder[index]);
238
+ }
239
+ if (!shuffled) {
240
+ console.warn("Failed to shuffle the choices after multiple attempts.");
241
+ return null;
242
+ }
243
+ shuffleInteraction.removeAttribute("shuffle");
244
+ let nonFixedIndex = 0;
245
+ for (const nonFixedChoice of nonFixedChoices) {
246
+ nonFixedChoice.parentElement.insertBefore(nonFixedChoice, fixedChoices[nonFixedIndex]?.element);
247
+ nonFixedIndex++;
248
+ }
249
+ for (const fixedChoice of fixedChoices) {
250
+ fixedChoice.element.parentElement.insertBefore(
251
+ fixedChoice.element,
252
+ nonFixedChoices[fixedChoice.originalOrder]
253
+ );
254
+ }
255
+ }
256
+ }
257
+ return { api, result: shuffelResults };
258
+ },
259
+ extendElementName: (tagName, extension) => {
260
+ extendElementName(xmlFragment, tagName, extension);
261
+ return api;
262
+ },
263
+ extendElementsWithClass: (param = "extend") => {
264
+ extendElementsWithClass(xmlFragment, param);
265
+ return api;
266
+ },
267
+ customInteraction(baseRef, baseItem) {
268
+ const qtiCustomInteraction = xmlFragment.querySelector("qti-custom-interaction");
269
+ const qtiCustomInteractionObject = qtiCustomInteraction.querySelector("object");
270
+ qtiCustomInteraction.setAttribute("data-base-ref", baseRef);
271
+ qtiCustomInteraction.setAttribute("data-base-item", baseRef + baseItem);
272
+ qtiCustomInteraction.setAttribute("data", qtiCustomInteractionObject.getAttribute("data"));
273
+ qtiCustomInteraction.setAttribute("width", qtiCustomInteractionObject.getAttribute("width"));
274
+ qtiCustomInteraction.setAttribute("height", qtiCustomInteractionObject.getAttribute("height"));
275
+ qtiCustomInteraction.removeChild(qtiCustomInteractionObject);
276
+ return api;
277
+ },
278
+ convertCDATAtoComment() {
279
+ convertCDATAtoComment(xmlFragment);
280
+ return api;
281
+ },
282
+ stripStyleSheets() {
283
+ stripStyleSheets(xmlFragment);
284
+ return api;
285
+ },
286
+ html() {
287
+ return new XMLSerializer().serializeToString(toHTML(xmlFragment));
288
+ },
289
+ xml() {
290
+ return new XMLSerializer().serializeToString(xmlFragment);
291
+ },
292
+ htmlDoc() {
293
+ return toHTML(xmlFragment);
294
+ },
295
+ xmlDoc() {
296
+ return xmlFragment;
297
+ }
298
+ };
299
+ return api;
300
+ };
301
+
302
+ // src/lib/qti-transformers/qti-transform-manifest.ts
303
+ var qtiTransformManifest = () => {
304
+ let xmlFragment;
305
+ const api = {
306
+ async load(uri) {
307
+ return new Promise((resolve) => {
308
+ loadXML(uri).then((xml2) => {
309
+ xmlFragment = xml2;
310
+ return resolve(api);
311
+ });
312
+ });
313
+ },
314
+ parse(xmlString) {
315
+ xmlFragment = parseXML(xmlString);
316
+ },
317
+ assessmentTest() {
318
+ const el = xmlFragment.querySelector('resource[type="imsqti_test_xmlv3p0"]');
319
+ return { href: el.getAttribute("href"), identifier: el.getAttribute("identifier") };
320
+ }
321
+ };
322
+ return api;
323
+ };
324
+
325
+ // src/lib/qti-transformers/qti-transform-test.ts
326
+ var qtiTransformTest = () => {
327
+ let xmlFragment;
328
+ const api = {
329
+ async load(uri) {
330
+ return new Promise((resolve, _) => {
331
+ loadXML(uri).then((xml2) => {
332
+ xmlFragment = xml2;
333
+ api.path(uri.substring(0, uri.lastIndexOf("/")));
334
+ return resolve(api);
335
+ });
336
+ });
337
+ },
338
+ parse(xmlString) {
339
+ xmlFragment = parseXML(xmlString);
340
+ return api;
341
+ },
342
+ path: (location) => {
343
+ setLocation(xmlFragment, location);
344
+ return api;
345
+ },
346
+ fn(fn) {
347
+ fn(xmlFragment);
348
+ return api;
349
+ },
350
+ items() {
351
+ return itemsFromTest(xmlFragment);
352
+ },
353
+ html() {
354
+ return new XMLSerializer().serializeToString(toHTML(xmlFragment));
355
+ },
356
+ xml() {
357
+ return new XMLSerializer().serializeToString(xmlFragment);
358
+ },
359
+ htmlDoc() {
360
+ return toHTML(xmlFragment);
361
+ },
362
+ xmlDoc() {
363
+ return xmlFragment;
364
+ }
365
+ };
366
+ return api;
367
+ };
368
+
369
+ export {
370
+ qtiTransformItem,
371
+ qtiTransformManifest,
372
+ qtiTransformTest
373
+ };
374
+ //# sourceMappingURL=chunk-5WS6ZWUN.js.map