@citolab/qti-components 7.0.8 → 7.0.9-beta.1

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 (545) hide show
  1. package/cdn/chunks/chunk-3AHQU35T.js +1 -0
  2. package/cdn/chunks/chunk-4AGTWY6I.js +1 -0
  3. package/cdn/{chunk-A536ZOJJ.js → chunks/chunk-6EIGTAJQ.js} +2 -4
  4. package/cdn/chunks/chunk-6UEXCXHG.js +17 -0
  5. package/cdn/chunks/chunk-BJL2ZC5L.js +1 -0
  6. package/{dist/chunks/chunk-NZQKGIJP.js → cdn/chunks/chunk-DKMHSSEK.js} +13 -24
  7. package/cdn/chunks/chunk-EG3QNAM6.js +939 -0
  8. package/cdn/chunks/chunk-FB3WTNRH.js +8 -0
  9. package/cdn/chunks/chunk-GCKESRQG.js +1 -0
  10. package/cdn/chunks/{chunk-4ILXLVT5.js → chunk-I5J4YQIW.js} +13 -34
  11. package/cdn/chunks/chunk-IKDNYCM7.js +1 -0
  12. package/cdn/chunks/chunk-KDO3T66B.js +1 -0
  13. package/cdn/chunks/chunk-KQPTKMFJ.js +1 -0
  14. package/cdn/chunks/chunk-M5PPZ5M3.js +59 -0
  15. package/cdn/chunks/chunk-O5MMIBRR.js +10 -0
  16. package/cdn/chunks/chunk-OEXGDZO2.js +8 -0
  17. package/cdn/chunks/{chunk-RXKI3AO4.js → chunk-R45JL2ZY.js} +1 -1
  18. package/cdn/chunks/chunk-W2VSEYLY.js +8 -0
  19. package/cdn/chunks/chunk-WYDU2FBY.js +8 -0
  20. package/cdn/chunks/chunk-X7T7HK65.js +8 -0
  21. package/cdn/chunks/{chunk-X2KBNXRO.js → chunk-YIYKK4RV.js} +1 -1
  22. package/cdn/exports/computed.context.js +1 -0
  23. package/cdn/exports/config.context.js +1 -0
  24. package/cdn/exports/qti-assessment-item.context.js +1 -1
  25. package/cdn/exports/qti-condition-expression.js +1 -1
  26. package/cdn/exports/qti-expression.js +1 -1
  27. package/cdn/exports/session.context.js +1 -0
  28. package/cdn/exports/test.context.js +1 -0
  29. package/cdn/index.global.js +1 -1
  30. package/cdn/index.js +1 -1
  31. package/cdn/qti-components/index.js +1 -1
  32. package/cdn/qti-item/core/index.js +1 -1
  33. package/cdn/qti-test/components/index.js +1 -1
  34. package/cdn/qti-test/components/test-container.js +1 -3549
  35. package/cdn/qti-test/components/test-end-attempt.js +1 -1
  36. package/cdn/qti-test/components/test-item-link.js +1 -1
  37. package/cdn/qti-test/components/test-navigation.js +1 -0
  38. package/cdn/qti-test/components/test-next.js +1 -1
  39. package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
  40. package/cdn/qti-test/components/test-prev.js +1 -1
  41. package/cdn/qti-test/components/test-show-correct-response.js +1 -1
  42. package/cdn/qti-test/components/test-view.js +1 -1
  43. package/cdn/qti-test/core/index.js +1 -1
  44. package/dist/chunks/chunk-3A4IOMBQ.js +8 -0
  45. package/dist/chunks/chunk-3A4IOMBQ.js.map +1 -0
  46. package/dist/chunks/{chunk-E4TWZ2DL.js → chunk-5E4OEZCA.js} +495 -179
  47. package/dist/chunks/chunk-5E4OEZCA.js.map +1 -0
  48. package/dist/chunks/{chunk-J2SHENRN.js → chunk-BH5H7BSS.js} +107 -21
  49. package/dist/chunks/chunk-BH5H7BSS.js.map +1 -0
  50. package/dist/chunks/chunk-CBYNKDSF.js +1 -0
  51. package/dist/chunks/{chunk-WWN5AD6V.js → chunk-CHINL5UJ.js} +12 -7
  52. package/dist/chunks/chunk-CHINL5UJ.js.map +1 -0
  53. package/dist/chunks/{chunk-W4272Q5U.js → chunk-CWCYTL3F.js} +18 -8
  54. package/dist/chunks/chunk-CWCYTL3F.js.map +1 -0
  55. package/dist/chunks/{chunk-GQ5P3NWC.js → chunk-FZVLLSCM.js} +18 -8
  56. package/dist/chunks/chunk-FZVLLSCM.js.map +1 -0
  57. package/dist/chunks/chunk-GNCPECOC.js +45 -0
  58. package/dist/chunks/chunk-GNCPECOC.js.map +1 -0
  59. package/dist/chunks/{chunk-YOXF6JPS.js → chunk-GRYVMG5Q.js} +135 -193
  60. package/dist/chunks/chunk-GRYVMG5Q.js.map +1 -0
  61. package/dist/chunks/{chunk-BPHQLJWE.js → chunk-I7HVKMDI.js} +2 -2
  62. package/dist/chunks/chunk-I7HVKMDI.js.map +1 -0
  63. package/dist/chunks/chunk-J4MM4JXS.js +8 -0
  64. package/dist/chunks/chunk-J4MM4JXS.js.map +1 -0
  65. package/dist/chunks/{chunk-FV7HWK54.js → chunk-JUAS2TVR.js} +1 -1
  66. package/dist/chunks/chunk-JUAS2TVR.js.map +1 -0
  67. package/dist/chunks/chunk-K6EUKFNW.js +43 -0
  68. package/dist/chunks/chunk-K6EUKFNW.js.map +1 -0
  69. package/dist/chunks/chunk-LZ7UIV5O.js +91 -0
  70. package/dist/chunks/chunk-LZ7UIV5O.js.map +1 -0
  71. package/dist/chunks/{chunk-KOEILLVS.js → chunk-NJNQOQUU.js} +1 -1
  72. package/dist/chunks/chunk-NJNQOQUU.js.map +1 -0
  73. package/dist/chunks/chunk-ODLYMQOS.js +8 -0
  74. package/dist/chunks/chunk-ODLYMQOS.js.map +1 -0
  75. package/dist/chunks/{chunk-XSI6FXGD.js → chunk-OOQLWOYU.js} +2 -2
  76. package/dist/chunks/{chunk-NHA53UTY.js → chunk-PR6AZWRP.js} +3 -6
  77. package/dist/chunks/chunk-PR6AZWRP.js.map +1 -0
  78. package/dist/chunks/chunk-QAA6MWGE.js +170 -0
  79. package/dist/chunks/chunk-QAA6MWGE.js.map +1 -0
  80. package/dist/{chunk-2CHF3TMY.js → chunks/chunk-QGPXAPBK.js} +119 -20
  81. package/dist/chunks/chunk-QGPXAPBK.js.map +1 -0
  82. package/dist/chunks/chunk-QTH3WLGY.js +8 -0
  83. package/dist/chunks/chunk-QTH3WLGY.js.map +1 -0
  84. package/dist/chunks/{chunk-DLUJN2FW.js → chunk-W7ZXKJ5O.js} +1 -1
  85. package/dist/chunks/chunk-W7ZXKJ5O.js.map +1 -0
  86. package/dist/chunks/{chunk-OIRWOI3E.js → chunk-WRHEO7NG.js} +1 -1
  87. package/dist/chunks/chunk-WRHEO7NG.js.map +1 -0
  88. package/dist/chunks/chunk-WXART76T.js +95 -0
  89. package/dist/chunks/chunk-WXART76T.js.map +1 -0
  90. package/dist/exports/computed.context.d.ts +30 -0
  91. package/dist/exports/computed.context.js +8 -0
  92. package/dist/exports/config.context.d.ts +8 -0
  93. package/dist/exports/config.context.js +8 -0
  94. package/dist/exports/interaction.js +1 -1
  95. package/dist/exports/item.context.d.ts +3 -3
  96. package/dist/exports/item.context.js +1 -1
  97. package/dist/exports/qti-assessment-item.context.d.ts +1 -1
  98. package/dist/exports/qti-assessment-item.context.js +1 -1
  99. package/dist/exports/qti-condition-expression.d.ts +1 -1
  100. package/dist/exports/qti-condition-expression.js +3 -3
  101. package/dist/exports/qti-expression.d.ts +1 -1
  102. package/dist/exports/qti-expression.js +2 -2
  103. package/dist/exports/session.context.d.ts +12 -0
  104. package/dist/exports/session.context.js +8 -0
  105. package/dist/exports/test.context.d.ts +16 -0
  106. package/dist/exports/test.context.js +8 -0
  107. package/dist/exports/variables.d.ts +1 -1
  108. package/dist/index.d.ts +11 -6
  109. package/dist/index.js +62 -55
  110. package/dist/item.css +7 -16
  111. package/dist/qti-components/index.d.ts +44 -26
  112. package/dist/qti-components/index.js +11 -7
  113. package/dist/qti-components-jsx.d.ts +144 -86
  114. package/dist/qti-item/core/index.js +2 -3
  115. package/dist/qti-loader/index.d.ts +2 -2
  116. package/dist/qti-loader/index.js +1 -1
  117. package/dist/{qti-response-declaration-Di9CsqiJ.d.ts → qti-response-declaration-CESClJ3_.d.ts} +7 -3
  118. package/dist/qti-test/components/index.d.ts +11 -5
  119. package/dist/qti-test/components/index.js +28 -19
  120. package/dist/qti-test/components/test-container.d.ts +3 -1
  121. package/dist/qti-test/components/test-container.js +6 -3778
  122. package/dist/qti-test/components/test-container.js.map +1 -1
  123. package/dist/qti-test/components/test-end-attempt.d.ts +4 -11
  124. package/dist/qti-test/components/test-end-attempt.js +3 -5
  125. package/dist/qti-test/components/test-item-link.d.ts +2 -11
  126. package/dist/qti-test/components/test-item-link.js +1 -5
  127. package/dist/qti-test/components/test-navigation.d.ts +35 -0
  128. package/dist/qti-test/components/test-navigation.js +12 -0
  129. package/dist/qti-test/components/test-navigation.js.map +1 -0
  130. package/dist/qti-test/components/test-next.d.ts +12 -12
  131. package/dist/qti-test/components/test-next.js +4 -4
  132. package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +8 -15
  133. package/dist/qti-test/components/test-paging-buttons-stamp.js +2 -5
  134. package/dist/qti-test/components/test-prev.d.ts +11 -12
  135. package/dist/qti-test/components/test-prev.js +4 -4
  136. package/dist/qti-test/components/test-show-correct-response.d.ts +4 -11
  137. package/dist/qti-test/components/test-show-correct-response.js +3 -5
  138. package/dist/qti-test/components/test-view.d.ts +3 -12
  139. package/dist/qti-test/components/test-view.js +2 -4
  140. package/dist/qti-test/core/index.d.ts +18 -48
  141. package/dist/qti-test/core/index.js +7 -12
  142. package/dist/{test.context-C2LBA3w4.d.ts → qti-test-part-BAM_WUTL.d.ts} +17 -33
  143. package/dist/{variables-cO3DzqJy.d.ts → variables-DNDfraER.d.ts} +14 -1
  144. package/dist/vscode.html-custom-data.json +49 -30
  145. package/package.json +20 -19
  146. package/cdn/chunk-4DFVJE2A.js +0 -48
  147. package/cdn/chunk-4I75QSIL.js +0 -8
  148. package/cdn/chunk-5WCOPF7O.js +0 -73
  149. package/cdn/chunk-66PERJA3.js +0 -939
  150. package/cdn/chunk-6WNSQ7U6.js +0 -939
  151. package/cdn/chunk-AT2C24P4.js +0 -8
  152. package/cdn/chunk-BLKKKK6C.js +0 -11
  153. package/cdn/chunk-DC2R556M.js +0 -5
  154. package/cdn/chunk-GALSGMIP.js +0 -5
  155. package/cdn/chunk-IXSX4SJX.js +0 -1
  156. package/cdn/chunk-KYOTSBCX.js +0 -1
  157. package/cdn/chunk-L4TDHAKL.js +0 -24
  158. package/cdn/chunk-LVW3MHTI.js +0 -23
  159. package/cdn/chunk-M6AATWPS.js +0 -59
  160. package/cdn/chunk-MFWSHIPH.js +0 -17
  161. package/cdn/chunk-QGKK4T2J.js +0 -8
  162. package/cdn/chunk-ROXN2HIJ.js +0 -8
  163. package/cdn/chunk-SQDSHH6N.js +0 -3539
  164. package/cdn/chunk-TJMODUN5.js +0 -8
  165. package/cdn/chunk-VI2WKTN4.js +0 -1
  166. package/cdn/chunk-Z6SKK5ZX.js +0 -8
  167. package/cdn/chunks/chunk-3GO57DNP.js +0 -0
  168. package/cdn/chunks/chunk-3V6LA7B3.js +0 -8
  169. package/cdn/chunks/chunk-4PEUIMDK.js +0 -8
  170. package/cdn/chunks/chunk-4WXQYE2P.js +0 -8
  171. package/cdn/chunks/chunk-5P7CTN7Q.js +0 -11
  172. package/cdn/chunks/chunk-5X76K77R.js +0 -8
  173. package/cdn/chunks/chunk-6MCYE7P5.js +0 -1
  174. package/cdn/chunks/chunk-6PW2L463.js +0 -0
  175. package/cdn/chunks/chunk-6S4CDN3T.js +0 -43
  176. package/cdn/chunks/chunk-76VGZJCP.js +0 -934
  177. package/cdn/chunks/chunk-7RBGYKOX.js +0 -5
  178. package/cdn/chunks/chunk-7XYBFL7U.js +0 -934
  179. package/cdn/chunks/chunk-AJJJAZWM.js +0 -1
  180. package/cdn/chunks/chunk-ANDPD7F2.js +0 -5
  181. package/cdn/chunks/chunk-ARHBUT6F.js +0 -5
  182. package/cdn/chunks/chunk-AUHO2E7V.js +0 -934
  183. package/cdn/chunks/chunk-CZ3CSGCE.js +0 -934
  184. package/cdn/chunks/chunk-D3GR6AUG.js +0 -43
  185. package/cdn/chunks/chunk-DZCKF45D.js +0 -5
  186. package/cdn/chunks/chunk-EFU4L43Q.js +0 -8
  187. package/cdn/chunks/chunk-FM5C34DM.js +0 -934
  188. package/cdn/chunks/chunk-FRS2J3OS.js +0 -59
  189. package/cdn/chunks/chunk-GMK2YRB2.js +0 -934
  190. package/cdn/chunks/chunk-H2V2RXUW.js +0 -11
  191. package/cdn/chunks/chunk-HUMOYGEM.js +0 -43
  192. package/cdn/chunks/chunk-IMJOPCFR.js +0 -1
  193. package/cdn/chunks/chunk-IQZ7AOCQ.js +0 -8
  194. package/cdn/chunks/chunk-J3JSSCM6.js +0 -5
  195. package/cdn/chunks/chunk-KHLUVO6Y.js +0 -8
  196. package/cdn/chunks/chunk-LARBLB7K.js +0 -8
  197. package/cdn/chunks/chunk-LNFCEHB3.js +0 -934
  198. package/cdn/chunks/chunk-MJMONWKB.js +0 -3539
  199. package/cdn/chunks/chunk-N5OHGRGG.js +0 -8
  200. package/cdn/chunks/chunk-NDHSIO2G.js +0 -8
  201. package/cdn/chunks/chunk-NRY3WHJD.js +0 -5
  202. package/cdn/chunks/chunk-PKT2SJQD.js +0 -8
  203. package/cdn/chunks/chunk-PPWEIKLT.js +0 -1
  204. package/cdn/chunks/chunk-PT523RSK.js +0 -8
  205. package/cdn/chunks/chunk-QD3NT5PG.js +0 -934
  206. package/cdn/chunks/chunk-QTK4CPHP.js +0 -8
  207. package/cdn/chunks/chunk-QV6I5NVQ.js +0 -8
  208. package/cdn/chunks/chunk-R33OODNX.js +0 -1
  209. package/cdn/chunks/chunk-RIXTWE2H.js +0 -8
  210. package/cdn/chunks/chunk-ROZIP5LG.js +0 -8
  211. package/cdn/chunks/chunk-RPZVSBLM.js +0 -8
  212. package/cdn/chunks/chunk-SATSEEWJ.js +0 -934
  213. package/cdn/chunks/chunk-SXM25YH3.js +0 -934
  214. package/cdn/chunks/chunk-T2KKTMAT.js +0 -934
  215. package/cdn/chunks/chunk-TEYXRLTI.js +0 -8
  216. package/cdn/chunks/chunk-TQBDBMWL.js +0 -5
  217. package/cdn/chunks/chunk-TV3SPOLH.js +0 -8
  218. package/cdn/chunks/chunk-TVDTF6P6.js +0 -934
  219. package/cdn/chunks/chunk-U2TE6TOV.js +0 -934
  220. package/cdn/chunks/chunk-W5Y3ZU2W.js +0 -5
  221. package/cdn/chunks/chunk-WPGJ54IP.js +0 -1
  222. package/cdn/chunks/chunk-YHWMZAZD.js +0 -43
  223. package/cdn/chunks/chunk-YVZ742ID.js +0 -934
  224. package/cdn/chunks/chunk-YWH4TGMA.js +0 -5
  225. package/cdn/chunks/chunk-YXR6KSZI.js +0 -11
  226. package/cdn/qti-components/index.global.js +0 -226
  227. package/cdn/qti-item/components/index.global.js +0 -149
  228. package/cdn/qti-item/components/index.js +0 -3549
  229. package/cdn/qti-item/components/item-container.global.js +0 -149
  230. package/cdn/qti-item/components/item-container.js +0 -3549
  231. package/cdn/qti-item/core/index.global.js +0 -149
  232. package/cdn/qti-item/index.global.js +0 -149
  233. package/cdn/qti-item/index.js +0 -3549
  234. package/cdn/qti-item/qti-item.global.js +0 -114
  235. package/cdn/qti-item/qti-item.js +0 -1
  236. package/cdn/qti-loader/index.global.js +0 -1
  237. package/cdn/qti-test/components/index.global.js +0 -207
  238. package/cdn/qti-test/components/styles.global.js +0 -44
  239. package/cdn/qti-test/components/test-component.abstract.global.js +0 -170
  240. package/cdn/qti-test/components/test-component.abstract.js +0 -1
  241. package/cdn/qti-test/components/test-container.global.js +0 -149
  242. package/cdn/qti-test/components/test-item-link.global.js +0 -170
  243. package/cdn/qti-test/components/test-next.global.js +0 -170
  244. package/cdn/qti-test/components/test-next.spec.css +0 -1
  245. package/cdn/qti-test/components/test-next.spec.global.js +0 -64
  246. package/cdn/qti-test/components/test-next.spec.js +0 -713
  247. package/cdn/qti-test/components/test-paging-buttons-stamp.global.js +0 -207
  248. package/cdn/qti-test/components/test-prev.global.js +0 -170
  249. package/cdn/qti-test/components/test-view.global.js +0 -170
  250. package/cdn/qti-test/context/index.global.js +0 -58
  251. package/cdn/qti-test/context/index.js +0 -1
  252. package/cdn/qti-test/context/test.context.global.js +0 -58
  253. package/cdn/qti-test/context/test.context.js +0 -1
  254. package/cdn/qti-test/core/index.global.js +0 -205
  255. package/cdn/qti-test/index.global.js +0 -242
  256. package/cdn/qti-test/index.js +0 -3598
  257. package/cdn/qti-test/mixins/index.global.js +0 -1
  258. package/cdn/qti-test/mixins/index.js +0 -23
  259. package/cdn/qti-test/mixins/test-loader.mixin.global.js +0 -1
  260. package/cdn/qti-test/mixins/test-loader.mixin.js +0 -23
  261. package/cdn/qti-test/mixins/test-navigation.mixin.global.js +0 -1
  262. package/cdn/qti-test/mixins/test-navigation.mixin.js +0 -1
  263. package/cdn/qti-test/mixins/test-view.mixin.global.js +0 -1
  264. package/cdn/qti-test/mixins/test-view.mixin.js +0 -1
  265. package/cdn/qti-test/qti-assessment-test/index.global.js +0 -170
  266. package/cdn/qti-test/qti-assessment-test/index.js +0 -1
  267. package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.global.js +0 -170
  268. package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -1
  269. package/cdn/qti-test/qti-assessment-test/qti-assessment-section.global.js +0 -170
  270. package/cdn/qti-test/qti-assessment-test/qti-assessment-section.js +0 -1
  271. package/cdn/qti-test/qti-assessment-test/qti-assessment-test.global.js +0 -170
  272. package/cdn/qti-test/qti-assessment-test/qti-assessment-test.js +0 -1
  273. package/cdn/qti-test/qti-assessment-test/qti-test-part.global.js +0 -114
  274. package/cdn/qti-test/qti-assessment-test/qti-test-part.js +0 -1
  275. package/cdn/qti-test/qti-test.global.js +0 -170
  276. package/cdn/qti-test/qti-test.js +0 -23
  277. package/cdn/qti-test/test-base.global.js +0 -170
  278. package/cdn/qti-test/test-base.js +0 -1
  279. package/cdn/qti-transformers/index.global.js +0 -1
  280. package/dist/chunk-2CHF3TMY.js.map +0 -1
  281. package/dist/chunk-2LWLX7WV.js +0 -6307
  282. package/dist/chunk-2LWLX7WV.js.map +0 -1
  283. package/dist/chunk-2OA7E3E7.js +0 -294
  284. package/dist/chunk-2OA7E3E7.js.map +0 -1
  285. package/dist/chunk-3G364JZC.js +0 -72
  286. package/dist/chunk-3G364JZC.js.map +0 -1
  287. package/dist/chunk-44VE5POH.js +0 -55
  288. package/dist/chunk-4YG2FPKK.js +0 -31
  289. package/dist/chunk-4YG2FPKK.js.map +0 -1
  290. package/dist/chunk-6TUE644E.js +0 -569
  291. package/dist/chunk-6TUE644E.js.map +0 -1
  292. package/dist/chunk-6ZMD232X.js +0 -78
  293. package/dist/chunk-6ZMD232X.js.map +0 -1
  294. package/dist/chunk-AYRSHIHA.js +0 -50
  295. package/dist/chunk-AYRSHIHA.js.map +0 -1
  296. package/dist/chunk-BN32D5J2.js +0 -43
  297. package/dist/chunk-BN32D5J2.js.map +0 -1
  298. package/dist/chunk-CJRXRBRQ.js +0 -50
  299. package/dist/chunk-CJRXRBRQ.js.map +0 -1
  300. package/dist/chunk-GPJ6WTE5.js +0 -118
  301. package/dist/chunk-GPJ6WTE5.js.map +0 -1
  302. package/dist/chunk-KAUHKHPH.js +0 -50
  303. package/dist/chunk-KAUHKHPH.js.map +0 -1
  304. package/dist/chunk-MAC76UNI.js +0 -1
  305. package/dist/chunk-QYN5S4EM.js +0 -107
  306. package/dist/chunk-QYN5S4EM.js.map +0 -1
  307. package/dist/chunk-UB5K44DB.js +0 -30
  308. package/dist/chunk-UB5K44DB.js.map +0 -1
  309. package/dist/chunk-UJTJIU3C.js +0 -43
  310. package/dist/chunk-UJTJIU3C.js.map +0 -1
  311. package/dist/chunk-XVQZ5JI5.js +0 -50
  312. package/dist/chunk-XVQZ5JI5.js.map +0 -1
  313. package/dist/chunk-XW3PQRKW.js +0 -6306
  314. package/dist/chunk-XW3PQRKW.js.map +0 -1
  315. package/dist/chunk-YQ7EXOAK.js +0 -10
  316. package/dist/chunk-YQ7EXOAK.js.map +0 -1
  317. package/dist/chunks/chunk-2V6LQV2K.js +0 -50
  318. package/dist/chunks/chunk-2V6LQV2K.js.map +0 -1
  319. package/dist/chunks/chunk-3EU75IUF.js +0 -118
  320. package/dist/chunks/chunk-3EU75IUF.js.map +0 -1
  321. package/dist/chunks/chunk-3QQFMVDS.js +0 -118
  322. package/dist/chunks/chunk-3QQFMVDS.js.map +0 -1
  323. package/dist/chunks/chunk-4GNVYCBN.js +0 -627
  324. package/dist/chunks/chunk-4GNVYCBN.js.map +0 -1
  325. package/dist/chunks/chunk-4MQV5IRV.js +0 -59
  326. package/dist/chunks/chunk-4MQV5IRV.js.map +0 -1
  327. package/dist/chunks/chunk-4WVLWWYJ.js +0 -50
  328. package/dist/chunks/chunk-4WVLWWYJ.js.map +0 -1
  329. package/dist/chunks/chunk-5KVGRLYT.js +0 -10
  330. package/dist/chunks/chunk-5KVGRLYT.js.map +0 -1
  331. package/dist/chunks/chunk-5PCD2B62.js +0 -6091
  332. package/dist/chunks/chunk-5PCD2B62.js.map +0 -1
  333. package/dist/chunks/chunk-5RTLOB3Q.js +0 -59
  334. package/dist/chunks/chunk-5RTLOB3Q.js.map +0 -1
  335. package/dist/chunks/chunk-6JXR63MH.js +0 -50
  336. package/dist/chunks/chunk-6JXR63MH.js.map +0 -1
  337. package/dist/chunks/chunk-6PAEJQSQ.js +0 -6058
  338. package/dist/chunks/chunk-6PAEJQSQ.js.map +0 -1
  339. package/dist/chunks/chunk-6QT4LIPL.js +0 -623
  340. package/dist/chunks/chunk-6QT4LIPL.js.map +0 -1
  341. package/dist/chunks/chunk-7QMCKYDR.js +0 -43
  342. package/dist/chunks/chunk-7QMCKYDR.js.map +0 -1
  343. package/dist/chunks/chunk-A24F75DB.js +0 -72
  344. package/dist/chunks/chunk-A24F75DB.js.map +0 -1
  345. package/dist/chunks/chunk-AUWATZ65.js +0 -10
  346. package/dist/chunks/chunk-AUWATZ65.js.map +0 -1
  347. package/dist/chunks/chunk-AXTEKPP5.js +0 -6084
  348. package/dist/chunks/chunk-AXTEKPP5.js.map +0 -1
  349. package/dist/chunks/chunk-B6MJCAOF.js +0 -6063
  350. package/dist/chunks/chunk-B6MJCAOF.js.map +0 -1
  351. package/dist/chunks/chunk-BJ2JLJIJ.js +0 -623
  352. package/dist/chunks/chunk-BJ2JLJIJ.js.map +0 -1
  353. package/dist/chunks/chunk-BPHQLJWE.js.map +0 -1
  354. package/dist/chunks/chunk-CD3E4M5Y.js +0 -107
  355. package/dist/chunks/chunk-CD3E4M5Y.js.map +0 -1
  356. package/dist/chunks/chunk-CEXAR7BF.js +0 -52
  357. package/dist/chunks/chunk-CEXAR7BF.js.map +0 -1
  358. package/dist/chunks/chunk-CWYAQA25.js +0 -6067
  359. package/dist/chunks/chunk-CWYAQA25.js.map +0 -1
  360. package/dist/chunks/chunk-D3QX5N57.js +0 -6117
  361. package/dist/chunks/chunk-D3QX5N57.js.map +0 -1
  362. package/dist/chunks/chunk-DLUJN2FW.js.map +0 -1
  363. package/dist/chunks/chunk-DNHDFXTV.js +0 -59
  364. package/dist/chunks/chunk-DNHDFXTV.js.map +0 -1
  365. package/dist/chunks/chunk-E4TWZ2DL.js.map +0 -1
  366. package/dist/chunks/chunk-FV7HWK54.js.map +0 -1
  367. package/dist/chunks/chunk-GQ5P3NWC.js.map +0 -1
  368. package/dist/chunks/chunk-GSWZT6N2.js +0 -50
  369. package/dist/chunks/chunk-GSWZT6N2.js.map +0 -1
  370. package/dist/chunks/chunk-HHVRU3AJ.js +0 -107
  371. package/dist/chunks/chunk-HHVRU3AJ.js.map +0 -1
  372. package/dist/chunks/chunk-HOTNM5DT.js +0 -1
  373. package/dist/chunks/chunk-IWG66KQQ.js +0 -107
  374. package/dist/chunks/chunk-IWG66KQQ.js.map +0 -1
  375. package/dist/chunks/chunk-J2SHENRN.js.map +0 -1
  376. package/dist/chunks/chunk-K6ATVWMP.js +0 -6091
  377. package/dist/chunks/chunk-K6ATVWMP.js.map +0 -1
  378. package/dist/chunks/chunk-KOEILLVS.js.map +0 -1
  379. package/dist/chunks/chunk-KYAIMBP5.js +0 -78
  380. package/dist/chunks/chunk-KYAIMBP5.js.map +0 -1
  381. package/dist/chunks/chunk-LNISKMIL.js +0 -6063
  382. package/dist/chunks/chunk-LNISKMIL.js.map +0 -1
  383. package/dist/chunks/chunk-LNKJEW5E.js +0 -627
  384. package/dist/chunks/chunk-LNKJEW5E.js.map +0 -1
  385. package/dist/chunks/chunk-LXJA3VP2.js +0 -72
  386. package/dist/chunks/chunk-LXJA3VP2.js.map +0 -1
  387. package/dist/chunks/chunk-MLT7V47R.js +0 -100
  388. package/dist/chunks/chunk-MLT7V47R.js.map +0 -1
  389. package/dist/chunks/chunk-N5FPZNMX.js +0 -43
  390. package/dist/chunks/chunk-N5FPZNMX.js.map +0 -1
  391. package/dist/chunks/chunk-NHA53UTY.js.map +0 -1
  392. package/dist/chunks/chunk-NZQKGIJP.js.map +0 -1
  393. package/dist/chunks/chunk-O6WEZVEM.js +0 -43
  394. package/dist/chunks/chunk-O6WEZVEM.js.map +0 -1
  395. package/dist/chunks/chunk-OIRWOI3E.js.map +0 -1
  396. package/dist/chunks/chunk-PWOY6REC.js +0 -6064
  397. package/dist/chunks/chunk-PWOY6REC.js.map +0 -1
  398. package/dist/chunks/chunk-QJELKGWM.js +0 -6061
  399. package/dist/chunks/chunk-QJELKGWM.js.map +0 -1
  400. package/dist/chunks/chunk-QUB54PXZ.js +0 -50
  401. package/dist/chunks/chunk-QUB54PXZ.js.map +0 -1
  402. package/dist/chunks/chunk-RX3BRYYI.js +0 -59
  403. package/dist/chunks/chunk-RX3BRYYI.js.map +0 -1
  404. package/dist/chunks/chunk-UEEMM6H2.js +0 -6090
  405. package/dist/chunks/chunk-UEEMM6H2.js.map +0 -1
  406. package/dist/chunks/chunk-UFYWCLXF.js +0 -10
  407. package/dist/chunks/chunk-UFYWCLXF.js.map +0 -1
  408. package/dist/chunks/chunk-UN2IFSGC.js +0 -1
  409. package/dist/chunks/chunk-VAPB5TN4.js +0 -46
  410. package/dist/chunks/chunk-VAPB5TN4.js.map +0 -1
  411. package/dist/chunks/chunk-VBF3GCZK.js +0 -50
  412. package/dist/chunks/chunk-VBF3GCZK.js.map +0 -1
  413. package/dist/chunks/chunk-W4272Q5U.js.map +0 -1
  414. package/dist/chunks/chunk-WWN5AD6V.js.map +0 -1
  415. package/dist/chunks/chunk-X226BX2U.js +0 -78
  416. package/dist/chunks/chunk-X226BX2U.js.map +0 -1
  417. package/dist/chunks/chunk-XCHS3RTZ.js +0 -107
  418. package/dist/chunks/chunk-XCHS3RTZ.js.map +0 -1
  419. package/dist/chunks/chunk-YFC3BVN2.js +0 -78
  420. package/dist/chunks/chunk-YFC3BVN2.js.map +0 -1
  421. package/dist/chunks/chunk-YOXF6JPS.js.map +0 -1
  422. package/dist/chunks/chunk-YQB6YLNW.js +0 -78
  423. package/dist/chunks/chunk-YQB6YLNW.js.map +0 -1
  424. package/dist/chunks/chunk-Z5THRO6Z.js +0 -46
  425. package/dist/chunks/chunk-Z5THRO6Z.js.map +0 -1
  426. package/dist/chunks/chunk-ZHAJ3CMP.js +0 -6091
  427. package/dist/chunks/chunk-ZHAJ3CMP.js.map +0 -1
  428. package/dist/chunks/chunk-ZPNJ2HP5.js +0 -71
  429. package/dist/chunks/chunk-ZPNJ2HP5.js.map +0 -1
  430. package/dist/chunks/chunk-ZQXZ6PK7.js +0 -649
  431. package/dist/chunks/chunk-ZQXZ6PK7.js.map +0 -1
  432. package/dist/custom-element-eslint-rules.js +0 -337
  433. package/dist/custom-elements.json +0 -27158
  434. package/dist/loader/index.d.ts +0 -20
  435. package/dist/loader/index.js +0 -310
  436. package/dist/loader/index.js.map +0 -1
  437. package/dist/qti-components/index.cjs +0 -6773
  438. package/dist/qti-components/index.cjs.map +0 -1
  439. package/dist/qti-components/index.d.cts +0 -150
  440. package/dist/qti-item/components/index.d.ts +0 -3
  441. package/dist/qti-item/components/index.js +0 -3856
  442. package/dist/qti-item/components/index.js.map +0 -1
  443. package/dist/qti-item/components/item-container.d.ts +0 -40
  444. package/dist/qti-item/components/item-container.js +0 -3856
  445. package/dist/qti-item/components/item-container.js.map +0 -1
  446. package/dist/qti-item/index.cjs +0 -89
  447. package/dist/qti-item/index.cjs.map +0 -1
  448. package/dist/qti-item/index.d.cts +0 -24
  449. package/dist/qti-item/index.d.ts +0 -4
  450. package/dist/qti-item/index.js +0 -3869
  451. package/dist/qti-item/index.js.map +0 -1
  452. package/dist/qti-item/qti-item.d.ts +0 -25
  453. package/dist/qti-item/qti-item.js +0 -26
  454. package/dist/qti-item/qti-item.js.map +0 -1
  455. package/dist/qti-loader/index.cjs +0 -332
  456. package/dist/qti-loader/index.cjs.map +0 -1
  457. package/dist/qti-loader/index.d.cts +0 -20
  458. package/dist/qti-response-declaration-DAeBp8HH.d.ts +0 -1008
  459. package/dist/qti-response-declaration-ucAqd0qK.d.ts +0 -1034
  460. package/dist/qti-simple-choice-3M44uWiN.d.ts +0 -1153
  461. package/dist/qti-simple-choice-B5GnzbqW.d.ts +0 -1080
  462. package/dist/qti-simple-choice-BOLF9wXz.d.ts +0 -1170
  463. package/dist/qti-simple-choice-BeixIkA0.d.ts +0 -1088
  464. package/dist/qti-simple-choice-BiEjEO6s.d.ts +0 -1152
  465. package/dist/qti-simple-choice-Bo_ikO6H.d.ts +0 -1198
  466. package/dist/qti-simple-choice-C0CcrtK5.d.ts +0 -1169
  467. package/dist/qti-simple-choice-Cgh1-Jbr.d.cts +0 -1185
  468. package/dist/qti-simple-choice-Cgh1-Jbr.d.ts +0 -1185
  469. package/dist/qti-simple-choice-Cn5y-Ta8.d.ts +0 -1158
  470. package/dist/qti-simple-choice-D0GiMrqD.d.ts +0 -1168
  471. package/dist/qti-simple-choice-DxWcdKHi.d.ts +0 -1158
  472. package/dist/qti-simple-choice-R_LxBTp8.d.ts +0 -1158
  473. package/dist/qti-simple-choice-hAIyfF0z.d.ts +0 -1114
  474. package/dist/qti-simple-choice-o4rje1RA.d.ts +0 -1176
  475. package/dist/qti-simple-choice-v2GxpPNh.d.ts +0 -1181
  476. package/dist/qti-test/components/test-component.abstract.d.ts +0 -26
  477. package/dist/qti-test/components/test-component.abstract.js +0 -11
  478. package/dist/qti-test/components/test-next.spec.css +0 -2481
  479. package/dist/qti-test/components/test-next.spec.css.map +0 -1
  480. package/dist/qti-test/components/test-next.spec.d.ts +0 -13
  481. package/dist/qti-test/components/test-next.spec.js +0 -45904
  482. package/dist/qti-test/components/test-next.spec.js.map +0 -1
  483. package/dist/qti-test/context/index.d.ts +0 -6
  484. package/dist/qti-test/context/index.js +0 -9
  485. package/dist/qti-test/context/index.js.map +0 -1
  486. package/dist/qti-test/context/test.context.d.ts +0 -6
  487. package/dist/qti-test/context/test.context.js +0 -9
  488. package/dist/qti-test/context/test.context.js.map +0 -1
  489. package/dist/qti-test/index.cjs +0 -4823
  490. package/dist/qti-test/index.cjs.map +0 -1
  491. package/dist/qti-test/index.d.cts +0 -304
  492. package/dist/qti-test/index.d.ts +0 -14
  493. package/dist/qti-test/index.js +0 -4746
  494. package/dist/qti-test/index.js.map +0 -1
  495. package/dist/qti-test/mixins/index.d.ts +0 -8
  496. package/dist/qti-test/mixins/index.js +0 -350
  497. package/dist/qti-test/mixins/index.js.map +0 -1
  498. package/dist/qti-test/mixins/test-loader.mixin.d.ts +0 -8
  499. package/dist/qti-test/mixins/test-loader.mixin.js +0 -240
  500. package/dist/qti-test/mixins/test-loader.mixin.js.map +0 -1
  501. package/dist/qti-test/mixins/test-navigation.mixin.d.ts +0 -22
  502. package/dist/qti-test/mixins/test-navigation.mixin.js +0 -64
  503. package/dist/qti-test/mixins/test-navigation.mixin.js.map +0 -1
  504. package/dist/qti-test/mixins/test-view.mixin.d.ts +0 -6
  505. package/dist/qti-test/mixins/test-view.mixin.js +0 -50
  506. package/dist/qti-test/mixins/test-view.mixin.js.map +0 -1
  507. package/dist/qti-test/qti-assessment-test/index.d.ts +0 -6
  508. package/dist/qti-test/qti-assessment-test/index.js +0 -221
  509. package/dist/qti-test/qti-assessment-test/index.js.map +0 -1
  510. package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.d.ts +0 -6
  511. package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -85
  512. package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js.map +0 -1
  513. package/dist/qti-test/qti-assessment-test/qti-assessment-section.d.ts +0 -6
  514. package/dist/qti-test/qti-assessment-test/qti-assessment-section.js +0 -73
  515. package/dist/qti-test/qti-assessment-test/qti-assessment-section.js.map +0 -1
  516. package/dist/qti-test/qti-assessment-test/qti-assessment-test.d.ts +0 -6
  517. package/dist/qti-test/qti-assessment-test/qti-assessment-test.js +0 -54
  518. package/dist/qti-test/qti-assessment-test/qti-assessment-test.js.map +0 -1
  519. package/dist/qti-test/qti-assessment-test/qti-test-part.d.ts +0 -19
  520. package/dist/qti-test/qti-assessment-test/qti-test-part.js +0 -62
  521. package/dist/qti-test/qti-assessment-test/qti-test-part.js.map +0 -1
  522. package/dist/qti-test/qti-test.d.ts +0 -68
  523. package/dist/qti-test/qti-test.js +0 -500
  524. package/dist/qti-test/qti-test.js.map +0 -1
  525. package/dist/qti-test/test-base.d.ts +0 -6
  526. package/dist/qti-test/test-base.js +0 -137
  527. package/dist/qti-test/test-base.js.map +0 -1
  528. package/dist/qti-transformers/index.cjs +0 -316
  529. package/dist/qti-transformers/index.cjs.map +0 -1
  530. package/dist/qti-transformers/index.d.cts +0 -75
  531. package/dist/test-base-BJwG9Ie8.d.ts +0 -109
  532. package/dist/test.context-Bx-606B3.d.ts +0 -99
  533. package/dist/test.context-CB5V4xJz.d.ts +0 -99
  534. package/dist/test.context-CaENAJNk.d.ts +0 -101
  535. package/dist/test.context-CmsDQ8k2.d.ts +0 -99
  536. package/dist/transformers/index.d.ts +0 -76
  537. package/dist/transformers/index.js +0 -293
  538. package/dist/transformers/index.js.map +0 -1
  539. /package/cdn/{chunk-22HAPLRD.js → chunks/chunk-MTNLMWSG.js} +0 -0
  540. /package/dist/{chunk-44VE5POH.js.map → chunks/chunk-CBYNKDSF.js.map} +0 -0
  541. /package/dist/chunks/{chunk-XSI6FXGD.js.map → chunk-OOQLWOYU.js.map} +0 -0
  542. /package/dist/{chunk-MAC76UNI.js.map → exports/computed.context.js.map} +0 -0
  543. /package/dist/{chunks/chunk-HOTNM5DT.js.map → exports/config.context.js.map} +0 -0
  544. /package/dist/{chunks/chunk-UN2IFSGC.js.map → exports/session.context.js.map} +0 -0
  545. /package/dist/{qti-test/components/test-component.abstract.js.map → exports/test.context.js.map} +0 -0
@@ -1,27 +1,27 @@
1
- import {
2
- qtiTransformItem
3
- } from "./chunk-XDMSEAYC.js";
4
1
  import {
5
2
  liveQuery
6
3
  } from "./chunk-D3RGDWKP.js";
7
4
  import {
8
5
  watch
9
6
  } from "./chunk-ELDMXTUQ.js";
10
- import {
11
- Interaction
12
- } from "./chunk-OIRWOI3E.js";
13
- import {
14
- itemContextVariables
15
- } from "./chunk-DLUJN2FW.js";
16
7
  import {
17
8
  QtiConditionExpression
18
- } from "./chunk-XSI6FXGD.js";
9
+ } from "./chunk-OOQLWOYU.js";
19
10
  import {
20
11
  QtiExpression
21
- } from "./chunk-BPHQLJWE.js";
12
+ } from "./chunk-I7HVKMDI.js";
13
+ import {
14
+ qtiTransformItem
15
+ } from "./chunk-XDMSEAYC.js";
16
+ import {
17
+ Interaction
18
+ } from "./chunk-WRHEO7NG.js";
19
+ import {
20
+ itemContextVariables
21
+ } from "./chunk-W7ZXKJ5O.js";
22
22
  import {
23
23
  itemContext
24
- } from "./chunk-KOEILLVS.js";
24
+ } from "./chunk-NJNQOQUU.js";
25
25
  import {
26
26
  __decorateClass
27
27
  } from "./chunk-H2JE6IVU.js";
@@ -243,13 +243,19 @@ var QtiAssessmentItem = class extends LitElement {
243
243
  value: this._context.variables.find((v) => v.identifier === identifier)?.value
244
244
  });
245
245
  }
246
- validate() {
246
+ validate(reportValidity = true) {
247
247
  if (this._interactionElements.every((interactionElement) => interactionElement.validate())) return true;
248
248
  if (this._interactionElements.some((interactionElement) => interactionElement.validate())) return false;
249
+ if (reportValidity) this.reportValidity();
249
250
  return null;
250
251
  }
252
+ reportValidity() {
253
+ for (const interactionElement of this._interactionElements) {
254
+ interactionElement.reportValidity();
255
+ }
256
+ }
251
257
  _getCompletionStatus() {
252
- const valid = this.validate();
258
+ const valid = this.validate(false);
253
259
  if (valid === true) return "completed";
254
260
  if (valid === false) return "incomplete";
255
261
  return "not_attempted";
@@ -677,6 +683,9 @@ QtiAssociableHotspot = __decorateClass([
677
683
  import { html as html7 } from "lit";
678
684
  import { customElement as customElement9, state as state3 } from "lit/decorators.js";
679
685
 
686
+ // src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts
687
+ import { property as property4 } from "lit/decorators.js";
688
+
680
689
  // src/lib/qti-components/qti-interaction/internal/drag-drop/flippables-mixin.ts
681
690
  var FlippablesMixin = (superClass, _droppablesSel, _draggablesSel) => {
682
691
  class FlippablesElement extends superClass {
@@ -744,7 +753,6 @@ var FlippablesMixin = (superClass, _droppablesSel, _draggablesSel) => {
744
753
  };
745
754
 
746
755
  // src/lib/qti-components/qti-interaction/internal/drag-drop/drag-drop-interaction-mixin.ts
747
- import { property as property4 } from "lit/decorators.js";
748
756
  var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelector, dragContainersSelector) => {
749
757
  class DragDropInteractionElement extends FlippablesMixin(
750
758
  superClass,
@@ -1078,7 +1086,6 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1078
1086
  }
1079
1087
  const lastElementChild = this.lastElementChild;
1080
1088
  this._internals.setValidity(isValid ? {} : { customError: true }, validityMessage, lastElementChild);
1081
- this.reportValidity();
1082
1089
  return isValid;
1083
1090
  }
1084
1091
  reportValidity() {
@@ -1098,7 +1105,7 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1098
1105
  const maxMatch = this.getMatchMaxValue(droppable);
1099
1106
  const currentAssociations = droppable.querySelectorAll('[qti-draggable="true"]').length;
1100
1107
  const unlimitedAssociations = maxMatch === 0;
1101
- return unlimitedAssociations || currentAssociations >= maxMatch;
1108
+ return !unlimitedAssociations && currentAssociations >= maxMatch;
1102
1109
  }
1103
1110
  dropDraggableInDroppable(draggable, droppable) {
1104
1111
  const cleanClone = draggable.cloneNode(true);
@@ -1143,12 +1150,18 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1143
1150
  this.deactivateDroppables();
1144
1151
  }
1145
1152
  checkAllMaxAssociations() {
1153
+ const currentAssociations = this.getValidAssociations();
1154
+ const maxAssociationsInterationReached = this.maxAssociations !== 0 && currentAssociations >= this.maxAssociations;
1146
1155
  this.droppables.forEach((d) => {
1147
- const maxAssociationsReached = this.checkMaxAssociations(d);
1148
- if (maxAssociationsReached) {
1156
+ if (maxAssociationsInterationReached) {
1149
1157
  this.disableDroppable(d);
1150
1158
  } else {
1151
- this.enableDroppable(d);
1159
+ const maxAssociationsReached = this.checkMaxAssociations(d);
1160
+ if (maxAssociationsReached) {
1161
+ this.disableDroppable(d);
1162
+ } else {
1163
+ this.enableDroppable(d);
1164
+ }
1152
1165
  }
1153
1166
  });
1154
1167
  }
@@ -1190,7 +1203,11 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1190
1203
  });
1191
1204
  }
1192
1205
  getValidAssociations() {
1193
- return this.droppables.filter((d) => d.childElementCount > 0).length;
1206
+ let count = 0;
1207
+ for (const droppable of this.droppables) {
1208
+ count = count + this.getDraggablesFromDroppable(droppable).length;
1209
+ }
1210
+ return count;
1194
1211
  }
1195
1212
  saveResponse() {
1196
1213
  const response = this.collectResponseData();
@@ -1373,13 +1390,6 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1373
1390
  e.preventDefault();
1374
1391
  this.dragClone.setAttribute("dragging", "");
1375
1392
  }
1376
- findParentInteractionElement(element) {
1377
- let parent = element.parentElement;
1378
- while (parent && !parent.tagName?.toLowerCase().endsWith("-interaction")) {
1379
- parent = parent.parentElement;
1380
- }
1381
- return parent;
1382
- }
1383
1393
  findDraggableInDraggableContainer(identifier) {
1384
1394
  const allDragContainers = this.dragContainers.flat();
1385
1395
  for (const container of allDragContainers) {
@@ -1590,10 +1600,10 @@ var ChoicesMixin = (superClass, selector) => {
1590
1600
  let validityMessage = "";
1591
1601
  if (this.maxChoices !== 0 && selectedCount > this.maxChoices) {
1592
1602
  isValid = false;
1593
- validityMessage = this.dataset.maxSelectionsMessage || `You can select at most ${this.maxChoices} choices.`;
1603
+ validityMessage = this.dataset.maxSelectionsMessage || `Please select no more than ${this.maxChoices} ${this.maxChoices === 1 ? "option" : "options"}.`;
1594
1604
  } else if (selectedCount < this.minChoices) {
1595
1605
  isValid = false;
1596
- validityMessage = this.dataset.minSelectionsMessage || `You must select at least ${this.minChoices} choices.`;
1606
+ validityMessage = `Please select at least ${this.minChoices} ${this.minChoices === 1 ? "option" : "options"}.`;
1597
1607
  }
1598
1608
  if (selectedChoices.length > 0) {
1599
1609
  this._internals.setValidity(
@@ -1602,7 +1612,6 @@ var ChoicesMixin = (superClass, selector) => {
1602
1612
  selectedChoices[selectedCount - 1] || this._choiceElements[0] || this
1603
1613
  );
1604
1614
  }
1605
- this.reportValidity();
1606
1615
  return isValid;
1607
1616
  }
1608
1617
  reportValidity() {
@@ -2571,17 +2580,26 @@ function positionHotspots(shape, coordsNumber, img, hotspot) {
2571
2580
  hotspot.style.height = bottomYPer - topYPer + "%";
2572
2581
  }
2573
2582
  break;
2583
+ case "ellipse":
2584
+ {
2585
+ const [centerX, centerY, radiusX, radiusY] = coordsNumber;
2586
+ const centerXPer = centerX / img.width * 100;
2587
+ const centerYPer = centerY / img.height * 100;
2588
+ const radiusXPer = radiusX / img.width * 100;
2589
+ const radiusYPer = radiusY / img.height * 100;
2590
+ hotspot.style.left = centerXPer - radiusXPer + "%";
2591
+ hotspot.style.top = centerYPer - radiusYPer + "%";
2592
+ hotspot.style.width = 2 * radiusXPer + "%";
2593
+ hotspot.style.height = 2 * radiusYPer + "%";
2594
+ hotspot.style.borderRadius = `50%`;
2595
+ }
2596
+ break;
2574
2597
  case "poly":
2575
2598
  {
2576
- const polycoords = coordsNumber.reduce((acc, currentValue, currentIndex, polyC) => {
2577
- if (currentIndex % 2 === 1) {
2578
- const lastVal = acc.pop();
2579
- acc[acc.length] = { x: lastVal, y: polyC[currentIndex] };
2580
- } else {
2581
- acc.push(currentValue);
2582
- }
2583
- return acc;
2584
- }, []);
2599
+ const polycoords = [];
2600
+ for (let i = 0; i < coordsNumber.length; i += 2) {
2601
+ polycoords.push({ x: coordsNumber[i], y: coordsNumber[i + 1] });
2602
+ }
2585
2603
  const leftX = Math.min(...polycoords.map((point) => point.x));
2586
2604
  const rightX = Math.max(...polycoords.map((point) => point.x));
2587
2605
  const topY = Math.min(...polycoords.map((point) => point.y));
@@ -2590,19 +2608,20 @@ function positionHotspots(shape, coordsNumber, img, hotspot) {
2590
2608
  const topYPer = topY / img.height * 100;
2591
2609
  const rightXPer = rightX / img.width * 100;
2592
2610
  const bottomYPer = bottomY / img.height * 100;
2593
- hotspot.style.left = leftX / img.width * 100 + "%";
2594
- hotspot.style.top = topY / img.height * 100 + "%";
2611
+ hotspot.style.left = leftXPer + "%";
2612
+ hotspot.style.top = topYPer + "%";
2595
2613
  hotspot.style.width = rightXPer - leftXPer + "%";
2596
2614
  hotspot.style.height = bottomYPer - topYPer + "%";
2597
2615
  const polygonData = polycoords.map((point) => ({
2598
2616
  x: (point.x - leftX) / (rightX - leftX) * 100,
2599
2617
  y: (point.y - topY) / (bottomY - topY) * 100
2600
2618
  }));
2601
- const polyD = polygonData.map((p) => Math.round(p.x) + "% " + Math.round(p.y) + "%").join(",");
2619
+ const polyD = polygonData.map((p) => `${p.x}% ${p.y}%`).join(",");
2602
2620
  hotspot.style.clipPath = `polygon(${polyD})`;
2603
2621
  }
2604
2622
  break;
2605
2623
  default:
2624
+ console.error(`Unsupported shape: ${shape}`);
2606
2625
  break;
2607
2626
  }
2608
2627
  }
@@ -2912,25 +2931,25 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
2912
2931
  setHotspotOrder(e) {
2913
2932
  const { identifier } = e.detail;
2914
2933
  const hotspot = this._choiceElements.find((el) => el.getAttribute("identifier") === identifier);
2934
+ if (!hotspot) return;
2915
2935
  const maxSelection = this._choiceElements.length;
2916
2936
  if (!this.choiceOrdering) {
2917
2937
  this.choiceOrdering = true;
2918
2938
  if (hotspot.order == null) {
2919
- if (this._choiceElements.filter((i) => i.order > 0).length >= maxSelection) {
2939
+ const currentSelection = this._choiceElements.filter((i) => i.order != null).length;
2940
+ if (currentSelection >= maxSelection) {
2920
2941
  this.choiceOrdering = false;
2921
2942
  return;
2922
2943
  }
2923
- hotspot.order = this._choiceElements.filter((i) => !!i.order).length + 1;
2924
- this.choiceOrdering = false;
2925
- return;
2944
+ hotspot.order = currentSelection + 1;
2926
2945
  } else {
2946
+ const removedOrder = hotspot.order;
2947
+ hotspot.order = null;
2927
2948
  this._choiceElements.forEach((hotspot2) => {
2928
- if (hotspot2.order > hotspot2.order) {
2949
+ if (hotspot2.order != null && hotspot2.order > removedOrder) {
2929
2950
  hotspot2.order--;
2930
2951
  }
2931
- return hotspot2;
2932
2952
  });
2933
- hotspot.order = null;
2934
2953
  }
2935
2954
  this.choiceOrdering = false;
2936
2955
  }
@@ -3236,11 +3255,6 @@ QtiInlineChoice = __decorateClass([
3236
3255
  customElement26("qti-inline-choice")
3237
3256
  ], QtiInlineChoice);
3238
3257
 
3239
- // src/lib/qti-components/qti-interaction/qti-match-interaction/qti-match-interaction.ts
3240
- import { html as html25, nothing } from "lit";
3241
- import { customElement as customElement28, property as property20, state as state8 } from "lit/decorators.js";
3242
- import { unsafeHTML as unsafeHTML2 } from "lit/directives/unsafe-html.js";
3243
-
3244
3258
  // src/lib/qti-components/qti-interaction/qti-simple-associable-choice.ts
3245
3259
  import { css as css20, html as html24, LitElement as LitElement14 } from "lit";
3246
3260
  import { customElement as customElement27, property as property19 } from "lit/decorators.js";
@@ -3305,6 +3319,11 @@ QtiSimpleAssociableChoice = __decorateClass([
3305
3319
  customElement27("qti-simple-associable-choice")
3306
3320
  ], QtiSimpleAssociableChoice);
3307
3321
 
3322
+ // src/lib/qti-components/qti-interaction/qti-match-interaction/qti-match-interaction.ts
3323
+ import { html as html25, nothing } from "lit";
3324
+ import { customElement as customElement28, property as property20, state as state8 } from "lit/decorators.js";
3325
+ import { unsafeHTML as unsafeHTML2 } from "lit/directives/unsafe-html.js";
3326
+
3308
3327
  // src/lib/qti-components/qti-interaction/qti-match-interaction/qti-match-interaction.styles.ts
3309
3328
  import { css as css21 } from "lit";
3310
3329
  var qti_match_interaction_styles_default = css21`
@@ -3445,7 +3464,7 @@ var QtiMatchInteraction = class extends DragDropInteractionMixin(
3445
3464
  const selectedInRowCount = this.value.filter((v) => v.split(" ")[0] === rowId).length || 0;
3446
3465
  const checked = this.value.includes(value);
3447
3466
  const part = `rb ${checked ? "rb-checked" : ""} ${this.correctOptions.includes(value) ? "rb-correct" : ""}`;
3448
- const disable = this.correctOptions.length > 0 ? true : row.matchMax === 1 ? false : selectedInRowCount >= row.matchMax && !checked;
3467
+ const disable = this.correctOptions.length > 0 ? true : row.matchMax === 1 ? false : row.matchMax !== 0 && selectedInRowCount >= row.matchMax && !checked;
3449
3468
  return html25`<td>
3450
3469
  <input
3451
3470
  type=${row.matchMax === 1 ? "radio" : `checkbox`}
@@ -3732,14 +3751,38 @@ var QtiPortableCustomInteraction = class extends Interaction {
3732
3751
  }
3733
3752
  return null;
3734
3753
  }
3754
+ addHyphenatedKeys(properties) {
3755
+ const updatedProperties = { ...properties };
3756
+ for (const key in properties) {
3757
+ if (Object.prototype.hasOwnProperty.call(properties, key)) {
3758
+ const hyphenatedKey = key.replace(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);
3759
+ updatedProperties[hyphenatedKey] = properties[key];
3760
+ }
3761
+ }
3762
+ return updatedProperties;
3763
+ }
3764
+ responseVariablesToQtiVariableJSON(input) {
3765
+ if (Array.isArray(input)) {
3766
+ return {
3767
+ list: {
3768
+ string: input
3769
+ }
3770
+ };
3771
+ } else {
3772
+ return {
3773
+ base: {
3774
+ string: input || ""
3775
+ }
3776
+ };
3777
+ }
3778
+ }
3735
3779
  startChecking() {
3736
3780
  this.intervalId = setInterval(() => {
3737
3781
  const response = this.pci.getResponse();
3738
- const newResponse = this.pci.getResponse();
3739
3782
  const stringified = JSON.stringify(response);
3740
3783
  if (stringified !== this.rawResponse) {
3741
3784
  this.rawResponse = stringified;
3742
- const value = this.convertQtiVariableJSON(newResponse);
3785
+ const value = this.convertQtiVariableJSON(response);
3743
3786
  this.value = value;
3744
3787
  this.saveResponse(value);
3745
3788
  }
@@ -3758,77 +3801,77 @@ var QtiPortableCustomInteraction = class extends Interaction {
3758
3801
  get value() {
3759
3802
  return this.rawResponse;
3760
3803
  }
3761
- getTAOConfig(node) {
3762
- const a = node.querySelectorAll("properties");
3763
- let config = {};
3764
- const getPropertyValue = (el) => {
3765
- const property38 = {};
3766
- const key = el.getAttribute("key");
3767
- if (key) {
3768
- const children = Array.from(el.children);
3769
- const allKey = children.map((c) => c.getAttribute("key"));
3770
- const isArray = allKey.length > 0 && !allKey.find((k) => !Number.isInteger(+k));
3771
- if (isArray) {
3772
- property38[key] = children.map((c) => getChildProperties(c));
3773
- } else {
3774
- property38[key] = el.textContent;
3775
- }
3776
- }
3777
- return property38;
3778
- };
3779
- const getChildProperties = (el) => {
3780
- if (el) {
3781
- let properties = {};
3782
- for (const child of el.children) {
3783
- properties = { ...properties, ...getPropertyValue(child) };
3784
- }
3785
- return properties;
3786
- }
3787
- };
3788
- for (const properties of a) {
3789
- const key = properties.getAttribute("key");
3790
- if (!key) {
3791
- config = { ...config, ...getChildProperties(properties) };
3792
- }
3793
- return config;
3794
- }
3795
- console.log("Can not find qti-custom-interaction config");
3796
- return null;
3797
- }
3798
3804
  register(pci) {
3799
3805
  this.pci = pci;
3800
- const type = this.parentElement.tagName === "QTI-CUSTOM-INTERACTION" ? "TAO" : "IMS";
3801
- const dom = type == "IMS" ? this.querySelector("qti-interaction-markup") : this.querySelector("markup");
3806
+ const dom = this.querySelector("qti-interaction-markup");
3802
3807
  dom.classList.add("qti-customInteraction");
3803
- if (type == "TAO" && this.querySelector("properties")) {
3808
+ if (this.querySelector("properties")) {
3804
3809
  this.querySelector("properties").style.display = "none";
3805
3810
  }
3806
- const config = type == "IMS" ? {
3807
- properties: this.dataset,
3808
- onready: () => {
3809
- console.log("onready");
3810
- }
3811
- } : this.getTAOConfig(this);
3812
- if (type == "IMS") {
3811
+ const jsonValue = this.responseVariablesToQtiVariableJSON(this.value);
3812
+ const config = {
3813
+ properties: this.addHyphenatedKeys({ ...this.dataset }),
3814
+ onready: (pciInstance) => {
3815
+ this.pci = pciInstance;
3816
+ },
3817
+ responseIdentifier: this.responseIdentifier,
3818
+ boundTo: jsonValue.base || jsonValue.list
3819
+ // TODO: implement the following properties:
3820
+ // templateVariables An object containing all of the template variables referenced (via qti-template-variable elements) in the qti-portable-custom-interaction and their current values.The values of variables MUST follow the structure defined in Appendix C.
3821
+ // contextVariables An object containing all of the context variables referenced (via qti-context-variable elements) in the qti-portable-custom-interaction and their current values. The values of variables MUST follow the structure defined in Appendix C.
3822
+ };
3823
+ if (pci.getInstance) {
3813
3824
  pci.getInstance(dom, config, void 0);
3814
3825
  } else {
3815
- pci.initialize(this.customInteractionTypeIdentifier, dom.firstElementChild, config);
3816
- }
3817
- if (type == "TAO") {
3818
- const links = Array.from(this.querySelectorAll("link")).map((acc) => acc.getAttribute("href"));
3819
- links.forEach((link) => {
3820
- const styles = document.createElement("link");
3821
- styles.rel = "stylesheet";
3822
- styles.type = "text/css";
3823
- styles.media = "screen";
3824
- styles.href = link;
3825
- dom.appendChild(styles);
3826
- });
3826
+ const restoreTAOConfig = (element) => {
3827
+ const config2 = {};
3828
+ const parseDataAttributes = (element2) => {
3829
+ const result = {};
3830
+ Object.entries(element2.dataset).forEach(([key, value]) => {
3831
+ if (!key.includes("__")) {
3832
+ result[key] = value;
3833
+ }
3834
+ });
3835
+ const nestedData = {};
3836
+ Object.entries(element2.dataset).forEach(([key, value]) => {
3837
+ const parts = key.split("__");
3838
+ if (parts.length > 1) {
3839
+ const [group, index, prop] = parts;
3840
+ nestedData[group] = nestedData[group] || {};
3841
+ nestedData[group][index] = nestedData[group][index] || {};
3842
+ nestedData[group][index][prop] = value;
3843
+ }
3844
+ });
3845
+ Object.entries(nestedData).forEach(([key, group]) => {
3846
+ result[key] = Object.values(group);
3847
+ });
3848
+ return result;
3849
+ };
3850
+ const data = parseDataAttributes(element);
3851
+ for (const key in data) {
3852
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
3853
+ const value = data[key];
3854
+ if (key === "config") {
3855
+ config2[key] = JSON.parse(value);
3856
+ } else {
3857
+ config2[key] = value;
3858
+ }
3859
+ }
3860
+ }
3861
+ return config2;
3862
+ };
3863
+ const taoConfig = restoreTAOConfig(this);
3864
+ pci.initialize(
3865
+ this.customInteractionTypeIdentifier,
3866
+ dom.firstElementChild,
3867
+ Object.keys(taoConfig).length ? taoConfig : null
3868
+ );
3827
3869
  }
3828
3870
  this.startChecking();
3829
3871
  }
3830
3872
  connectedCallback() {
3831
3873
  super.connectedCallback();
3874
+ console.log("connectedCallback");
3832
3875
  define("qtiCustomInteractionContext", () => {
3833
3876
  return {
3834
3877
  register: (ctxA) => {
@@ -3840,8 +3883,22 @@ var QtiPortableCustomInteraction = class extends Interaction {
3840
3883
  });
3841
3884
  const config = this.buildRequireConfig();
3842
3885
  const requirePCI = requirejs.config(config);
3886
+ requirejs.onError = function(err) {
3887
+ console.error("RequireJS error:", err);
3888
+ if (err.requireType === "timeout") {
3889
+ console.error("Modules that timed out:", err.requireModules);
3890
+ }
3891
+ throw err;
3892
+ };
3843
3893
  requirePCI(["require"], (require2) => {
3844
- require2([this.module]);
3894
+ try {
3895
+ require2([this.module], () => {
3896
+ }, (err) => {
3897
+ console.error("Error loading module:", err);
3898
+ });
3899
+ } catch (error) {
3900
+ console.error("Error in require call:", error);
3901
+ }
3845
3902
  });
3846
3903
  }
3847
3904
  disconnectedCallback() {
@@ -3885,7 +3942,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
3885
3942
  combineRequireResolvePaths(path1, path2) {
3886
3943
  const path1Array = Array.isArray(path1) ? path1 : [path1];
3887
3944
  const path2Array = Array.isArray(path2) ? path2 : [path2];
3888
- return path1Array.concat(path2Array);
3945
+ return path1Array.concat(path2Array).filter((value, index, self) => self.indexOf(value) === index);
3889
3946
  }
3890
3947
  removeDoubleSlashes(str) {
3891
3948
  const singleForwardSlashes = str.replace(/([^:]\/)\/+/g, "$1").replace(/\/\//g, "/").replace("http:/", "http://").replace("https:/", "https://");
@@ -4004,7 +4061,7 @@ var QtiSelectPointInteraction = class extends Interaction {
4004
4061
  this._imgElement = null;
4005
4062
  // Extracted click handler method
4006
4063
  this._onImageClick = (event) => {
4007
- if (this._points.length < this.maxChoices) {
4064
+ if (this.maxChoices === 0 || this._points.length < this.maxChoices) {
4008
4065
  const x = event.offsetX;
4009
4066
  const y = event.offsetY;
4010
4067
  this._points = [...this._points, `${x} ${y}`];
@@ -5110,6 +5167,82 @@ import { property as property30 } from "lit/decorators.js";
5110
5167
 
5111
5168
  // src/lib/qti-components/qti-response-processing/utilities/scoring-helper.ts
5112
5169
  var ScoringHelper = class {
5170
+ /**
5171
+ * Checks if a given point is within a specified area.
5172
+ * @param point The point to test, represented as a string "x y" (e.g., "102 113").
5173
+ * @param areaKey The area definition, including shape and coordinates (e.g., "circle,102,113,16").
5174
+ * @param baseType The base type of the response, must be "point" for this method to proceed.
5175
+ * @returns True if the point is within the area; false otherwise.
5176
+ */
5177
+ static isPointInArea(point, areaKey, baseType) {
5178
+ if (baseType !== "point") {
5179
+ console.warn(`Base type ${baseType} is not supported for point area mapping.`);
5180
+ return false;
5181
+ }
5182
+ const [px, py] = point.split(" ").map(Number);
5183
+ const [shape, ...coords] = areaKey.split(",");
5184
+ const coordinates = coords.map(Number);
5185
+ switch (shape.toLowerCase()) {
5186
+ case "circle":
5187
+ case "default": {
5188
+ const [cx, cy, radius] = coordinates;
5189
+ if (coordinates.length !== 3) {
5190
+ console.warn(`Invalid circle definition: ${areaKey}`);
5191
+ return false;
5192
+ }
5193
+ const distance = Math.sqrt((px - cx) ** 2 + (py - cy) ** 2);
5194
+ return distance <= radius;
5195
+ }
5196
+ case "rect": {
5197
+ const [x1, y1, x2, y2] = coordinates;
5198
+ if (coordinates.length !== 4) {
5199
+ console.warn(`Invalid rectangle definition: ${areaKey}`);
5200
+ return false;
5201
+ }
5202
+ return px >= x1 && px <= x2 && py >= y1 && py <= y2;
5203
+ }
5204
+ case "ellipse": {
5205
+ const [cx, cy, rx, ry] = coordinates;
5206
+ if (coordinates.length !== 4) {
5207
+ console.warn(`Invalid ellipse definition: ${areaKey}`);
5208
+ return false;
5209
+ }
5210
+ const normalizedX = (px - cx) ** 2 / rx ** 2;
5211
+ const normalizedY = (py - cy) ** 2 / ry ** 2;
5212
+ return normalizedX + normalizedY <= 1;
5213
+ }
5214
+ case "poly": {
5215
+ if (coordinates.length < 6 || coordinates.length % 2 !== 0) {
5216
+ console.warn(`Invalid polygon definition: ${areaKey}`);
5217
+ return false;
5218
+ }
5219
+ const vertices = [];
5220
+ for (let i = 0; i < coordinates.length; i += 2) {
5221
+ vertices.push({ x: coordinates[i], y: coordinates[i + 1] });
5222
+ }
5223
+ return this.isPointInPolygon({ x: px, y: py }, vertices);
5224
+ }
5225
+ default:
5226
+ console.warn(`Unsupported shape type: ${shape}`);
5227
+ return false;
5228
+ }
5229
+ }
5230
+ /**
5231
+ * Checks if a point is inside a polygon using the ray-casting algorithm.
5232
+ * @param point The point to test.
5233
+ * @param vertices The vertices of the polygon in order (array of {x, y} objects).
5234
+ * @returns True if the point is inside the polygon; false otherwise.
5235
+ */
5236
+ static isPointInPolygon(point, vertices) {
5237
+ let inside = false;
5238
+ for (let i = 0, j = vertices.length - 1; i < vertices.length; j = i++) {
5239
+ const xi = vertices[i].x, yi = vertices[i].y;
5240
+ const xj = vertices[j].x, yj = vertices[j].y;
5241
+ const intersect = yi > point.y !== yj > point.y && point.x < (xj - xi) * (point.y - yi) / (yj - yi) + xi;
5242
+ if (intersect) inside = !inside;
5243
+ }
5244
+ return inside;
5245
+ }
5113
5246
  static compareSingleValues(value1, value2, baseType) {
5114
5247
  switch (baseType) {
5115
5248
  case "identifier":
@@ -5285,8 +5418,8 @@ import { property as property31 } from "lit/decorators.js";
5285
5418
  var QtiMapResponse = class extends QtiExpression {
5286
5419
  getResult() {
5287
5420
  const response = this.context.variables.find((r) => r.identifier === this.identifier);
5288
- if (!response) {
5289
- console.warn(`Response ${this.identifier} can not be found`);
5421
+ if (!response || !response.mapping) {
5422
+ console.error(`Response ${this.identifier} can not be found`);
5290
5423
  return null;
5291
5424
  }
5292
5425
  const mapping = response.mapping;
@@ -5316,10 +5449,157 @@ __decorateClass([
5316
5449
  ], QtiMapResponse.prototype, "identifier", 2);
5317
5450
  customElements.define("qti-map-response", QtiMapResponse);
5318
5451
 
5319
- // src/lib/qti-components/qti-response-processing/qti-expression/qti-mapping/qti-mapping.ts
5452
+ // src/lib/qti-components/qti-response-processing/qti-expression/qti-map-response-point/qti-map-response-point.ts
5320
5453
  import { property as property32 } from "lit/decorators.js";
5321
- import { LitElement as LitElement25 } from "lit";
5322
- var QtiMapping = class extends LitElement25 {
5454
+
5455
+ // src/lib/qti-components/internal/qti-expression.ts
5456
+ import { consume as consume3 } from "@lit/context";
5457
+ import { css as css34, html as html44, LitElement as LitElement25 } from "lit";
5458
+ import { state as state13 } from "lit/decorators.js";
5459
+ var QtiExpression2 = class extends LitElement25 {
5460
+ constructor() {
5461
+ super(...arguments);
5462
+ this.getVariables = () => (
5463
+ // FIXME: if this itself is multiple, this will never enter the qti-multiple switch
5464
+ // See this example here: https://github.com/1EdTech/qti-examples/blob/master/qtiv3-examples/packaging/items/Example05-feedbackBlock-adaptive.xml
5465
+ Array.from(this.children).map((e) => {
5466
+ switch (e.tagName.toLowerCase()) {
5467
+ case "qti-base-value": {
5468
+ return {
5469
+ baseType: e.getAttribute("base-type"),
5470
+ value: e.textContent.trim(),
5471
+ cardinality: "single"
5472
+ };
5473
+ }
5474
+ case "qti-variable": {
5475
+ const identifier = e.getAttribute("identifier") || "";
5476
+ const variable = this.context.variables.find((v) => v.identifier === identifier) || null;
5477
+ return variable;
5478
+ }
5479
+ case "qti-multiple": {
5480
+ const multiple = e;
5481
+ const values = multiple.getResult();
5482
+ if (values.length > 0) {
5483
+ return {
5484
+ identifier: "",
5485
+ baseType: values[0].baseType,
5486
+ value: values.map((v) => v.value),
5487
+ cardinality: "multiple",
5488
+ type: "response"
5489
+ };
5490
+ }
5491
+ return null;
5492
+ }
5493
+ case "qti-correct": {
5494
+ const identifier = e.getAttribute("identifier") || "";
5495
+ const responseVariable = this.context.variables.find((v) => v.identifier === identifier) || null;
5496
+ return {
5497
+ baseType: responseVariable.baseType,
5498
+ value: responseVariable.correctResponse,
5499
+ cardinality: responseVariable.cardinality
5500
+ };
5501
+ }
5502
+ default: {
5503
+ try {
5504
+ const expression = e;
5505
+ const value = expression.getResult();
5506
+ return {
5507
+ baseType: "integer",
5508
+ value: value.toString(),
5509
+ cardinality: "single"
5510
+ };
5511
+ } catch (error) {
5512
+ console.warn("default not sufficient");
5513
+ }
5514
+ return null;
5515
+ }
5516
+ }
5517
+ }).filter((v) => v !== null)
5518
+ );
5519
+ }
5520
+ render() {
5521
+ return html44`<pre>${JSON.stringify(this.result, null, 2)}</pre>
5522
+ <slot></slot>`;
5523
+ }
5524
+ calculate() {
5525
+ this.result = this.getResult();
5526
+ return this.result;
5527
+ }
5528
+ getResult() {
5529
+ throw new Error("Not implemented");
5530
+ }
5531
+ };
5532
+ // hide the slot with css
5533
+ QtiExpression2.styles = css34`
5534
+ slot {
5535
+ display: none;
5536
+ }
5537
+ `;
5538
+ __decorateClass([
5539
+ state13()
5540
+ ], QtiExpression2.prototype, "result", 2);
5541
+ __decorateClass([
5542
+ consume3({ context: itemContext, subscribe: true }),
5543
+ state13()
5544
+ ], QtiExpression2.prototype, "context", 2);
5545
+
5546
+ // src/lib/qti-components/qti-response-processing/qti-expression/qti-map-response-point/qti-map-response-point.ts
5547
+ var QtiMapResponsePoint = class extends QtiExpression2 {
5548
+ getResult() {
5549
+ const response = this.context.variables.find((r) => r.identifier === this.identifier);
5550
+ if (!response) {
5551
+ console.warn(`Response ${this.identifier} cannot be found`);
5552
+ return null;
5553
+ }
5554
+ const areaMapping = response.areaMapping;
5555
+ if (!areaMapping) {
5556
+ console.warn(`Area mapping not found for response ${this.identifier}`);
5557
+ return null;
5558
+ }
5559
+ const candidateResponses = !Array.isArray(response.value) ? [response.value] : response.value;
5560
+ if (!candidateResponses || candidateResponses.length === 0) {
5561
+ console.warn(`No candidate responses for response ${this.identifier}`);
5562
+ return null;
5563
+ }
5564
+ let result = 0;
5565
+ const mappedAreas = /* @__PURE__ */ new Set();
5566
+ for (const candidateResponse of candidateResponses) {
5567
+ for (const entry of areaMapping.mapEntries) {
5568
+ if (mappedAreas.has(entry.coords)) {
5569
+ continue;
5570
+ }
5571
+ const isPointInArea = ScoringHelper.isPointInArea(
5572
+ candidateResponse,
5573
+ `${entry.shape},${entry.coords}`,
5574
+ response.baseType
5575
+ );
5576
+ if (isPointInArea) {
5577
+ result += entry.mappedValue ?? 0;
5578
+ mappedAreas.add(entry.coords);
5579
+ }
5580
+ }
5581
+ }
5582
+ if (mappedAreas.size < candidateResponses.length) {
5583
+ result += areaMapping.defaultValue;
5584
+ }
5585
+ if (areaMapping.lowerBound != null) {
5586
+ result = Math.max(areaMapping.lowerBound, result);
5587
+ }
5588
+ if (areaMapping.upperBound != null) {
5589
+ result = Math.min(areaMapping.upperBound, result);
5590
+ }
5591
+ return result;
5592
+ }
5593
+ };
5594
+ __decorateClass([
5595
+ property32({ type: String })
5596
+ ], QtiMapResponsePoint.prototype, "identifier", 2);
5597
+ customElements.define("qti-map-response-point", QtiMapResponsePoint);
5598
+
5599
+ // src/lib/qti-components/qti-response-processing/qti-expression/qti-mapping/qti-mapping.ts
5600
+ import { property as property33 } from "lit/decorators.js";
5601
+ import { LitElement as LitElement26 } from "lit";
5602
+ var QtiMapping = class extends LitElement26 {
5323
5603
  constructor() {
5324
5604
  super(...arguments);
5325
5605
  this.defaultValue = 0;
@@ -5334,16 +5614,46 @@ var QtiMapping = class extends LitElement25 {
5334
5614
  }
5335
5615
  };
5336
5616
  __decorateClass([
5337
- property32({ attribute: "default-value", type: Number })
5617
+ property33({ attribute: "default-value", type: Number })
5338
5618
  ], QtiMapping.prototype, "defaultValue", 2);
5339
5619
  __decorateClass([
5340
- property32({ attribute: "lower-bound", type: Number })
5620
+ property33({ attribute: "lower-bound", type: Number })
5341
5621
  ], QtiMapping.prototype, "lowerBound", 2);
5342
5622
  __decorateClass([
5343
- property32({ attribute: "upper-bound", type: Number })
5623
+ property33({ attribute: "upper-bound", type: Number })
5344
5624
  ], QtiMapping.prototype, "upperBound", 2);
5345
5625
  customElements.define("qti-mapping", QtiMapping);
5346
5626
 
5627
+ // src/lib/qti-components/qti-response-processing/qti-expression/qti-area-mapping/qti-area-mapping.ts
5628
+ import { property as property34 } from "lit/decorators.js";
5629
+ import { LitElement as LitElement27 } from "lit";
5630
+ var QtiAreaMapping = class extends LitElement27 {
5631
+ constructor() {
5632
+ super(...arguments);
5633
+ this.defaultValue = 0;
5634
+ }
5635
+ get mapEntries() {
5636
+ return Array.from(this.querySelectorAll("qti-area-map-entry")).map((el) => {
5637
+ return {
5638
+ shape: el.getAttribute("shape"),
5639
+ coords: el.getAttribute("coords"),
5640
+ mappedValue: +el.getAttribute("mapped-value"),
5641
+ defaultValue: el.getAttribute("default-value") ? +el.getAttribute("default-value") : 0
5642
+ };
5643
+ });
5644
+ }
5645
+ };
5646
+ __decorateClass([
5647
+ property34({ attribute: "default-value", type: Number })
5648
+ ], QtiAreaMapping.prototype, "defaultValue", 2);
5649
+ __decorateClass([
5650
+ property34({ attribute: "lower-bound", type: Number })
5651
+ ], QtiAreaMapping.prototype, "lowerBound", 2);
5652
+ __decorateClass([
5653
+ property34({ attribute: "upper-bound", type: Number })
5654
+ ], QtiAreaMapping.prototype, "upperBound", 2);
5655
+ customElements.define("qti-area-mapping", QtiAreaMapping);
5656
+
5347
5657
  // src/lib/qti-components/qti-response-processing/qti-expression/qti-match/qti-match.ts
5348
5658
  var QtiMatch = class _QtiMatch extends QtiExpression {
5349
5659
  //PK : FIXME.
@@ -5483,10 +5793,10 @@ var QtiMultiple = class extends QtiExpression {
5483
5793
  customElements.define("qti-multiple", QtiMultiple);
5484
5794
 
5485
5795
  // src/lib/qti-components/qti-response-processing/qti-expression/qti-not/qti-not.ts
5486
- import { html as html44 } from "lit";
5796
+ import { html as html45 } from "lit";
5487
5797
  var QtiNot = class extends QtiExpression {
5488
5798
  render() {
5489
- return html44`${super.render()}`;
5799
+ return html45`${super.render()}`;
5490
5800
  }
5491
5801
  getResult() {
5492
5802
  const expression = this.firstElementChild;
@@ -5550,13 +5860,13 @@ var QtiOrdered = class extends QtiExpression {
5550
5860
  customElements.define("qti-ordered", QtiOrdered);
5551
5861
 
5552
5862
  // src/lib/qti-components/qti-response-processing/qti-expression/qti-printed-variable/qti-printed-variable.ts
5553
- import { consume as consume3 } from "@lit/context";
5554
- import { LitElement as LitElement26, html as html45 } from "lit";
5555
- import { property as property33, state as state13 } from "lit/decorators.js";
5556
- var QtiPrintedVariable = class extends LitElement26 {
5863
+ import { consume as consume4 } from "@lit/context";
5864
+ import { LitElement as LitElement28, html as html46 } from "lit";
5865
+ import { property as property35, state as state14 } from "lit/decorators.js";
5866
+ var QtiPrintedVariable = class extends LitElement28 {
5557
5867
  render() {
5558
5868
  const value = this.context?.variables.find((v) => v.identifier === this.identifier)?.value;
5559
- return html45`${JSON.stringify(value, null, 2)}`;
5869
+ return html46`${JSON.stringify(value, null, 2)}`;
5560
5870
  }
5561
5871
  calculate() {
5562
5872
  const result = this.context.variables.find((v) => v.identifier === this.identifier) || null;
@@ -5564,11 +5874,11 @@ var QtiPrintedVariable = class extends LitElement26 {
5564
5874
  }
5565
5875
  };
5566
5876
  __decorateClass([
5567
- property33({ type: String })
5877
+ property35({ type: String })
5568
5878
  ], QtiPrintedVariable.prototype, "identifier", 2);
5569
5879
  __decorateClass([
5570
- consume3({ context: itemContext, subscribe: true }),
5571
- state13()
5880
+ consume4({ context: itemContext, subscribe: true }),
5881
+ state14()
5572
5882
  ], QtiPrintedVariable.prototype, "context", 2);
5573
5883
  customElements.define("qti-printed-variable", QtiPrintedVariable);
5574
5884
 
@@ -5628,7 +5938,7 @@ function qtiSubtractMixin(Base) {
5628
5938
  customElements.define("qti-subtract", QtiSubtract);
5629
5939
 
5630
5940
  // src/lib/qti-components/qti-response-processing/qti-expression/qti-string-match/qti-string-match.ts
5631
- import { property as property34 } from "lit/decorators.js";
5941
+ import { property as property36 } from "lit/decorators.js";
5632
5942
  var QtiStringMatch = class extends QtiExpression {
5633
5943
  constructor() {
5634
5944
  super(...arguments);
@@ -5652,7 +5962,7 @@ var QtiStringMatch = class extends QtiExpression {
5652
5962
  }
5653
5963
  };
5654
5964
  __decorateClass([
5655
- property34({ type: String, attribute: "case-sensitive" })
5965
+ property36({ type: String, attribute: "case-sensitive" })
5656
5966
  ], QtiStringMatch.prototype, "caseSensitive", 2);
5657
5967
  customElements.define("qti-string-match", QtiStringMatch);
5658
5968
 
@@ -5700,11 +6010,11 @@ var QtiVariable = class extends QtiExpression {
5700
6010
  customElements.define("qti-variable", QtiVariable);
5701
6011
 
5702
6012
  // src/lib/qti-components/qti-rubric-block/qti-content-body.ts
5703
- import { LitElement as LitElement27, html as html46 } from "lit";
6013
+ import { LitElement as LitElement29, html as html47 } from "lit";
5704
6014
  import { customElement as customElement43 } from "lit/decorators.js";
5705
- var QtiContentBody = class extends LitElement27 {
6015
+ var QtiContentBody = class extends LitElement29 {
5706
6016
  render() {
5707
- return html46`<slot></slot>`;
6017
+ return html47`<slot></slot>`;
5708
6018
  }
5709
6019
  };
5710
6020
  QtiContentBody = __decorateClass([
@@ -5712,9 +6022,9 @@ QtiContentBody = __decorateClass([
5712
6022
  ], QtiContentBody);
5713
6023
 
5714
6024
  // src/lib/qti-components/qti-rubric-block/qti-rubric-block.ts
5715
- import { LitElement as LitElement28, css as css34, html as html47 } from "lit";
5716
- import { customElement as customElement44, property as property35 } from "lit/decorators.js";
5717
- var QtiRubricBlock = class extends LitElement28 {
6025
+ import { LitElement as LitElement30, css as css35, html as html48 } from "lit";
6026
+ import { customElement as customElement44, property as property37 } from "lit/decorators.js";
6027
+ var QtiRubricBlock = class extends LitElement30 {
5718
6028
  handleclassNamesChange() {
5719
6029
  const classNames = this.classNames.split(" ");
5720
6030
  classNames.forEach((className) => {
@@ -5731,29 +6041,29 @@ var QtiRubricBlock = class extends LitElement28 {
5731
6041
  });
5732
6042
  }
5733
6043
  render() {
5734
- return html47`<slot></slot>`;
6044
+ return html48`<slot></slot>`;
5735
6045
  }
5736
6046
  connectedCallback() {
5737
6047
  super.connectedCallback();
5738
6048
  this.setAttribute("slot", "qti-rubric-block");
5739
6049
  }
5740
6050
  };
5741
- QtiRubricBlock.styles = css34`
6051
+ QtiRubricBlock.styles = css35`
5742
6052
  :host {
5743
6053
  display: block;
5744
6054
  }
5745
6055
  `;
5746
6056
  __decorateClass([
5747
- property35({ type: String })
6057
+ property37({ type: String })
5748
6058
  ], QtiRubricBlock.prototype, "id", 2);
5749
6059
  __decorateClass([
5750
- property35({ type: String })
6060
+ property37({ type: String })
5751
6061
  ], QtiRubricBlock.prototype, "use", 2);
5752
6062
  __decorateClass([
5753
- property35({ type: String })
6063
+ property37({ type: String })
5754
6064
  ], QtiRubricBlock.prototype, "view", 2);
5755
6065
  __decorateClass([
5756
- property35({ type: String, attribute: "class" })
6066
+ property37({ type: String, attribute: "class" })
5757
6067
  ], QtiRubricBlock.prototype, "classNames", 2);
5758
6068
  __decorateClass([
5759
6069
  watch("classNames", { waitUntilFirstUpdate: true })
@@ -5763,9 +6073,9 @@ QtiRubricBlock = __decorateClass([
5763
6073
  ], QtiRubricBlock);
5764
6074
 
5765
6075
  // src/lib/qti-components/qti-stylesheet/qti-stylesheet.ts
5766
- import { LitElement as LitElement29 } from "lit";
6076
+ import { LitElement as LitElement31 } from "lit";
5767
6077
  import { customElement as customElement45 } from "lit/decorators.js";
5768
- var QtiStylesheet = class extends LitElement29 {
6078
+ var QtiStylesheet = class extends LitElement31 {
5769
6079
  constructor() {
5770
6080
  super(...arguments);
5771
6081
  this.styleElement = null;
@@ -5819,16 +6129,16 @@ QtiStylesheet = __decorateClass([
5819
6129
  ], QtiStylesheet);
5820
6130
 
5821
6131
  // src/lib/qti-components/qti-variable-declaration/qti-outcome-declaration/qti-outcome-declaration.ts
5822
- import { consume as consume4 } from "@lit/context";
5823
- import { css as css35, html as html49 } from "lit";
5824
- import { customElement as customElement47, property as property36, state as state14 } from "lit/decorators.js";
6132
+ import { consume as consume5 } from "@lit/context";
6133
+ import { css as css36, html as html50 } from "lit";
6134
+ import { customElement as customElement47, property as property38, state as state15 } from "lit/decorators.js";
5825
6135
 
5826
6136
  // src/lib/qti-components/qti-variable-declaration/qti-variable-declaration.ts
5827
- import { html as html48, LitElement as LitElement30 } from "lit";
6137
+ import { html as html49, LitElement as LitElement32 } from "lit";
5828
6138
  import { customElement as customElement46 } from "lit/decorators.js";
5829
- var QtiVariableDeclaration = class extends LitElement30 {
6139
+ var QtiVariableDeclaration = class extends LitElement32 {
5830
6140
  render() {
5831
- return html48`<slot></slot>`;
6141
+ return html49`<slot></slot>`;
5832
6142
  }
5833
6143
  defaultValues(variable) {
5834
6144
  const htmlValues = Array.from(this.querySelectorAll("qti-default-value > qti-value"));
@@ -5854,7 +6164,7 @@ var QtiOutcomeDeclaration = class extends QtiVariableDeclaration {
5854
6164
  }
5855
6165
  render() {
5856
6166
  const value = this.itemContext?.variables.find((v) => v.identifier === this.identifier)?.value;
5857
- return html49`${JSON.stringify(value, null, 2)}`;
6167
+ return html50`${JSON.stringify(value, null, 2)}`;
5858
6168
  }
5859
6169
  get interpolationTable() {
5860
6170
  const table = this.querySelector("qti-interpolation-table");
@@ -5897,40 +6207,40 @@ var QtiOutcomeDeclaration = class extends QtiVariableDeclaration {
5897
6207
  }
5898
6208
  };
5899
6209
  QtiOutcomeDeclaration.styles = [
5900
- css35`
6210
+ css36`
5901
6211
  :host {
5902
6212
  display: none;
5903
6213
  }
5904
6214
  `
5905
6215
  ];
5906
6216
  __decorateClass([
5907
- property36({ type: String, attribute: "base-type" })
6217
+ property38({ type: String, attribute: "base-type" })
5908
6218
  ], QtiOutcomeDeclaration.prototype, "baseType", 2);
5909
6219
  __decorateClass([
5910
- property36({ type: String, attribute: "external-scored" })
6220
+ property38({ type: String, attribute: "external-scored" })
5911
6221
  ], QtiOutcomeDeclaration.prototype, "externalScored", 2);
5912
6222
  __decorateClass([
5913
- property36({ type: String })
6223
+ property38({ type: String })
5914
6224
  ], QtiOutcomeDeclaration.prototype, "identifier", 2);
5915
6225
  __decorateClass([
5916
- property36({ type: String })
6226
+ property38({ type: String })
5917
6227
  ], QtiOutcomeDeclaration.prototype, "cardinality", 2);
5918
6228
  __decorateClass([
5919
- consume4({ context: itemContext, subscribe: true }),
5920
- state14()
6229
+ consume5({ context: itemContext, subscribe: true }),
6230
+ state15()
5921
6231
  ], QtiOutcomeDeclaration.prototype, "itemContext", 2);
5922
6232
  QtiOutcomeDeclaration = __decorateClass([
5923
6233
  customElement47("qti-outcome-declaration")
5924
6234
  ], QtiOutcomeDeclaration);
5925
6235
 
5926
6236
  // src/lib/qti-components/qti-variable-declaration/qti-response-declaration/qti-response-declaration.ts
5927
- import { consume as consume5 } from "@lit/context";
5928
- import { css as css36, html as html50 } from "lit";
5929
- import { customElement as customElement48, property as property37, state as state15 } from "lit/decorators.js";
6237
+ import { consume as consume6 } from "@lit/context";
6238
+ import { css as css37, html as html51 } from "lit";
6239
+ import { customElement as customElement48, property as property39, state as state16 } from "lit/decorators.js";
5930
6240
  var QtiResponseDeclaration = class extends QtiVariableDeclaration {
5931
6241
  render() {
5932
6242
  const value = this.itemContext?.variables.find((v) => v.identifier === this.identifier)?.value;
5933
- return html50`${JSON.stringify(value, null, 2)}`;
6243
+ return html51`${JSON.stringify(value, null, 2)}`;
5934
6244
  }
5935
6245
  connectedCallback() {
5936
6246
  super.connectedCallback();
@@ -5940,6 +6250,7 @@ var QtiResponseDeclaration = class extends QtiVariableDeclaration {
5940
6250
  correctResponse: this.correctResponse,
5941
6251
  cardinality: this.cardinality || "single",
5942
6252
  mapping: this.mapping,
6253
+ areaMapping: this.areaMapping,
5943
6254
  value: null,
5944
6255
  type: "response",
5945
6256
  candidateResponse: null
@@ -5974,26 +6285,29 @@ var QtiResponseDeclaration = class extends QtiVariableDeclaration {
5974
6285
  get mapping() {
5975
6286
  return this.querySelector("qti-mapping");
5976
6287
  }
6288
+ get areaMapping() {
6289
+ return this.querySelector("qti-area-mapping");
6290
+ }
5977
6291
  };
5978
6292
  QtiResponseDeclaration.styles = [
5979
- css36`
6293
+ css37`
5980
6294
  :host {
5981
6295
  display: none;
5982
6296
  }
5983
6297
  `
5984
6298
  ];
5985
6299
  __decorateClass([
5986
- property37({ type: String, attribute: "base-type" })
6300
+ property39({ type: String, attribute: "base-type" })
5987
6301
  ], QtiResponseDeclaration.prototype, "baseType", 2);
5988
6302
  __decorateClass([
5989
- property37({ type: String })
6303
+ property39({ type: String })
5990
6304
  ], QtiResponseDeclaration.prototype, "identifier", 2);
5991
6305
  __decorateClass([
5992
- property37({ type: String })
6306
+ property39({ type: String })
5993
6307
  ], QtiResponseDeclaration.prototype, "cardinality", 2);
5994
6308
  __decorateClass([
5995
- consume5({ context: itemContext, subscribe: true }),
5996
- state15()
6309
+ consume6({ context: itemContext, subscribe: true }),
6310
+ state16()
5997
6311
  ], QtiResponseDeclaration.prototype, "itemContext", 2);
5998
6312
  QtiResponseDeclaration = __decorateClass([
5999
6313
  customElement48("qti-response-declaration")
@@ -6064,7 +6378,9 @@ export {
6064
6378
  QtiLt,
6065
6379
  QtiLte,
6066
6380
  QtiMapResponse,
6381
+ QtiMapResponsePoint,
6067
6382
  QtiMapping,
6383
+ QtiAreaMapping,
6068
6384
  QtiMatch,
6069
6385
  QtiMember,
6070
6386
  QtiMultiple,
@@ -6085,4 +6401,4 @@ export {
6085
6401
  QtiOutcomeDeclaration,
6086
6402
  QtiResponseDeclaration
6087
6403
  };
6088
- //# sourceMappingURL=chunk-E4TWZ2DL.js.map
6404
+ //# sourceMappingURL=chunk-5E4OEZCA.js.map