@citolab/qti-components 7.3.22 → 7.4.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 (346) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +5485 -1
  3. package/custom-elements.json +29837 -0
  4. package/dist/chunks/chunk-6K4ROGDD.js +364 -0
  5. package/dist/chunks/chunk-6K4ROGDD.js.map +1 -0
  6. package/dist/chunks/chunk-GUDRSXIP.js +189 -0
  7. package/dist/chunks/chunk-GUDRSXIP.js.map +1 -0
  8. package/dist/chunks/{chunk-WFUXZ4UT.js → chunk-JDY5GL7E.js} +13 -1
  9. package/dist/chunks/{chunk-WFUXZ4UT.js.map → chunk-JDY5GL7E.js.map} +1 -1
  10. package/dist/chunks/{chunk-LF6SO3JU.js → chunk-LN74Z5QM.js} +653 -450
  11. package/dist/chunks/chunk-LN74Z5QM.js.map +1 -0
  12. package/dist/chunks/{chunk-ELDMXTUQ.js → chunk-O5N4DCU6.js} +7 -2
  13. package/dist/chunks/chunk-O5N4DCU6.js.map +1 -0
  14. package/dist/chunks/chunk-TJ6ZOT7A.js +2235 -0
  15. package/dist/chunks/chunk-TJ6ZOT7A.js.map +1 -0
  16. package/dist/computed-item.context-DpK-sS0T.d.ts +19 -0
  17. package/dist/{exports/config.context.d.ts → config.context-CmQ9L62n.d.ts} +1 -4
  18. package/dist/custom-elements.json +29837 -0
  19. package/dist/index.d.ts +8 -39
  20. package/dist/index.js +34 -104
  21. package/{cdn/chunks/chunk-5TDBMEY5.js → dist/item.css} +7 -24
  22. package/dist/qti-assessment-item-D77dJ1Ot.d.ts +104 -0
  23. package/dist/qti-components/index.d.ts +1238 -19
  24. package/dist/qti-components/index.js +6 -14
  25. package/dist/qti-components-jsx.d.ts +4463 -0
  26. package/dist/qti-item/index.d.ts +113 -0
  27. package/dist/qti-item/index.js +16 -0
  28. package/dist/qti-loader/index.d.ts +2 -6
  29. package/dist/qti-loader/index.js +24 -5
  30. package/dist/qti-loader/index.js.map +1 -1
  31. package/dist/qti-test/index.d.ts +593 -0
  32. package/dist/qti-test/index.js +62 -0
  33. package/dist/qti-transformers/index.d.ts +38 -2
  34. package/dist/qti-transformers/index.js +1 -2
  35. package/dist/test.context-L609DNAz.d.ts +58 -0
  36. package/dist/variables-Vgyr6yyW.d.ts +58 -0
  37. package/dist/vscode.css-custom-data.json +11 -0
  38. package/dist/vscode.html-custom-data.json +1135 -0
  39. package/package.json +74 -113
  40. package/cdn/chunks/chunk-2BSPQRNR.js +0 -6
  41. package/cdn/chunks/chunk-3CVBBZDT.js +0 -17
  42. package/cdn/chunks/chunk-3IBGLVHA.js +0 -1
  43. package/cdn/chunks/chunk-3YQMAZEO.js +0 -29
  44. package/cdn/chunks/chunk-5UQLGV7F.js +0 -5
  45. package/cdn/chunks/chunk-5WLHU3FH.js +0 -8
  46. package/cdn/chunks/chunk-6SGFGN34.js +0 -8
  47. package/cdn/chunks/chunk-6XVY32RS.js +0 -1
  48. package/cdn/chunks/chunk-7ME56ODO.js +0 -1
  49. package/cdn/chunks/chunk-CZDMOYYF.js +0 -1
  50. package/cdn/chunks/chunk-DNBBQ7LY.js +0 -1
  51. package/cdn/chunks/chunk-DP5FVJRS.js +0 -21
  52. package/cdn/chunks/chunk-E6IOJ4MV.js +0 -23
  53. package/cdn/chunks/chunk-G76Y52EL.js +0 -1471
  54. package/cdn/chunks/chunk-HCXHHI6V.js +0 -18
  55. package/cdn/chunks/chunk-HDMF4QZO.js +0 -48
  56. package/cdn/chunks/chunk-HKWYQB5Z.js +0 -37
  57. package/cdn/chunks/chunk-J5P2GBPV.js +0 -1
  58. package/cdn/chunks/chunk-KWPDTFYH.js +0 -1
  59. package/cdn/chunks/chunk-LIUOA3YV.js +0 -1
  60. package/cdn/chunks/chunk-LO2NM3CE.js +0 -1
  61. package/cdn/chunks/chunk-MD33BNWM.js +0 -1
  62. package/cdn/chunks/chunk-MRQ46JRY.js +0 -8
  63. package/cdn/chunks/chunk-NJP4VZB3.js +0 -8
  64. package/cdn/chunks/chunk-O4RAJ3LM.js +0 -25
  65. package/cdn/chunks/chunk-OSLUHYFD.js +0 -8
  66. package/cdn/chunks/chunk-P6SSTAJ2.js +0 -1
  67. package/cdn/chunks/chunk-PP62N3C4.js +0 -8
  68. package/cdn/chunks/chunk-PU7OABT3.js +0 -1
  69. package/cdn/chunks/chunk-PUI3LIFH.js +0 -0
  70. package/cdn/chunks/chunk-QBAXWCYQ.js +0 -5
  71. package/cdn/chunks/chunk-QEFO63QX.js +0 -8
  72. package/cdn/chunks/chunk-QQCGUVEV.js +0 -1
  73. package/cdn/chunks/chunk-QQR6POPY.js +0 -1
  74. package/cdn/chunks/chunk-RGNFAPWY.js +0 -2
  75. package/cdn/chunks/chunk-S5QDLZ6J.js +0 -1
  76. package/cdn/chunks/chunk-SEM2PEP6.js +0 -5
  77. package/cdn/chunks/chunk-SVVO2SFS.js +0 -1
  78. package/cdn/chunks/chunk-TCHROQU3.js +0 -1
  79. package/cdn/chunks/chunk-UMDZKG6K.js +0 -1
  80. package/cdn/chunks/chunk-VEG7LKS3.js +0 -48
  81. package/cdn/chunks/chunk-WCCTDLQ4.js +0 -8
  82. package/cdn/chunks/chunk-X4FA36TC.js +0 -1
  83. package/cdn/chunks/chunk-XJ2CFTZP.js +0 -1
  84. package/cdn/chunks/chunk-XUJ7TXHW.js +0 -1
  85. package/cdn/chunks/chunk-YCBNF5QU.js +0 -17
  86. package/cdn/chunks/chunk-YHLQ2JQ2.js +0 -1
  87. package/cdn/chunks/chunk-ZPCQH3EY.js +0 -10
  88. package/cdn/exports/computed-item.context.js +0 -1
  89. package/cdn/exports/computed.context.js +0 -1
  90. package/cdn/exports/config.context.js +0 -1
  91. package/cdn/exports/expression-result.js +0 -0
  92. package/cdn/exports/interaction.interface.js +0 -0
  93. package/cdn/exports/interaction.js +0 -1
  94. package/cdn/exports/item.context.js +0 -1
  95. package/cdn/exports/qti-assessment-item.context.js +0 -1
  96. package/cdn/exports/qti-condition-expression.js +0 -1
  97. package/cdn/exports/qti-expression.js +0 -1
  98. package/cdn/exports/qti-test.js +0 -0
  99. package/cdn/exports/qti.context.js +0 -1
  100. package/cdn/exports/session.context.js +0 -1
  101. package/cdn/exports/test.context.js +0 -1
  102. package/cdn/exports/variables.js +0 -0
  103. package/cdn/qti-components/index.js +0 -1
  104. package/cdn/qti-item/components/item-container.js +0 -1
  105. package/cdn/qti-item/components/item-correct-response-mode.js +0 -10
  106. package/cdn/qti-item/components/item-show-candidate-correction.js +0 -8
  107. package/cdn/qti-item/components/item-show-correct-response.js +0 -1
  108. package/cdn/qti-item/components/print-item-variables.js +0 -1
  109. package/cdn/qti-item/components/styles.js +0 -1
  110. package/cdn/qti-item/core/index.js +0 -1
  111. package/cdn/qti-loader/index.js +0 -1
  112. package/cdn/qti-test/components/index.js +0 -1
  113. package/cdn/qti-test/components/styles.js +0 -1
  114. package/cdn/qti-test/components/test-check-item.js +0 -1
  115. package/cdn/qti-test/components/test-container.js +0 -1
  116. package/cdn/qti-test/components/test-end-attempt.js +0 -1
  117. package/cdn/qti-test/components/test-item-link.js +0 -1
  118. package/cdn/qti-test/components/test-navigation.js +0 -1
  119. package/cdn/qti-test/components/test-next.js +0 -1
  120. package/cdn/qti-test/components/test-paging-buttons-stamp.js +0 -1
  121. package/cdn/qti-test/components/test-prev.js +0 -1
  122. package/cdn/qti-test/components/test-print-context.js +0 -1
  123. package/cdn/qti-test/components/test-print-item-variables.js +0 -1
  124. package/cdn/qti-test/components/test-scoring-buttons.js +0 -1
  125. package/cdn/qti-test/components/test-scoring-feedback.js +0 -1
  126. package/cdn/qti-test/components/test-section-buttons-stamp.js +0 -1
  127. package/cdn/qti-test/components/test-section-link.js +0 -1
  128. package/cdn/qti-test/components/test-show-correct-response.js +0 -1
  129. package/cdn/qti-test/components/test-stamp.js +0 -1
  130. package/cdn/qti-test/components/test-view-toggle.js +0 -1
  131. package/cdn/qti-test/components/test-view.js +0 -1
  132. package/cdn/qti-test/core/index.js +0 -1
  133. package/cdn/qti-transformers/index.js +0 -1
  134. package/dist/chunks/chunk-22IRJWWY.js +0 -10
  135. package/dist/chunks/chunk-22IRJWWY.js.map +0 -1
  136. package/dist/chunks/chunk-36G5MQKR.js +0 -85
  137. package/dist/chunks/chunk-36G5MQKR.js.map +0 -1
  138. package/dist/chunks/chunk-4OGJBG35.js +0 -8
  139. package/dist/chunks/chunk-4OGJBG35.js.map +0 -1
  140. package/dist/chunks/chunk-5KCXO2RP.js +0 -36
  141. package/dist/chunks/chunk-5KCXO2RP.js.map +0 -1
  142. package/dist/chunks/chunk-5ZHHNEDA.js +0 -30
  143. package/dist/chunks/chunk-5ZHHNEDA.js.map +0 -1
  144. package/dist/chunks/chunk-7K44TDQO.js +0 -91
  145. package/dist/chunks/chunk-7K44TDQO.js.map +0 -1
  146. package/dist/chunks/chunk-7OMJMXHK.js +0 -50
  147. package/dist/chunks/chunk-7OMJMXHK.js.map +0 -1
  148. package/dist/chunks/chunk-AZIKAG7K.js +0 -8
  149. package/dist/chunks/chunk-AZIKAG7K.js.map +0 -1
  150. package/dist/chunks/chunk-BLBSZDQ4.js +0 -52
  151. package/dist/chunks/chunk-BLBSZDQ4.js.map +0 -1
  152. package/dist/chunks/chunk-CJADUWEC.js +0 -10
  153. package/dist/chunks/chunk-CJADUWEC.js.map +0 -1
  154. package/dist/chunks/chunk-CP34TICQ.js +0 -45
  155. package/dist/chunks/chunk-CP34TICQ.js.map +0 -1
  156. package/dist/chunks/chunk-CTESMSQO.js +0 -56
  157. package/dist/chunks/chunk-CTESMSQO.js.map +0 -1
  158. package/dist/chunks/chunk-DZAMXOSC.js +0 -30
  159. package/dist/chunks/chunk-DZAMXOSC.js.map +0 -1
  160. package/dist/chunks/chunk-E6V3JHVT.js +0 -31
  161. package/dist/chunks/chunk-E6V3JHVT.js.map +0 -1
  162. package/dist/chunks/chunk-EJZQSOHU.js +0 -85
  163. package/dist/chunks/chunk-EJZQSOHU.js.map +0 -1
  164. package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
  165. package/dist/chunks/chunk-EMVOKXSA.js +0 -84
  166. package/dist/chunks/chunk-EMVOKXSA.js.map +0 -1
  167. package/dist/chunks/chunk-ERYHQVOT.js +0 -8
  168. package/dist/chunks/chunk-ERYHQVOT.js.map +0 -1
  169. package/dist/chunks/chunk-ETLOKJAG.js +0 -94
  170. package/dist/chunks/chunk-ETLOKJAG.js.map +0 -1
  171. package/dist/chunks/chunk-FL72PF4D.js +0 -19
  172. package/dist/chunks/chunk-FL72PF4D.js.map +0 -1
  173. package/dist/chunks/chunk-GAHXUFMQ.js +0 -93
  174. package/dist/chunks/chunk-GAHXUFMQ.js.map +0 -1
  175. package/dist/chunks/chunk-H2JE6IVU.js +0 -15
  176. package/dist/chunks/chunk-H2JE6IVU.js.map +0 -1
  177. package/dist/chunks/chunk-H6KHXSIO.js +0 -8
  178. package/dist/chunks/chunk-H6KHXSIO.js.map +0 -1
  179. package/dist/chunks/chunk-HFAUM56X.js +0 -208
  180. package/dist/chunks/chunk-HFAUM56X.js.map +0 -1
  181. package/dist/chunks/chunk-JQ6HWGRY.js +0 -22
  182. package/dist/chunks/chunk-JQ6HWGRY.js.map +0 -1
  183. package/dist/chunks/chunk-KG5Z2CKO.js +0 -86
  184. package/dist/chunks/chunk-KG5Z2CKO.js.map +0 -1
  185. package/dist/chunks/chunk-KSXNC564.js +0 -43
  186. package/dist/chunks/chunk-KSXNC564.js.map +0 -1
  187. package/dist/chunks/chunk-LF6SO3JU.js.map +0 -1
  188. package/dist/chunks/chunk-NJNQOQUU.js +0 -8
  189. package/dist/chunks/chunk-NJNQOQUU.js.map +0 -1
  190. package/dist/chunks/chunk-ODHS7HDB.js +0 -94
  191. package/dist/chunks/chunk-ODHS7HDB.js.map +0 -1
  192. package/dist/chunks/chunk-QCB6P7DH.js +0 -146
  193. package/dist/chunks/chunk-QCB6P7DH.js.map +0 -1
  194. package/dist/chunks/chunk-QU7KR7VX.js +0 -367
  195. package/dist/chunks/chunk-QU7KR7VX.js.map +0 -1
  196. package/dist/chunks/chunk-TU6COU44.js +0 -82
  197. package/dist/chunks/chunk-TU6COU44.js.map +0 -1
  198. package/dist/chunks/chunk-TUKEQ36K.js +0 -60
  199. package/dist/chunks/chunk-TUKEQ36K.js.map +0 -1
  200. package/dist/chunks/chunk-TWYN56XO.js +0 -92
  201. package/dist/chunks/chunk-TWYN56XO.js.map +0 -1
  202. package/dist/chunks/chunk-UHQVQBCL.js +0 -89
  203. package/dist/chunks/chunk-UHQVQBCL.js.map +0 -1
  204. package/dist/chunks/chunk-WFFIUFJJ.js +0 -28
  205. package/dist/chunks/chunk-WFFIUFJJ.js.map +0 -1
  206. package/dist/chunks/chunk-WN6TJQI2.js +0 -103
  207. package/dist/chunks/chunk-WN6TJQI2.js.map +0 -1
  208. package/dist/chunks/chunk-WPEFNKMC.js +0 -923
  209. package/dist/chunks/chunk-WPEFNKMC.js.map +0 -1
  210. package/dist/chunks/chunk-YPMZLHGG.js +0 -52
  211. package/dist/chunks/chunk-YPMZLHGG.js.map +0 -1
  212. package/dist/chunks/chunk-YWEWSQJR.js +0 -40
  213. package/dist/chunks/chunk-YWEWSQJR.js.map +0 -1
  214. package/dist/chunks/chunk-ZGSNDSK3.js +0 -1
  215. package/dist/chunks/chunk-ZGSNDSK3.js.map +0 -1
  216. package/dist/exports/computed-item.context.d.ts +0 -29
  217. package/dist/exports/computed-item.context.js +0 -8
  218. package/dist/exports/computed-item.context.js.map +0 -1
  219. package/dist/exports/computed.context.d.ts +0 -42
  220. package/dist/exports/computed.context.js +0 -8
  221. package/dist/exports/computed.context.js.map +0 -1
  222. package/dist/exports/config.context.js +0 -8
  223. package/dist/exports/config.context.js.map +0 -1
  224. package/dist/exports/expression-result.d.ts +0 -19
  225. package/dist/exports/expression-result.js +0 -1
  226. package/dist/exports/expression-result.js.map +0 -1
  227. package/dist/exports/interaction.d.ts +0 -8
  228. package/dist/exports/interaction.interface.d.ts +0 -13
  229. package/dist/exports/interaction.interface.js +0 -1
  230. package/dist/exports/interaction.interface.js.map +0 -1
  231. package/dist/exports/interaction.js +0 -12
  232. package/dist/exports/interaction.js.map +0 -1
  233. package/dist/exports/item.context.d.ts +0 -8
  234. package/dist/exports/item.context.js +0 -8
  235. package/dist/exports/item.context.js.map +0 -1
  236. package/dist/exports/qti-assessment-item.context.d.ts +0 -14
  237. package/dist/exports/qti-assessment-item.context.js +0 -8
  238. package/dist/exports/qti-assessment-item.context.js.map +0 -1
  239. package/dist/exports/qti-condition-expression.d.ts +0 -15
  240. package/dist/exports/qti-condition-expression.js +0 -11
  241. package/dist/exports/qti-condition-expression.js.map +0 -1
  242. package/dist/exports/qti-expression.d.ts +0 -8
  243. package/dist/exports/qti-expression.js +0 -10
  244. package/dist/exports/qti-expression.js.map +0 -1
  245. package/dist/exports/qti-test.d.ts +0 -40
  246. package/dist/exports/qti-test.js +0 -1
  247. package/dist/exports/qti-test.js.map +0 -1
  248. package/dist/exports/qti.context.d.ts +0 -14
  249. package/dist/exports/qti.context.js +0 -8
  250. package/dist/exports/qti.context.js.map +0 -1
  251. package/dist/exports/session.context.d.ts +0 -26
  252. package/dist/exports/session.context.js +0 -10
  253. package/dist/exports/session.context.js.map +0 -1
  254. package/dist/exports/test.context.d.ts +0 -21
  255. package/dist/exports/test.context.js +0 -10
  256. package/dist/exports/test.context.js.map +0 -1
  257. package/dist/exports/variables.d.ts +0 -8
  258. package/dist/exports/variables.js +0 -1
  259. package/dist/exports/variables.js.map +0 -1
  260. package/dist/qti-item/components/item-container.d.ts +0 -40
  261. package/dist/qti-item/components/item-container.js +0 -11
  262. package/dist/qti-item/components/item-container.js.map +0 -1
  263. package/dist/qti-item/components/item-correct-response-mode.d.ts +0 -17
  264. package/dist/qti-item/components/item-correct-response-mode.js +0 -62
  265. package/dist/qti-item/components/item-correct-response-mode.js.map +0 -1
  266. package/dist/qti-item/components/item-show-candidate-correction.d.ts +0 -34
  267. package/dist/qti-item/components/item-show-candidate-correction.js +0 -88
  268. package/dist/qti-item/components/item-show-candidate-correction.js.map +0 -1
  269. package/dist/qti-item/components/item-show-correct-response.d.ts +0 -33
  270. package/dist/qti-item/components/item-show-correct-response.js +0 -10
  271. package/dist/qti-item/components/item-show-correct-response.js.map +0 -1
  272. package/dist/qti-item/components/print-item-variables.d.ts +0 -23
  273. package/dist/qti-item/components/print-item-variables.js +0 -9
  274. package/dist/qti-item/components/print-item-variables.js.map +0 -1
  275. package/dist/qti-item/components/styles.d.ts +0 -8
  276. package/dist/qti-item/components/styles.js +0 -14
  277. package/dist/qti-item/components/styles.js.map +0 -1
  278. package/dist/qti-item/core/index.d.ts +0 -51
  279. package/dist/qti-item/core/index.js +0 -26
  280. package/dist/qti-response-declaration-DKr08ANy.d.ts +0 -1397
  281. package/dist/qti-test/components/index.d.ts +0 -33
  282. package/dist/qti-test/components/index.js +0 -87
  283. package/dist/qti-test/components/styles.d.ts +0 -8
  284. package/dist/qti-test/components/styles.js +0 -14
  285. package/dist/qti-test/components/styles.js.map +0 -1
  286. package/dist/qti-test/components/test-check-item.d.ts +0 -16
  287. package/dist/qti-test/components/test-check-item.js +0 -9
  288. package/dist/qti-test/components/test-check-item.js.map +0 -1
  289. package/dist/qti-test/components/test-container.d.ts +0 -39
  290. package/dist/qti-test/components/test-container.js +0 -11
  291. package/dist/qti-test/components/test-container.js.map +0 -1
  292. package/dist/qti-test/components/test-end-attempt.d.ts +0 -16
  293. package/dist/qti-test/components/test-end-attempt.js +0 -9
  294. package/dist/qti-test/components/test-end-attempt.js.map +0 -1
  295. package/dist/qti-test/components/test-item-link.d.ts +0 -18
  296. package/dist/qti-test/components/test-item-link.js +0 -9
  297. package/dist/qti-test/components/test-item-link.js.map +0 -1
  298. package/dist/qti-test/components/test-navigation.d.ts +0 -73
  299. package/dist/qti-test/components/test-navigation.js +0 -13
  300. package/dist/qti-test/components/test-navigation.js.map +0 -1
  301. package/dist/qti-test/components/test-next.d.ts +0 -48
  302. package/dist/qti-test/components/test-next.js +0 -12
  303. package/dist/qti-test/components/test-next.js.map +0 -1
  304. package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +0 -23
  305. package/dist/qti-test/components/test-paging-buttons-stamp.js +0 -9
  306. package/dist/qti-test/components/test-paging-buttons-stamp.js.map +0 -1
  307. package/dist/qti-test/components/test-prev.d.ts +0 -46
  308. package/dist/qti-test/components/test-prev.js +0 -12
  309. package/dist/qti-test/components/test-prev.js.map +0 -1
  310. package/dist/qti-test/components/test-print-context.d.ts +0 -25
  311. package/dist/qti-test/components/test-print-context.js +0 -9
  312. package/dist/qti-test/components/test-print-context.js.map +0 -1
  313. package/dist/qti-test/components/test-print-item-variables.d.ts +0 -27
  314. package/dist/qti-test/components/test-print-item-variables.js +0 -9
  315. package/dist/qti-test/components/test-print-item-variables.js.map +0 -1
  316. package/dist/qti-test/components/test-scoring-buttons.d.ts +0 -32
  317. package/dist/qti-test/components/test-scoring-buttons.js +0 -9
  318. package/dist/qti-test/components/test-scoring-buttons.js.map +0 -1
  319. package/dist/qti-test/components/test-scoring-feedback.d.ts +0 -27
  320. package/dist/qti-test/components/test-scoring-feedback.js +0 -9
  321. package/dist/qti-test/components/test-scoring-feedback.js.map +0 -1
  322. package/dist/qti-test/components/test-section-buttons-stamp.d.ts +0 -23
  323. package/dist/qti-test/components/test-section-buttons-stamp.js +0 -9
  324. package/dist/qti-test/components/test-section-buttons-stamp.js.map +0 -1
  325. package/dist/qti-test/components/test-section-link.d.ts +0 -18
  326. package/dist/qti-test/components/test-section-link.js +0 -9
  327. package/dist/qti-test/components/test-section-link.js.map +0 -1
  328. package/dist/qti-test/components/test-show-correct-response.d.ts +0 -39
  329. package/dist/qti-test/components/test-show-correct-response.js +0 -10
  330. package/dist/qti-test/components/test-show-correct-response.js.map +0 -1
  331. package/dist/qti-test/components/test-stamp.d.ts +0 -31
  332. package/dist/qti-test/components/test-stamp.js +0 -9
  333. package/dist/qti-test/components/test-stamp.js.map +0 -1
  334. package/dist/qti-test/components/test-view-toggle.d.ts +0 -19
  335. package/dist/qti-test/components/test-view-toggle.js +0 -9
  336. package/dist/qti-test/components/test-view-toggle.js.map +0 -1
  337. package/dist/qti-test/components/test-view.d.ts +0 -24
  338. package/dist/qti-test/components/test-view.js +0 -10
  339. package/dist/qti-test/components/test-view.js.map +0 -1
  340. package/dist/qti-test/core/index.d.ts +0 -105
  341. package/dist/qti-test/core/index.js +0 -36
  342. package/dist/qti-test/core/index.js.map +0 -1
  343. package/dist/qti-test-feedback-CZsbp6z4.d.ts +0 -91
  344. package/dist/qti-transform-item-C9WtMeDR.d.ts +0 -39
  345. /package/dist/qti-item/{core/index.js.map → index.js.map} +0 -0
  346. /package/dist/qti-test/{components/index.js.map → index.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/components/test-navigation.ts"],"sourcesContent":["import { consume, provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { computedContext } from '../../exports/computed.context';\nimport { configContext } from '../../exports/config.context';\nimport { testContext } from '../../exports/test.context';\nimport { sessionContext } from '../../exports/session.context';\nimport { qtiContext } from '../../exports/qti.context';\n\nimport type { QtiContext } from '../../exports/qti.context';\nimport type { QtiAssessmentItem } from '../../qti-components';\nimport type { OutcomeVariable } from '../../exports/variables';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { PropertyValues } from 'lit';\nimport type { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiTestPart } from '../core';\nimport type { ConfigContext } from '../../exports/config.context';\nimport type { SessionContext } from '../../exports/session.context';\nimport type { TestContext } from '../../exports/test.context';\n\ntype CustomEventMap = {\n 'test-end-attempt': CustomEvent;\n 'test-show-correct-response': CustomEvent<{ value: boolean }>;\n};\n\ndeclare global {\n interface GlobalEventHandlersEventMap extends CustomEventMap {}\n}\n\n@customElement('test-navigation')\nexport class TestNavigation extends LitElement {\n @property({ type: String }) identifier = undefined;\n\n @state()\n public initContext: { identifier: string; [key: string]: any }[] = [];\n\n @state()\n @provide({ context: qtiContext })\n public qtiContext: QtiContext = {\n QTI_CONTEXT: {\n testIdentifier: '',\n candidateIdentifier: '',\n environmentIdentifier: 'default'\n }\n };\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n @state()\n @consume({ context: testContext, subscribe: true })\n protected _testContext?: TestContext;\n\n @state()\n @consume({ context: sessionContext, subscribe: true })\n protected _sessionContext?: SessionContext;\n\n @state()\n @provide({ context: computedContext })\n protected computedContext: ComputedContext;\n\n @property({ type: Boolean, attribute: 'auto-score-items' }) autoScoreItems = false;\n\n // @state()\n // private stampContext: {\n // view?: View;\n // test?: unknown;\n // activeTestpart?: unknown;\n // activeSection?: unknown;\n // activeItem?: unknown;\n // } = {\n // view: 'candidate',\n // activeItem: {},\n // activeSection: {\n // items: []\n // },\n // activeTestpart: {\n // items: []\n // },\n // test: {}\n // };\n // @property({ type: Boolean, reflect: true }) public debug = false;\n\n private _testElement: QtiAssessmentTest;\n\n constructor() {\n super();\n this.addEventListener('qti-assessment-test-connected', this._handleTestConnected.bind(this));\n this.addEventListener('qti-assessment-item-connected', this._handleItemConnected.bind(this));\n\n this.addEventListener('qti-interaction-changed', this._handleInteractionChanged.bind(this));\n\n this.addEventListener('test-end-attempt', this._handleTestEndAttempt.bind(this));\n this.addEventListener('test-show-correct-response', this._handleTestShowCorrectResponse.bind(this));\n this.addEventListener('test-show-candidate-correction', this._handleTestShowCandidateCorrection.bind(this));\n this.addEventListener('test-update-outcome-variable', this._handleTestUpdateOutcomeVariable.bind(this));\n }\n\n /**\n * Handles the 'test-end-attempt' event.\n * @private\n * @listens TestNavigation#test-end-attempt\n * @param {CustomEvent} event - The custom event object.\n */\n private _handleTestEndAttempt(_event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._sessionContext.navItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n const reportValidityAfterScoring = this.configContext?.reportValidityAfterScoring === true ? true : false;\n qtiAssessmentItemEl.processResponse(true, reportValidityAfterScoring);\n }\n\n // protected createRenderRoot(): HTMLElement | DocumentFragment {\n // return this;\n // }\n\n // myTemplate: TemplateFunction;\n\n // connectedCallback(): void {\n // super.connectedCallback();\n // const templateElement = this.querySelector<HTMLTemplateElement>('template');\n // if (!templateElement) {\n // this.myTemplate = null;\n // return;\n // }\n // this.myTemplate = prepareTemplate(templateElement);\n // }\n\n /**\n * Handles the 'test-show-correct-response' event.\n * @private\n * @listens TestNavigation#test-show-correct-response\n * @param {CustomEvent} event - The custom event object.\n */\n private _handleTestShowCorrectResponse(event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._sessionContext.navItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n if (!qtiAssessmentItemEl) return;\n qtiAssessmentItemEl.showCorrectResponse(event.detail);\n }\n\n /**\n * Handles the 'test-show-candidate-correction' event.\n * @private\n * @listens TestNavigation#test-show-candidate-correction\n * @param {CustomEvent} event - The custom event object.\n */\n private _handleTestShowCandidateCorrection(event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._sessionContext.navItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.showCandidateCorrection(event.detail);\n }\n\n private _handleTestUpdateOutcomeVariable(event: CustomEvent) {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${event.detail.assessmentItemRefId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.setOutcomeVariable(event.detail.outcomeVariableId, event.detail.value);\n }\n\n private _handleInteractionChanged(_event: CustomEvent) {\n if (this.autoScoreItems) {\n const assessmentItem = (_event.composedPath()[0] as HTMLElement).closest('qti-assessment-item');\n const scoreOutcomeIdentifier = assessmentItem.variables.find(v => v.identifier === 'SCORE') as OutcomeVariable;\n if (\n scoreOutcomeIdentifier &&\n scoreOutcomeIdentifier.externalScored === null &&\n assessmentItem.adaptive === 'false'\n ) {\n const reportValidityAfterScoring = this.configContext?.reportValidityAfterScoring === true ? true : false;\n assessmentItem.processResponse(true, reportValidityAfterScoring);\n }\n }\n }\n\n render() {\n // return this.myTemplate ? this.myTemplate(this.stampContext) : nothing;\n return html`<slot></slot>`;\n }\n\n /* PK: on test connected we can build the computed context */\n private _handleTestConnected(event: CustomEvent) {\n this._testElement = event.detail as QtiAssessmentTest;\n // Set the testIdentifier in qtiContext if not already set\n if (!this.qtiContext.QTI_CONTEXT?.testIdentifier) {\n const currentContext = this.qtiContext.QTI_CONTEXT || {\n testIdentifier: '',\n candidateIdentifier: 'not set',\n environmentIdentifier: 'default'\n };\n this.qtiContext = {\n QTI_CONTEXT: {\n ...currentContext,\n testIdentifier: this._testElement.identifier,\n environmentIdentifier: currentContext.environmentIdentifier || 'default'\n }\n };\n }\n\n // Process qti-context-declaration elements to get default values\n const contextDeclarations = this._testElement.querySelectorAll('qti-context-declaration[identifier=\"QTI_CONTEXT\"]');\n\n contextDeclarations.forEach(declaration => {\n const defaultValues = this._extractDefaultValues(declaration);\n if (Object.keys(defaultValues).length > 0) {\n // Merge default values with current context, but don't override existing runtime values\n this.qtiContext = {\n QTI_CONTEXT: {\n ...defaultValues, // Default values first\n ...this.qtiContext.QTI_CONTEXT // Runtime values override defaults\n }\n };\n }\n });\n\n const testPartElements = Array.from(this._testElement?.querySelectorAll<QtiTestPart>(`qti-test-part`) || []);\n this.computedContext = {\n identifier: this._testElement.identifier,\n title: this._testElement.title,\n view: this._sessionContext?.view,\n testParts: testPartElements.map(testPart => {\n const sectionElements = [...testPart.querySelectorAll<QtiAssessmentSection>(`qti-assessment-section`)];\n return {\n active: false,\n identifier: testPart.identifier,\n navigationMode: testPart.navigationMode,\n submissionMode: testPart.submissionMode,\n sections: sectionElements.map(section => {\n const itemElements = [...section.querySelectorAll<QtiAssessmentItemRef>(`qti-assessment-item-ref`)];\n return {\n active: false,\n identifier: section.identifier,\n title: section.title,\n items: itemElements.map(item => ({\n ...this.initContext?.find(i => i.identifier === item.identifier),\n active: false,\n identifier: item.identifier,\n categories: item.category ? item.category?.split(' ') : [],\n href: item.href,\n variables: [],\n }))\n };\n })\n };\n })\n };\n }\n\n /**\n * Extract default values from a qti-context-declaration element\n */\n private _extractDefaultValues(declaration: Element): Record<string, any> {\n const defaultValues: Record<string, any> = {};\n\n const defaultValueElement = declaration.querySelector('qti-default-value');\n if (!defaultValueElement) {\n return defaultValues;\n }\n\n const valueElements = defaultValueElement.querySelectorAll('qti-value[field-identifier]');\n valueElements.forEach(valueElement => {\n const fieldIdentifier = valueElement.getAttribute('field-identifier');\n const baseType = valueElement.getAttribute('base-type') || 'string';\n const textContent = valueElement.textContent?.trim() || '';\n\n if (fieldIdentifier) {\n // Convert value based on base-type\n let value: any = textContent;\n switch (baseType) {\n case 'integer':\n value = parseInt(textContent, 10);\n break;\n case 'float':\n case 'duration':\n value = parseFloat(textContent);\n break;\n case 'boolean':\n value = textContent.toLowerCase() === 'true';\n break;\n case 'string':\n default:\n value = textContent;\n break;\n }\n\n defaultValues[fieldIdentifier] = value;\n }\n });\n\n return defaultValues;\n }\n\n /* PK: on item connected we can add item only properties in the xml */\n private _handleItemConnected(event: CustomEvent) {\n const itemElement = event.detail as QtiAssessmentItem;\n\n this.computedContext = {\n ...this.computedContext,\n testParts: this.computedContext.testParts.map(testPart => {\n return {\n ...testPart,\n sections: testPart.sections.map(section => {\n return {\n ...section,\n items: section.items.map(item => {\n if (item.identifier !== itemElement.parentElement.getAttribute('identifier')) {\n return item;\n }\n\n const scoreOutcome = itemElement.querySelector<HTMLElement>(\n \"qti-outcome-declaration[identifier='SCORE']\"\n );\n // const scoreOutcome = item.variables.find(vr => vr.identifier == 'SCORE') as OutcomeVariable;\n const externalScored = scoreOutcome?.getAttribute('externalScored');\n\n const responseDeclarations = itemElement.querySelectorAll<HTMLElement>('qti-response-declaration');\n const containsCorrectResponse = Array.from(responseDeclarations).some(r =>\n r.querySelector('qti-correct-response')\n );\n // check if every responseDeclaration has a correctResponse\n const containsMapping = Array.from(responseDeclarations).some(r => {\n const mapping = r.querySelector('qti-mapping');\n const areaMapping = r.querySelector('qti-area-mapping');\n return mapping?.querySelector('qti-map-entry') || areaMapping?.querySelector('qti-area-map-entry');\n });\n\n const hasCorrectResponse = containsCorrectResponse || containsMapping;\n\n const hasResponseProcessing = itemElement.querySelector('qti-response-processing') ? true : false;\n\n return {\n ...item,\n assessmentItemIdentifier: itemElement.getAttribute('identifier'),\n label: itemElement.getAttribute('label'),\n title: itemElement.title,\n externalScored,\n adaptive: itemElement.adaptive == 'true' || false,\n timeDependent: itemElement.timeDependent == 'true' || false,\n variables: itemElement.variables,\n hasCorrectResponse,\n hasResponseProcessing\n };\n })\n };\n })\n };\n })\n };\n }\n\n /* PK: on every change of the candidate we will recomputed the computedContext */\n protected willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) return;\n\n let itemIndex = 1;\n this.computedContext = {\n ...this.computedContext,\n view: this._sessionContext?.view,\n testParts: this.computedContext.testParts.map(testPart => {\n return {\n ...testPart,\n active: this._sessionContext?.navPartId === testPart.identifier || false,\n sections: testPart.sections.map(section => {\n return {\n ...section,\n active: this._sessionContext?.navSectionId === section.identifier || false,\n completed: section.items.every(\n item =>\n this._testContext.items\n .find(i => i.identifier === item.identifier)\n ?.variables.find(v => v.identifier === 'completionStatus').value === 'completed'\n ),\n\n items: section.items.map(item => {\n const itemContext = this._testContext?.items.find(i => i.identifier === item.identifier);\n const computedItem = {\n ...item,\n ...itemContext,\n ...this.initContext?.find(i => i.identifier === item.identifier)\n };\n\n const rawscore = computedItem.variables?.find(vr => vr.identifier == 'SCORE')?.value;\n\n const score = rawscore === undefined || rawscore === null ? null : parseFloat(rawscore?.toString());\n\n const completionStatus = computedItem.variables?.find(v => v.identifier === 'completionStatus')\n ?.value as string;\n\n const response = computedItem.variables?.find(v => v.identifier === 'RESPONSE')?.value || '';\n const numAttempts = computedItem.variables?.find(v => v.identifier === 'numAttempts')?.value || 0;\n\n const active = this._sessionContext?.navItemRefId === computedItem.identifier || false;\n\n // Computed and opiniated\n // const type = item.categories.includes(this.configContext?.infoItemCategory) ? 'info' : 'regular';\n // const correct = (type == 'regular' && score !== undefined && !isNaN(score) && score > 0) || false;\n // const incorrect = (type == 'regular' && score !== undefined && !isNaN(score) && score <= 0) || false;\n // const completed = completionStatus === 'completed';\n\n const index = item.categories.includes(this.configContext?.infoItemCategory) ? null : itemIndex++;\n const rawMaxScore = item.variables?.find(vr => vr.identifier == 'MAXSCORE')?.value;\n const maxScore =\n rawMaxScore === undefined || rawMaxScore === null ? null : parseFloat(rawMaxScore?.toString());\n\n return {\n ...computedItem,\n completionStatus,\n numAttempts,\n score,\n response,\n index,\n // type,\n active,\n // correct,\n maxScore\n // incorrect,\n // completed\n };\n })\n };\n })\n };\n })\n };\n\n // const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n // const activeSection = activeTestPart?.sections.find(section => section.active);\n // const activeItem = activeSection?.items.find(item => item.active);\n // const { variables, ...augmentedItem } = activeItem || {};\n\n // if (!activeTestPart || !activeSection || !activeItem) {\n // this.stampContext = null;\n // return;\n // }\n\n // const augmentedTestPart = {\n // ...activeTestPart,\n // items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n // sections: activeTestPart.sections.map(section => ({\n // ...section,\n // items: section.items.map(({ variables, ...rest }) => rest)\n // }))\n // };\n\n // const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables, ...rest }) => rest) };\n // const { testParts, ...activeTest } = this.computedContext;\n\n // this.stampContext = {\n // view: this.computedContext.view,\n // activeItem: augmentedItem,\n // activeSection: augmentedSection,\n // activeTestpart: augmentedTestPart,\n // test: activeTest\n // };\n\n this.disp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 @@
1
- import {
2
- computedContext
3
- } from "./chunk-AZIKAG7K.js";
4
- import {
5
- __decorateClass
6
- } from "./chunk-H2JE6IVU.js";
7
-
8
- // src/lib/qti-test/components/test-scoring-buttons.ts
9
- import { html, LitElement, nothing } from "lit";
10
- import { consume } from "@lit/context";
11
- import { customElement, property } from "lit/decorators.js";
12
- import { prepareTemplate } from "@heximal/templates";
13
- var TestScoringButtons = class extends LitElement {
14
- constructor() {
15
- super();
16
- this.view = "";
17
- this.disabled = false;
18
- this.myTemplate = null;
19
- this.addEventListener("click", (e) => {
20
- const target = e.target;
21
- const value = parseFloat(target.value);
22
- if (target.tagName === "INPUT") {
23
- this._changeOutcomeScore(value);
24
- }
25
- });
26
- }
27
- createRenderRoot() {
28
- return this;
29
- }
30
- connectedCallback() {
31
- super.connectedCallback();
32
- const templateElement = this.querySelector("template");
33
- if (!templateElement) {
34
- this.myTemplate = null;
35
- return;
36
- }
37
- this.myTemplate = prepareTemplate(templateElement);
38
- }
39
- _changeOutcomeScore(value) {
40
- const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
41
- const sectionItems = testPart.sections.flatMap((section) => section.items);
42
- const currentItemIdentifier = sectionItems.find((item) => item.active)?.identifier;
43
- this.dispatchEvent(
44
- new CustomEvent("test-update-outcome-variable", {
45
- detail: {
46
- assessmentItemRefId: currentItemIdentifier,
47
- outcomeVariableId: "SCORE",
48
- value
49
- },
50
- bubbles: true
51
- })
52
- );
53
- }
54
- render() {
55
- const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
56
- if (!activeItem || !activeItem.variables) return html``;
57
- const maxScore = activeItem.variables.find((vr) => vr.identifier == "MAXSCORE")?.value;
58
- const scoreOutcome = activeItem.variables.find((vr) => vr.identifier == "SCORE");
59
- const score = scoreOutcome?.value;
60
- const disabled = !(scoreOutcome?.externalScored === "human");
61
- if (!maxScore || !scoreOutcome) return nothing;
62
- const scores = [...Array(Number(maxScore) + 1).keys()];
63
- return html`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing}`;
64
- }
65
- };
66
- __decorateClass([
67
- property({ type: String, attribute: "view" })
68
- ], TestScoringButtons.prototype, "view", 2);
69
- __decorateClass([
70
- property({ type: Boolean })
71
- ], TestScoringButtons.prototype, "disabled", 2);
72
- __decorateClass([
73
- consume({ context: computedContext, subscribe: true })
74
- ], TestScoringButtons.prototype, "computedContext", 2);
75
- TestScoringButtons = __decorateClass([
76
- customElement("test-scoring-buttons")
77
- ], TestScoringButtons);
78
-
79
- export {
80
- TestScoringButtons
81
- };
82
- //# sourceMappingURL=chunk-TU6COU44.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/components/test-scoring-buttons.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { consume } from '@lit/context';\nimport { customElement, property } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { TemplateFunction } from '@heximal/templates';\nimport type { OutcomeVariable } from '../../exports/variables';\nimport type { ComputedContext } from '../../exports/computed.context';\n\n@customElement('test-scoring-buttons')\nexport class TestScoringButtons extends LitElement {\n @property({ type: String, attribute: 'view' }) view = ''; // is only an attribute, but this is here because.. react\n @property({ type: Boolean }) disabled: boolean = false;\n myTemplate: TemplateFunction | null = null;\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 if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n @consume({ context: computedContext, subscribe: true })\n protected computedContext?: ComputedContext;\n\n private _changeOutcomeScore(value: number) {\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n const sectionItems = testPart.sections.flatMap(section => section.items);\n const currentItemIdentifier = sectionItems.find(item => item.active)?.identifier;\n\n this.dispatchEvent(\n new CustomEvent('test-update-outcome-variable', {\n detail: {\n assessmentItemRefId: currentItemIdentifier,\n outcomeVariableId: 'SCORE',\n value\n },\n bubbles: true\n })\n );\n }\n\n render() {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const maxScore = activeItem.variables.find(vr => vr.identifier == 'MAXSCORE')?.value;\n const scoreOutcome = activeItem.variables.find(vr => vr.identifier == 'SCORE') as OutcomeVariable;\n\n const score = scoreOutcome?.value;\n\n const disabled = !(scoreOutcome?.externalScored === 'human');\n\n if (!maxScore || !scoreOutcome) return nothing;\n const scores = [...Array(Number(maxScore) + 1).keys()];\n\n return html`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing}`;\n }\n\n constructor() {\n super();\n this.addEventListener('click', e => {\n const target = e.target as HTMLInputElement;\n const value = parseFloat(target.value);\n if (target.tagName === 'INPUT') {\n this._changeOutcomeScore(value);\n }\n });\n\n // return maxScore\n // ? html`\n // <form part=\"form\">\n // ${[...Array(Number(maxScore) + 1).keys()].map(itemIndex => {\n // const identifier = `scoring-buttons${itemIndex}${activeItem.identifier}`;\n // return html` <input\n // part=\"input\"\n // type=\"radio\"\n // ?disabled=${this.disabled}\n // .checked=${itemIndex === Number(score)}\n // @change=${() => this._changeOutcomeScore(itemIndex)}\n // id=${identifier}\n // name=${`scoring-buttons-${activeItem.identifier}`}\n // value=${itemIndex}\n // />\n\n // <label part=\"label\" for=${identifier}>${itemIndex}</label>`;\n // })}\n // </form>\n // <slot></slot>\n // `\n // : nothing;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-scoring-buttons': TestScoringButtons;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,eAAe;AACxB,SAAS,eAAe,gBAAgB;AACxC,SAAS,uBAAuB;AASzB,IAAM,qBAAN,cAAiC,WAAW;AAAA,EA2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,cAAc;AAE5B,UAAM,WAAW,EAAE,cAAc,mBAAmB;AAEpD,QAAI,CAAC,YAAY,CAAC,aAAc,QAAO;AACvC,UAAM,SAAS,CAAC,GAAG,MAAM,OAAO,QAAQ,IAAI,CAAC,EAAE,KAAK,CAAC;AAErD,WAAO,OAAO,KAAK,aAAa,KAAK,WAAW,EAAE,QAAQ,OAAO,SAAS,CAAC,IAAI,OAAO;AAAA,EACxF;AAmCF;AA3FiD;AAAA,EAA9C,SAAS,EAAE,MAAM,QAAQ,WAAW,OAAO,CAAC;AAAA,GADlC,mBACoC;AAClB;AAAA,EAA5B,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAFhB,mBAEkB;AAkBnB;AAAA,EADT,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAnB3C,mBAoBD;AApBC,qBAAN;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB;","names":["testPart"]}
@@ -1,60 +0,0 @@
1
- import {
2
- sessionContext
3
- } from "./chunk-22IRJWWY.js";
4
- import {
5
- __decorateClass
6
- } from "./chunk-H2JE6IVU.js";
7
-
8
- // src/lib/qti-test/components/test-view-toggle.ts
9
- import { consume } from "@lit/context";
10
- import { html, LitElement, nothing } from "lit";
11
- import { customElement } from "lit/decorators.js";
12
- import { prepareTemplate } from "@heximal/templates";
13
- var TestViewToggle = class extends LitElement {
14
- createRenderRoot() {
15
- return this;
16
- }
17
- connectedCallback() {
18
- super.connectedCallback();
19
- const templateElement = this.querySelector("template");
20
- if (!templateElement) {
21
- this.myTemplate = null;
22
- return;
23
- }
24
- this.myTemplate = prepareTemplate(templateElement);
25
- }
26
- _switchView(view) {
27
- this.dispatchEvent(
28
- new CustomEvent("on-test-switch-view", {
29
- composed: true,
30
- bubbles: true,
31
- detail: view
32
- })
33
- );
34
- }
35
- firstUpdated(_changedProperties) {
36
- this.addEventListener("click", () => {
37
- if (this.sessionContext?.view === "scorer") {
38
- this._switchView("candidate");
39
- } else {
40
- this._switchView("scorer");
41
- }
42
- });
43
- }
44
- render() {
45
- return html`${this.myTemplate ? this.myTemplate({
46
- view: this.sessionContext?.view
47
- }) : nothing}`;
48
- }
49
- };
50
- __decorateClass([
51
- consume({ context: sessionContext, subscribe: true })
52
- ], TestViewToggle.prototype, "sessionContext", 2);
53
- TestViewToggle = __decorateClass([
54
- customElement("test-view-toggle")
55
- ], TestViewToggle);
56
-
57
- export {
58
- TestViewToggle
59
- };
60
- //# sourceMappingURL=chunk-TUKEQ36K.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/components/test-view-toggle.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\n\nimport { sessionContext } from '../../exports/session.context';\n\nimport type { PropertyValues } from 'lit';\nimport type { SessionContext } from '../../exports/session.context';\n\n@customElement('test-view-toggle')\nexport class TestViewToggle extends LitElement {\n myTemplate: any;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n @consume({ context: sessionContext, subscribe: true })\n private sessionContext: SessionContext;\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n protected firstUpdated(_changedProperties: PropertyValues): void {\n this.addEventListener('click', () => {\n if (this.sessionContext?.view === 'scorer') {\n this._switchView('candidate');\n } else {\n this._switchView('scorer');\n }\n });\n }\n\n render() {\n return html`${this.myTemplate\n ? this.myTemplate({\n view: this.sessionContext?.view\n })\n : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-view-toggle': TestViewToggle;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAQzB,IAAM,iBAAN,cAA6B,WAAW;AAAA,EAGnC,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAKA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,QAAI,CAAC,iBAAiB;AACpB,WAAK,aAAa;AAClB;AAAA,IACF;AACA,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEA,YAAY,MAAc;AACxB,SAAK;AAAA,MACH,IAAI,YAAY,uBAAuB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,aAAa,oBAA0C;AAC/D,SAAK,iBAAiB,SAAS,MAAM;AACnC,UAAI,KAAK,gBAAgB,SAAS,UAAU;AAC1C,aAAK,YAAY,WAAW;AAAA,MAC9B,OAAO;AACL,aAAK,YAAY,QAAQ;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,SAAS;AACP,WAAO,OAAO,KAAK,aACf,KAAK,WAAW;AAAA,MACd,MAAM,KAAK,gBAAgB;AAAA,IAC7B,CAAC,IACD,OAAO;AAAA,EACb;AACF;AAvCU;AAAA,EADP,QAAQ,EAAE,SAAS,gBAAgB,WAAW,KAAK,CAAC;AAAA,GAP1C,eAQH;AARG,iBAAN;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB;","names":[]}
@@ -1,92 +0,0 @@
1
- import {
2
- btn,
3
- dis
4
- } from "./chunk-5ZHHNEDA.js";
5
- import {
6
- computedContext
7
- } from "./chunk-AZIKAG7K.js";
8
- import {
9
- __decorateClass
10
- } from "./chunk-H2JE6IVU.js";
11
-
12
- // src/lib/qti-test/components/test-show-correct-response.ts
13
- import { css, html, LitElement } from "lit";
14
- import { customElement, property } from "lit/decorators.js";
15
- import { consume } from "@lit/context";
16
- var TestShowCorrectResponse = class extends LitElement {
17
- constructor() {
18
- super(...arguments);
19
- this.shown = false;
20
- this.disabled = false;
21
- this.showCorrectText = "Show correct response";
22
- this.hideCorrectText = "Hide correct response";
23
- this.noCorrectResponseText = "No correct response specified";
24
- }
25
- // Store previous active item reference
26
- willUpdate(_changedProperties) {
27
- const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
28
- if (this._previousActiveItem !== activeItem) {
29
- this.shown = false;
30
- this._previousActiveItem = activeItem;
31
- }
32
- if (activeItem) {
33
- const containsCorrectResponse = !!activeItem?.variables?.some((v) => v["correctResponse"]);
34
- const containsMapping = !!activeItem?.variables?.some((v) => {
35
- return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
36
- });
37
- this.disabled = !containsCorrectResponse && !containsMapping;
38
- } else {
39
- this.disabled = true;
40
- }
41
- }
42
- _toggleState() {
43
- if (this.disabled) return;
44
- this.shown = !this.shown;
45
- this.dispatchEvent(
46
- new CustomEvent("test-show-correct-response", {
47
- detail: this.shown,
48
- bubbles: true
49
- })
50
- );
51
- }
52
- _getDisplayedText() {
53
- return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
54
- }
55
- render() {
56
- return html` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
57
- }
58
- };
59
- TestShowCorrectResponse.styles = css`
60
- :host {
61
- ${btn};
62
- }
63
- :host([disabled]) {
64
- ${dis};
65
- }
66
- `;
67
- __decorateClass([
68
- consume({ context: computedContext, subscribe: true })
69
- ], TestShowCorrectResponse.prototype, "computedContext", 2);
70
- __decorateClass([
71
- property({ type: Boolean, reflect: true })
72
- ], TestShowCorrectResponse.prototype, "shown", 2);
73
- __decorateClass([
74
- property({ type: Boolean, reflect: true })
75
- ], TestShowCorrectResponse.prototype, "disabled", 2);
76
- __decorateClass([
77
- property({ type: String })
78
- ], TestShowCorrectResponse.prototype, "showCorrectText", 2);
79
- __decorateClass([
80
- property({ type: String })
81
- ], TestShowCorrectResponse.prototype, "hideCorrectText", 2);
82
- __decorateClass([
83
- property({ type: String })
84
- ], TestShowCorrectResponse.prototype, "noCorrectResponseText", 2);
85
- TestShowCorrectResponse = __decorateClass([
86
- customElement("test-show-correct-response")
87
- ], TestShowCorrectResponse);
88
-
89
- export {
90
- TestShowCorrectResponse
91
- };
92
- //# sourceMappingURL=chunk-TWYN56XO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/components/test-show-correct-response.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\n\n/**\n * @deprecated test-show-correct-response is deprecated and will be removed in the future.\n */\n@customElement('test-show-correct-response')\nexport class TestShowCorrectResponse extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n private _previousActiveItem?: unknown; // Store previous active item reference\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n const activeItem = this.computedContext?.testParts\n .flatMap(testPart => testPart.sections.flatMap(section => section.items))\n .find(item => item.active);\n\n // If active item changed, reset shown before the update\n if (this._previousActiveItem !== activeItem) {\n this.shown = false;\n this._previousActiveItem = activeItem; // Update previous active item\n }\n\n if (activeItem) {\n const containsCorrectResponse = !!activeItem?.variables?.some(v => v['correctResponse']);\n const containsMapping = !!activeItem?.variables?.some(v => {\n return v['mapping']?.mapEntries?.length > 0 || v['areaMapping']?.areaMapEntries?.length > 0;\n });\n this.disabled = !containsCorrectResponse && !containsMapping;\n } else {\n this.disabled = true;\n }\n }\n private _toggleState() {\n if (this.disabled) return;\n this.shown = !this.shown;\n\n this.dispatchEvent(\n new CustomEvent('test-show-correct-response', {\n detail: this.shown,\n bubbles: true\n })\n );\n }\n\n private _getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n render() {\n return html` <div @click=\"${this._toggleState}\">${this._getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-show-correct-response': TestShowCorrectResponse;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC,SAAS,eAAe;AAWjB,IAAM,0BAAN,cAAsC,WAAW;AAAA,EAAjD;AAAA;AAauC,iBAAQ;AACR,oBAAW;AAC3B,2BAAkB;AAClB,2BAAkB;AAClB,iCAAwB;AAAA;AAAA;AAAA,EAIpD,WAAW,oBAA4D;AACrE,UAAM,aAAa,KAAK,iBAAiB,UACtC,QAAQ,cAAY,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK,CAAC,EACvE,KAAK,UAAQ,KAAK,MAAM;AAG3B,QAAI,KAAK,wBAAwB,YAAY;AAC3C,WAAK,QAAQ;AACb,WAAK,sBAAsB;AAAA,IAC7B;AAEA,QAAI,YAAY;AACd,YAAM,0BAA0B,CAAC,CAAC,YAAY,WAAW,KAAK,OAAK,EAAE,iBAAiB,CAAC;AACvF,YAAM,kBAAkB,CAAC,CAAC,YAAY,WAAW,KAAK,OAAK;AACzD,eAAO,EAAE,SAAS,GAAG,YAAY,SAAS,KAAK,EAAE,aAAa,GAAG,gBAAgB,SAAS;AAAA,MAC5F,CAAC;AACD,WAAK,WAAW,CAAC,2BAA2B,CAAC;AAAA,IAC/C,OAAO;AACL,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EACQ,eAAe;AACrB,QAAI,KAAK,SAAU;AACnB,SAAK,QAAQ,CAAC,KAAK;AAEnB,SAAK;AAAA,MACH,IAAI,YAAY,8BAA8B;AAAA,QAC5C,QAAQ,KAAK;AAAA,QACb,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEQ,oBAA4B;AAClC,WAAO,KAAK,WAAW,KAAK,wBAAwB,KAAK,QAAQ,KAAK,kBAAkB,KAAK;AAAA,EAC/F;AAAA,EAEA,SAAS;AACP,WAAO,qBAAqB,KAAK,YAAY,KAAK,KAAK,kBAAkB,CAAC;AAAA,EAC5E;AACF;AA7Da,wBAIJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AAPT;AAAA,EADN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAD3C,wBAEJ;AAWqC;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAb/B,wBAaiC;AACA;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAd/B,wBAciC;AAChB;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAff,wBAeiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAhBf,wBAgBiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAjBf,wBAiBiB;AAjBjB,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
@@ -1,89 +0,0 @@
1
- import {
2
- btn,
3
- dis
4
- } from "./chunk-DZAMXOSC.js";
5
- import {
6
- computedItemContext
7
- } from "./chunk-4OGJBG35.js";
8
- import {
9
- __decorateClass
10
- } from "./chunk-H2JE6IVU.js";
11
-
12
- // src/lib/qti-item/components/item-show-correct-response.ts
13
- import { css, html, LitElement } from "lit";
14
- import { customElement, property } from "lit/decorators.js";
15
- import { consume } from "@lit/context";
16
- var ItemShowCorrectResponse = class extends LitElement {
17
- constructor() {
18
- super(...arguments);
19
- this.shown = false;
20
- this.disabled = false;
21
- this.showCorrectText = "Show correct response";
22
- this.hideCorrectText = "Hide correct response";
23
- this.noCorrectResponseText = "No correct response specified";
24
- this._hasCorrectResponse = false;
25
- // correct response is removed on certain point
26
- this._previousActiveItem = "";
27
- }
28
- // Store previous active item reference
29
- updated() {
30
- if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {
31
- this._previousActiveItem = this.computedContext?.identifier;
32
- const containsCorrectResponse = !!this.computedContext?.variables.some((v) => v["correctResponse"]);
33
- const containsMapping = !!this.computedContext?.variables.some((v) => {
34
- return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
35
- });
36
- this._hasCorrectResponse = containsCorrectResponse || containsMapping;
37
- }
38
- this.disabled = !this._hasCorrectResponse;
39
- }
40
- _toggleState() {
41
- if (this.disabled) return;
42
- this.dispatchEvent(
43
- new CustomEvent("item-show-correct-response", {
44
- detail: !this.shown,
45
- bubbles: true
46
- })
47
- );
48
- }
49
- _getDisplayedText() {
50
- return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
51
- }
52
- render() {
53
- return html` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
54
- }
55
- };
56
- ItemShowCorrectResponse.styles = css`
57
- :host {
58
- ${btn};
59
- }
60
- :host([disabled]) {
61
- ${dis};
62
- }
63
- `;
64
- __decorateClass([
65
- consume({ context: computedItemContext, subscribe: true })
66
- ], ItemShowCorrectResponse.prototype, "computedContext", 2);
67
- __decorateClass([
68
- property({ type: Boolean, reflect: true })
69
- ], ItemShowCorrectResponse.prototype, "shown", 2);
70
- __decorateClass([
71
- property({ type: Boolean, reflect: true })
72
- ], ItemShowCorrectResponse.prototype, "disabled", 2);
73
- __decorateClass([
74
- property({ type: String })
75
- ], ItemShowCorrectResponse.prototype, "showCorrectText", 2);
76
- __decorateClass([
77
- property({ type: String })
78
- ], ItemShowCorrectResponse.prototype, "hideCorrectText", 2);
79
- __decorateClass([
80
- property({ type: String })
81
- ], ItemShowCorrectResponse.prototype, "noCorrectResponseText", 2);
82
- ItemShowCorrectResponse = __decorateClass([
83
- customElement("item-show-correct-response")
84
- ], ItemShowCorrectResponse);
85
-
86
- export {
87
- ItemShowCorrectResponse
88
- };
89
- //# sourceMappingURL=chunk-UHQVQBCL.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-item/components/item-show-correct-response.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { computedItemContext } from '../../exports/computed-item.context';\n\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\n\n@customElement('item-show-correct-response')\nexport class ItemShowCorrectResponse extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n private _hasCorrectResponse = false; // correct response is removed on certain point\n private _previousActiveItem = ''; // Store previous active item reference\n\n updated() {\n if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {\n this._previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => v['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return v['mapping']?.mapEntries?.length > 0 || v['areaMapping']?.areaMapEntries?.length > 0;\n });\n this._hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this._hasCorrectResponse;\n }\n\n private _toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-correct-response', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n private _getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n render() {\n return html` <div @click=\"${this._toggleState}\">${this._getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-correct-response': ItemShowCorrectResponse;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC,SAAS,eAAe;AAQjB,IAAM,0BAAN,cAAsC,WAAW;AAAA,EAAjD;AAAA;AAauC,iBAAQ;AACR,oBAAW;AAC3B,2BAAkB;AAClB,2BAAkB;AAClB,iCAAwB;AAEpD,SAAQ,sBAAsB;AAC9B;AAAA,SAAQ,sBAAsB;AAAA;AAAA;AAAA,EAE9B,UAAU;AACR,QAAI,CAAC,KAAK,uBAAuB,KAAK,wBAAwB,KAAK,iBAAiB,YAAY;AAC9F,WAAK,sBAAsB,KAAK,iBAAiB;AACjD,YAAM,0BAA0B,CAAC,CAAC,KAAK,iBAAiB,UAAU,KAAK,OAAK,EAAE,iBAAiB,CAAC;AAChG,YAAM,kBAAkB,CAAC,CAAC,KAAK,iBAAiB,UAAU,KAAK,OAAK;AAClE,eAAO,EAAE,SAAS,GAAG,YAAY,SAAS,KAAK,EAAE,aAAa,GAAG,gBAAgB,SAAS;AAAA,MAC5F,CAAC;AACD,WAAK,sBAAsB,2BAA2B;AAAA,IACxD;AACA,SAAK,WAAW,CAAC,KAAK;AAAA,EACxB;AAAA,EAEQ,eAAe;AACrB,QAAI,KAAK,SAAU;AAEnB,SAAK;AAAA,MACH,IAAI,YAAY,8BAA8B;AAAA,QAC5C,QAAQ,CAAC,KAAK;AAAA,QACd,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEQ,oBAA4B;AAClC,WAAO,KAAK,WAAW,KAAK,wBAAwB,KAAK,QAAQ,KAAK,kBAAkB,KAAK;AAAA,EAC/F;AAAA,EAEA,SAAS;AACP,WAAO,qBAAqB,KAAK,YAAY,KAAK,KAAK,kBAAkB,CAAC;AAAA,EAC5E;AACF;AApDa,wBAIJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AAPT;AAAA,EADN,QAAQ,EAAE,SAAS,qBAAqB,WAAW,KAAK,CAAC;AAAA,GAD/C,wBAEJ;AAWqC;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAb/B,wBAaiC;AACA;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAd/B,wBAciC;AAChB;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAff,wBAeiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAhBf,wBAgBiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAjBf,wBAiBiB;AAjBjB,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
@@ -1,28 +0,0 @@
1
- import {
2
- computedContext
3
- } from "./chunk-AZIKAG7K.js";
4
- import {
5
- __decorateClass
6
- } from "./chunk-H2JE6IVU.js";
7
-
8
- // src/lib/qti-test/components/test-print-context.ts
9
- import { html, LitElement } from "lit";
10
- import { consume } from "@lit/context";
11
- import { customElement, state } from "lit/decorators.js";
12
- var TestPrintContext = class extends LitElement {
13
- render() {
14
- return html` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
15
- }
16
- };
17
- __decorateClass([
18
- state(),
19
- consume({ context: computedContext, subscribe: true })
20
- ], TestPrintContext.prototype, "computedContext", 2);
21
- TestPrintContext = __decorateClass([
22
- customElement("test-print-context")
23
- ], TestPrintContext);
24
-
25
- export {
26
- TestPrintContext
27
- };
28
- //# sourceMappingURL=chunk-WFFIUFJJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-test/components/test-print-context.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { consume } from '@lit/context';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\n\n@customElement('test-print-context')\nexport class TestPrintContext extends LitElement {\n @state()\n @consume({ context: computedContext, subscribe: true })\n public computedContext?: ComputedContext;\n\n render() {\n return html` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-print-context': TestPrintContext;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe;AACxB,SAAS,eAAe,aAAa;AAO9B,IAAM,mBAAN,cAA+B,WAAW;AAAA,EAK/C,SAAS;AACP,WAAO,oBAAoB,KAAK,UAAU,KAAK,iBAAiB,MAAM,CAAC,CAAC;AAAA,EAC1E;AACF;AALS;AAAA,EAFN,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAF3C,iBAGJ;AAHI,mBAAN;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB;","names":[]}
@@ -1,103 +0,0 @@
1
- import {
2
- computedItemContext
3
- } from "./chunk-4OGJBG35.js";
4
- import {
5
- configContext
6
- } from "./chunk-ERYHQVOT.js";
7
- import {
8
- __decorateClass
9
- } from "./chunk-H2JE6IVU.js";
10
-
11
- // src/lib/qti-item/core/qti-item.ts
12
- import { provide } from "@lit/context";
13
- import { html, LitElement } from "lit";
14
- import { customElement, state } from "lit/decorators.js";
15
- var QtiItem = class extends LitElement {
16
- constructor() {
17
- super();
18
- this.configContext = {};
19
- // Store event handlers as instance properties
20
- this._onItemContextChanged = this._handleItemContextChanged.bind(this);
21
- this._onAssessmentItemConnected = this._handleAssessmentItemConnected.bind(this);
22
- this._onHandleShowCorrectResponse = this._handleShowCorrectResponse.bind(this);
23
- this._onHandleShowCandidateCorrection = this._handleShowCandidateCorrection.bind(this);
24
- this._onHandleSwitchCorrectResponseMode = this._handleSwitchCorrectResponseMode.bind(this);
25
- this.addEventListener("qti-item-context-updated", this._onItemContextChanged);
26
- this.addEventListener("qti-assessment-item-connected", this._onAssessmentItemConnected);
27
- this.addEventListener("item-show-correct-response", this._onHandleShowCorrectResponse);
28
- this.addEventListener("item-show-candidate-correction", this._onHandleShowCandidateCorrection);
29
- this.addEventListener("item-switch-correct-response-mode", this._onHandleSwitchCorrectResponseMode);
30
- }
31
- _handleItemContextChanged(e) {
32
- this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);
33
- }
34
- _handleAssessmentItemConnected(e) {
35
- const fullVariables = e.detail._context.variables;
36
- this._qtiAssessmentItem = e.detail;
37
- this.computedContext = this.computedContext?.identifier === this._qtiAssessmentItem.identifier ? { ...this.computedContext, title: this._qtiAssessmentItem.title } : {
38
- identifier: this._qtiAssessmentItem.identifier,
39
- title: this._qtiAssessmentItem.title,
40
- adaptive: this._qtiAssessmentItem.getAttribute("adaptive")?.toLowerCase() === "true" || false,
41
- variables: fullVariables,
42
- correctResponseMode: "internal"
43
- };
44
- this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier, fullVariables || []);
45
- }
46
- _handleShowCorrectResponse(e) {
47
- if (this._qtiAssessmentItem) {
48
- this._qtiAssessmentItem.showCorrectResponse(e.detail);
49
- }
50
- }
51
- _handleShowCandidateCorrection(e) {
52
- if (this._qtiAssessmentItem) {
53
- this._qtiAssessmentItem.showCandidateCorrection(e.detail);
54
- }
55
- }
56
- _handleSwitchCorrectResponseMode(e) {
57
- this._handleShowCorrectResponse(new CustomEvent("item-show-correct-response", { detail: false, bubbles: true }));
58
- this.configContext = {
59
- ...this.configContext,
60
- correctResponseMode: e.detail
61
- };
62
- }
63
- _updateItemVariablesInTestContext(identifier, variables) {
64
- const rawscore = variables?.find((vr) => vr.identifier == "SCORE")?.value;
65
- const score = parseFloat(rawscore?.toString());
66
- const completionStatus = variables?.find((v) => v.identifier === "completionStatus")?.value;
67
- const correct = score !== void 0 && !isNaN(score) && score > 0;
68
- const incorrect = score !== void 0 && !isNaN(score) && score <= 0;
69
- const completed = completionStatus === "completed";
70
- this.computedContext = {
71
- ...this.computedContext,
72
- identifier,
73
- correct,
74
- incorrect,
75
- completed,
76
- variables
77
- };
78
- }
79
- render() {
80
- return html`<slot></slot>`;
81
- }
82
- disconnectedCallback() {
83
- super.disconnectedCallback();
84
- this.removeEventListener("qti-item-context-changed", this._onItemContextChanged);
85
- this.removeEventListener("qti-assessment-item-connected", this._onAssessmentItemConnected);
86
- }
87
- };
88
- __decorateClass([
89
- state(),
90
- provide({ context: computedItemContext })
91
- ], QtiItem.prototype, "computedContext", 2);
92
- __decorateClass([
93
- state(),
94
- provide({ context: configContext })
95
- ], QtiItem.prototype, "configContext", 2);
96
- QtiItem = __decorateClass([
97
- customElement("qti-item")
98
- ], QtiItem);
99
-
100
- export {
101
- QtiItem
102
- };
103
- //# sourceMappingURL=chunk-WN6TJQI2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/qti-item/core/qti-item.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { computedItemContext } from '../../exports/computed-item.context';\nimport { configContext } from '../../exports/config.context.ts';\n\nimport type { ConfigContext, CorrectResponseMode} from '../../exports/config.context.ts';\nimport type { QtiAssessmentItem } from '../../qti-components';\nimport type { ItemContext } from '../../exports/item.context';\nimport type { VariableDeclaration } from '../../exports/variables';\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\n\n/**\n * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.\n * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.\n * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.\n * See `<item-container>` for more details.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('qti-item')\nexport class QtiItem extends LitElement {\n\n @state()\n @provide({ context: computedItemContext })\n public computedContext: ComputedItemContext;\n private _qtiAssessmentItem?: QtiAssessmentItem;\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n // Store event handlers as instance properties\n private _onItemContextChanged = this._handleItemContextChanged.bind(this);\n private _onAssessmentItemConnected = this._handleAssessmentItemConnected.bind(this);\n\n private _onHandleShowCorrectResponse = this._handleShowCorrectResponse.bind(this);\n private _onHandleShowCandidateCorrection = this._handleShowCandidateCorrection.bind(this);\n private _onHandleSwitchCorrectResponseMode = this._handleSwitchCorrectResponseMode.bind(this);\n\n constructor() {\n super();\n this.addEventListener('qti-item-context-updated', this._onItemContextChanged);\n this.addEventListener('qti-assessment-item-connected', this._onAssessmentItemConnected);\n this.addEventListener('item-show-correct-response', this._onHandleShowCorrectResponse);\n this.addEventListener('item-show-candidate-correction', this._onHandleShowCandidateCorrection);\n this.addEventListener('item-switch-correct-response-mode', this._onHandleSwitchCorrectResponseMode);\n }\n\n private _handleItemContextChanged(e: CustomEvent<{ itemContext: ItemContext }>) {\n this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);\n }\n\n private _handleAssessmentItemConnected(e: CustomEvent<QtiAssessmentItem>) {\n const fullVariables = (e.detail as any)._context.variables;\n this._qtiAssessmentItem = e.detail;\n this.computedContext =\n this.computedContext?.identifier === this._qtiAssessmentItem.identifier\n ? { ...this.computedContext, title: this._qtiAssessmentItem.title }\n : ({\n identifier: this._qtiAssessmentItem.identifier,\n title: this._qtiAssessmentItem.title,\n adaptive: this._qtiAssessmentItem.getAttribute('adaptive')?.toLowerCase() === 'true' || false,\n variables: fullVariables,\n correctResponseMode: 'internal',\n } as ComputedItemContext);\n this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier, fullVariables || []);\n }\n\n private _handleShowCorrectResponse(e: CustomEvent<boolean>) {\n if (this._qtiAssessmentItem) {\n this._qtiAssessmentItem.showCorrectResponse(e.detail);\n }\n }\n\n private _handleShowCandidateCorrection(e: CustomEvent<boolean>) {\n if (this._qtiAssessmentItem) {\n this._qtiAssessmentItem.showCandidateCorrection(e.detail);\n }\n }\n\n private _handleSwitchCorrectResponseMode(e: CustomEvent<CorrectResponseMode>) {\n // Switch off the correct response first\n this._handleShowCorrectResponse(new CustomEvent('item-show-correct-response', { detail: false, bubbles: true }));\n\n this.configContext = {\n ...this.configContext,\n correctResponseMode: e.detail\n };\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: readonly VariableDeclaration<string | string[] | null>[]\n ): void {\n const rawscore = variables?.find(vr => vr.identifier == 'SCORE')?.value;\n const score = parseFloat(rawscore?.toString());\n const completionStatus = variables?.find(v => v.identifier === 'completionStatus')?.value;\n\n const correct = score !== undefined && !isNaN(score) && score > 0;\n const incorrect = score !== undefined && !isNaN(score) && score <= 0;\n const completed = completionStatus === 'completed';\n this.computedContext = {\n ...this.computedContext,\n identifier,\n correct,\n incorrect,\n completed,\n variables\n };\n }\n\n render() {\n return html`<slot></slot>`;\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-item-context-changed', this._onItemContextChanged);\n this.removeEventListener('qti-assessment-item-connected', this._onAssessmentItemConnected);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,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