@citolab/qti-components 7.0.5 → 7.0.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/cdn/chunk-4DFVJE2A.js +48 -0
  2. package/cdn/chunk-4I75QSIL.js +8 -0
  3. package/cdn/chunk-5WCOPF7O.js +73 -0
  4. package/cdn/chunk-A536ZOJJ.js +43 -0
  5. package/cdn/chunk-BLKKKK6C.js +11 -0
  6. package/cdn/chunk-DC2R556M.js +5 -0
  7. package/cdn/chunk-GALSGMIP.js +5 -0
  8. package/cdn/chunk-IXSX4SJX.js +1 -0
  9. package/cdn/chunk-KYOTSBCX.js +1 -0
  10. package/cdn/chunk-L4TDHAKL.js +24 -0
  11. package/cdn/chunk-M6AATWPS.js +59 -0
  12. package/cdn/{chunks/chunk-UIEC4LXR.js → chunk-MFWSHIPH.js} +1 -1
  13. package/cdn/chunk-QGKK4T2J.js +8 -0
  14. package/cdn/chunk-ROXN2HIJ.js +8 -0
  15. package/cdn/{chunks/chunk-CFXQCNG6.js → chunk-SQDSHH6N.js} +18 -2
  16. package/cdn/chunk-T4A5AZCI.js +939 -0
  17. package/cdn/index.global.js +71 -71
  18. package/cdn/index.js +1 -4503
  19. package/cdn/qti-components/index.global.js +1 -1
  20. package/cdn/qti-components/index.js +1 -924
  21. package/cdn/qti-item/core/index.global.js +149 -0
  22. package/cdn/qti-item/core/index.js +1 -0
  23. package/cdn/qti-loader/index.js +1 -23
  24. package/cdn/qti-test/components/index.global.js +1 -36
  25. package/cdn/qti-test/components/index.js +1 -3598
  26. package/cdn/qti-test/components/styles.js +1 -17
  27. package/cdn/qti-test/components/test-component.abstract.js +1 -1
  28. package/cdn/qti-test/components/test-item-link.js +1 -24
  29. package/cdn/qti-test/components/test-next.js +1 -24
  30. package/cdn/qti-test/components/test-next.spec.global.js +1 -234
  31. package/cdn/qti-test/components/test-next.spec.js +245 -4747
  32. package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -3
  33. package/cdn/qti-test/components/test-prev.js +1 -24
  34. package/cdn/qti-test/components/test-view.js +1 -11
  35. package/cdn/qti-test/core/index.global.js +205 -0
  36. package/cdn/qti-test/core/index.js +1 -0
  37. package/cdn/qti-transformers/index.js +1 -23
  38. package/dist/{chunks/chunk-Y6UWSECL.js → chunk-2CHF3TMY.js} +2 -2
  39. package/dist/chunk-2CHF3TMY.js.map +1 -0
  40. package/dist/{chunks/chunk-XDMSEAYC.js → chunk-2OA7E3E7.js} +1 -1
  41. package/dist/chunk-2OA7E3E7.js.map +1 -0
  42. package/dist/{chunks/chunk-W4B23OIP.js → chunk-3TFUBCJW.js} +4 -4
  43. package/dist/chunk-3TFUBCJW.js.map +1 -0
  44. package/dist/{chunks/chunk-6YE2KJ4C.js → chunk-44VE5POH.js} +1 -1
  45. package/dist/{chunks/chunk-3ROZMGAN.js → chunk-4FH7P7YI.js} +4 -4
  46. package/dist/chunk-4FH7P7YI.js.map +1 -0
  47. package/dist/{chunks/chunk-ELDMXTUQ.js → chunk-4YG2FPKK.js} +1 -1
  48. package/dist/chunk-4YG2FPKK.js.map +1 -0
  49. package/dist/{chunks/chunk-HWA4A3SR.js → chunk-6SG3NMKU.js} +4 -4
  50. package/dist/chunk-6SG3NMKU.js.map +1 -0
  51. package/dist/{chunks/chunk-LKINC6JO.js → chunk-ANLIJZBL.js} +6 -6
  52. package/dist/chunk-ANLIJZBL.js.map +1 -0
  53. package/dist/{qti-test/qti-test.js → chunk-CNQYM52B.js} +308 -239
  54. package/dist/chunk-CNQYM52B.js.map +1 -0
  55. package/dist/{chunks/chunk-XDFXD3BI.js → chunk-F3NTI6TX.js} +2 -2
  56. package/dist/chunk-F3NTI6TX.js.map +1 -0
  57. package/dist/{chunks/chunk-ZEFOMZNY.js → chunk-F7HTXGGH.js} +3 -3
  58. package/dist/chunk-F7HTXGGH.js.map +1 -0
  59. package/dist/chunk-MAC76UNI.js +1 -0
  60. package/dist/{chunks/chunk-PUBGXXTM.js → chunk-OO6JSYLP.js} +4 -4
  61. package/dist/chunk-OO6JSYLP.js.map +1 -0
  62. package/dist/{chunks/chunk-LROTNPC2.js → chunk-QYN5S4EM.js} +22 -9
  63. package/dist/chunk-QYN5S4EM.js.map +1 -0
  64. package/dist/{chunks/chunk-4O5F7WV7.js → chunk-UB5K44DB.js} +1 -1
  65. package/dist/chunk-UB5K44DB.js.map +1 -0
  66. package/dist/{chunks/chunk-3OXGDCSU.js → chunk-UBZPSVSE.js} +83 -35
  67. package/dist/chunk-UBZPSVSE.js.map +1 -0
  68. package/dist/index.d.ts +5 -10
  69. package/dist/index.js +131 -11043
  70. package/dist/index.js.map +1 -1
  71. package/dist/qti-components/index.js +94 -6431
  72. package/dist/qti-components/index.js.map +1 -1
  73. package/dist/qti-components-jsx.d.ts +83 -83
  74. package/dist/qti-item/{components/item-container.d.ts → core/index.d.ts} +22 -1
  75. package/dist/qti-item/core/index.js +13 -0
  76. package/dist/qti-loader/index.js +6 -287
  77. package/dist/qti-loader/index.js.map +1 -1
  78. package/dist/qti-test/components/index.d.ts +1 -3
  79. package/dist/qti-test/components/index.js +23 -4135
  80. package/dist/qti-test/components/index.js.map +1 -1
  81. package/dist/qti-test/components/styles.js +7 -22
  82. package/dist/qti-test/components/styles.js.map +1 -1
  83. package/dist/qti-test/components/test-component.abstract.d.ts +1 -2
  84. package/dist/qti-test/components/test-component.abstract.js +6 -145
  85. package/dist/qti-test/components/test-component.abstract.js.map +1 -1
  86. package/dist/qti-test/components/test-item-link.d.ts +1 -2
  87. package/dist/qti-test/components/test-item-link.js +8 -198
  88. package/dist/qti-test/components/test-item-link.js.map +1 -1
  89. package/dist/qti-test/components/test-next.d.ts +1 -2
  90. package/dist/qti-test/components/test-next.js +8 -205
  91. package/dist/qti-test/components/test-next.js.map +1 -1
  92. package/{cdn/qti-test/components/test-container.js → dist/qti-test/components/test-next.spec.css} +224 -1292
  93. package/dist/qti-test/components/test-next.spec.css.map +1 -0
  94. package/dist/qti-test/components/test-next.spec.d.ts +3 -6
  95. package/dist/qti-test/components/test-next.spec.js +141 -11152
  96. package/dist/qti-test/components/test-next.spec.js.map +1 -1
  97. package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +1 -2
  98. package/dist/qti-test/components/test-paging-buttons-stamp.js +7 -214
  99. package/dist/qti-test/components/test-paging-buttons-stamp.js.map +1 -1
  100. package/dist/qti-test/components/test-prev.d.ts +1 -2
  101. package/dist/qti-test/components/test-prev.js +8 -205
  102. package/dist/qti-test/components/test-prev.js.map +1 -1
  103. package/dist/qti-test/components/test-view.d.ts +1 -2
  104. package/dist/qti-test/components/test-view.js +7 -205
  105. package/dist/qti-test/components/test-view.js.map +1 -1
  106. package/dist/qti-test/core/index.d.ts +121 -0
  107. package/dist/qti-test/core/index.js +27 -0
  108. package/dist/qti-transformers/index.js +6 -287
  109. package/dist/qti-transformers/index.js.map +1 -1
  110. package/dist/{test-base-BJwG9Ie8.d.ts → test.context-DbSTxKk_.d.ts} +18 -28
  111. package/dist/vscode.html-custom-data.json +21 -21
  112. package/package.json +90 -78
  113. package/cdn/chunks/chunk-4UJBK6JO.js +0 -1
  114. package/cdn/chunks/chunk-5O3Z7TDV.js +0 -1
  115. package/cdn/chunks/chunk-65LFT33L.js +0 -8
  116. package/cdn/chunks/chunk-6D25UFJR.js +0 -8
  117. package/cdn/chunks/chunk-6UGPNL7M.js +0 -1
  118. package/cdn/chunks/chunk-CSUKVUZF.js +0 -3
  119. package/cdn/chunks/chunk-CSY3WI5A.js +0 -1
  120. package/cdn/chunks/chunk-DAZR7RUI.js +0 -0
  121. package/cdn/chunks/chunk-EHK76KRT.js +0 -1
  122. package/cdn/chunks/chunk-EOPEMJS3.js +0 -0
  123. package/cdn/chunks/chunk-G5O7EN45.js +0 -5
  124. package/cdn/chunks/chunk-GEFUIFM7.js +0 -0
  125. package/cdn/chunks/chunk-JLNHEMQG.js +0 -1
  126. package/cdn/chunks/chunk-LPWIM7QJ.js +0 -902
  127. package/cdn/chunks/chunk-M3YRM3AV.js +0 -1
  128. package/cdn/chunks/chunk-M6BOWL2U.js +0 -1
  129. package/cdn/chunks/chunk-P5IE36FO.js +0 -8
  130. package/cdn/chunks/chunk-PXH5KN5O.js +0 -1
  131. package/cdn/chunks/chunk-RBEI6NIF.js +0 -1
  132. package/cdn/chunks/chunk-SMKIYFFI.js +0 -1
  133. package/cdn/chunks/chunk-SRLMW23F.js +0 -0
  134. package/cdn/chunks/chunk-T3YDLD2H.js +0 -11
  135. package/cdn/chunks/chunk-T6IXJ4W4.js +0 -1
  136. package/cdn/chunks/chunk-TFAUBGP2.js +0 -0
  137. package/cdn/chunks/chunk-V44O3GTW.js +0 -0
  138. package/cdn/chunks/chunk-V6B54FQW.js +0 -5
  139. package/cdn/chunks/chunk-V6KX6BQN.js +0 -1
  140. package/cdn/chunks/chunk-VYANBI35.js +0 -1
  141. package/cdn/chunks/chunk-XUJ7TXHW.js +0 -1
  142. package/cdn/chunks/chunk-ZIZLFFSG.js +0 -0
  143. package/cdn/index.css +0 -1
  144. package/cdn/qti-item/components/index.css +0 -1
  145. package/cdn/qti-item/components/index.global.js +0 -149
  146. package/cdn/qti-item/components/index.js +0 -3549
  147. package/cdn/qti-item/components/item-container.css +0 -1
  148. package/cdn/qti-item/components/item-container.global.js +0 -149
  149. package/cdn/qti-item/components/item-container.js +0 -3549
  150. package/cdn/qti-item/index.css +0 -1
  151. package/cdn/qti-item/index.global.js +0 -149
  152. package/cdn/qti-item/index.js +0 -3549
  153. package/cdn/qti-item/qti-item.global.js +0 -114
  154. package/cdn/qti-item/qti-item.js +0 -1
  155. package/cdn/qti-test/components/index.css +0 -1
  156. package/cdn/qti-test/components/test-container.css +0 -1
  157. package/cdn/qti-test/components/test-container.global.js +0 -149
  158. package/cdn/qti-test/context/index.global.js +0 -58
  159. package/cdn/qti-test/context/index.js +0 -1
  160. package/cdn/qti-test/context/test.context.global.js +0 -58
  161. package/cdn/qti-test/context/test.context.js +0 -1
  162. package/cdn/qti-test/index.css +0 -1
  163. package/cdn/qti-test/index.global.js +0 -242
  164. package/cdn/qti-test/index.js +0 -3598
  165. package/cdn/qti-test/mixins/index.global.js +0 -1
  166. package/cdn/qti-test/mixins/index.js +0 -23
  167. package/cdn/qti-test/mixins/test-loader.mixin.global.js +0 -1
  168. package/cdn/qti-test/mixins/test-loader.mixin.js +0 -23
  169. package/cdn/qti-test/mixins/test-navigation.mixin.global.js +0 -1
  170. package/cdn/qti-test/mixins/test-navigation.mixin.js +0 -1
  171. package/cdn/qti-test/mixins/test-view.mixin.global.js +0 -1
  172. package/cdn/qti-test/mixins/test-view.mixin.js +0 -1
  173. package/cdn/qti-test/qti-assessment-test/index.global.js +0 -170
  174. package/cdn/qti-test/qti-assessment-test/index.js +0 -1
  175. package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.global.js +0 -170
  176. package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -1
  177. package/cdn/qti-test/qti-assessment-test/qti-assessment-section.global.js +0 -170
  178. package/cdn/qti-test/qti-assessment-test/qti-assessment-section.js +0 -1
  179. package/cdn/qti-test/qti-assessment-test/qti-assessment-test.global.js +0 -170
  180. package/cdn/qti-test/qti-assessment-test/qti-assessment-test.js +0 -1
  181. package/cdn/qti-test/qti-assessment-test/qti-test-part.global.js +0 -114
  182. package/cdn/qti-test/qti-assessment-test/qti-test-part.js +0 -1
  183. package/cdn/qti-test/qti-test.global.js +0 -170
  184. package/cdn/qti-test/qti-test.js +0 -23
  185. package/cdn/qti-test/test-base.global.js +0 -170
  186. package/cdn/qti-test/test-base.js +0 -1
  187. package/dist/chunks/chunk-3G2DDBJW.js +0 -44
  188. package/dist/chunks/chunk-3G2DDBJW.js.map +0 -1
  189. package/dist/chunks/chunk-3NLCJYSX.js +0 -1
  190. package/dist/chunks/chunk-3OXGDCSU.js.map +0 -1
  191. package/dist/chunks/chunk-3ROZMGAN.js.map +0 -1
  192. package/dist/chunks/chunk-4O5F7WV7.js.map +0 -1
  193. package/dist/chunks/chunk-AAQCM2FP.js +0 -56
  194. package/dist/chunks/chunk-AAQCM2FP.js.map +0 -1
  195. package/dist/chunks/chunk-D3RGDWKP.js +0 -37
  196. package/dist/chunks/chunk-D3RGDWKP.js.map +0 -1
  197. package/dist/chunks/chunk-DJLE6EV2.js +0 -36
  198. package/dist/chunks/chunk-DJLE6EV2.js.map +0 -1
  199. package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
  200. package/dist/chunks/chunk-EW5CTHAD.js +0 -1
  201. package/dist/chunks/chunk-HWA4A3SR.js.map +0 -1
  202. package/dist/chunks/chunk-IKZWK2C5.js +0 -1
  203. package/dist/chunks/chunk-IP7JSYO6.js +0 -1
  204. package/dist/chunks/chunk-IP7JSYO6.js.map +0 -1
  205. package/dist/chunks/chunk-JE6BMXZU.js +0 -94
  206. package/dist/chunks/chunk-JE6BMXZU.js.map +0 -1
  207. package/dist/chunks/chunk-JSPJGWGT.js +0 -20
  208. package/dist/chunks/chunk-JSPJGWGT.js.map +0 -1
  209. package/dist/chunks/chunk-LKINC6JO.js.map +0 -1
  210. package/dist/chunks/chunk-LROTNPC2.js.map +0 -1
  211. package/dist/chunks/chunk-MTMT2RMF.js +0 -63
  212. package/dist/chunks/chunk-MTMT2RMF.js.map +0 -1
  213. package/dist/chunks/chunk-NDJZGJUR.js +0 -65
  214. package/dist/chunks/chunk-NDJZGJUR.js.map +0 -1
  215. package/dist/chunks/chunk-OE2LFIH2.js +0 -1
  216. package/dist/chunks/chunk-OE2LFIH2.js.map +0 -1
  217. package/dist/chunks/chunk-OJ2XGDWK.js +0 -1
  218. package/dist/chunks/chunk-OJ2XGDWK.js.map +0 -1
  219. package/dist/chunks/chunk-PUBGXXTM.js.map +0 -1
  220. package/dist/chunks/chunk-QRCUNRP5.js +0 -75
  221. package/dist/chunks/chunk-QRCUNRP5.js.map +0 -1
  222. package/dist/chunks/chunk-S6JJYCO7.js +0 -51
  223. package/dist/chunks/chunk-S6JJYCO7.js.map +0 -1
  224. package/dist/chunks/chunk-U3AALKEP.js +0 -1
  225. package/dist/chunks/chunk-U3AALKEP.js.map +0 -1
  226. package/dist/chunks/chunk-UCQFSRYF.js +0 -34
  227. package/dist/chunks/chunk-UCQFSRYF.js.map +0 -1
  228. package/dist/chunks/chunk-URGVQ64M.js +0 -1
  229. package/dist/chunks/chunk-URGVQ64M.js.map +0 -1
  230. package/dist/chunks/chunk-V4FXK4TP.js +0 -128
  231. package/dist/chunks/chunk-V4FXK4TP.js.map +0 -1
  232. package/dist/chunks/chunk-W4B23OIP.js.map +0 -1
  233. package/dist/chunks/chunk-XDFXD3BI.js.map +0 -1
  234. package/dist/chunks/chunk-XDMSEAYC.js.map +0 -1
  235. package/dist/chunks/chunk-XPDS72XY.js +0 -29
  236. package/dist/chunks/chunk-XPDS72XY.js.map +0 -1
  237. package/dist/chunks/chunk-Y6UWSECL.js.map +0 -1
  238. package/dist/chunks/chunk-ZEFOMZNY.js.map +0 -1
  239. package/dist/index-Cvrd4KQA.d.ts +0 -109
  240. package/dist/qti-item/components/index.d.ts +0 -3
  241. package/dist/qti-item/components/index.js +0 -3856
  242. package/dist/qti-item/components/index.js.map +0 -1
  243. package/dist/qti-item/components/item-container.js +0 -3856
  244. package/dist/qti-item/components/item-container.js.map +0 -1
  245. package/dist/qti-item/index.d.ts +0 -4
  246. package/dist/qti-item/index.js +0 -3869
  247. package/dist/qti-item/index.js.map +0 -1
  248. package/dist/qti-item/qti-item.d.ts +0 -25
  249. package/dist/qti-item/qti-item.js +0 -26
  250. package/dist/qti-item/qti-item.js.map +0 -1
  251. package/dist/qti-test/components/test-container.d.ts +0 -37
  252. package/dist/qti-test/components/test-container.js +0 -3782
  253. package/dist/qti-test/components/test-container.js.map +0 -1
  254. package/dist/qti-test/context/index.d.ts +0 -6
  255. package/dist/qti-test/context/index.js +0 -9
  256. package/dist/qti-test/context/index.js.map +0 -1
  257. package/dist/qti-test/context/test.context.d.ts +0 -6
  258. package/dist/qti-test/context/test.context.js +0 -9
  259. package/dist/qti-test/context/test.context.js.map +0 -1
  260. package/dist/qti-test/index.d.ts +0 -14
  261. package/dist/qti-test/index.js +0 -4746
  262. package/dist/qti-test/index.js.map +0 -1
  263. package/dist/qti-test/mixins/index.d.ts +0 -8
  264. package/dist/qti-test/mixins/index.js +0 -350
  265. package/dist/qti-test/mixins/index.js.map +0 -1
  266. package/dist/qti-test/mixins/test-loader.mixin.d.ts +0 -8
  267. package/dist/qti-test/mixins/test-loader.mixin.js +0 -240
  268. package/dist/qti-test/mixins/test-loader.mixin.js.map +0 -1
  269. package/dist/qti-test/mixins/test-navigation.mixin.d.ts +0 -22
  270. package/dist/qti-test/mixins/test-navigation.mixin.js +0 -64
  271. package/dist/qti-test/mixins/test-navigation.mixin.js.map +0 -1
  272. package/dist/qti-test/mixins/test-view.mixin.d.ts +0 -6
  273. package/dist/qti-test/mixins/test-view.mixin.js +0 -50
  274. package/dist/qti-test/mixins/test-view.mixin.js.map +0 -1
  275. package/dist/qti-test/qti-assessment-test/index.d.ts +0 -6
  276. package/dist/qti-test/qti-assessment-test/index.js +0 -221
  277. package/dist/qti-test/qti-assessment-test/index.js.map +0 -1
  278. package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.d.ts +0 -6
  279. package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -85
  280. package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js.map +0 -1
  281. package/dist/qti-test/qti-assessment-test/qti-assessment-section.d.ts +0 -6
  282. package/dist/qti-test/qti-assessment-test/qti-assessment-section.js +0 -73
  283. package/dist/qti-test/qti-assessment-test/qti-assessment-section.js.map +0 -1
  284. package/dist/qti-test/qti-assessment-test/qti-assessment-test.d.ts +0 -6
  285. package/dist/qti-test/qti-assessment-test/qti-assessment-test.js +0 -54
  286. package/dist/qti-test/qti-assessment-test/qti-assessment-test.js.map +0 -1
  287. package/dist/qti-test/qti-assessment-test/qti-test-part.d.ts +0 -19
  288. package/dist/qti-test/qti-assessment-test/qti-test-part.js +0 -62
  289. package/dist/qti-test/qti-assessment-test/qti-test-part.js.map +0 -1
  290. package/dist/qti-test/qti-test.d.ts +0 -68
  291. package/dist/qti-test/qti-test.js.map +0 -1
  292. package/dist/qti-test/test-base.d.ts +0 -6
  293. package/dist/qti-test/test-base.js +0 -137
  294. package/dist/qti-test/test-base.js.map +0 -1
  295. /package/cdn/{chunks/chunk-6DMSHH5X.js → chunk-22HAPLRD.js} +0 -0
  296. /package/cdn/{chunks/chunk-5FCXUJAG.js → chunk-LVW3MHTI.js} +0 -0
  297. /package/cdn/{chunks/chunk-T4HD2C4F.js → chunk-VI2WKTN4.js} +0 -0
  298. /package/dist/{chunks/chunk-3NLCJYSX.js.map → chunk-44VE5POH.js.map} +0 -0
  299. /package/dist/{chunks/chunk-6YE2KJ4C.js.map → chunk-MAC76UNI.js.map} +0 -0
  300. /package/dist/{chunks/chunk-EW5CTHAD.js.map → qti-item/core/index.js.map} +0 -0
  301. /package/dist/{chunks/chunk-IKZWK2C5.js.map → qti-test/core/index.js.map} +0 -0
@@ -989,8 +989,6 @@ export type TestElementProps = {
989
989
  "onqti-interaction-response"?: (e: CustomEvent<CustomEvent>) => void;
990
990
  };
991
991
 
992
- export type QtiItemProps = {};
993
-
994
992
  export type ItemContainerProps = {
995
993
  /** URL of the item to load */
996
994
  "item-url"?: string;
@@ -1000,6 +998,8 @@ export type ItemContainerProps = {
1000
998
  itemXML?: string;
1001
999
  };
1002
1000
 
1001
+ export type QtiItemProps = {};
1002
+
1003
1003
  export type QtiAssessmentItemRefProps = {
1004
1004
  /** */
1005
1005
  category?: string | undefined;
@@ -1069,11 +1069,6 @@ export type QtiTestPartProps = {
1069
1069
  "onqti-test-part-connected"?: (e: CustomEvent<Event>) => void;
1070
1070
  };
1071
1071
 
1072
- export type QtiTestProps = {
1073
- /** */
1074
- context?: TestContext;
1075
- };
1076
-
1077
1072
  export type TestNextProps = {
1078
1073
  /** */
1079
1074
  role?: string;
@@ -1124,15 +1119,6 @@ export type TestItemLinkProps = {
1124
1119
  "onqti-request-test-item"?: (e: CustomEvent<CustomEvent>) => void;
1125
1120
  };
1126
1121
 
1127
- export type TestContainerProps = {
1128
- /** URL of the item to load */
1129
- "test-url"?: string;
1130
- /** A parsed HTML document */
1131
- testDoc?: DocumentFragment;
1132
- /** The raw XML string */
1133
- testXML?: string;
1134
- };
1135
-
1136
1122
  export type TestPagingButtonsStampProps = {
1137
1123
  /** */
1138
1124
  "max-displayed-items"?: number;
@@ -1148,6 +1134,20 @@ export type TestPagingButtonsStampProps = {
1148
1134
  "onqti-request-test-item"?: (e: CustomEvent<CustomEvent>) => void;
1149
1135
  };
1150
1136
 
1137
+ export type QtiTestProps = {
1138
+ /** */
1139
+ context?: TestContext;
1140
+ };
1141
+
1142
+ export type TestContainerProps = {
1143
+ /** URL of the item to load */
1144
+ "test-url"?: string;
1145
+ /** A parsed HTML document */
1146
+ testDoc?: DocumentFragment;
1147
+ /** The raw XML string */
1148
+ testXML?: string;
1149
+ };
1150
+
1151
1151
  export type CustomElements = {
1152
1152
  /**
1153
1153
  *
@@ -1923,10 +1923,12 @@ export type CustomElements = {
1923
1923
  "test-element": Partial<TestElementProps & BaseProps & BaseEvents>;
1924
1924
 
1925
1925
  /**
1926
- * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.
1927
- * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.
1928
- * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.
1929
- * See `<item-container>` for more details.
1926
+ * `<item-container>` is a custom element designed for hosting the qti-assessment-item.
1927
+ * The `qti-assessment-item` will be placed inside the shadow DOM of this element.
1928
+ * The element loads the item from the provided URL and renders it inside the shadow DOM.
1929
+ *
1930
+ * ### Styling
1931
+ * Add a class to the element for styling.
1930
1932
  *
1931
1933
  * ```html
1932
1934
  * <qti-item>
@@ -1936,15 +1938,13 @@ export type CustomElements = {
1936
1938
  * ---
1937
1939
  *
1938
1940
  */
1939
- "qti-item": Partial<QtiItemProps & BaseProps & BaseEvents>;
1941
+ "item-container": Partial<ItemContainerProps & BaseProps & BaseEvents>;
1940
1942
 
1941
1943
  /**
1942
- * `<item-container>` is a custom element designed for hosting the qti-assessment-item.
1943
- * The `qti-assessment-item` will be placed inside the shadow DOM of this element.
1944
- * The element loads the item from the provided URL and renders it inside the shadow DOM.
1945
- *
1946
- * ### Styling
1947
- * Add a class to the element for styling.
1944
+ * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.
1945
+ * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.
1946
+ * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.
1947
+ * See `<item-container>` for more details.
1948
1948
  *
1949
1949
  * ```html
1950
1950
  * <qti-item>
@@ -1954,7 +1954,7 @@ export type CustomElements = {
1954
1954
  * ---
1955
1955
  *
1956
1956
  */
1957
- "item-container": Partial<ItemContainerProps & BaseProps & BaseEvents>;
1957
+ "qti-item": Partial<QtiItemProps & BaseProps & BaseEvents>;
1958
1958
 
1959
1959
  /**
1960
1960
  *
@@ -1996,6 +1996,61 @@ export type CustomElements = {
1996
1996
  */
1997
1997
  "qti-test-part": Partial<QtiTestPartProps & BaseProps & BaseEvents>;
1998
1998
 
1999
+ /**
2000
+ * Represents a custom element for navigating to the next test item.
2001
+ * ---
2002
+ *
2003
+ *
2004
+ * ### **Events:**
2005
+ * - **on-test-switch-view**
2006
+ * - **qti-request-test-item**
2007
+ */
2008
+ "test-next": Partial<TestNextProps & BaseProps & BaseEvents>;
2009
+
2010
+ /**
2011
+ * Represents a custom element for navigating to the previous test item.
2012
+ * ---
2013
+ *
2014
+ *
2015
+ * ### **Events:**
2016
+ * - **on-test-switch-view**
2017
+ * - **qti-request-test-item**
2018
+ */
2019
+ "test-prev": Partial<TestPrevProps & BaseProps & BaseEvents>;
2020
+
2021
+ /**
2022
+ *
2023
+ * ---
2024
+ *
2025
+ *
2026
+ * ### **Events:**
2027
+ * - **on-test-switch-view**
2028
+ * - **qti-request-test-item**
2029
+ */
2030
+ "test-view": Partial<TestViewProps & BaseProps & BaseEvents>;
2031
+
2032
+ /**
2033
+ *
2034
+ * ---
2035
+ *
2036
+ *
2037
+ * ### **Events:**
2038
+ * - **on-test-switch-view**
2039
+ * - **qti-request-test-item**
2040
+ */
2041
+ "test-item-link": Partial<TestItemLinkProps & BaseProps & BaseEvents>;
2042
+
2043
+ /**
2044
+ *
2045
+ * ---
2046
+ *
2047
+ *
2048
+ * ### **Events:**
2049
+ * - **on-test-switch-view**
2050
+ * - **qti-request-test-item**
2051
+ */
2052
+ "test-paging-buttons-stamp": Partial<TestPagingButtonsStampProps & BaseProps & BaseEvents>;
2053
+
1999
2054
  /**
2000
2055
  * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
2001
2056
  *
@@ -2045,50 +2100,6 @@ export type CustomElements = {
2045
2100
  */
2046
2101
  "qti-test": Partial<QtiTestProps & BaseProps & BaseEvents>;
2047
2102
 
2048
- /**
2049
- * Represents a custom element for navigating to the next test item.
2050
- * ---
2051
- *
2052
- *
2053
- * ### **Events:**
2054
- * - **on-test-switch-view**
2055
- * - **qti-request-test-item**
2056
- */
2057
- "test-next": Partial<TestNextProps & BaseProps & BaseEvents>;
2058
-
2059
- /**
2060
- * Represents a custom element for navigating to the previous test item.
2061
- * ---
2062
- *
2063
- *
2064
- * ### **Events:**
2065
- * - **on-test-switch-view**
2066
- * - **qti-request-test-item**
2067
- */
2068
- "test-prev": Partial<TestPrevProps & BaseProps & BaseEvents>;
2069
-
2070
- /**
2071
- *
2072
- * ---
2073
- *
2074
- *
2075
- * ### **Events:**
2076
- * - **on-test-switch-view**
2077
- * - **qti-request-test-item**
2078
- */
2079
- "test-view": Partial<TestViewProps & BaseProps & BaseEvents>;
2080
-
2081
- /**
2082
- *
2083
- * ---
2084
- *
2085
- *
2086
- * ### **Events:**
2087
- * - **on-test-switch-view**
2088
- * - **qti-request-test-item**
2089
- */
2090
- "test-item-link": Partial<TestItemLinkProps & BaseProps & BaseEvents>;
2091
-
2092
2103
  /**
2093
2104
  * `<test-container>` is a custom element designed for hosting the qti-assessment-item.
2094
2105
  * The `qti-assessment-test` will be placed inside the shadow DOM of this element.
@@ -2103,15 +2114,4 @@ export type CustomElements = {
2103
2114
  *
2104
2115
  */
2105
2116
  "test-container": Partial<TestContainerProps & BaseProps & BaseEvents>;
2106
-
2107
- /**
2108
- *
2109
- * ---
2110
- *
2111
- *
2112
- * ### **Events:**
2113
- * - **on-test-switch-view**
2114
- * - **qti-request-test-item**
2115
- */
2116
- "test-paging-buttons-stamp": Partial<TestPagingButtonsStampProps & BaseProps & BaseEvents>;
2117
2117
  };
@@ -37,4 +37,25 @@ declare global {
37
37
  }
38
38
  }
39
39
 
40
- export { ItemContainer };
40
+ /**
41
+ * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.
42
+ * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.
43
+ * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.
44
+ * See `<item-container>` for more details.
45
+ *
46
+ * ```html
47
+ * <qti-item>
48
+ * <item-container class="m-4 bg-white" item-url="./path/to/item.xml"></item-container>
49
+ * </qti-item>
50
+ * ```
51
+ */
52
+ declare class QtiItem extends LitElement {
53
+ render(): lit_html.TemplateResult<1>;
54
+ }
55
+ declare global {
56
+ interface HTMLElementTagNameMap {
57
+ 'qti-item': QtiItem;
58
+ }
59
+ }
60
+
61
+ export { ItemContainer, QtiItem };
@@ -0,0 +1,13 @@
1
+ import {
2
+ ItemContainer,
3
+ QtiItem
4
+ } from "../../chunk-QYN5S4EM.js";
5
+ import "../../chunk-2CHF3TMY.js";
6
+ import "../../chunk-2OA7E3E7.js";
7
+ import "../../chunk-4YG2FPKK.js";
8
+ import "../../chunk-44VE5POH.js";
9
+ export {
10
+ ItemContainer,
11
+ QtiItem
12
+ };
13
+ //# sourceMappingURL=index.js.map
@@ -1,290 +1,9 @@
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
-
136
- // src/lib/qti-transformers/qti-transform-item.ts
137
- var qtiTransformItem = () => {
138
- let xmlFragment;
139
- const api = {
140
- async load(uri, cancelPreviousRequest = false) {
141
- return new Promise((resolve) => {
142
- loadXML(uri, cancelPreviousRequest).then((xml2) => {
143
- xmlFragment = xml2;
144
- api.path(uri.substring(0, uri.lastIndexOf("/")));
145
- return resolve(api);
146
- });
147
- });
148
- },
149
- parse(xmlString) {
150
- xmlFragment = parseXML(xmlString);
151
- return api;
152
- },
153
- path: (location) => {
154
- setLocation(xmlFragment, location);
155
- return api;
156
- },
157
- fn(fn) {
158
- fn(xmlFragment);
159
- return api;
160
- },
161
- pciHooks(uri) {
162
- const attributes = ["hook", "module"];
163
- const documentPath = uri.substring(0, uri.lastIndexOf("/"));
164
- for (const attribute of attributes) {
165
- const srcAttributes = xmlFragment.querySelectorAll("[" + attribute + "]");
166
- srcAttributes.forEach((node) => {
167
- const srcValue = node.getAttribute(attribute);
168
- if (!srcValue.startsWith("data:") && !srcValue.startsWith("http")) {
169
- node.setAttribute("base-url", uri);
170
- node.setAttribute(
171
- "module",
172
- documentPath + "/" + encodeURI(srcValue + (srcValue.endsWith(".js") ? "" : ".js"))
173
- );
174
- }
175
- });
176
- }
177
- return api;
178
- },
179
- extendElementName: (tagName, extension) => {
180
- extendElementName(xmlFragment, tagName, extension);
181
- return api;
182
- },
183
- extendElementsWithClass: (param = "extend") => {
184
- extendElementsWithClass(xmlFragment, param);
185
- return api;
186
- },
187
- customInteraction(baseRef, baseItem) {
188
- const qtiCustomInteraction = xmlFragment.querySelector("qti-custom-interaction");
189
- const qtiCustomInteractionObject = qtiCustomInteraction.querySelector("object");
190
- qtiCustomInteraction.setAttribute("data-base-ref", baseRef);
191
- qtiCustomInteraction.setAttribute("data-base-item", baseRef + baseItem);
192
- qtiCustomInteraction.setAttribute("data", qtiCustomInteractionObject.getAttribute("data"));
193
- qtiCustomInteraction.setAttribute("width", qtiCustomInteractionObject.getAttribute("width"));
194
- qtiCustomInteraction.setAttribute("height", qtiCustomInteractionObject.getAttribute("height"));
195
- qtiCustomInteraction.removeChild(qtiCustomInteractionObject);
196
- return api;
197
- },
198
- convertCDATAtoComment() {
199
- convertCDATAtoComment(xmlFragment);
200
- return api;
201
- },
202
- stripStyleSheets() {
203
- stripStyleSheets(xmlFragment);
204
- return api;
205
- },
206
- html() {
207
- return new XMLSerializer().serializeToString(toHTML(xmlFragment));
208
- },
209
- xml() {
210
- return new XMLSerializer().serializeToString(xmlFragment);
211
- },
212
- htmlDoc() {
213
- return toHTML(xmlFragment);
214
- },
215
- xmlDoc() {
216
- return xmlFragment;
217
- }
218
- };
219
- return api;
220
- };
221
-
222
- // src/lib/qti-transformers/qti-transform-manifest.ts
223
- var qtiTransformManifest = () => {
224
- let xmlFragment;
225
- const api = {
226
- async load(uri) {
227
- return new Promise((resolve) => {
228
- loadXML(uri).then((xml2) => {
229
- xmlFragment = xml2;
230
- return resolve(api);
231
- });
232
- });
233
- },
234
- parse(xmlString) {
235
- xmlFragment = parseXML(xmlString);
236
- },
237
- assessmentTest() {
238
- const el = xmlFragment.querySelector('resource[type="imsqti_test_xmlv3p0"]');
239
- return { href: el.getAttribute("href"), identifier: el.getAttribute("identifier") };
240
- }
241
- };
242
- return api;
243
- };
244
-
245
- // src/lib/qti-transformers/qti-transform-test.ts
246
- var qtiTransformTest = () => {
247
- let xmlFragment;
248
- const api = {
249
- async load(uri) {
250
- return new Promise((resolve, _) => {
251
- loadXML(uri).then((xml2) => {
252
- xmlFragment = xml2;
253
- api.path(uri.substring(0, uri.lastIndexOf("/")));
254
- return resolve(api);
255
- });
256
- });
257
- },
258
- parse(xmlString) {
259
- xmlFragment = parseXML(xmlString);
260
- return api;
261
- },
262
- path: (location) => {
263
- setLocation(xmlFragment, location);
264
- return api;
265
- },
266
- fn(fn) {
267
- fn(xmlFragment);
268
- return api;
269
- },
270
- items() {
271
- return itemsFromTest(xmlFragment);
272
- },
273
- html() {
274
- return new XMLSerializer().serializeToString(toHTML(xmlFragment));
275
- },
276
- xml() {
277
- return new XMLSerializer().serializeToString(xmlFragment);
278
- },
279
- htmlDoc() {
280
- return toHTML(xmlFragment);
281
- },
282
- xmlDoc() {
283
- return xmlFragment;
284
- }
285
- };
286
- return api;
287
- };
1
+ import {
2
+ qtiTransformItem,
3
+ qtiTransformManifest,
4
+ qtiTransformTest
5
+ } from "../chunk-2OA7E3E7.js";
6
+ import "../chunk-44VE5POH.js";
288
7
 
289
8
  // src/lib/qti-loader/qti-loader.ts
290
9
  var getManifestInfo = async (manifestURL) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/qti-transformers/qti-transformers.ts","../../src/lib/qti-transformers/qti-transform-item.ts","../../src/lib/qti-transformers/qti-transform-manifest.ts","../../src/lib/qti-transformers/qti-transform-test.ts","../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["const xml = String.raw;\n\n/* <!-- convert CDATA to comments -->\n <xsl:template match=\"text()[contains(., 'CDATA')]\">\n <xsl:comment>\n <xsl:value-of select=\".\"/>\n </xsl:comment>\n</xsl:template>\n*/\n\n/*\n <!-- remove xml comments -->\n <xsl:template match=\"comment()\" />\n */\n\nconst xmlToHTML = xml`<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:output method=\"html\" version=\"5.0\" encoding=\"UTF-8\" indent=\"yes\" />\n <xsl:template match=\"@*|node()\">\n <xsl:copy>\n <xsl:apply-templates select=\"@*|node()\"/>\n </xsl:copy>\n </xsl:template>\n\n <!-- remove existing namespaces -->\n <xsl:template match=\"*\">\n <!-- remove element prefix -->\n <xsl:element name=\"{local-name()}\">\n <!-- process attributes -->\n <xsl:for-each select=\"@*\">\n <!-- remove attribute prefix -->\n <xsl:attribute name=\"{local-name()}\">\n <xsl:value-of select=\".\"/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>`;\n\n// Function to extend elements with a specific tag name by adding an extension suffix\nexport function extendElementName(xmlFragment: XMLDocument, tagName: string, extension: string) {\n xmlFragment.querySelectorAll(tagName).forEach(element => {\n const newTagName = `${tagName}-${extension}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n });\n}\n\n// Function to extend any element with a specific class pattern (e.g., \"extend:suffix\")\nexport function extendElementsWithClass(xmlFragment: XMLDocument, classNamePattern: string) {\n xmlFragment.querySelectorAll('*').forEach(element => {\n const classList = element.classList;\n if (classList) {\n classList.forEach(className => {\n if (className.startsWith(`${classNamePattern}:`)) {\n const suffix = className.slice(`${classNamePattern}:`.length);\n const newTagName = `${element.nodeName}-${suffix}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n }\n });\n }\n });\n}\n\n// Helper function to create a new element with a new tag name and copy attributes and children\nfunction createElementWithNewTagName(element, newTagName) {\n const newElement = document.createElement(newTagName);\n // Copy attributes\n for (const attr of element.attributes) {\n newElement.setAttribute(attr.name, attr.value);\n }\n // Copy child nodes\n while (element.firstChild) {\n newElement.appendChild(element.firstChild);\n }\n return newElement;\n}\n\nexport function itemsFromTest(xmlFragment: DocumentFragment) {\n const items: { identifier: string; href: string; category: string }[] = [];\n xmlFragment.querySelectorAll('qti-assessment-item-ref').forEach(el => {\n const identifier = el.getAttribute('identifier');\n const href = el.getAttribute('href');\n const category = el.getAttribute('category');\n items.push({ identifier, href, category });\n });\n return items;\n}\n\nlet currentRequest: XMLHttpRequest | null = null;\n\nexport function loadXML(url, cancelPreviousRequest = false) {\n if (cancelPreviousRequest && currentRequest !== null) {\n currentRequest.abort(); // Abort the ongoing request if there is one\n }\n\n return new Promise<XMLDocument | null>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n currentRequest = xhr; // Store the current request\n\n xhr.open('GET', url, true);\n xhr.responseType = 'document';\n\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.responseXML);\n } else {\n reject(xhr.statusText);\n }\n };\n\n xhr.onerror = () => {\n reject(xhr.statusText);\n };\n\n xhr.send();\n });\n}\n\nexport function parseXML(xmlDocument: string) {\n const parser = new DOMParser();\n const xmlFragment = parser.parseFromString(xmlDocument, 'text/xml');\n return xmlFragment;\n}\n\nexport function toHTML(xmlFragment: Document): DocumentFragment {\n const processor = new XSLTProcessor();\n const xsltDocument = new DOMParser().parseFromString(xmlToHTML, 'text/xml');\n processor.importStylesheet(xsltDocument);\n const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);\n return itemHTMLFragment;\n}\n\nexport function setLocation(xmlFragment: DocumentFragment, location: string) {\n if (!location.endsWith('/')) {\n location += '/';\n }\n\n xmlFragment.querySelectorAll('[src],[href],[primary-path]').forEach(elWithSrc => {\n let attr: 'src' | 'href' | 'primary-path' | '' = '';\n\n if (elWithSrc.getAttribute('src')) {\n attr = 'src';\n }\n if (elWithSrc.getAttribute('href')) {\n attr = 'href';\n }\n if (elWithSrc.getAttribute('primary-path')) {\n attr = 'primary-path';\n }\n const attrValue = elWithSrc.getAttribute(attr)?.trim();\n\n if (!attrValue.startsWith('data:') && !attrValue.startsWith('http')) {\n const newSrcValue = location + encodeURI(attrValue);\n elWithSrc.setAttribute(attr, newSrcValue);\n }\n });\n}\n\nexport function convertCDATAtoComment(xmlFragment: DocumentFragment) {\n const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class=\"js.org\"] > qti-base-value');\n cdataElements.forEach(element => {\n const commentText = document.createComment(element.textContent);\n element.replaceChild(commentText, element.firstChild);\n });\n}\n\nexport function stripStyleSheets(xmlFragment: DocumentFragment) {\n // remove qti-stylesheet tag\n xmlFragment.querySelectorAll('qti-stylesheet').forEach(stylesheet => stylesheet.remove());\n}\n","/**\n * Browser based QTI-XML to HTML transformer.\n * Returns an object with methods to load, parse, transform and serialize QTI XML items.\n * @returns An object with methods to load, parse, transform and serialize QTI XML items.\n * @example\n * const qtiTransformer = qtiTransformItem();\n * await qtiTransformer.load('path/to/xml/file.xml');\n * qtiTransformer.path('/assessmentItem/itemBody');\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n * const htmldoc = qtiTransformer.htmldoc();\n * const xmldoc = qtiTransformer.xmldoc();\n *\n * qtiTransformItem().parse(storyXML).html()\n */\n\nimport {\n convertCDATAtoComment,\n extendElementName,\n extendElementsWithClass,\n loadXML,\n parseXML,\n setLocation,\n stripStyleSheets,\n toHTML\n} from './qti-transformers';\n\nexport type transformItemApi = {\n load: (uri: string, cancelPreviousRequest?: boolean) => Promise<transformItemApi>;\n parse: (xmlString: string) => transformItemApi;\n path: (location: string) => transformItemApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformItemApi;\n pciHooks: (uri: string) => transformItemApi;\n extendElementName: (elementName: string, extend: string) => transformItemApi;\n extendElementsWithClass: (param?: string) => transformItemApi;\n customInteraction: (baseRef: string, baseItem: string) => transformItemApi;\n convertCDATAtoComment: () => transformItemApi;\n stripStyleSheets: () => transformItemApi;\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformItem = () => {\n let xmlFragment: XMLDocument;\n\n const api: transformItemApi = {\n async load(uri: string, cancelPreviousRequest = false): Promise<typeof api> {\n return new Promise<typeof api>(resolve => {\n loadXML(uri, cancelPreviousRequest).then(xml => {\n xmlFragment = xml;\n // set the base path for images and other resources,\n // you probably want to set the base path to the document root else you can use the path method to set it\n api.path(uri.substring(0, uri.lastIndexOf('/')));\n return resolve(api);\n });\n });\n },\n parse(xmlString: string): typeof api {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n path: (location: string): typeof api => {\n setLocation(xmlFragment, location);\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void): typeof api {\n fn(xmlFragment);\n return api;\n },\n pciHooks(uri: string): typeof api {\n const attributes = ['hook', 'module'];\n const documentPath = uri.substring(0, uri.lastIndexOf('/'));\n for (const attribute of attributes) {\n const srcAttributes = xmlFragment.querySelectorAll('[' + attribute + ']');\n srcAttributes.forEach(node => {\n const srcValue = node.getAttribute(attribute)!;\n if (!srcValue.startsWith('data:') && !srcValue.startsWith('http')) {\n // Just paste the relative path of the src location after the documentrootPath\n // old pcis can have a .js, new pci's don't\n node.setAttribute('base-url', uri);\n node.setAttribute(\n 'module',\n documentPath + '/' + encodeURI(srcValue + (srcValue.endsWith('.js') ? '' : '.js'))\n );\n }\n });\n }\n return api;\n },\n extendElementName: (tagName: string, extension: string): typeof api => {\n extendElementName(xmlFragment, tagName, extension);\n return api;\n },\n extendElementsWithClass: (param: string = 'extend'): typeof api => {\n extendElementsWithClass(xmlFragment, param);\n return api;\n },\n customInteraction(baseRef: string, baseItem: string): typeof api {\n const qtiCustomInteraction = xmlFragment.querySelector('qti-custom-interaction');\n const qtiCustomInteractionObject = qtiCustomInteraction.querySelector('object');\n\n qtiCustomInteraction.setAttribute('data-base-ref', baseRef);\n qtiCustomInteraction.setAttribute('data-base-item', baseRef + baseItem);\n qtiCustomInteraction.setAttribute('data', qtiCustomInteractionObject.getAttribute('data'));\n qtiCustomInteraction.setAttribute('width', qtiCustomInteractionObject.getAttribute('width'));\n qtiCustomInteraction.setAttribute('height', qtiCustomInteractionObject.getAttribute('height'));\n\n qtiCustomInteraction.removeChild(qtiCustomInteractionObject);\n return api;\n },\n convertCDATAtoComment(): typeof api {\n convertCDATAtoComment(xmlFragment);\n return api;\n },\n stripStyleSheets(): typeof api {\n stripStyleSheets(xmlFragment);\n return api;\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment; // new XMLSerializer().serializeToString(xmlFragment);\n }\n };\n return api;\n};\n","import { loadXML, parseXML } from './qti-transformers';\n\nexport const qtiTransformManifest = (): {\n load: (uri: string) => Promise<typeof api>;\n assessmentTest: () => { href: string; identifier: string };\n} => {\n let xmlFragment: XMLDocument;\n\n const api = {\n async load(uri) {\n return new Promise<typeof api>(resolve => {\n loadXML(uri).then(xml => {\n xmlFragment = xml;\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n },\n assessmentTest() {\n const el = xmlFragment.querySelector('resource[type=\"imsqti_test_xmlv3p0\"]');\n return { href: el.getAttribute('href'), identifier: el.getAttribute('identifier') };\n }\n };\n return api;\n};\n","/**\n * Returns an object with methods to load, parse and transform QTI tests.\n * @returns An object with methods to load, parse and transform QTI tests.\n * @example\n * const qtiTransformer = qtiTransformTest();\n * await qtiTransformer.load('https://example.com/test.xml');\n * const items = qtiTransformer.items();\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n */\n\nimport { itemsFromTest, loadXML, parseXML, setLocation, toHTML } from './qti-transformers';\n\nexport type transformTestApi = {\n load: (uri: string) => Promise<transformTestApi>;\n parse: (xmlString: string) => transformTestApi;\n path: (location: string) => transformTestApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;\n items: () => { identifier: string; href: string; category: string }[];\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformTest = (): transformTestApi => {\n let xmlFragment: XMLDocument;\n\n const api: transformTestApi = {\n async load(uri) {\n return new Promise<transformTestApi>((resolve, _) => {\n loadXML(uri).then(xml => {\n xmlFragment = xml;\n\n api.path(uri.substring(0, uri.lastIndexOf('/')));\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n path: (location: string): typeof api => {\n setLocation(xmlFragment, location);\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void) {\n fn(xmlFragment);\n return api;\n },\n items() {\n return itemsFromTest(xmlFragment);\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment;\n }\n };\n return api;\n};\n","import { QtiAssessmentItem } from '../qti-components';\nimport { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\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 qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n"],"mappings":";AAAA,IAAM,MAAM,OAAO;AAenB,IAAM,YAAY;AAAA;AAAA;AAAA;A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":["import { QtiAssessmentItem } from '../qti-components';\nimport { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\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 qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n"],"mappings":";;;;;;;;AAoBO,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,YACjC,iBAAiB,EACd,KAAK,OAAO,EACZ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;","names":[]}
@@ -3,11 +3,9 @@ export { TestNext } from './test-next.js';
3
3
  export { TestPrev } from './test-prev.js';
4
4
  export { TestView } from './test-view.js';
5
5
  export { TestItemLink } from './test-item-link.js';
6
- export { TestContainer } from './test-container.js';
7
6
  export { TestPagingButtonsStamp } from './test-paging-buttons-stamp.js';
8
7
  import 'lit';
9
- import '../../test-base-BJwG9Ie8.js';
10
- import '../qti-assessment-test/qti-test-part.js';
8
+ import '../../test.context-DbSTxKk_.js';
11
9
  import 'lit-html';
12
10
  import '../../qti-simple-choice-DxWcdKHi.js';
13
11
  import 'lit-html/directives/ref.js';