@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
@@ -1,230 +1,103 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
10
- };
11
-
12
- // src/lib/qti-test/qti-test.ts
13
- import { html } from "lit";
14
- import { customElement } from "lit/decorators.js";
1
+ import {
2
+ item_default
3
+ } from "./chunk-2CHF3TMY.js";
4
+ import {
5
+ qtiTransformItem,
6
+ qtiTransformTest
7
+ } from "./chunk-2OA7E3E7.js";
8
+ import {
9
+ testContext,
10
+ testElement
11
+ } from "./chunk-F3NTI6TX.js";
12
+ import {
13
+ watch
14
+ } from "./chunk-4YG2FPKK.js";
15
+ import {
16
+ __decorateClass
17
+ } from "./chunk-44VE5POH.js";
15
18
 
16
- // src/lib/qti-transformers/qti-transformers.ts
17
- var xml = String.raw;
18
- var xmlToHTML = xml`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
19
- <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
20
- <xsl:template match="@*|node()">
21
- <xsl:copy>
22
- <xsl:apply-templates select="@*|node()"/>
23
- </xsl:copy>
24
- </xsl:template>
25
-
26
- <!-- remove existing namespaces -->
27
- <xsl:template match="*">
28
- <!-- remove element prefix -->
29
- <xsl:element name="{local-name()}">
30
- <!-- process attributes -->
31
- <xsl:for-each select="@*">
32
- <!-- remove attribute prefix -->
33
- <xsl:attribute name="{local-name()}">
34
- <xsl:value-of select="."/>
35
- </xsl:attribute>
36
- </xsl:for-each>
37
- <xsl:apply-templates/>
38
- </xsl:element>
39
- </xsl:template>
40
- </xsl:stylesheet>`;
41
- function extendElementName(xmlFragment, tagName, extension) {
42
- xmlFragment.querySelectorAll(tagName).forEach((element) => {
43
- const newTagName = `${tagName}-${extension}`;
44
- const newElement = createElementWithNewTagName(element, newTagName);
45
- element.replaceWith(newElement);
46
- });
47
- }
48
- function extendElementsWithClass(xmlFragment, classNamePattern) {
49
- xmlFragment.querySelectorAll("*").forEach((element) => {
50
- const classList = element.classList;
51
- if (classList) {
52
- classList.forEach((className) => {
53
- if (className.startsWith(`${classNamePattern}:`)) {
54
- const suffix = className.slice(`${classNamePattern}:`.length);
55
- const newTagName = `${element.nodeName}-${suffix}`;
56
- const newElement = createElementWithNewTagName(element, newTagName);
57
- element.replaceWith(newElement);
58
- }
59
- });
60
- }
61
- });
62
- }
63
- function createElementWithNewTagName(element, newTagName) {
64
- const newElement = document.createElement(newTagName);
65
- for (const attr of element.attributes) {
66
- newElement.setAttribute(attr.name, attr.value);
67
- }
68
- while (element.firstChild) {
69
- newElement.appendChild(element.firstChild);
70
- }
71
- return newElement;
72
- }
73
- var currentRequest = null;
74
- function loadXML(url, cancelPreviousRequest = false) {
75
- if (cancelPreviousRequest && currentRequest !== null) {
76
- currentRequest.abort();
77
- }
78
- return new Promise((resolve, reject) => {
79
- const xhr = new XMLHttpRequest();
80
- currentRequest = xhr;
81
- xhr.open("GET", url, true);
82
- xhr.responseType = "document";
83
- xhr.onload = () => {
84
- if (xhr.status >= 200 && xhr.status < 300) {
85
- resolve(xhr.responseXML);
86
- } else {
87
- reject(xhr.statusText);
88
- }
89
- };
90
- xhr.onerror = () => {
91
- reject(xhr.statusText);
92
- };
93
- xhr.send();
94
- });
95
- }
96
- function parseXML(xmlDocument) {
97
- const parser = new DOMParser();
98
- const xmlFragment = parser.parseFromString(xmlDocument, "text/xml");
99
- return xmlFragment;
100
- }
101
- function toHTML(xmlFragment) {
102
- const processor = new XSLTProcessor();
103
- const xsltDocument = new DOMParser().parseFromString(xmlToHTML, "text/xml");
104
- processor.importStylesheet(xsltDocument);
105
- const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);
106
- return itemHTMLFragment;
107
- }
108
- function setLocation(xmlFragment, location) {
109
- if (!location.endsWith("/")) {
110
- location += "/";
19
+ // src/lib/qti-test/core/components/test-container.ts
20
+ import { LitElement, html } from "lit";
21
+ import { customElement, property, state } from "lit/decorators.js";
22
+ import { until } from "lit/directives/until.js";
23
+ var TestContainer = class extends LitElement {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.testURL = null;
27
+ this.testDoc = null;
28
+ this.testXML = null;
29
+ /** Template content if provided */
30
+ this.templateContent = null;
111
31
  }
112
- xmlFragment.querySelectorAll("[src],[href],[primary-path]").forEach((elWithSrc) => {
113
- let attr = "";
114
- if (elWithSrc.getAttribute("src")) {
115
- attr = "src";
116
- }
117
- if (elWithSrc.getAttribute("href")) {
118
- attr = "href";
32
+ async handleTestURLChange() {
33
+ if (!this.testURL) return;
34
+ try {
35
+ const api = await qtiTransformTest().load(this.testURL);
36
+ this.testDoc = api.htmlDoc();
37
+ } catch (error) {
38
+ console.error("Error loading or parsing XML:", error);
119
39
  }
120
- if (elWithSrc.getAttribute("primary-path")) {
121
- attr = "primary-path";
40
+ }
41
+ handleTestXMLChange() {
42
+ if (!this.testXML) return;
43
+ try {
44
+ this.testDoc = qtiTransformTest().parse(this.testXML).htmlDoc();
45
+ } catch (error) {
46
+ console.error("Error parsing XML:", error);
122
47
  }
123
- const attrValue = elWithSrc.getAttribute(attr)?.trim();
124
- if (!attrValue.startsWith("data:") && !attrValue.startsWith("http")) {
125
- const newSrcValue = location + encodeURI(attrValue);
126
- elWithSrc.setAttribute(attr, newSrcValue);
48
+ }
49
+ async connectedCallback() {
50
+ super.connectedCallback();
51
+ this.initializeTemplateContent();
52
+ this.applyStyles();
53
+ if (this.testURL) {
54
+ this.handleTestURLChange();
127
55
  }
128
- });
129
- }
130
- function convertCDATAtoComment(xmlFragment) {
131
- const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value');
132
- cdataElements.forEach((element) => {
133
- const commentText = document.createComment(element.textContent);
134
- element.replaceChild(commentText, element.firstChild);
135
- });
136
- }
137
- function stripStyleSheets(xmlFragment) {
138
- xmlFragment.querySelectorAll("qti-stylesheet").forEach((stylesheet) => stylesheet.remove());
139
- }
140
-
141
- // src/lib/qti-transformers/qti-transform-item.ts
142
- var qtiTransformItem = () => {
143
- let xmlFragment;
144
- const api = {
145
- async load(uri, cancelPreviousRequest = false) {
146
- return new Promise((resolve) => {
147
- loadXML(uri, cancelPreviousRequest).then((xml2) => {
148
- xmlFragment = xml2;
149
- api.path(uri.substring(0, uri.lastIndexOf("/")));
150
- return resolve(api);
151
- });
152
- });
153
- },
154
- parse(xmlString) {
155
- xmlFragment = parseXML(xmlString);
156
- return api;
157
- },
158
- path: (location) => {
159
- setLocation(xmlFragment, location);
160
- return api;
161
- },
162
- fn(fn) {
163
- fn(xmlFragment);
164
- return api;
165
- },
166
- pciHooks(uri) {
167
- const attributes = ["hook", "module"];
168
- const documentPath = uri.substring(0, uri.lastIndexOf("/"));
169
- for (const attribute of attributes) {
170
- const srcAttributes = xmlFragment.querySelectorAll("[" + attribute + "]");
171
- srcAttributes.forEach((node) => {
172
- const srcValue = node.getAttribute(attribute);
173
- if (!srcValue.startsWith("data:") && !srcValue.startsWith("http")) {
174
- node.setAttribute("base-url", uri);
175
- node.setAttribute(
176
- "module",
177
- documentPath + "/" + encodeURI(srcValue + (srcValue.endsWith(".js") ? "" : ".js"))
178
- );
179
- }
180
- });
181
- }
182
- return api;
183
- },
184
- extendElementName: (tagName, extension) => {
185
- extendElementName(xmlFragment, tagName, extension);
186
- return api;
187
- },
188
- extendElementsWithClass: (param = "extend") => {
189
- extendElementsWithClass(xmlFragment, param);
190
- return api;
191
- },
192
- customInteraction(baseRef, baseItem) {
193
- const qtiCustomInteraction = xmlFragment.querySelector("qti-custom-interaction");
194
- const qtiCustomInteractionObject = qtiCustomInteraction.querySelector("object");
195
- qtiCustomInteraction.setAttribute("data-base-ref", baseRef);
196
- qtiCustomInteraction.setAttribute("data-base-item", baseRef + baseItem);
197
- qtiCustomInteraction.setAttribute("data", qtiCustomInteractionObject.getAttribute("data"));
198
- qtiCustomInteraction.setAttribute("width", qtiCustomInteractionObject.getAttribute("width"));
199
- qtiCustomInteraction.setAttribute("height", qtiCustomInteractionObject.getAttribute("height"));
200
- qtiCustomInteraction.removeChild(qtiCustomInteractionObject);
201
- return api;
202
- },
203
- convertCDATAtoComment() {
204
- convertCDATAtoComment(xmlFragment);
205
- return api;
206
- },
207
- stripStyleSheets() {
208
- stripStyleSheets(xmlFragment);
209
- return api;
210
- },
211
- html() {
212
- return new XMLSerializer().serializeToString(toHTML(xmlFragment));
213
- },
214
- xml() {
215
- return new XMLSerializer().serializeToString(xmlFragment);
216
- },
217
- htmlDoc() {
218
- return toHTML(xmlFragment);
219
- },
220
- xmlDoc() {
221
- return xmlFragment;
56
+ if (this.testXML) {
57
+ this.handleTestXMLChange();
222
58
  }
223
- };
224
- return api;
59
+ }
60
+ initializeTemplateContent() {
61
+ const template = this.querySelector("template");
62
+ this.templateContent = template ? template.content : html``;
63
+ }
64
+ applyStyles() {
65
+ const sheet = new CSSStyleSheet();
66
+ sheet.replaceSync(item_default);
67
+ this.shadowRoot.adoptedStyleSheets = [sheet];
68
+ }
69
+ render() {
70
+ return html`
71
+ ${this.templateContent}
72
+ <slot></slot>
73
+ ${until(this.testDoc, html`<span>Loading...</span>`)}
74
+ `;
75
+ }
225
76
  };
77
+ __decorateClass([
78
+ property({ type: String, attribute: "test-url" })
79
+ ], TestContainer.prototype, "testURL", 2);
80
+ __decorateClass([
81
+ state()
82
+ ], TestContainer.prototype, "testDoc", 2);
83
+ __decorateClass([
84
+ state()
85
+ ], TestContainer.prototype, "testXML", 2);
86
+ __decorateClass([
87
+ watch("testURL", { waitUntilFirstUpdate: true })
88
+ ], TestContainer.prototype, "handleTestURLChange", 1);
89
+ __decorateClass([
90
+ watch("testXML", { waitUntilFirstUpdate: true })
91
+ ], TestContainer.prototype, "handleTestXMLChange", 1);
92
+ TestContainer = __decorateClass([
93
+ customElement("test-container")
94
+ ], TestContainer);
95
+
96
+ // src/lib/qti-test/core/qti-test.ts
97
+ import { html as html2 } from "lit";
98
+ import { customElement as customElement2 } from "lit/decorators.js";
226
99
 
227
- // src/lib/qti-test/mixins/test-loader.mixin.ts
100
+ // src/lib/qti-test/core/mixins/test-loader.mixin.ts
228
101
  var TestLoaderMixin = (superClass) => {
229
102
  class TestLoaderClass extends superClass {
230
103
  // private testURL = '';
@@ -250,7 +123,7 @@ var TestLoaderMixin = (superClass) => {
250
123
  return TestLoaderClass;
251
124
  };
252
125
 
253
- // src/lib/qti-test/mixins/test-navigation.mixin.ts
126
+ // src/lib/qti-test/core/mixins/test-navigation.mixin.ts
254
127
  var TestNavigationMixin = (superClass) => {
255
128
  class TestNavigationClass extends superClass {
256
129
  constructor(...args) {
@@ -311,7 +184,7 @@ var TestNavigationMixin = (superClass) => {
311
184
  return TestNavigationClass;
312
185
  };
313
186
 
314
- // src/lib/qti-test/mixins/test-view.mixin.ts
187
+ // src/lib/qti-test/core/mixins/test-view.mixin.ts
315
188
  var TestViewMixin = (superClass) => {
316
189
  class TestViewClass extends superClass {
317
190
  constructor(...args) {
@@ -358,18 +231,11 @@ var TestViewMixin = (superClass) => {
358
231
  return TestViewClass;
359
232
  };
360
233
 
361
- // src/lib/qti-test/test-base.ts
234
+ // src/lib/qti-test/core/test-base.ts
362
235
  import { provide } from "@lit/context";
363
- import { LitElement } from "lit";
364
- import { state } from "lit/decorators.js";
365
-
366
- // src/lib/qti-test/context/test.context.ts
367
- import { createContext } from "@lit/context";
368
- var testContext = createContext(Symbol("test"));
369
- var testElement = createContext(Symbol("testElement"));
370
-
371
- // src/lib/qti-test/test-base.ts
372
- var TestBase = class extends LitElement {
236
+ import { LitElement as LitElement2 } from "lit";
237
+ import { state as state2 } from "lit/decorators.js";
238
+ var TestBase = class extends LitElement2 {
373
239
  constructor() {
374
240
  super();
375
241
  this._testContext = { items: [], testOutcomeVariables: [] };
@@ -473,28 +339,231 @@ var TestBase = class extends LitElement {
473
339
  }
474
340
  };
475
341
  __decorateClass([
476
- state(),
342
+ state2(),
477
343
  provide({ context: testContext })
478
344
  ], TestBase.prototype, "_testContext", 2);
479
345
  __decorateClass([
480
- state(),
346
+ state2(),
481
347
  provide({ context: testElement })
482
348
  ], TestBase.prototype, "testElement", 2);
483
349
 
484
- // src/lib/qti-test/qti-test.ts
350
+ // src/lib/qti-test/core/qti-test.ts
485
351
  var QtiTest = class extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
486
352
  /**
487
353
  * Renders the component's template.
488
354
  * Provides a default `<slot>` for content projection.
489
355
  */
490
356
  render() {
491
- return html`<slot></slot>`;
357
+ return html2`<slot></slot>`;
492
358
  }
493
359
  };
494
360
  QtiTest = __decorateClass([
495
- customElement("qti-test")
361
+ customElement2("qti-test")
496
362
  ], QtiTest);
363
+
364
+ // src/lib/qti-test/core/qti-assessment-test/qti-assessment-item-ref.ts
365
+ import { consume } from "@lit/context";
366
+ import { html as html3, LitElement as LitElement3 } from "lit";
367
+ import { property as property2 } from "lit/decorators.js";
368
+ var stringToBooleanConverter = {
369
+ fromAttribute(value) {
370
+ return value === "true";
371
+ },
372
+ toAttribute(value) {
373
+ return value ? "true" : "false";
374
+ }
375
+ };
376
+ var QtiAssessmentItemRef = class extends LitElement3 {
377
+ constructor() {
378
+ super(...arguments);
379
+ this.weigths = /* @__PURE__ */ new Map();
380
+ }
381
+ // the XMLDocument
382
+ createRenderRoot() {
383
+ return this;
384
+ }
385
+ get assessmentItem() {
386
+ return this.renderRoot?.querySelector("qti-assessment-item");
387
+ }
388
+ async connectedCallback() {
389
+ super.connectedCallback();
390
+ await this.updateComplete;
391
+ this.dispatchEvent(
392
+ new CustomEvent("qti-assessment-item-ref-connected", {
393
+ bubbles: true,
394
+ composed: true,
395
+ detail: { identifier: this.identifier, href: this.href, category: this.category }
396
+ })
397
+ );
398
+ }
399
+ render() {
400
+ return html3`${this.xmlDoc}`;
401
+ }
402
+ };
403
+ __decorateClass([
404
+ property2({ type: String })
405
+ ], QtiAssessmentItemRef.prototype, "category", 2);
406
+ __decorateClass([
407
+ property2({ type: String })
408
+ ], QtiAssessmentItemRef.prototype, "identifier", 2);
409
+ __decorateClass([
410
+ property2({ type: Boolean, converter: stringToBooleanConverter })
411
+ ], QtiAssessmentItemRef.prototype, "required", 2);
412
+ __decorateClass([
413
+ property2({ type: Boolean, converter: stringToBooleanConverter })
414
+ ], QtiAssessmentItemRef.prototype, "fixed", 2);
415
+ __decorateClass([
416
+ property2({ type: String })
417
+ ], QtiAssessmentItemRef.prototype, "href", 2);
418
+ __decorateClass([
419
+ consume({ context: testContext, subscribe: true })
420
+ ], QtiAssessmentItemRef.prototype, "_testContext", 2);
421
+ __decorateClass([
422
+ property2({ type: Object, attribute: false })
423
+ ], QtiAssessmentItemRef.prototype, "xmlDoc", 2);
424
+ if (!customElements.get("qti-assessment-item-ref")) {
425
+ customElements.define("qti-assessment-item-ref", QtiAssessmentItemRef);
426
+ }
427
+
428
+ // src/lib/qti-test/core/qti-assessment-test/qti-assessment-section.ts
429
+ import { consume as consume2 } from "@lit/context";
430
+ import { html as html4, LitElement as LitElement4 } from "lit";
431
+ import { property as property3 } from "lit/decorators.js";
432
+ var stringToBooleanConverter2 = {
433
+ fromAttribute(value) {
434
+ return value === "true";
435
+ },
436
+ toAttribute(value) {
437
+ return value ? "true" : "false";
438
+ }
439
+ };
440
+ var QtiAssessmentSection = class extends LitElement4 {
441
+ async connectedCallback() {
442
+ super.connectedCallback();
443
+ await this.updateComplete;
444
+ this.dispatchEvent(
445
+ new Event("qti-assessment-section-connected", {
446
+ bubbles: true,
447
+ composed: true
448
+ })
449
+ );
450
+ }
451
+ render() {
452
+ return html4`<slot name="qti-rubric-block"></slot><slot></slot>`;
453
+ }
454
+ };
455
+ __decorateClass([
456
+ property3({ type: String })
457
+ ], QtiAssessmentSection.prototype, "identifier", 2);
458
+ __decorateClass([
459
+ property3({ type: String })
460
+ ], QtiAssessmentSection.prototype, "required", 2);
461
+ __decorateClass([
462
+ property3({ type: Boolean, converter: stringToBooleanConverter2 })
463
+ ], QtiAssessmentSection.prototype, "fixed", 2);
464
+ __decorateClass([
465
+ property3({ type: String })
466
+ ], QtiAssessmentSection.prototype, "title", 2);
467
+ __decorateClass([
468
+ property3({ type: Boolean, converter: stringToBooleanConverter2 })
469
+ ], QtiAssessmentSection.prototype, "visible", 2);
470
+ __decorateClass([
471
+ property3({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
472
+ ], QtiAssessmentSection.prototype, "keepTogether", 2);
473
+ __decorateClass([
474
+ consume2({ context: testContext, subscribe: true })
475
+ ], QtiAssessmentSection.prototype, "_testContext", 2);
476
+ if (!customElements.get("qti-assessment-section")) {
477
+ customElements.define("qti-assessment-section", QtiAssessmentSection);
478
+ }
479
+
480
+ // src/lib/qti-test/core/qti-assessment-test/qti-assessment-test.ts
481
+ import { consume as consume3 } from "@lit/context";
482
+ import { html as html5, LitElement as LitElement5 } from "lit";
483
+ import { customElement as customElement3, property as property4 } from "lit/decorators.js";
484
+ var QtiAssessmentTest = class extends LitElement5 {
485
+ async connectedCallback() {
486
+ super.connectedCallback();
487
+ await this.updateComplete;
488
+ this.dispatchEvent(
489
+ new CustomEvent("qti-assessment-test-connected", {
490
+ detail: this,
491
+ bubbles: true,
492
+ composed: true
493
+ })
494
+ );
495
+ }
496
+ render() {
497
+ return html5` <slot></slot>`;
498
+ }
499
+ };
500
+ __decorateClass([
501
+ property4({ type: String })
502
+ ], QtiAssessmentTest.prototype, "identifier", 2);
503
+ __decorateClass([
504
+ property4({ type: String })
505
+ ], QtiAssessmentTest.prototype, "title", 2);
506
+ __decorateClass([
507
+ consume3({ context: testContext, subscribe: true })
508
+ ], QtiAssessmentTest.prototype, "_testContext", 2);
509
+ QtiAssessmentTest = __decorateClass([
510
+ customElement3("qti-assessment-test")
511
+ ], QtiAssessmentTest);
512
+
513
+ // src/lib/qti-test/core/qti-assessment-test/qti-test-part.ts
514
+ import { html as html6, LitElement as LitElement6 } from "lit";
515
+ import { customElement as customElement4, property as property5 } from "lit/decorators.js";
516
+ var QtiTestPart = class extends LitElement6 {
517
+ constructor() {
518
+ super(...arguments);
519
+ this.identifier = "";
520
+ this.title = "";
521
+ this.class = "";
522
+ this.NavigationMode = "nonlinear";
523
+ this.submissionMode = "individual";
524
+ }
525
+ async connectedCallback() {
526
+ super.connectedCallback();
527
+ await this.updateComplete;
528
+ this.dispatchEvent(
529
+ new Event("qti-test-part-connected", {
530
+ bubbles: true,
531
+ composed: true
532
+ })
533
+ );
534
+ }
535
+ render() {
536
+ return html6` <slot></slot>`;
537
+ }
538
+ };
539
+ __decorateClass([
540
+ property5({ type: String })
541
+ ], QtiTestPart.prototype, "identifier", 2);
542
+ __decorateClass([
543
+ property5({ type: String })
544
+ ], QtiTestPart.prototype, "title", 2);
545
+ __decorateClass([
546
+ property5({ type: String })
547
+ ], QtiTestPart.prototype, "class", 2);
548
+ __decorateClass([
549
+ property5({ type: String, attribute: "navigation-mode" })
550
+ ], QtiTestPart.prototype, "NavigationMode", 2);
551
+ __decorateClass([
552
+ property5({ type: String, attribute: "submission-mode" })
553
+ ], QtiTestPart.prototype, "submissionMode", 2);
554
+ QtiTestPart = __decorateClass([
555
+ customElement4("qti-test-part")
556
+ ], QtiTestPart);
557
+ if (!customElements.get("qti-test-part")) {
558
+ customElements.define("qti-test-part", QtiTestPart);
559
+ }
560
+
497
561
  export {
498
- QtiTest
562
+ TestContainer,
563
+ QtiTest,
564
+ QtiAssessmentItemRef,
565
+ QtiAssessmentSection,
566
+ QtiAssessmentTest,
567
+ QtiTestPart
499
568
  };
500
- //# sourceMappingURL=qti-test.js.map
569
+ //# sourceMappingURL=chunk-CNQYM52B.js.map