@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,73 +0,0 @@
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-assessment-test/qti-assessment-section.ts
13
- import { consume } from "@lit/context";
14
- import { html, LitElement } from "lit";
15
- import { property } from "lit/decorators.js";
16
-
17
- // src/lib/qti-test/context/test.context.ts
18
- import { createContext } from "@lit/context";
19
- var testContext = createContext(Symbol("test"));
20
- var testElement = createContext(Symbol("testElement"));
21
-
22
- // src/lib/qti-test/qti-assessment-test/qti-assessment-section.ts
23
- var stringToBooleanConverter = {
24
- fromAttribute(value) {
25
- return value === "true";
26
- },
27
- toAttribute(value) {
28
- return value ? "true" : "false";
29
- }
30
- };
31
- var QtiAssessmentSection = class extends LitElement {
32
- async connectedCallback() {
33
- super.connectedCallback();
34
- await this.updateComplete;
35
- this.dispatchEvent(
36
- new Event("qti-assessment-section-connected", {
37
- bubbles: true,
38
- composed: true
39
- })
40
- );
41
- }
42
- render() {
43
- return html`<slot name="qti-rubric-block"></slot><slot></slot>`;
44
- }
45
- };
46
- __decorateClass([
47
- property({ type: String })
48
- ], QtiAssessmentSection.prototype, "identifier", 2);
49
- __decorateClass([
50
- property({ type: String })
51
- ], QtiAssessmentSection.prototype, "required", 2);
52
- __decorateClass([
53
- property({ type: Boolean, converter: stringToBooleanConverter })
54
- ], QtiAssessmentSection.prototype, "fixed", 2);
55
- __decorateClass([
56
- property({ type: String })
57
- ], QtiAssessmentSection.prototype, "title", 2);
58
- __decorateClass([
59
- property({ type: Boolean, converter: stringToBooleanConverter })
60
- ], QtiAssessmentSection.prototype, "visible", 2);
61
- __decorateClass([
62
- property({ type: Boolean, converter: stringToBooleanConverter, attribute: "keep-together" })
63
- ], QtiAssessmentSection.prototype, "keepTogether", 2);
64
- __decorateClass([
65
- consume({ context: testContext, subscribe: true })
66
- ], QtiAssessmentSection.prototype, "_testContext", 2);
67
- if (!customElements.get("qti-assessment-section")) {
68
- customElements.define("qti-assessment-section", QtiAssessmentSection);
69
- }
70
- export {
71
- QtiAssessmentSection
72
- };
73
- //# sourceMappingURL=qti-assessment-section.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/qti-test/qti-assessment-test/qti-assessment-section.ts","../../../src/lib/qti-test/context/test.context.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\n\n// https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection\n\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\nexport class QtiAssessmentSection extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) required: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed: boolean;\n @property({ type: String }) title: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) visible: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' }) keepTogether: boolean;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-assessment-section-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-assessment-section')) {\n customElements.define('qti-assessment-section', QtiAssessmentSection);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-section': QtiAssessmentSection;\n }\n}\n","import { createContext } from '@lit/context';\nimport { QtiAssessmentTest } from '../qti-assessment-test';\nimport { ItemContext, VariableDeclaration } from '../../qti-components';\nimport { View } from '../mixins/test-view.mixin';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[]>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = {\n el: QtiAssessmentTest;\n};\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,kBAAkB;AACjC,SAAS,gBAAgB;;;ACFzB,SAAS,qBAAqB;AAgBvB,IAAM,cAAc,cAAqC,OAAO,MAAM,CAAC;AAMvE,IAAM,cAAc,cAAqC,OAAO,aAAa,CAAC;;;ADfrF,IAAM,2BAA2B;AAAA,EAC/B,cAAc,OAAwB;AACpC,WAAO,UAAU;AAAA,EACnB;AAAA,EACA,YAAY,OAAwB;AAClC,WAAO,QAAQ,SAAS;AAAA,EAC1B;AACF;AAEO,IAAM,uBAAN,cAAmC,WAAW;AAAA,EAWnD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,MAAM,oCAAoC;AAAA,QAC5C,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAxB8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,qBACiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,qBAEiB;AACsC;AAAA,EAAjE,SAAS,EAAE,MAAM,SAAS,WAAW,yBAAyB,CAAC;AAAA,GAHrD,qBAGuD;AACtC;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAJf,qBAIiB;AACsC;AAAA,EAAjE,SAAS,EAAE,MAAM,SAAS,WAAW,yBAAyB,CAAC;AAAA,GALrD,qBAKuD;AAC4B;AAAA,EAA7F,SAAS,EAAE,MAAM,SAAS,WAAW,0BAA0B,WAAW,gBAAgB,CAAC;AAAA,GANjF,qBAMmF;AAGvF;AAAA,EADN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GARvC,qBASJ;AAkBT,IAAI,CAAC,eAAe,IAAI,wBAAwB,GAAG;AACjD,iBAAe,OAAO,0BAA0B,oBAAoB;AACtE;","names":[]}
@@ -1,6 +0,0 @@
1
- import 'lit-html';
2
- import 'lit';
3
- export { b as QtiAssessmentTest } from '../../test-base-BJwG9Ie8.js';
4
- import './qti-test-part.js';
5
- import '../../qti-simple-choice-DxWcdKHi.js';
6
- import 'lit-html/directives/ref.js';
@@ -1,54 +0,0 @@
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-assessment-test/qti-assessment-test.ts
13
- import { consume } from "@lit/context";
14
- import { html, LitElement } from "lit";
15
- import { customElement, property } from "lit/decorators.js";
16
-
17
- // src/lib/qti-test/context/test.context.ts
18
- import { createContext } from "@lit/context";
19
- var testContext = createContext(Symbol("test"));
20
- var testElement = createContext(Symbol("testElement"));
21
-
22
- // src/lib/qti-test/qti-assessment-test/qti-assessment-test.ts
23
- var QtiAssessmentTest = class extends LitElement {
24
- async connectedCallback() {
25
- super.connectedCallback();
26
- await this.updateComplete;
27
- this.dispatchEvent(
28
- new CustomEvent("qti-assessment-test-connected", {
29
- detail: this,
30
- bubbles: true,
31
- composed: true
32
- })
33
- );
34
- }
35
- render() {
36
- return html` <slot></slot>`;
37
- }
38
- };
39
- __decorateClass([
40
- property({ type: String })
41
- ], QtiAssessmentTest.prototype, "identifier", 2);
42
- __decorateClass([
43
- property({ type: String })
44
- ], QtiAssessmentTest.prototype, "title", 2);
45
- __decorateClass([
46
- consume({ context: testContext, subscribe: true })
47
- ], QtiAssessmentTest.prototype, "_testContext", 2);
48
- QtiAssessmentTest = __decorateClass([
49
- customElement("qti-assessment-test")
50
- ], QtiAssessmentTest);
51
- export {
52
- QtiAssessmentTest
53
- };
54
- //# sourceMappingURL=qti-assessment-test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/qti-test/qti-assessment-test/qti-assessment-test.ts","../../../src/lib/qti-test/context/test.context.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\n\n@customElement('qti-assessment-test')\nexport class QtiAssessmentTest extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) title: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-test-connected', {\n detail: this,\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-test': QtiAssessmentTest;\n }\n}\n","import { createContext } from '@lit/context';\nimport { QtiAssessmentTest } from '../qti-assessment-test';\nimport { ItemContext, VariableDeclaration } from '../../qti-components';\nimport { View } from '../mixins/test-view.mixin';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[]>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = {\n el: QtiAssessmentTest;\n};\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,gBAAgB;;;ACFxC,SAAS,qBAAqB;AAgBvB,IAAM,cAAc,cAAqC,OAAO,MAAM,CAAC;AAMvE,IAAM,cAAc,cAAqC,OAAO,aAAa,CAAC;;;ADhB9E,IAAM,oBAAN,cAAgC,WAAW;AAAA,EAOhD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,YAAY,iCAAiC;AAAA,QAC/C,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AArB8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,kBACiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,kBAEiB;AAGrB;AAAA,EADN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAJvC,kBAKJ;AALI,oBAAN;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB;","names":[]}
@@ -1,19 +0,0 @@
1
- import * as lit_html from 'lit-html';
2
- import { LitElement } from 'lit';
3
-
4
- declare class QtiTestPart extends LitElement {
5
- identifier: string;
6
- title: string;
7
- class: string;
8
- NavigationMode: 'linear' | 'nonlinear';
9
- submissionMode: 'individual' | 'simultaneous';
10
- connectedCallback(): Promise<void>;
11
- render(): lit_html.TemplateResult<1>;
12
- }
13
- declare global {
14
- interface HTMLElementTagNameMap {
15
- 'qti-test-part': QtiTestPart;
16
- }
17
- }
18
-
19
- export { QtiTestPart };
@@ -1,62 +0,0 @@
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-assessment-test/qti-test-part.ts
13
- import { html, LitElement } from "lit";
14
- import { customElement, property } from "lit/decorators.js";
15
- var QtiTestPart = class extends LitElement {
16
- constructor() {
17
- super(...arguments);
18
- this.identifier = "";
19
- this.title = "";
20
- this.class = "";
21
- this.NavigationMode = "nonlinear";
22
- this.submissionMode = "individual";
23
- }
24
- async connectedCallback() {
25
- super.connectedCallback();
26
- await this.updateComplete;
27
- this.dispatchEvent(
28
- new Event("qti-test-part-connected", {
29
- bubbles: true,
30
- composed: true
31
- })
32
- );
33
- }
34
- render() {
35
- return html` <slot></slot>`;
36
- }
37
- };
38
- __decorateClass([
39
- property({ type: String })
40
- ], QtiTestPart.prototype, "identifier", 2);
41
- __decorateClass([
42
- property({ type: String })
43
- ], QtiTestPart.prototype, "title", 2);
44
- __decorateClass([
45
- property({ type: String })
46
- ], QtiTestPart.prototype, "class", 2);
47
- __decorateClass([
48
- property({ type: String, attribute: "navigation-mode" })
49
- ], QtiTestPart.prototype, "NavigationMode", 2);
50
- __decorateClass([
51
- property({ type: String, attribute: "submission-mode" })
52
- ], QtiTestPart.prototype, "submissionMode", 2);
53
- QtiTestPart = __decorateClass([
54
- customElement("qti-test-part")
55
- ], QtiTestPart);
56
- if (!customElements.get("qti-test-part")) {
57
- customElements.define("qti-test-part", QtiTestPart);
58
- }
59
- export {
60
- QtiTestPart
61
- };
62
- //# sourceMappingURL=qti-test-part.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/qti-test/qti-assessment-test/qti-test-part.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n@customElement('qti-test-part')\nexport class QtiTestPart extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) title: string = '';\n @property({ type: String }) class: string = '';\n\n @property({ type: String, attribute: 'navigation-mode' })\n NavigationMode: 'linear' | 'nonlinear' = 'nonlinear';\n\n @property({ type: String, attribute: 'submission-mode' })\n submissionMode: 'individual' | 'simultaneous' = 'individual';\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-test-part-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-test-part')) {\n customElements.define('qti-test-part', QtiTestPart);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-part': QtiTestPart;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,gBAAgB;AAEjC,IAAM,cAAN,cAA0B,WAAW;AAAA,EAArC;AAAA;AACuB,sBAAqB;AACrB,iBAAgB;AAChB,iBAAgB;AAG5C,0BAAyC;AAGzC,0BAAgD;AAAA;AAAA,EAEhD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,MAAM,2BAA2B;AAAA,QACnC,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAxB8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,YACiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,YAEiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAHf,YAGiB;AAG5B;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAL7C,YAMX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAR7C,YASX;AATW,cAAN;AAAA,EADN,cAAc,eAAe;AAAA,GACjB;AA2Bb,IAAI,CAAC,eAAe,IAAI,eAAe,GAAG;AACxC,iBAAe,OAAO,iBAAiB,WAAW;AACpD;","names":[]}
@@ -1,68 +0,0 @@
1
- import * as lit_html from 'lit-html';
2
- import { f as TestBase } from '../test-base-BJwG9Ie8.js';
3
- import './qti-assessment-test/qti-test-part.js';
4
- import 'lit';
5
- import '../qti-simple-choice-DxWcdKHi.js';
6
- import 'lit-html/directives/ref.js';
7
-
8
- declare const QtiTest_base: (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {}) & (abstract new (...args: any[]) => {}) & typeof TestBase;
9
- /**
10
- * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
11
- *
12
- * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.
13
- *
14
- * ### Example Usage
15
- *
16
- * Minimal example including navigation:
17
- *
18
- * ```html
19
- * <qti-test>
20
- * <test-container test-url="./path/to/assessment.xml"></test-container>
21
- * <nav class="flex">
22
- * <test-prev></test-prev>
23
- * <test-next></test-next>
24
- * </nav>
25
- * </qti-test>
26
- * ```
27
- *
28
- * Use the following file structure
29
- * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.
30
- *
31
- * ```plaintext
32
- * Root/
33
- * ├── index.html
34
- * └── /assets/api/examples/
35
- * ├── assessmenttest.xml
36
- * └── imsmanifest.xml
37
- *
38
- * ```
39
- *
40
- * ### Test components
41
- *
42
- * Use test components inside the qti-test component for added functionality.
43
- * ### Test next
44
- * `<test-next> | TestNext`
45
- *
46
- * ### Test prev
47
- *
48
- * `<test-prev> | TestPrev`
49
- * ### Test components
50
- *
51
- * You can use normal class names to style the elements.
52
- * And you can use the `test-prev` and `test-next` elements to navigate through the test.
53
- *
54
- */
55
- declare class QtiTest extends QtiTest_base {
56
- /**
57
- * Renders the component's template.
58
- * Provides a default `<slot>` for content projection.
59
- */
60
- render(): lit_html.TemplateResult<1>;
61
- }
62
- declare global {
63
- interface HTMLElementTagNameMap {
64
- 'qti-test': QtiTest;
65
- }
66
- }
67
-
68
- export { QtiTest };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/qti-test.ts","../../src/lib/qti-transformers/qti-transformers.ts","../../src/lib/qti-transformers/qti-transform-item.ts","../../src/lib/qti-test/mixins/test-loader.mixin.ts","../../src/lib/qti-test/mixins/test-navigation.mixin.ts","../../src/lib/qti-test/mixins/test-view.mixin.ts","../../src/lib/qti-test/test-base.ts","../../src/lib/qti-test/context/test.context.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestLoaderMixin, TestNavigationMixin, TestViewMixin } from './mixins';\nimport { TestBase } from './test-base';\n\n/**\n * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n *\n * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n *\n * ### Example Usage\n *\n * Minimal example including navigation:\n *\n * ```html\n * <qti-test>\n * <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n * <nav class=\"flex\">\n * <test-prev></test-prev>\n * <test-next></test-next>\n * </nav>\n * </qti-test>\n * ```\n *\n * Use the following file structure\n * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n *\n * ```plaintext\n * Root/\n * ├── index.html\n * └── /assets/api/examples/\n * ├── assessmenttest.xml\n * └── imsmanifest.xml\n *\n * ```\n *\n * ### Test components\n *\n * Use test components inside the qti-test component for added functionality.\n * ### Test next\n * `<test-next> | TestNext`\n *\n * ### Test prev\n *\n * `<test-prev> | TestPrev`\n * ### Test components\n *\n * You can use normal class names to style the elements.\n * And you can use the `test-prev` and `test-next` elements to navigate through the test.\n *\n */\n@customElement('qti-test')\nexport class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {\n /**\n * Renders the component's template.\n * Provides a default `<slot>` for content projection.\n */\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test': QtiTest;\n }\n}\n","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 { LitElement } from 'lit';\nimport { qtiTransformItem } from '../../qti-transformers';\n\n// const setSessionData = <T>(key: string, value?: T): void => sessionStorage.setItem(key, JSON.stringify(value));\n// const getSessionData = <T>(key: string): T | null => (sessionStorage.getItem(key) ? JSON.parse(sessionStorage.getItem(key)!) : null);\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestLoaderInterface {}\nexport const TestLoaderMixin = <T extends Constructor<LitElement>>(superClass: T) => {\n abstract class TestLoaderClass extends superClass {\n // private testURL = '';\n\n constructor(...args: any[]) {\n super(...args);\n\n // this.addEventListener('qti-load-test-request', (e: CustomEvent /* 1. Request the test */) => {\n // const { testURL } = e.detail;\n // if (!testURL) {\n // console.warn(\n // 'No test found, there should be an attribute test-url with the path to the test on the test-container'\n // );\n // } else {\n // this.testURL = testURL;\n // }\n\n // e.detail.promise = (async () => {\n // e.preventDefault(); /* indicates that the event was catched and handled */\n // const api = await qtiTransformTest().load(`${this.testURL}`); /* 6. load the item */\n // return api.htmlDoc(); /* 3. Return html version of the assessment.xml */\n // })();\n // });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n // this.context = getSessionData(`testcontext-${this.testURL}`); /* 4. Set the context */\n });\n\n this.addEventListener('qti-load-item-request' /* 5. Request the item */, ({ detail }: CustomEvent) => {\n // if (!this.testURL) return;\n detail.promise = (async () => {\n const api = await qtiTransformItem().load(\n `${detail.href}`,\n detail.cancelPreviousRequest\n ); /* 6. load the item */\n return api.htmlDoc(); /* 7. Return HTML version of the item.xml */\n })();\n });\n\n this.addEventListener('qti-interaction-changed', _e => {\n /* 8. Interaction changed */\n // const scoreOutcomeIdentifier = qtiAssessmentItem.variables.find(v => v.identifier === 'SCORE') as OutcomeVariable;\n // if (scoreOutcomeIdentifier.externalScored === null && qtiAssessmentItem.adaptive === 'false') {\n // qtiAssessmentItem.processResponse(); /* 9. Process the response */\n // }\n // setSessionData(`testcontext-${this.testURL}`, this.context); /* 10. Update the context */\n });\n\n this.addEventListener('qti-outcome-changed', () => {\n // setSessionData(`testcontext-${this.testURL}`, this.context); /* 10. Update the context */\n });\n }\n }\n\n return TestLoaderClass as Constructor<TestLoaderInterface> & T;\n};\n","import { QtiAssessmentItemRef } from '../qti-assessment-test';\nimport { TestBase } from '../test-base';\n\ndeclare module '../context/test.context' {\n interface TestContext {\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestNavigationInterface {}\nexport const TestNavigationMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n\n // this.addEventListener('qti-request-test-part', (e: CustomEvent) => {\n // this._clearLoadedItems();\n // });\n\n // Load all items of a section\n // this.addEventListener('qti-request-test-section', ({ detail: navSectionId }: CustomEvent<string>) => {\n // this._clearLoadedItems();\n\n // const sectionRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n // `qti-assessment-section[identifier=\"${navSectionId}\"]`\n // );\n\n // const itemRefEls = this.testElement.el.querySelectorAll(\n // `qti-assessment-section[identifier=\"${navSectionId}\"] > qti-assessment-item-ref`\n // );\n\n // const navPartId = sectionRefEl.closest('qti-test-part').identifier;\n\n // this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId: null };\n\n // const items = Array.from(itemRefEls).map((itemRef: QtiAssessmentItemRef) => {\n // return { identifier: itemRef.identifier, href: itemRef.href, element: itemRef };\n // });\n\n // const promises = items.map((item, index) => {\n // return new Promise((resolve, reject) => {\n // return this._loadItemRequest(item.href, false)\n // .then(doc => (item.element.xmlDoc = doc))\n // .then(() => resolve(item))\n // .catch(error => console.error('Failed to load item:', error));\n // });\n // });\n\n // Promise.all(promises)\n // .then(results => {\n // requestAnimationFrame(() =>\n // this.dispatchEvent(new CustomEvent('qti-test-connected', { detail: results, bubbles: true, composed: true }))\n // );\n // })\n // .catch(error => console.error('One or more promises failed:', error));\n // });\n\n // load an item\n this.addEventListener('qti-request-test-item', ({ detail: navItemId }: CustomEvent<string>) => {\n if (!navItemId) return;\n this._clearLoadedItems();\n\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${navItemId}\"]`\n );\n\n const promise = this._loadItemRequest(itemRefEl.href, false);\n\n const navPartId = itemRefEl.closest('qti-test-part').identifier;\n const navSectionId = itemRefEl.closest('qti-assessment-section').identifier;\n this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };\n\n if (promise) {\n promise\n .then(doc => {\n itemRefEl.xmlDoc = doc;\n requestAnimationFrame(() =>\n this.dispatchEvent(new CustomEvent('qti-item-connected', { bubbles: true, composed: true }))\n );\n this._testContext = { ...this._testContext, navItemLoading: false };\n })\n .catch(error => console.error('Failed to load item:', error));\n } else {\n console.info('Load item request was not handled:', itemRefEl.href);\n }\n });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n let navItemId = this._testContext.navItemId;\n if (!navItemId) {\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref');\n navItemId = itemRefEl.identifier;\n }\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', { detail: navItemId, bubbles: true, composed: true })\n );\n });\n }\n\n private _clearLoadedItems(): void {\n const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);\n Array.from(itemRefEls).forEach((itemElement: QtiAssessmentItemRef) => {\n itemElement.xmlDoc = null;\n });\n }\n\n private _loadItemRequest(href: string, cancelPreviousRequest: boolean = true): Promise<DocumentFragment> {\n const event = new CustomEvent('qti-load-item-request', {\n bubbles: true,\n composed: true,\n detail: {\n href: href,\n promise: null,\n cancelPreviousRequest\n }\n });\n this.dispatchEvent(event);\n\n return event.detail.promise;\n }\n }\n\n return TestNavigationClass as Constructor<TestNavigationInterface> & T;\n};\n","import { QtiAssessmentItem } from '../../qti-components';\nimport { TestBase } from '../test-base';\n\nexport type View = 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor' | '';\n\ndeclare module '../context' {\n interface TestContext {\n view?: View;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestViewInterface {}\n\nexport const TestViewMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestViewClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n this._testContext = { ...this._testContext, view: 'candidate' };\n\n this.addEventListener('on-test-switch-view', (e: CustomEvent<View>) => {\n this._testContext = { ...this._testContext, view: e.detail };\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-test-connected', () => {\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent) => {\n this._updateElementView();\n this._setCorrectResponseVisibility(e.detail);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n // if (previousContext && previousContext.view !== this._testContext.view) {\n this._updateElementView();\n // }\n }\n }\n\n // Method to handle view updates for elements based on the current context view\n private _updateElementView() {\n if (this.testElement && this.testElement.el) {\n const viewElements = Array.from(this.testElement.el.querySelectorAll('[view]'));\n\n viewElements.forEach((element: HTMLElement) => {\n element.classList.toggle('show', element.getAttribute('view') === this._testContext.view);\n });\n\n const assessmentItem = this.testElement.el.querySelector<QtiAssessmentItem>(\n `qti-assessment-item[identifier=\"${this._testContext.navItemId}\"]`\n );\n if (assessmentItem) {\n assessmentItem.showCorrectResponse(this._testContext.view === 'scorer');\n }\n }\n }\n\n // Event handler for connected QTI assessment items\n private _setCorrectResponseVisibility(assessmentItem: QtiAssessmentItem): void {\n assessmentItem.showCorrectResponse(this._testContext.view === 'scorer');\n }\n }\n\n return TestViewClass as Constructor<TestViewInterface> & T;\n};\n","import { provide } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { TestContext, testContext, TestElement, testElement } from './context';\nimport { QtiAssessmentTest } from './qti-assessment-test';\nimport { ItemContext, QtiAssessmentItem, VariableValue } from '../qti-components';\n\nexport abstract class TestBase extends LitElement {\n @state()\n @provide({ context: testContext })\n protected _testContext: Readonly<TestContext> = { items: [], testOutcomeVariables: [] };\n\n @state()\n @provide({ context: testElement })\n protected testElement: TestElement = { el: null };\n\n constructor() {\n super();\n\n this.addEventListener('qti-assessment-test-connected', (e: CustomEvent<QtiAssessmentTest>) => {\n const qtiAssessmentTest = e.detail;\n\n const items = Array.from(qtiAssessmentTest.querySelectorAll('qti-assessment-item-ref')).map(\n (itemRef): ItemContext & { category: string } => ({\n href: itemRef.href,\n identifier: itemRef.identifier,\n category: itemRef.category,\n variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n })\n );\n this.testElement = { el: qtiAssessmentTest };\n this._testContext = { ...this._testContext, items };\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent<QtiAssessmentItem>) => {\n this._updateItemInTestContext(e.detail);\n });\n this.addEventListener('qti-outcome-changed', e => {\n const assessmentitem = e.composedPath()[0] as QtiAssessmentItem;\n this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);\n });\n\n // this.addEventListener(\n // 'qti-assessment-item-ref-connected',\n // (e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }) => {\n // this._addItemToTestContext(e);\n // }\n // );\n }\n\n get context(): TestContext {\n return this._testContext;\n }\n\n // /* restores the context by updating existing items and adding new items from the \"contextToRestore\" parameter into the \"this._context.items\" array. */\n set context(testContext: TestContext) {\n if (testContext === null || testContext === undefined) return;\n this._testContext = { ...testContext }; // Clone the context to avoid modifying the original object\n // // append the items that are not yet in the context and replace the ones that are\n testContext.items?.forEach(itemContext => {\n const existingItemContext = this._testContext.items.find(i => i.identifier === itemContext.identifier);\n if (existingItemContext) {\n existingItemContext.variables = itemContext.variables;\n } else {\n this._testContext.items.push(itemContext);\n }\n });\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: VariableValue<string | string[] | null>[]\n ): void {\n // Update the test context with modified variables for the specified item\n this._testContext = {\n ...this._testContext, // Spread existing test context properties\n items: this._testContext.items.map(itemContext => {\n // If the item identifier doesn't match, keep it unchanged\n if (itemContext.identifier !== identifier) {\n return itemContext;\n }\n\n // Update the matching item with new variables\n return {\n ...itemContext, // Keep other properties of the item context\n variables: variables.map(variable => {\n // Find a matching variable in the current item context\n const matchingVariable = itemContext.variables.find(v => v.identifier === variable.identifier);\n\n // Merge matching variable with the new one, or use the new variable if no match\n return matchingVariable ? { ...matchingVariable, ...variable } : variable;\n })\n };\n })\n };\n }\n\n /**\n * Updates the variables of an assessment item in the test context.\n * - Matches the assessment item with the corresponding test context item.\n * - If the item is not found, logs a warning.\n * - Updates variables in the test context if exactly one variable exists.\n * - Otherwise, syncs the assessment item's variables with the test context.\n *\n * @param assessmentItem - The assessment item to update.\n */\n private _updateItemInTestContext = (assessmentItem: QtiAssessmentItem): void => {\n const { identifier, variables } = assessmentItem;\n\n // console.log(this._testContext);\n\n // Find the corresponding item in the test context by identifier\n const itemContext = this._testContext.items.find(i => i?.identifier === identifier);\n\n if (!itemContext) {\n console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);\n return;\n }\n\n // Update variables in the test context or sync them to the assessment item\n if (itemContext.variables?.length === 1) {\n // The loaded qti-assessment-item itself has variables which are not in test context yet.\n this._updateItemVariablesInTestContext(identifier, variables);\n } else {\n // Sync the assessment item's variables with the test context\n assessmentItem.variables = [...(itemContext.variables || [])];\n }\n };\n\n // private _addItemToTestContext(\n // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }\n // ): void {\n // const { href, identifier, category } = e.detail;\n\n // // Update test context items, adding a new item if the identifier is not already in the list\n // if (!this._testContext.items.some(item => item.identifier === identifier)) {\n // this._testContext.items.push({\n // href,\n // identifier,\n // category,\n // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n // // category: e.target.category\n // });\n // }\n // }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('qti-test', '');\n }\n}\n","import { createContext } from '@lit/context';\nimport { QtiAssessmentTest } from '../qti-assessment-test';\nimport { ItemContext, VariableDeclaration } from '../../qti-components';\nimport { View } from '../mixins/test-view.mixin';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[]>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = {\n el: QtiAssessmentTest;\n};\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;;;ACD9B,IAAM,MAAM,OAAO;AAenB,IAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBX,SAAS,kBAAkB,aAA0B,SAAiB,WAAmB;AAC9F,cAAY,iBAAiB,OAAO,EAAE,QAAQ,aAAW;AACvD,UAAM,aAAa,GAAG,OAAO,IAAI,SAAS;AAC1C,UAAM,aAAa,4BAA4B,SAAS,U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qB;AACvB,4BAAoB,YAAY,YAAY;AAAA,MAC9C,OAAO;AACL,aAAK,aAAa,MAAM,KAAK,WAAW;AAAA,MAC1C;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEQ,kCACN,YACA,WACM;AAEN,SAAK,eAAe;AAAA,MAClB,GAAG,KAAK;AAAA;AAAA,MACR,OAAO,KAAK,aAAa,MAAM,IAAI,iBAAe;AAEhD,YAAI,YAAY,eAAe,YAAY;AACzC,iBAAO;AAAA,QACT;AAGA,eAAO;AAAA,UACL,GAAG;AAAA;AAAA,UACH,WAAW,UAAU,IAAI,cAAY;AAEnC,kBAAM,mBAAmB,YAAY,UAAU,KAAK,OAAK,EAAE,eAAe,SAAS,UAAU;AAG7F,mBAAO,mBAAmB,EAAE,GAAG,kBAAkB,GAAG,SAAS,IAAI;AAAA,UACnE,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmDA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,aAAa,YAAY,EAAE;AAAA,EAClC;AACF;AA3IY;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,YAAY,CAAC;AAAA,GAFb,SAGV;AAIA;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,YAAY,CAAC;AAAA,GANb,SAOV;;;ANsCL,IAAM,UAAN,cAAsB,gBAAgB,oBAAoB,cAAc,QAAQ,CAAC,CAAC,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,EAKzF,SAAS;AACP,WAAO;AAAA,EACT;AACF;AARa,UAAN;AAAA,EADN,cAAc,UAAU;AAAA,GACZ;","names":["xml","testContext"]}
@@ -1,6 +0,0 @@
1
- import 'lit';
2
- export { f as TestBase } from '../test-base-BJwG9Ie8.js';
3
- import './qti-assessment-test/qti-test-part.js';
4
- import 'lit-html';
5
- import '../qti-simple-choice-DxWcdKHi.js';
6
- import 'lit-html/directives/ref.js';
@@ -1,137 +0,0 @@
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/test-base.ts
13
- import { provide } from "@lit/context";
14
- import { LitElement } from "lit";
15
- import { state } from "lit/decorators.js";
16
-
17
- // src/lib/qti-test/context/test.context.ts
18
- import { createContext } from "@lit/context";
19
- var testContext = createContext(Symbol("test"));
20
- var testElement = createContext(Symbol("testElement"));
21
-
22
- // src/lib/qti-test/test-base.ts
23
- var TestBase = class extends LitElement {
24
- constructor() {
25
- super();
26
- this._testContext = { items: [], testOutcomeVariables: [] };
27
- this.testElement = { el: null };
28
- /**
29
- * Updates the variables of an assessment item in the test context.
30
- * - Matches the assessment item with the corresponding test context item.
31
- * - If the item is not found, logs a warning.
32
- * - Updates variables in the test context if exactly one variable exists.
33
- * - Otherwise, syncs the assessment item's variables with the test context.
34
- *
35
- * @param assessmentItem - The assessment item to update.
36
- */
37
- this._updateItemInTestContext = (assessmentItem) => {
38
- const { identifier, variables } = assessmentItem;
39
- const itemContext = this._testContext.items.find((i) => i?.identifier === identifier);
40
- if (!itemContext) {
41
- console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);
42
- return;
43
- }
44
- if (itemContext.variables?.length === 1) {
45
- this._updateItemVariablesInTestContext(identifier, variables);
46
- } else {
47
- assessmentItem.variables = [...itemContext.variables || []];
48
- }
49
- };
50
- this.addEventListener("qti-assessment-test-connected", (e) => {
51
- const qtiAssessmentTest = e.detail;
52
- const items = Array.from(qtiAssessmentTest.querySelectorAll("qti-assessment-item-ref")).map(
53
- (itemRef) => ({
54
- href: itemRef.href,
55
- identifier: itemRef.identifier,
56
- category: itemRef.category,
57
- variables: [{ identifier: "completionStatus", value: "not_attempted", type: "outcome" }]
58
- })
59
- );
60
- this.testElement = { el: qtiAssessmentTest };
61
- this._testContext = { ...this._testContext, items };
62
- });
63
- this.addEventListener("qti-assessment-item-connected", (e) => {
64
- this._updateItemInTestContext(e.detail);
65
- });
66
- this.addEventListener("qti-outcome-changed", (e) => {
67
- const assessmentitem = e.composedPath()[0];
68
- this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);
69
- });
70
- }
71
- get context() {
72
- return this._testContext;
73
- }
74
- // /* restores the context by updating existing items and adding new items from the "contextToRestore" parameter into the "this._context.items" array. */
75
- set context(testContext2) {
76
- if (testContext2 === null || testContext2 === void 0) return;
77
- this._testContext = { ...testContext2 };
78
- testContext2.items?.forEach((itemContext) => {
79
- const existingItemContext = this._testContext.items.find((i) => i.identifier === itemContext.identifier);
80
- if (existingItemContext) {
81
- existingItemContext.variables = itemContext.variables;
82
- } else {
83
- this._testContext.items.push(itemContext);
84
- }
85
- });
86
- }
87
- _updateItemVariablesInTestContext(identifier, variables) {
88
- this._testContext = {
89
- ...this._testContext,
90
- // Spread existing test context properties
91
- items: this._testContext.items.map((itemContext) => {
92
- if (itemContext.identifier !== identifier) {
93
- return itemContext;
94
- }
95
- return {
96
- ...itemContext,
97
- // Keep other properties of the item context
98
- variables: variables.map((variable) => {
99
- const matchingVariable = itemContext.variables.find((v) => v.identifier === variable.identifier);
100
- return matchingVariable ? { ...matchingVariable, ...variable } : variable;
101
- })
102
- };
103
- })
104
- };
105
- }
106
- // private _addItemToTestContext(
107
- // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }
108
- // ): void {
109
- // const { href, identifier, category } = e.detail;
110
- // // Update test context items, adding a new item if the identifier is not already in the list
111
- // if (!this._testContext.items.some(item => item.identifier === identifier)) {
112
- // this._testContext.items.push({
113
- // href,
114
- // identifier,
115
- // category,
116
- // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]
117
- // // category: e.target.category
118
- // });
119
- // }
120
- // }
121
- connectedCallback() {
122
- super.connectedCallback();
123
- this.setAttribute("qti-test", "");
124
- }
125
- };
126
- __decorateClass([
127
- state(),
128
- provide({ context: testContext })
129
- ], TestBase.prototype, "_testContext", 2);
130
- __decorateClass([
131
- state(),
132
- provide({ context: testElement })
133
- ], TestBase.prototype, "testElement", 2);
134
- export {
135
- TestBase
136
- };
137
- //# sourceMappingURL=test-base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/test-base.ts","../../src/lib/qti-test/context/test.context.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { TestContext, testContext, TestElement, testElement } from './context';\nimport { QtiAssessmentTest } from './qti-assessment-test';\nimport { ItemContext, QtiAssessmentItem, VariableValue } from '../qti-components';\n\nexport abstract class TestBase extends LitElement {\n @state()\n @provide({ context: testContext })\n protected _testContext: Readonly<TestContext> = { items: [], testOutcomeVariables: [] };\n\n @state()\n @provide({ context: testElement })\n protected testElement: TestElement = { el: null };\n\n constructor() {\n super();\n\n this.addEventListener('qti-assessment-test-connected', (e: CustomEvent<QtiAssessmentTest>) => {\n const qtiAssessmentTest = e.detail;\n\n const items = Array.from(qtiAssessmentTest.querySelectorAll('qti-assessment-item-ref')).map(\n (itemRef): ItemContext & { category: string } => ({\n href: itemRef.href,\n identifier: itemRef.identifier,\n category: itemRef.category,\n variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n })\n );\n this.testElement = { el: qtiAssessmentTest };\n this._testContext = { ...this._testContext, items };\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent<QtiAssessmentItem>) => {\n this._updateItemInTestContext(e.detail);\n });\n this.addEventListener('qti-outcome-changed', e => {\n const assessmentitem = e.composedPath()[0] as QtiAssessmentItem;\n this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);\n });\n\n // this.addEventListener(\n // 'qti-assessment-item-ref-connected',\n // (e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }) => {\n // this._addItemToTestContext(e);\n // }\n // );\n }\n\n get context(): TestContext {\n return this._testContext;\n }\n\n // /* restores the context by updating existing items and adding new items from the \"contextToRestore\" parameter into the \"this._context.items\" array. */\n set context(testContext: TestContext) {\n if (testContext === null || testContext === undefined) return;\n this._testContext = { ...testContext }; // Clone the context to avoid modifying the original object\n // // append the items that are not yet in the context and replace the ones that are\n testContext.items?.forEach(itemContext => {\n const existingItemContext = this._testContext.items.find(i => i.identifier === itemContext.identifier);\n if (existingItemContext) {\n existingItemContext.variables = itemContext.variables;\n } else {\n this._testContext.items.push(itemContext);\n }\n });\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: VariableValue<string | string[] | null>[]\n ): void {\n // Update the test context with modified variables for the specified item\n this._testContext = {\n ...this._testContext, // Spread existing test context properties\n items: this._testContext.items.map(itemContext => {\n // If the item identifier doesn't match, keep it unchanged\n if (itemContext.identifier !== identifier) {\n return itemContext;\n }\n\n // Update the matching item with new variables\n return {\n ...itemContext, // Keep other properties of the item context\n variables: variables.map(variable => {\n // Find a matching variable in the current item context\n const matchingVariable = itemContext.variables.find(v => v.identifier === variable.identifier);\n\n // Merge matching variable with the new one, or use the new variable if no match\n return matchingVariable ? { ...matchingVariable, ...variable } : variable;\n })\n };\n })\n };\n }\n\n /**\n * Updates the variables of an assessment item in the test context.\n * - Matches the assessment item with the corresponding test context item.\n * - If the item is not found, logs a warning.\n * - Updates variables in the test context if exactly one variable exists.\n * - Otherwise, syncs the assessment item's variables with the test context.\n *\n * @param assessmentItem - The assessment item to update.\n */\n private _updateItemInTestContext = (assessmentItem: QtiAssessmentItem): void => {\n const { identifier, variables } = assessmentItem;\n\n // console.log(this._testContext);\n\n // Find the corresponding item in the test context by identifier\n const itemContext = this._testContext.items.find(i => i?.identifier === identifier);\n\n if (!itemContext) {\n console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);\n return;\n }\n\n // Update variables in the test context or sync them to the assessment item\n if (itemContext.variables?.length === 1) {\n // The loaded qti-assessment-item itself has variables which are not in test context yet.\n this._updateItemVariablesInTestContext(identifier, variables);\n } else {\n // Sync the assessment item's variables with the test context\n assessmentItem.variables = [...(itemContext.variables || [])];\n }\n };\n\n // private _addItemToTestContext(\n // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }\n // ): void {\n // const { href, identifier, category } = e.detail;\n\n // // Update test context items, adding a new item if the identifier is not already in the list\n // if (!this._testContext.items.some(item => item.identifier === identifier)) {\n // this._testContext.items.push({\n // href,\n // identifier,\n // category,\n // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n // // category: e.target.category\n // });\n // }\n // }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('qti-test', '');\n }\n}\n","import { createContext } from '@lit/context';\nimport { QtiAssessmentTest } from '../qti-assessment-test';\nimport { ItemContext, VariableDeclaration } from '../../qti-components';\nimport { View } from '../mixins/test-view.mixin';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[]>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = {\n el: QtiAssessmentTest;\n};\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;;;ACFtB,SAAS,qBAAqB;AAgBvB,IAAM,cAAc,cAAqC,OAAO,MAAM,CAAC;A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