@citolab/qti-components 7.1.6 → 7.2.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 (373) hide show
  1. package/cdn/chunks/chunk-2GVQHMFN.js +5 -0
  2. package/cdn/chunks/chunk-34TLO462.js +1 -0
  3. package/cdn/chunks/chunk-3AUZHOWF.js +5 -0
  4. package/cdn/chunks/chunk-3BTFQ7WO.js +5 -0
  5. package/cdn/chunks/chunk-3G52PPHF.js +1 -0
  6. package/cdn/chunks/chunk-3T7FMZJJ.js +5 -0
  7. package/cdn/chunks/chunk-3WMAQ764.js +23 -0
  8. package/cdn/chunks/chunk-3XYZ63C3.js +1 -0
  9. package/cdn/chunks/chunk-43VY76CQ.js +5 -0
  10. package/cdn/chunks/chunk-4VDQDT6F.js +1 -0
  11. package/cdn/chunks/chunk-4XDZ5XHU.js +1007 -0
  12. package/cdn/chunks/chunk-52V4Q43H.js +5 -0
  13. package/cdn/chunks/chunk-5DVS53XB.js +1007 -0
  14. package/cdn/chunks/chunk-6BZPFYLZ.js +1 -0
  15. package/cdn/chunks/chunk-7B6HAKFL.js +1 -0
  16. package/cdn/chunks/chunk-7BENQ76L.js +1 -0
  17. package/cdn/chunks/chunk-A6PJTNI7.js +23 -0
  18. package/cdn/chunks/chunk-AFBSMLI4.js +5 -0
  19. package/cdn/chunks/chunk-AU2GM346.js +23 -0
  20. package/cdn/chunks/chunk-B345O2HX.js +1 -0
  21. package/cdn/chunks/chunk-B3RMHCUZ.js +1 -0
  22. package/cdn/chunks/chunk-BFPXRWNH.js +5 -0
  23. package/cdn/chunks/chunk-BGBABJCL.js +5 -0
  24. package/cdn/chunks/chunk-BKSBIZJA.js +5 -0
  25. package/cdn/chunks/chunk-BWG4B5VP.js +0 -0
  26. package/cdn/chunks/chunk-C25LH4KA.js +1 -0
  27. package/cdn/chunks/chunk-CDCBI3YD.js +1 -0
  28. package/cdn/chunks/chunk-CQPD5NPM.js +1 -0
  29. package/cdn/chunks/chunk-CS6UCV2Q.js +5 -0
  30. package/cdn/chunks/chunk-D74A6CWS.js +8 -0
  31. package/cdn/chunks/chunk-DFZQWABG.js +5 -0
  32. package/cdn/chunks/chunk-DHZMASGY.js +5 -0
  33. package/cdn/chunks/chunk-EZ7OIK2M.js +1007 -0
  34. package/cdn/chunks/chunk-F2WLIUYH.js +5 -0
  35. package/cdn/chunks/chunk-F3ZZJBV2.js +5 -0
  36. package/cdn/chunks/chunk-FCH2GIHD.js +1 -0
  37. package/cdn/chunks/chunk-FKUEIENC.js +5 -0
  38. package/cdn/chunks/chunk-FMCWO2FJ.js +17 -0
  39. package/cdn/chunks/chunk-FQW2YR3J.js +1 -0
  40. package/cdn/chunks/chunk-FVEUVB2H.js +23 -0
  41. package/cdn/chunks/chunk-GMF365YO.js +16 -0
  42. package/cdn/chunks/chunk-GWRXCQHZ.js +23 -0
  43. package/cdn/chunks/chunk-HAXNBTTE.js +1 -0
  44. package/cdn/chunks/chunk-HEAJ2NEA.js +1007 -0
  45. package/cdn/chunks/chunk-HKBOCCDM.js +5 -0
  46. package/cdn/chunks/chunk-HRLTVAPZ.js +5 -0
  47. package/cdn/chunks/chunk-HZ5STZXK.js +5 -0
  48. package/cdn/chunks/chunk-I5HGXKPD.js +1007 -0
  49. package/cdn/chunks/chunk-IELXBBZK.js +5 -0
  50. package/cdn/chunks/chunk-IHL5T5GX.js +5 -0
  51. package/cdn/chunks/chunk-J2M4UG43.js +1 -0
  52. package/cdn/chunks/chunk-JAMSX45C.js +1 -0
  53. package/cdn/chunks/chunk-JEPI46VU.js +5 -0
  54. package/cdn/chunks/chunk-JSQUXTN4.js +1033 -0
  55. package/cdn/chunks/chunk-JXDOR5ZC.js +1 -0
  56. package/cdn/chunks/chunk-JZCJOPJ4.js +1007 -0
  57. package/cdn/chunks/chunk-KKEW6E2D.js +5 -0
  58. package/cdn/chunks/chunk-L4UTGAI5.js +5 -0
  59. package/cdn/chunks/chunk-LMLG3NBM.js +5 -0
  60. package/cdn/chunks/chunk-MM2ZXHVH.js +5 -0
  61. package/cdn/chunks/chunk-NQQE76LE.js +1 -0
  62. package/cdn/chunks/chunk-O6CWZJXT.js +28 -0
  63. package/cdn/chunks/chunk-OSEDGNNB.js +1007 -0
  64. package/cdn/chunks/chunk-PJFHT7NY.js +5 -0
  65. package/cdn/chunks/chunk-PKWOG7OF.js +5 -0
  66. package/cdn/chunks/chunk-PTG4PTFS.js +5 -0
  67. package/cdn/chunks/chunk-QIRSCGXH.js +1007 -0
  68. package/cdn/chunks/chunk-RIPDQPTC.js +5 -0
  69. package/cdn/chunks/chunk-RO5THFZ6.js +5 -0
  70. package/cdn/chunks/chunk-SQ3RENJ6.js +5 -0
  71. package/cdn/chunks/chunk-SUOAWPV7.js +23 -0
  72. package/cdn/chunks/chunk-T43NJLH5.js +5 -0
  73. package/cdn/chunks/chunk-TIH5N4LQ.js +1007 -0
  74. package/cdn/chunks/chunk-TOUJRNTD.js +1007 -0
  75. package/cdn/chunks/chunk-TSMKXWWV.js +5 -0
  76. package/cdn/chunks/chunk-TU4L55WU.js +5 -0
  77. package/cdn/chunks/chunk-UDPQY4OA.js +1007 -0
  78. package/cdn/chunks/chunk-ULI6NOVG.js +23 -0
  79. package/cdn/chunks/chunk-UTEMKKYS.js +1 -0
  80. package/cdn/chunks/chunk-UV3CSMRU.js +5 -0
  81. package/cdn/chunks/chunk-V2RDHKE2.js +5 -0
  82. package/cdn/chunks/chunk-VQLIWL6K.js +5 -0
  83. package/cdn/chunks/chunk-VZEUFE5C.js +3455 -0
  84. package/cdn/chunks/chunk-W5B2MLGL.js +1 -0
  85. package/cdn/chunks/chunk-WJGOCWFB.js +1 -0
  86. package/cdn/chunks/chunk-WLQN7SVZ.js +1033 -0
  87. package/cdn/chunks/chunk-WUX2JPB5.js +17 -0
  88. package/cdn/chunks/chunk-X7FRU3B6.js +5 -0
  89. package/cdn/chunks/chunk-XS46RWY6.js +5 -0
  90. package/cdn/chunks/chunk-XTNESJMB.js +5 -0
  91. package/cdn/chunks/chunk-Y2EDF22E.js +16 -0
  92. package/cdn/chunks/chunk-YE4ZNHXG.js +23 -0
  93. package/cdn/chunks/chunk-YMFPA4QO.js +5 -0
  94. package/cdn/chunks/chunk-YRK3ZLQP.js +1033 -0
  95. package/cdn/index.global.js +1 -1
  96. package/cdn/index.js +1 -1
  97. package/cdn/qti-components/index.js +1 -1
  98. package/cdn/qti-item/components/item-container.js +1 -1
  99. package/cdn/qti-item/core/index.js +1 -1
  100. package/cdn/qti-loader/index.js +1 -1
  101. package/cdn/qti-test/components/index.js +1 -1
  102. package/cdn/qti-test/components/test-container.js +1 -1
  103. package/cdn/qti-test/components/test-navigation.js +1 -1
  104. package/cdn/qti-test/components/test-next.js +1 -1
  105. package/cdn/qti-test/components/test-scoring-buttons.js +1 -1
  106. package/cdn/qti-test/components/test-scoring-feedback.js +1 -1
  107. package/cdn/qti-test/components/test-stamp.js +1 -0
  108. package/cdn/qti-test/components/test-view-toggle.js +1 -1
  109. package/cdn/qti-test/core/index.js +1 -1
  110. package/cdn/qti-transformers/index.js +1 -1
  111. package/dist/chunks/chunk-2GPGOKL6.js +94 -0
  112. package/dist/chunks/chunk-2GPGOKL6.js.map +1 -0
  113. package/dist/chunks/chunk-2J22QBLB.js +94 -0
  114. package/dist/chunks/chunk-2J22QBLB.js.map +1 -0
  115. package/dist/chunks/chunk-34F2DVNP.js +85 -0
  116. package/dist/chunks/chunk-34F2DVNP.js.map +1 -0
  117. package/dist/chunks/chunk-3TM6VQEG.js +375 -0
  118. package/dist/chunks/chunk-3TM6VQEG.js.map +1 -0
  119. package/dist/chunks/chunk-3YVVZ2MO.js +374 -0
  120. package/dist/chunks/chunk-3YVVZ2MO.js.map +1 -0
  121. package/dist/chunks/chunk-46RFKXS6.js +94 -0
  122. package/dist/chunks/chunk-46RFKXS6.js.map +1 -0
  123. package/dist/chunks/chunk-47BWT37I.js +94 -0
  124. package/dist/chunks/chunk-47BWT37I.js.map +1 -0
  125. package/dist/chunks/chunk-4EXSIVXY.js +68 -0
  126. package/dist/chunks/chunk-4EXSIVXY.js.map +1 -0
  127. package/dist/chunks/chunk-4JL6LXWC.js +94 -0
  128. package/dist/chunks/chunk-4JL6LXWC.js.map +1 -0
  129. package/dist/chunks/chunk-4TQ3YR2O.js +31 -0
  130. package/dist/chunks/chunk-4TQ3YR2O.js.map +1 -0
  131. package/dist/chunks/chunk-4VEH63K4.js +854 -0
  132. package/dist/chunks/chunk-4VEH63K4.js.map +1 -0
  133. package/dist/chunks/chunk-5FKTC6XV.js +99 -0
  134. package/dist/chunks/chunk-5FKTC6XV.js.map +1 -0
  135. package/dist/chunks/chunk-5SZAGP4N.js +863 -0
  136. package/dist/chunks/chunk-5SZAGP4N.js.map +1 -0
  137. package/dist/chunks/chunk-64EQ3AQ4.js +240 -0
  138. package/dist/chunks/chunk-64EQ3AQ4.js.map +1 -0
  139. package/dist/chunks/chunk-6MECYIS2.js +94 -0
  140. package/dist/chunks/chunk-6MECYIS2.js.map +1 -0
  141. package/dist/chunks/chunk-6T5ICOX2.js +94 -0
  142. package/dist/chunks/chunk-6T5ICOX2.js.map +1 -0
  143. package/dist/chunks/chunk-6ZK4ZDQA.js +94 -0
  144. package/dist/chunks/chunk-6ZK4ZDQA.js.map +1 -0
  145. package/dist/chunks/chunk-7KTTLJUH.js +45 -0
  146. package/dist/chunks/chunk-7KTTLJUH.js.map +1 -0
  147. package/dist/chunks/chunk-7LFQ6D75.js +95 -0
  148. package/dist/chunks/chunk-7LFQ6D75.js.map +1 -0
  149. package/dist/chunks/chunk-7T5WVG7T.js +853 -0
  150. package/dist/chunks/chunk-7T5WVG7T.js.map +1 -0
  151. package/dist/chunks/chunk-A5IAS5VV.js +54 -0
  152. package/dist/chunks/chunk-A5IAS5VV.js.map +1 -0
  153. package/dist/chunks/chunk-ABDJRZ2V.js +78 -0
  154. package/dist/chunks/chunk-ABDJRZ2V.js.map +1 -0
  155. package/dist/chunks/chunk-AN33KA5S.js +94 -0
  156. package/dist/chunks/chunk-AN33KA5S.js.map +1 -0
  157. package/dist/chunks/chunk-B2SP77UV.js +818 -0
  158. package/dist/chunks/chunk-B2SP77UV.js.map +1 -0
  159. package/dist/chunks/chunk-BB7V3D2X.js +250 -0
  160. package/dist/chunks/chunk-BB7V3D2X.js.map +1 -0
  161. package/dist/chunks/chunk-BJAP2552.js +6893 -0
  162. package/dist/chunks/chunk-BJAP2552.js.map +1 -0
  163. package/dist/chunks/chunk-BSPLGP2R.js +627 -0
  164. package/dist/chunks/chunk-BSPLGP2R.js.map +1 -0
  165. package/dist/chunks/chunk-BWUEY6V5.js +818 -0
  166. package/dist/chunks/chunk-BWUEY6V5.js.map +1 -0
  167. package/dist/chunks/chunk-C7YUIKFQ.js +249 -0
  168. package/dist/chunks/chunk-C7YUIKFQ.js.map +1 -0
  169. package/dist/chunks/chunk-CIZ7HKZC.js +42 -0
  170. package/dist/chunks/chunk-CIZ7HKZC.js.map +1 -0
  171. package/dist/chunks/chunk-CJSBOJOH.js +6888 -0
  172. package/dist/chunks/chunk-CJSBOJOH.js.map +1 -0
  173. package/dist/chunks/chunk-CYB63HHS.js +31 -0
  174. package/dist/chunks/chunk-CYB63HHS.js.map +1 -0
  175. package/dist/chunks/chunk-DFSZKFKS.js +43 -0
  176. package/dist/chunks/chunk-DFSZKFKS.js.map +1 -0
  177. package/dist/chunks/chunk-DNRSH4DB.js +854 -0
  178. package/dist/chunks/chunk-DNRSH4DB.js.map +1 -0
  179. package/dist/chunks/chunk-DPDCXMHW.js +81 -0
  180. package/dist/chunks/chunk-DPDCXMHW.js.map +1 -0
  181. package/dist/chunks/chunk-DQ62VQEH.js +627 -0
  182. package/dist/chunks/chunk-DQ62VQEH.js.map +1 -0
  183. package/dist/chunks/chunk-E4G74EVO.js +99 -0
  184. package/dist/chunks/chunk-E4G74EVO.js.map +1 -0
  185. package/dist/chunks/chunk-EA7DHOYO.js +6903 -0
  186. package/dist/chunks/chunk-EA7DHOYO.js.map +1 -0
  187. package/dist/chunks/chunk-EAFJQRTV.js +56 -0
  188. package/dist/chunks/chunk-EAFJQRTV.js.map +1 -0
  189. package/dist/chunks/chunk-EL4TPH56.js +94 -0
  190. package/dist/chunks/chunk-EL4TPH56.js.map +1 -0
  191. package/dist/chunks/chunk-FI6LX4IS.js +853 -0
  192. package/dist/chunks/chunk-FI6LX4IS.js.map +1 -0
  193. package/dist/chunks/chunk-FORIPEB2.js +241 -0
  194. package/dist/chunks/chunk-FORIPEB2.js.map +1 -0
  195. package/dist/chunks/chunk-G3TG4ADZ.js +8 -0
  196. package/dist/chunks/chunk-G3TG4ADZ.js.map +1 -0
  197. package/dist/chunks/chunk-H4XZSMVR.js +375 -0
  198. package/dist/chunks/chunk-H4XZSMVR.js.map +1 -0
  199. package/dist/chunks/chunk-H6O2X4MD.js +42 -0
  200. package/dist/chunks/chunk-H6O2X4MD.js.map +1 -0
  201. package/dist/chunks/chunk-H7W3RQS4.js +627 -0
  202. package/dist/chunks/chunk-H7W3RQS4.js.map +1 -0
  203. package/dist/chunks/chunk-HMHM2W7Z.js +241 -0
  204. package/dist/chunks/chunk-HMHM2W7Z.js.map +1 -0
  205. package/dist/chunks/chunk-I3RHYDUK.js +6917 -0
  206. package/dist/chunks/chunk-I3RHYDUK.js.map +1 -0
  207. package/dist/chunks/chunk-IHNLBY62.js +42 -0
  208. package/dist/chunks/chunk-IHNLBY62.js.map +1 -0
  209. package/dist/chunks/chunk-ILA6BNIO.js +31 -0
  210. package/dist/chunks/chunk-ILA6BNIO.js.map +1 -0
  211. package/dist/chunks/chunk-JFZF77EN.js +31 -0
  212. package/dist/chunks/chunk-JFZF77EN.js.map +1 -0
  213. package/dist/chunks/chunk-JOQ2E6SE.js +92 -0
  214. package/dist/chunks/chunk-JOQ2E6SE.js.map +1 -0
  215. package/dist/chunks/chunk-JQBEZ43O.js +240 -0
  216. package/dist/chunks/chunk-JQBEZ43O.js.map +1 -0
  217. package/dist/chunks/chunk-JQQ755AG.js +854 -0
  218. package/dist/chunks/chunk-JQQ755AG.js.map +1 -0
  219. package/dist/chunks/chunk-JRDTY7YA.js +627 -0
  220. package/dist/chunks/chunk-JRDTY7YA.js.map +1 -0
  221. package/dist/chunks/chunk-JU7QJQ6F.js +853 -0
  222. package/dist/chunks/chunk-JU7QJQ6F.js.map +1 -0
  223. package/dist/chunks/chunk-K6LM7XK5.js +94 -0
  224. package/dist/chunks/chunk-K6LM7XK5.js.map +1 -0
  225. package/dist/chunks/chunk-K6PU3ZO4.js +853 -0
  226. package/dist/chunks/chunk-K6PU3ZO4.js.map +1 -0
  227. package/dist/chunks/chunk-KD26ZB2H.js +3445 -0
  228. package/dist/chunks/chunk-KD26ZB2H.js.map +1 -0
  229. package/dist/chunks/chunk-KGL6SIOD.js +6893 -0
  230. package/dist/chunks/chunk-KGL6SIOD.js.map +1 -0
  231. package/dist/chunks/chunk-KIRLKN6I.js +68 -0
  232. package/dist/chunks/chunk-KIRLKN6I.js.map +1 -0
  233. package/dist/chunks/chunk-L74KEUIS.js +94 -0
  234. package/dist/chunks/chunk-L74KEUIS.js.map +1 -0
  235. package/dist/chunks/chunk-LEXNKJYF.js +6888 -0
  236. package/dist/chunks/chunk-LEXNKJYF.js.map +1 -0
  237. package/dist/chunks/chunk-LVE5GKDT.js +94 -0
  238. package/dist/chunks/chunk-LVE5GKDT.js.map +1 -0
  239. package/dist/chunks/chunk-LVZHVB7F.js +31 -0
  240. package/dist/chunks/chunk-LVZHVB7F.js.map +1 -0
  241. package/dist/chunks/chunk-MGLNBEW4.js +33 -0
  242. package/dist/chunks/chunk-MGLNBEW4.js.map +1 -0
  243. package/dist/chunks/chunk-MS7YRGNG.js +56 -0
  244. package/dist/chunks/chunk-MS7YRGNG.js.map +1 -0
  245. package/dist/chunks/chunk-N25ZKAHQ.js +50 -0
  246. package/dist/chunks/chunk-N25ZKAHQ.js.map +1 -0
  247. package/dist/chunks/chunk-N46CJQRI.js +94 -0
  248. package/dist/chunks/chunk-N46CJQRI.js.map +1 -0
  249. package/dist/chunks/chunk-N4QWREF4.js +375 -0
  250. package/dist/chunks/chunk-N4QWREF4.js.map +1 -0
  251. package/dist/chunks/chunk-NM3JA4DH.js +6893 -0
  252. package/dist/chunks/chunk-NM3JA4DH.js.map +1 -0
  253. package/dist/chunks/chunk-NOHVLBCB.js +371 -0
  254. package/dist/chunks/chunk-NOHVLBCB.js.map +1 -0
  255. package/dist/chunks/chunk-NQSOVEFB.js +31 -0
  256. package/dist/chunks/chunk-NQSOVEFB.js.map +1 -0
  257. package/dist/chunks/chunk-OA7AFFCB.js +866 -0
  258. package/dist/chunks/chunk-OA7AFFCB.js.map +1 -0
  259. package/dist/chunks/chunk-OLNSD7FR.js +31 -0
  260. package/dist/chunks/chunk-OLNSD7FR.js.map +1 -0
  261. package/dist/chunks/chunk-OREE4FRY.js +42 -0
  262. package/dist/chunks/chunk-OREE4FRY.js.map +1 -0
  263. package/dist/chunks/chunk-P66WO2Q5.js +870 -0
  264. package/dist/chunks/chunk-P66WO2Q5.js.map +1 -0
  265. package/dist/chunks/chunk-PKOIFI5C.js +853 -0
  266. package/dist/chunks/chunk-PKOIFI5C.js.map +1 -0
  267. package/dist/chunks/chunk-QFV3VHZ4.js +43 -0
  268. package/dist/chunks/chunk-QFV3VHZ4.js.map +1 -0
  269. package/dist/chunks/chunk-QTKNSVUO.js +854 -0
  270. package/dist/chunks/chunk-QTKNSVUO.js.map +1 -0
  271. package/dist/chunks/chunk-RSGEN2FF.js +6917 -0
  272. package/dist/chunks/chunk-RSGEN2FF.js.map +1 -0
  273. package/dist/chunks/chunk-S6XGFD5B.js +6893 -0
  274. package/dist/chunks/chunk-S6XGFD5B.js.map +1 -0
  275. package/dist/chunks/chunk-SOT463MH.js +68 -0
  276. package/dist/chunks/chunk-SOT463MH.js.map +1 -0
  277. package/dist/chunks/chunk-SZMR2BFI.js +94 -0
  278. package/dist/chunks/chunk-SZMR2BFI.js.map +1 -0
  279. package/dist/chunks/chunk-TDKYWAGB.js +50 -0
  280. package/dist/chunks/chunk-TDKYWAGB.js.map +1 -0
  281. package/dist/chunks/chunk-TDNCAAAT.js +627 -0
  282. package/dist/chunks/chunk-TDNCAAAT.js.map +1 -0
  283. package/dist/chunks/chunk-TVOHUHS4.js +94 -0
  284. package/dist/chunks/chunk-TVOHUHS4.js.map +1 -0
  285. package/dist/chunks/chunk-UE3R54FP.js +853 -0
  286. package/dist/chunks/chunk-UE3R54FP.js.map +1 -0
  287. package/dist/chunks/chunk-UUEOV5NM.js +1 -0
  288. package/dist/chunks/chunk-UUEOV5NM.js.map +1 -0
  289. package/dist/chunks/chunk-UZRIKXLU.js +94 -0
  290. package/dist/chunks/chunk-UZRIKXLU.js.map +1 -0
  291. package/dist/chunks/chunk-VAYGVW5R.js +6903 -0
  292. package/dist/chunks/chunk-VAYGVW5R.js.map +1 -0
  293. package/dist/chunks/chunk-VEWD22O5.js +383 -0
  294. package/dist/chunks/chunk-VEWD22O5.js.map +1 -0
  295. package/dist/chunks/chunk-VF32HLF4.js +81 -0
  296. package/dist/chunks/chunk-VF32HLF4.js.map +1 -0
  297. package/dist/chunks/chunk-VY7QNZVM.js +6893 -0
  298. package/dist/chunks/chunk-VY7QNZVM.js.map +1 -0
  299. package/dist/chunks/chunk-W4FWEMCO.js +871 -0
  300. package/dist/chunks/chunk-W4FWEMCO.js.map +1 -0
  301. package/dist/chunks/chunk-W5VRVGBL.js +81 -0
  302. package/dist/chunks/chunk-W5VRVGBL.js.map +1 -0
  303. package/dist/chunks/chunk-WDGXLQLI.js +94 -0
  304. package/dist/chunks/chunk-WDGXLQLI.js.map +1 -0
  305. package/dist/chunks/chunk-WTTOJHIM.js +371 -0
  306. package/dist/chunks/chunk-WTTOJHIM.js.map +1 -0
  307. package/dist/chunks/chunk-WZZOX7S2.js +853 -0
  308. package/dist/chunks/chunk-WZZOX7S2.js.map +1 -0
  309. package/dist/chunks/chunk-X2G652U7.js +6903 -0
  310. package/dist/chunks/chunk-X2G652U7.js.map +1 -0
  311. package/dist/chunks/chunk-XKQP4R6O.js +380 -0
  312. package/dist/chunks/chunk-XKQP4R6O.js.map +1 -0
  313. package/dist/chunks/chunk-Z3SN77PI.js +31 -0
  314. package/dist/chunks/chunk-Z3SN77PI.js.map +1 -0
  315. package/dist/chunks/chunk-ZECYUSVI.js +43 -0
  316. package/dist/chunks/chunk-ZECYUSVI.js.map +1 -0
  317. package/dist/chunks/chunk-ZSPVMGE5.js +94 -0
  318. package/dist/chunks/chunk-ZSPVMGE5.js.map +1 -0
  319. package/dist/chunks/chunk-ZTXBJYUG.js +94 -0
  320. package/dist/chunks/chunk-ZTXBJYUG.js.map +1 -0
  321. package/dist/exports/computed-item.context.d.ts +1 -1
  322. package/dist/exports/computed.context.d.ts +1 -1
  323. package/dist/exports/interaction.d.ts +1 -1
  324. package/dist/exports/item.context.d.ts +1 -1
  325. package/dist/exports/qti-assessment-item.context.d.ts +1 -1
  326. package/dist/exports/qti-condition-expression.d.ts +1 -1
  327. package/dist/exports/qti-expression.d.ts +1 -1
  328. package/dist/exports/session.context.d.ts +2 -2
  329. package/dist/exports/test.context.d.ts +1 -1
  330. package/dist/exports/variables.d.ts +1 -1
  331. package/dist/index.d.ts +7 -2
  332. package/dist/index.js +28 -12
  333. package/dist/item.css +26 -130
  334. package/dist/qti-components/index.d.ts +2 -2
  335. package/dist/qti-components/index.js +2 -2
  336. package/dist/qti-components-jsx.d.ts +91 -9
  337. package/dist/qti-item/components/item-container.js +3 -3
  338. package/dist/qti-item/components/item-show-correct-response.d.ts +1 -1
  339. package/dist/qti-item/components/print-item-variables.d.ts +1 -1
  340. package/dist/qti-item/core/index.d.ts +1 -1
  341. package/dist/qti-item/core/index.js +3 -3
  342. package/dist/qti-loader/index.d.ts +1 -1
  343. package/dist/qti-loader/index.js +2 -2
  344. package/dist/qti-response-declaration-C3kpm650.d.ts +1171 -0
  345. package/dist/qti-test/components/index.d.ts +7 -2
  346. package/dist/qti-test/components/index.js +25 -9
  347. package/dist/qti-test/components/test-container.js +3 -3
  348. package/dist/qti-test/components/test-navigation.d.ts +3 -2
  349. package/dist/qti-test/components/test-navigation.js +1 -1
  350. package/dist/qti-test/components/test-next.d.ts +1 -1
  351. package/dist/qti-test/components/test-next.js +1 -1
  352. package/dist/qti-test/components/test-prev.d.ts +1 -1
  353. package/dist/qti-test/components/test-print-context.d.ts +1 -1
  354. package/dist/qti-test/components/test-print-item-variables.d.ts +1 -1
  355. package/dist/qti-test/components/test-scoring-buttons.d.ts +2 -1
  356. package/dist/qti-test/components/test-scoring-buttons.js +1 -1
  357. package/dist/qti-test/components/test-scoring-feedback.d.ts +9 -1273
  358. package/dist/qti-test/components/test-scoring-feedback.js +4 -60
  359. package/dist/qti-test/components/test-scoring-feedback.js.map +1 -1
  360. package/dist/qti-test/components/test-show-correct-response.d.ts +1 -1
  361. package/dist/qti-test/components/test-stamp.d.ts +18 -0
  362. package/dist/qti-test/components/test-stamp.js +9 -0
  363. package/dist/qti-test/components/test-stamp.js.map +1 -0
  364. package/dist/qti-test/components/test-view-toggle.d.ts +2 -2
  365. package/dist/qti-test/components/test-view-toggle.js +1 -1
  366. package/dist/qti-test/core/index.d.ts +4 -4
  367. package/dist/qti-test/core/index.js +3 -3
  368. package/dist/qti-test-feedback-CG8nrjhS.d.ts +98 -0
  369. package/dist/qti-test-feedback-R38tNXBH.d.ts +98 -0
  370. package/dist/qti-transformers/index.d.ts +4 -1
  371. package/dist/qti-transformers/index.js +1 -1
  372. package/dist/vscode.html-custom-data.json +38 -13
  373. package/package.json +4 -4
@@ -0,0 +1,375 @@
1
+ // src/lib/qti-transformers/qti-transformers.ts
2
+ var xml = String.raw;
3
+ var xmlToHTML = xml`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
+ <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
5
+ <xsl:template match="@*|node()">
6
+ <xsl:copy>
7
+ <xsl:apply-templates select="@*|node()"/>
8
+ </xsl:copy>
9
+ </xsl:template>
10
+
11
+ <!-- remove existing namespaces -->
12
+ <xsl:template match="*">
13
+ <!-- remove element prefix -->
14
+ <xsl:element name="{local-name()}">
15
+ <!-- process attributes -->
16
+ <xsl:for-each select="@*">
17
+ <!-- remove attribute prefix -->
18
+ <xsl:attribute name="{local-name()}">
19
+ <xsl:value-of select="."/>
20
+ </xsl:attribute>
21
+ </xsl:for-each>
22
+ <xsl:apply-templates/>
23
+ </xsl:element>
24
+ </xsl:template>
25
+ </xsl:stylesheet>`;
26
+ function extendElementName(xmlFragment, tagName, extension) {
27
+ xmlFragment.querySelectorAll(tagName).forEach((element) => {
28
+ const newTagName = `${tagName}-${extension}`;
29
+ const newElement = createElementWithNewTagName(element, newTagName);
30
+ element.replaceWith(newElement);
31
+ });
32
+ }
33
+ function extendElementsWithClass(xmlFragment, classNamePattern) {
34
+ xmlFragment.querySelectorAll("*").forEach((element) => {
35
+ const classList = element.classList;
36
+ if (classList) {
37
+ classList.forEach((className) => {
38
+ if (className.startsWith(`${classNamePattern}:`)) {
39
+ const suffix = className.slice(`${classNamePattern}:`.length);
40
+ const newTagName = `${element.nodeName}-${suffix}`;
41
+ const newElement = createElementWithNewTagName(element, newTagName);
42
+ element.replaceWith(newElement);
43
+ }
44
+ });
45
+ }
46
+ });
47
+ }
48
+ function createElementWithNewTagName(element, newTagName) {
49
+ const newElement = document.createElement(newTagName);
50
+ for (const attr of element.attributes) {
51
+ newElement.setAttribute(attr.name, attr.value);
52
+ }
53
+ while (element.firstChild) {
54
+ newElement.appendChild(element.firstChild);
55
+ }
56
+ return newElement;
57
+ }
58
+ function itemsFromTest(xmlFragment) {
59
+ const items = [];
60
+ xmlFragment.querySelectorAll("qti-assessment-item-ref").forEach((el) => {
61
+ const identifier = el.getAttribute("identifier");
62
+ const href = el.getAttribute("href");
63
+ const category = el.getAttribute("category");
64
+ items.push({ identifier, href, category });
65
+ });
66
+ return items;
67
+ }
68
+ function loadXML(url) {
69
+ const xhr = new XMLHttpRequest();
70
+ const promise = new Promise((resolve, reject) => {
71
+ xhr.open("GET", url, true);
72
+ xhr.responseType = "document";
73
+ xhr.onload = () => {
74
+ if (xhr.status >= 200 && xhr.status < 300) {
75
+ resolve(xhr.responseXML);
76
+ } else {
77
+ reject(xhr.statusText);
78
+ }
79
+ };
80
+ xhr.onerror = () => {
81
+ reject(xhr.statusText);
82
+ };
83
+ xhr.send();
84
+ });
85
+ return { promise, xhr };
86
+ }
87
+ function parseXML(xmlDocument) {
88
+ const parser = new DOMParser();
89
+ const xmlFragment = parser.parseFromString(xmlDocument, "text/xml");
90
+ return xmlFragment;
91
+ }
92
+ function toHTML(xmlFragment) {
93
+ const processor = new XSLTProcessor();
94
+ const xsltDocument = new DOMParser().parseFromString(xmlToHTML, "text/xml");
95
+ processor.importStylesheet(xsltDocument);
96
+ const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);
97
+ return itemHTMLFragment;
98
+ }
99
+ function setLocation(xmlFragment, location) {
100
+ if (!location.endsWith("/")) {
101
+ location += "/";
102
+ }
103
+ xmlFragment.querySelectorAll("[src],[href],[primary-path]").forEach((elWithSrc) => {
104
+ let attr = "";
105
+ if (elWithSrc.getAttribute("src")) {
106
+ attr = "src";
107
+ }
108
+ if (elWithSrc.getAttribute("href")) {
109
+ attr = "href";
110
+ }
111
+ if (elWithSrc.getAttribute("primary-path")) {
112
+ attr = "primary-path";
113
+ }
114
+ const attrValue = elWithSrc.getAttribute(attr)?.trim();
115
+ if (!attrValue.startsWith("data:") && !attrValue.startsWith("http")) {
116
+ const newSrcValue = location + encodeURI(attrValue);
117
+ elWithSrc.setAttribute(attr, newSrcValue);
118
+ }
119
+ });
120
+ }
121
+ function convertCDATAtoComment(xmlFragment) {
122
+ const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value');
123
+ cdataElements.forEach((element) => {
124
+ const commentText = document.createComment(element.textContent);
125
+ element.replaceChild(commentText, element.firstChild);
126
+ });
127
+ }
128
+ function stripStyleSheets(xmlFragment) {
129
+ xmlFragment.querySelectorAll("qti-stylesheet").forEach((stylesheet) => stylesheet.remove());
130
+ }
131
+ function getShuffleQuerySelectorByTagName(tagName) {
132
+ switch (tagName) {
133
+ case "qti-choice-interaction":
134
+ case "qti-order-interaction":
135
+ return "qti-simple-choice";
136
+ case "qti-inline-choice-interaction":
137
+ return "qti-inline-choice";
138
+ case "qti-match-interaction":
139
+ return [
140
+ "qti-simple-match-set:first-of-type qti-simple-associable-choice",
141
+ "qti-simple-match-set:last-of-type > qti-simple-associable-choice"
142
+ ];
143
+ case "qti-gap-match-interaction":
144
+ return "qti-gap-text";
145
+ case "qti-associate-interaction":
146
+ return "qti-simple-associable-choice";
147
+ default:
148
+ }
149
+ }
150
+
151
+ // src/lib/qti-transformers/qti-transform-item.ts
152
+ var qtiTransformItem = (cache = false) => {
153
+ let xmlFragment;
154
+ const api = {
155
+ load(uri) {
156
+ const fullKey = encodeURI(uri);
157
+ if (cache) {
158
+ if (sessionStorage.getItem(fullKey)) {
159
+ return {
160
+ api: Promise.resolve(api.parse(sessionStorage.getItem(fullKey))),
161
+ request: null
162
+ };
163
+ }
164
+ }
165
+ const { promise, xhr } = loadXML(uri);
166
+ const a = new Promise((resolve) => {
167
+ promise.then((xml2) => {
168
+ xmlFragment = xml2;
169
+ api.shuffleInteractions();
170
+ api.path(uri.substring(0, uri.lastIndexOf("/")));
171
+ if (cache) sessionStorage.setItem(fullKey, new XMLSerializer().serializeToString(xmlFragment));
172
+ return resolve(api);
173
+ });
174
+ });
175
+ return { api: a, request: xhr };
176
+ },
177
+ parse(xmlString) {
178
+ xmlFragment = parseXML(xmlString);
179
+ return api;
180
+ },
181
+ path: (location) => {
182
+ setLocation(xmlFragment, location);
183
+ return api;
184
+ },
185
+ fn(fn) {
186
+ fn(xmlFragment);
187
+ return api;
188
+ },
189
+ pciHooks(uri) {
190
+ const attributes = ["hook", "module"];
191
+ const documentPath = uri.substring(0, uri.lastIndexOf("/"));
192
+ for (const attribute of attributes) {
193
+ const srcAttributes = xmlFragment.querySelectorAll("[" + attribute + "]");
194
+ srcAttributes.forEach((node) => {
195
+ const srcValue = node.getAttribute(attribute);
196
+ if (!srcValue.startsWith("data:") && !srcValue.startsWith("http")) {
197
+ node.setAttribute("base-url", uri);
198
+ node.setAttribute(
199
+ "module",
200
+ documentPath + "/" + encodeURI(srcValue + (srcValue.endsWith(".js") ? "" : ".js"))
201
+ );
202
+ }
203
+ });
204
+ }
205
+ return api;
206
+ },
207
+ shuffleInteractions() {
208
+ const shuffleElements = xmlFragment.querySelectorAll(`[shuffle="true"]`);
209
+ const shuffleInteractions = Array.from(shuffleElements).filter(
210
+ (e) => e.tagName?.toLowerCase().endsWith("-interaction")
211
+ );
212
+ for (const shuffleInteraction of shuffleInteractions) {
213
+ const query = getShuffleQuerySelectorByTagName(shuffleInteraction.tagName.toLowerCase());
214
+ const queries = Array.isArray(query) ? query : [query];
215
+ for (const q of queries) {
216
+ const choices = Array.from(shuffleInteraction.querySelectorAll(q));
217
+ const fixedChoices = choices.map((choice, originalOrder2) => ({
218
+ element: choice,
219
+ fixed: choice.hasAttribute("fixed") && choice.getAttribute("fixed") === "true",
220
+ originalOrder: originalOrder2
221
+ })).filter((choice) => choice.fixed);
222
+ const nonFixedChoices = choices.filter(
223
+ (choice) => !choice.hasAttribute("fixed") || choice.getAttribute("fixed") !== "true"
224
+ );
225
+ if (nonFixedChoices.length <= 1) {
226
+ console.warn("Shuffling is not possible with fewer than 2 non-fixed elements.");
227
+ return api;
228
+ }
229
+ const originalOrder = [...nonFixedChoices];
230
+ let shuffled = false;
231
+ let attempts = 0;
232
+ while (!shuffled && attempts < 20) {
233
+ attempts++;
234
+ for (let i = nonFixedChoices.length - 1; i > 0; i--) {
235
+ const j = Math.floor(Math.random() * (i + 1));
236
+ [nonFixedChoices[i], nonFixedChoices[j]] = [nonFixedChoices[j], nonFixedChoices[i]];
237
+ }
238
+ shuffled = !nonFixedChoices.every((choice, index) => choice === originalOrder[index]);
239
+ }
240
+ if (!shuffled) {
241
+ console.warn("Failed to shuffle the choices after multiple attempts.");
242
+ return null;
243
+ }
244
+ shuffleInteraction.removeAttribute("shuffle");
245
+ let nonFixedIndex = 0;
246
+ for (const nonFixedChoice of nonFixedChoices) {
247
+ nonFixedChoice.parentElement.insertBefore(nonFixedChoice, fixedChoices[nonFixedIndex]?.element);
248
+ nonFixedIndex++;
249
+ }
250
+ for (const fixedChoice of fixedChoices) {
251
+ fixedChoice.element.parentElement.insertBefore(
252
+ fixedChoice.element,
253
+ nonFixedChoices[fixedChoice.originalOrder]
254
+ );
255
+ }
256
+ }
257
+ }
258
+ return api;
259
+ },
260
+ extendElementName: (tagName, extension) => {
261
+ extendElementName(xmlFragment, tagName, extension);
262
+ return api;
263
+ },
264
+ extendElementsWithClass: (param = "extend") => {
265
+ extendElementsWithClass(xmlFragment, param);
266
+ return api;
267
+ },
268
+ customInteraction(baseRef, baseItem) {
269
+ const qtiCustomInteraction = xmlFragment.querySelector("qti-custom-interaction");
270
+ const qtiCustomInteractionObject = qtiCustomInteraction.querySelector("object");
271
+ qtiCustomInteraction.setAttribute("data-base-ref", baseRef);
272
+ qtiCustomInteraction.setAttribute("data-base-item", baseRef + baseItem);
273
+ qtiCustomInteraction.setAttribute("data", qtiCustomInteractionObject.getAttribute("data"));
274
+ qtiCustomInteraction.setAttribute("width", qtiCustomInteractionObject.getAttribute("width"));
275
+ qtiCustomInteraction.setAttribute("height", qtiCustomInteractionObject.getAttribute("height"));
276
+ qtiCustomInteraction.removeChild(qtiCustomInteractionObject);
277
+ return api;
278
+ },
279
+ convertCDATAtoComment() {
280
+ convertCDATAtoComment(xmlFragment);
281
+ return api;
282
+ },
283
+ stripStyleSheets() {
284
+ stripStyleSheets(xmlFragment);
285
+ return api;
286
+ },
287
+ html() {
288
+ return new XMLSerializer().serializeToString(toHTML(xmlFragment));
289
+ },
290
+ xml() {
291
+ return new XMLSerializer().serializeToString(xmlFragment);
292
+ },
293
+ htmlDoc() {
294
+ return toHTML(xmlFragment);
295
+ },
296
+ xmlDoc() {
297
+ return xmlFragment;
298
+ }
299
+ };
300
+ return api;
301
+ };
302
+
303
+ // src/lib/qti-transformers/qti-transform-manifest.ts
304
+ var qtiTransformManifest = () => {
305
+ let xmlFragment;
306
+ const api = {
307
+ async load(uri) {
308
+ return new Promise((resolve) => {
309
+ loadXML(uri).promise.then((xml2) => {
310
+ xmlFragment = xml2;
311
+ return resolve(api);
312
+ });
313
+ });
314
+ },
315
+ parse(xmlString) {
316
+ xmlFragment = parseXML(xmlString);
317
+ },
318
+ assessmentTest() {
319
+ const el = xmlFragment.querySelector('resource[type="imsqti_test_xmlv3p0"]');
320
+ return { href: el.getAttribute("href"), identifier: el.getAttribute("identifier") };
321
+ }
322
+ };
323
+ return api;
324
+ };
325
+
326
+ // src/lib/qti-transformers/qti-transform-test.ts
327
+ var qtiTransformTest = () => {
328
+ let xmlFragment;
329
+ const api = {
330
+ async load(uri) {
331
+ return new Promise((resolve, _) => {
332
+ loadXML(uri).promise.then((xml2) => {
333
+ xmlFragment = xml2;
334
+ api.path(uri.substring(0, uri.lastIndexOf("/")));
335
+ return resolve(api);
336
+ });
337
+ });
338
+ },
339
+ parse(xmlString) {
340
+ xmlFragment = parseXML(xmlString);
341
+ return api;
342
+ },
343
+ path: (location) => {
344
+ setLocation(xmlFragment, location);
345
+ return api;
346
+ },
347
+ fn(fn) {
348
+ fn(xmlFragment);
349
+ return api;
350
+ },
351
+ items() {
352
+ return itemsFromTest(xmlFragment);
353
+ },
354
+ html() {
355
+ return new XMLSerializer().serializeToString(toHTML(xmlFragment));
356
+ },
357
+ xml() {
358
+ return new XMLSerializer().serializeToString(xmlFragment);
359
+ },
360
+ htmlDoc() {
361
+ return toHTML(xmlFragment);
362
+ },
363
+ xmlDoc() {
364
+ return xmlFragment;
365
+ }
366
+ };
367
+ return api;
368
+ };
369
+
370
+ export {
371
+ qtiTransformItem,
372
+ qtiTransformManifest,
373
+ qtiTransformTest
374
+ };
375
+ //# sourceMappingURL=chunk-H4XZSMVR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-transformers/qti-transformers.ts","../../src/lib/qti-transformers/qti-transform-item.ts","../../src/lib/qti-transformers/qti-transform-manifest.ts","../../src/lib/qti-transformers/qti-transform-test.ts"],"sourcesContent":["const xml = String.raw;\n\n/* <!-- convert CDATA to comments -->\n <xsl:template match=\"text()[contains(., 'CDATA')]\">\n <xsl:comment>\n <xsl:value-of select=\".\"/>\n </xsl:comment>\n</xsl:template>\n*/\n\n/*\n <!-- remove xml comments -->\n <xsl:template match=\"comment()\" />\n */\n\nconst xmlToHTML = xml`<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:output method=\"html\" version=\"5.0\" encoding=\"UTF-8\" indent=\"yes\" />\n <xsl:template match=\"@*|node()\">\n <xsl:copy>\n <xsl:apply-templates select=\"@*|node()\"/>\n </xsl:copy>\n </xsl:template>\n\n <!-- remove existing namespaces -->\n <xsl:template match=\"*\">\n <!-- remove element prefix -->\n <xsl:element name=\"{local-name()}\">\n <!-- process attributes -->\n <xsl:for-each select=\"@*\">\n <!-- remove attribute prefix -->\n <xsl:attribute name=\"{local-name()}\">\n <xsl:value-of select=\".\"/>\n </xsl:attribute>\n </xsl:for-each>\n <xsl:apply-templates/>\n </xsl:element>\n</xsl:template>\n</xsl:stylesheet>`;\n\n// Function to extend elements with a specific tag name by adding an extension suffix\nexport function extendElementName(xmlFragment: XMLDocument, tagName: string, extension: string) {\n xmlFragment.querySelectorAll(tagName).forEach(element => {\n const newTagName = `${tagName}-${extension}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n });\n}\n\n// Function to extend any element with a specific class pattern (e.g., \"extend:suffix\")\nexport function extendElementsWithClass(xmlFragment: XMLDocument, classNamePattern: string) {\n xmlFragment.querySelectorAll('*').forEach(element => {\n const classList = element.classList;\n if (classList) {\n classList.forEach(className => {\n if (className.startsWith(`${classNamePattern}:`)) {\n const suffix = className.slice(`${classNamePattern}:`.length);\n const newTagName = `${element.nodeName}-${suffix}`;\n const newElement = createElementWithNewTagName(element, newTagName);\n element.replaceWith(newElement);\n }\n });\n }\n });\n}\n\n// Helper function to create a new element with a new tag name and copy attributes and children\nfunction createElementWithNewTagName(element, newTagName) {\n const newElement = document.createElement(newTagName);\n // Copy attributes\n for (const attr of element.attributes) {\n newElement.setAttribute(attr.name, attr.value);\n }\n // Copy child nodes\n while (element.firstChild) {\n newElement.appendChild(element.firstChild);\n }\n return newElement;\n}\n\nexport function itemsFromTest(xmlFragment: DocumentFragment) {\n const items: { identifier: string; href: string; category: string }[] = [];\n xmlFragment.querySelectorAll('qti-assessment-item-ref').forEach(el => {\n const identifier = el.getAttribute('identifier');\n const href = el.getAttribute('href');\n const category = el.getAttribute('category');\n items.push({ identifier, href, category });\n });\n return items;\n}\n\n// let currentRequest: XMLHttpRequest | null = null;\n\nexport function loadXML(url): { promise: Promise<XMLDocument | null>; xhr: XMLHttpRequest } {\n const xhr = new XMLHttpRequest();\n\n const promise = new Promise<XMLDocument | null>((resolve, reject) => {\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 return { promise, xhr };\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\nexport function getShuffleQuerySelectorByTagName(tagName: string) {\n switch (tagName) {\n case 'qti-choice-interaction':\n case 'qti-order-interaction':\n return 'qti-simple-choice';\n case 'qti-inline-choice-interaction':\n return 'qti-inline-choice';\n case 'qti-match-interaction':\n return [\n 'qti-simple-match-set:first-of-type qti-simple-associable-choice',\n 'qti-simple-match-set:last-of-type > qti-simple-associable-choice'\n ];\n case 'qti-gap-match-interaction':\n return 'qti-gap-text';\n case 'qti-associate-interaction':\n return 'qti-simple-associable-choice';\n default:\n }\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 */\nimport {\n convertCDATAtoComment,\n extendElementName,\n extendElementsWithClass,\n getShuffleQuerySelectorByTagName,\n loadXML,\n parseXML,\n setLocation,\n stripStyleSheets,\n toHTML\n} from './qti-transformers';\n\nexport type transformItemApi = {\n load: (uri: string) => { api: Promise<transformItemApi>; request: XMLHttpRequest | null };\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 shuffleInteractions: () => transformItemApi;\n stripStyleSheets: () => transformItemApi;\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformItem = (cache: boolean = false) => {\n let xmlFragment: XMLDocument;\n\n const api: transformItemApi = {\n load(uri: string) {\n const fullKey = encodeURI(uri);\n if (cache) {\n if (sessionStorage.getItem(fullKey)) {\n return {\n api: Promise.resolve(api.parse(sessionStorage.getItem(fullKey)!)),\n request: null\n };\n }\n }\n const { promise, xhr } = loadXML(uri);\n const a = new Promise<typeof api>(resolve => {\n promise.then(xml => {\n xmlFragment = xml;\n api.shuffleInteractions();\n api.path(uri.substring(0, uri.lastIndexOf('/')));\n if (cache) sessionStorage.setItem(fullKey, new XMLSerializer().serializeToString(xmlFragment));\n return resolve(api);\n });\n });\n\n return { api: a, request: xhr };\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 shuffleInteractions(): typeof api {\n const shuffleElements = xmlFragment.querySelectorAll(`[shuffle=\"true\"]`);\n const shuffleInteractions = Array.from(shuffleElements).filter(e =>\n e.tagName?.toLowerCase().endsWith('-interaction')\n );\n\n for (const shuffleInteraction of shuffleInteractions) {\n const query = getShuffleQuerySelectorByTagName(shuffleInteraction.tagName.toLowerCase());\n const queries = Array.isArray(query) ? query : [query];\n\n for (const q of queries) {\n const choices = Array.from(shuffleInteraction.querySelectorAll(q)) as HTMLElement[];\n\n const fixedChoices = choices\n .map((choice, originalOrder) => ({\n element: choice,\n fixed: choice.hasAttribute('fixed') && choice.getAttribute('fixed') === 'true',\n originalOrder\n }))\n .filter(choice => choice.fixed);\n\n const nonFixedChoices = choices.filter(\n choice => !choice.hasAttribute('fixed') || choice.getAttribute('fixed') !== 'true'\n );\n\n if (nonFixedChoices.length <= 1) {\n console.warn('Shuffling is not possible with fewer than 2 non-fixed elements.');\n return api;\n }\n\n const originalOrder = [...nonFixedChoices];\n let shuffled = false;\n let attempts = 0;\n\n while (!shuffled && attempts < 20) {\n attempts++;\n for (let i = nonFixedChoices.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [nonFixedChoices[i], nonFixedChoices[j]] = [nonFixedChoices[j], nonFixedChoices[i]];\n }\n shuffled = !nonFixedChoices.every((choice, index) => choice === originalOrder[index]);\n }\n\n if (!shuffled) {\n console.warn('Failed to shuffle the choices after multiple attempts.');\n return null;\n }\n\n // Remove the shuffle attribute\n shuffleInteraction.removeAttribute('shuffle');\n\n // Reorder the elements in the DOM\n let nonFixedIndex = 0;\n for (const nonFixedChoice of nonFixedChoices) {\n nonFixedChoice.parentElement.insertBefore(nonFixedChoice, fixedChoices[nonFixedIndex]?.element);\n nonFixedIndex++;\n }\n for (const fixedChoice of fixedChoices) {\n fixedChoice.element.parentElement.insertBefore(\n fixedChoice.element,\n nonFixedChoices[fixedChoice.originalOrder]\n );\n }\n }\n }\n\n return api;\n },\n extendElementName: (tagName: string, extension: string): typeof api => {\n extendElementName(xmlFragment, tagName, extension);\n return api;\n },\n extendElementsWithClass: (param: string = 'extend'): typeof api => {\n extendElementsWithClass(xmlFragment, param);\n return api;\n },\n customInteraction(baseRef: string, baseItem: string): typeof api {\n const qtiCustomInteraction = xmlFragment.querySelector('qti-custom-interaction');\n const qtiCustomInteractionObject = qtiCustomInteraction.querySelector('object');\n\n qtiCustomInteraction.setAttribute('data-base-ref', baseRef);\n qtiCustomInteraction.setAttribute('data-base-item', baseRef + baseItem);\n qtiCustomInteraction.setAttribute('data', qtiCustomInteractionObject.getAttribute('data'));\n qtiCustomInteraction.setAttribute('width', qtiCustomInteractionObject.getAttribute('width'));\n qtiCustomInteraction.setAttribute('height', qtiCustomInteractionObject.getAttribute('height'));\n\n qtiCustomInteraction.removeChild(qtiCustomInteractionObject);\n return api;\n },\n convertCDATAtoComment(): typeof api {\n convertCDATAtoComment(xmlFragment);\n return api;\n },\n stripStyleSheets(): typeof api {\n stripStyleSheets(xmlFragment);\n return api;\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment; // new XMLSerializer().serializeToString(xmlFragment);\n }\n };\n return api;\n};\n","import { loadXML, parseXML } from './qti-transformers';\n\nexport const qtiTransformManifest = (): {\n load: (uri: string) => Promise<typeof api>;\n assessmentTest: () => { href: string; identifier: string };\n} => {\n let xmlFragment: XMLDocument;\n\n const api = {\n async load(uri) {\n return new Promise<typeof api>(resolve => {\n loadXML(uri).promise.then(xml => {\n xmlFragment = xml;\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n },\n assessmentTest() {\n const el = xmlFragment.querySelector('resource[type=\"imsqti_test_xmlv3p0\"]');\n return { href: el.getAttribute('href'), identifier: el.getAttribute('identifier') };\n }\n };\n return api;\n};\n","/**\n * Returns an object with methods to load, parse and transform QTI tests.\n * @returns An object with methods to load, parse and transform QTI tests.\n * @example\n * const qtiTransformer = qtiTransformTest();\n * await qtiTransformer.load('https://example.com/test.xml');\n * const items = qtiTransformer.items();\n * const html = qtiTransformer.html();\n * const xml = qtiTransformer.xml();\n */\n\nimport { itemsFromTest, loadXML, parseXML, setLocation, toHTML } from './qti-transformers';\n\nexport type transformTestApi = {\n load: (uri: string) => Promise<transformTestApi>;\n parse: (xmlString: string) => transformTestApi;\n path: (location: string) => transformTestApi;\n fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;\n items: () => { identifier: string; href: string; category: string }[];\n html: () => string;\n xml: () => string;\n htmlDoc: () => DocumentFragment;\n xmlDoc: () => XMLDocument;\n};\n\nexport const qtiTransformTest = (): transformTestApi => {\n let xmlFragment: XMLDocument;\n\n const api: transformTestApi = {\n async load(uri) {\n return new Promise<transformTestApi>((resolve, _) => {\n loadXML(uri).promise.then(xml => {\n xmlFragment = xml;\n\n api.path(uri.substring(0, uri.lastIndexOf('/')));\n return resolve(api);\n });\n });\n },\n parse(xmlString: string) {\n xmlFragment = parseXML(xmlString);\n return api;\n },\n path: (location: string): typeof api => {\n setLocation(xmlFragment, location);\n return api;\n },\n fn(fn: (xmlFragment: XMLDocument) => void) {\n fn(xmlFragment);\n return api;\n },\n items() {\n return itemsFromTest(xmlFragment);\n },\n html() {\n return new XMLSerializer().serializeToString(toHTML(xmlFragment));\n },\n xml(): string {\n return new XMLSerializer().serializeToString(xmlFragment);\n },\n htmlDoc() {\n return toHTML(xmlFragment);\n },\n xmlDoc(): XMLDocument {\n return xmlFragment;\n }\n };\n return api;\n};\n"],"mappings":";AAAA,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,UAAU;AAClE,YAAQ,YAAY,UAAU;AAAA,EAChC,CAAC;AACH;AAGO,SAAS,wBAAwB,aAA0B,kBAA0B;AAC1F,cAAY,iBAAiB,GAAG,EAAE,QAAQ,aAAW;AACnD,UAAM,YAAY,QAAQ;AAC1B,QAAI,WAAW;AACb,gBAAU,QAAQ,eAAa;AAC7B,YAAI,UAAU,WAAW,GAAG,gBAAgB,GAAG,GAAG;AAChD,gBAAM,SAAS,UAAU,MAAM,GAAG,gBAAgB,IAAI,MAAM;AAC5D,gBAAM,aAAa,GAAG,QAAQ,QAAQ,IAAI,MAAM;AAChD,gBAAM,aAAa,4BAA4B,SAAS,UAAU;AAClE,kBAAQ,YAAY,UAAU;AAAA,QAChC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;AAGA,SAAS,4BAA4B,SAAS,YAAY;AACxD,QAAM,aAAa,SAAS,cAAc,UAAU;AAEpD,aAAW,QAAQ,QAAQ,YAAY;AACrC,eAAW,aAAa,KAAK,MAAM,KAAK,KAAK;AAAA,EAC/C;AAEA,SAAO,QAAQ,YAAY;AACzB,eAAW,YAAY,QAAQ,UAAU;AAAA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;AAAA,IACA,GAAG,IAAwC;AACzC,SAAG,WAAW;AACd,aAAO;AAAA,IACT;AAAA,IACA,QAAQ;AACN,aAAO,cAAc,WAAW;AAAA,IAClC;AAAA,IACA,OAAO;AACL,aAAO,IAAI,cAAc,EAAE,kBAAkB,OAAO,WAAW,CAAC;AAAA,IAClE;AAAA,IACA,MAAc;AACZ,aAAO,IAAI,cAAc,EAAE,kBAAkB,WAAW;AAAA,IAC1D;AAAA,IACA,UAAU;AACR,aAAO,OAAO,WAAW;AAAA,IAC3B;AAAA,IACA,SAAsB;AACpB,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;","names":["xml","originalOrder","xml","xml"]}
@@ -0,0 +1,42 @@
1
+ import {
2
+ computedContext
3
+ } from "./chunk-6Z5YR5U2.js";
4
+ import {
5
+ __decorateClass
6
+ } from "./chunk-H2JE6IVU.js";
7
+
8
+ // src/lib/qti-test/components/test-stamp.ts
9
+ import { html, LitElement } from "lit";
10
+ import { customElement } from "lit/decorators.js";
11
+ import { prepareTemplate } from "stampino";
12
+ import { consume } from "@lit/context";
13
+ var TestStamp = class extends LitElement {
14
+ createRenderRoot() {
15
+ return this;
16
+ }
17
+ connectedCallback() {
18
+ super.connectedCallback();
19
+ const templateElement = this.querySelector("template");
20
+ this.myTemplate = prepareTemplate(templateElement);
21
+ }
22
+ render() {
23
+ if (!this.computedContext) return html``;
24
+ const activeItems = this.computedContext?.testParts.flatMap(
25
+ (testPart) => testPart.sections.flatMap((section) => section.items).find((item) => item.active)
26
+ );
27
+ const activeItem = activeItems && activeItems.length > 0 ? activeItems[0] : null;
28
+ if (!activeItem) return html``;
29
+ return html`${this.myTemplate({ computedContext: this.computedContext, item: activeItem })}`;
30
+ }
31
+ };
32
+ __decorateClass([
33
+ consume({ context: computedContext, subscribe: true })
34
+ ], TestStamp.prototype, "computedContext", 2);
35
+ TestStamp = __decorateClass([
36
+ customElement("test-stamp")
37
+ ], TestStamp);
38
+
39
+ export {
40
+ TestStamp
41
+ };
42
+ //# sourceMappingURL=chunk-H6O2X4MD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from 'stampino';\n\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n myTemplate: TemplateFunction;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n render() {\n if (!this.computedContext) return html``;\n const activeItems = this.computedContext?.testParts.flatMap(testPart =>\n testPart.sections.flatMap(section => section.items).find(item => item.active)\n );\n const activeItem = activeItems && activeItems.length > 0 ? activeItems[0] : null;\n if (!activeItem) return html``;\n return html`${this.myTemplate({ computedContext: this.computedContext, item: activeItem })}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAQjB,IAAM,YAAN,cAAwB,WAAW;AAAA,EAM9B,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEA,SAAS;AACP,QAAI,CAAC,KAAK,gBAAiB,QAAO;AAClC,UAAM,cAAc,KAAK,iBAAiB,UAAU;AAAA,MAAQ,cAC1D,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK,EAAE,KAAK,UAAQ,KAAK,MAAM;AAAA,IAC9E;AACA,UAAM,aAAa,eAAe,YAAY,SAAS,IAAI,YAAY,CAAC,IAAI;AAC5E,QAAI,CAAC,WAAY,QAAO;AACxB,WAAO,OAAO,KAAK,WAAW,EAAE,iBAAiB,KAAK,iBAAiB,MAAM,WAAW,CAAC,CAAC;AAAA,EAC5F;AACF;AAvBU;AAAA,EADP,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAD3C,UAEH;AAFG,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}