@pie-qti/item-player 0.1.9 → 0.1.11

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 (737) hide show
  1. package/README.md +17 -0
  2. package/dist/catalog/applyGlossaryTriggers.d.ts +13 -3
  3. package/dist/catalog/applyGlossaryTriggers.js +1 -0
  4. package/dist/catalog/applyGlossaryTriggers.js.map +1 -0
  5. package/dist/catalog/catalogExtractor.d.ts +0 -1
  6. package/dist/catalog/catalogExtractor.js +1 -0
  7. package/dist/catalog/catalogExtractor.js.map +1 -0
  8. package/dist/catalog/catalogLookup.d.ts +0 -1
  9. package/dist/catalog/catalogLookup.js +1 -0
  10. package/dist/catalog/catalogLookup.js.map +1 -0
  11. package/dist/catalog/glossaryAction.d.ts +4 -3
  12. package/dist/catalog/glossaryAction.js +1 -0
  13. package/dist/catalog/glossaryAction.js.map +1 -0
  14. package/dist/catalog/types.d.ts +0 -1
  15. package/dist/catalog/types.js +1 -0
  16. package/dist/catalog/types.js.map +1 -0
  17. package/dist/components/actions/typesetAction.d.ts +0 -1
  18. package/dist/components/actions/typesetAction.js +1 -0
  19. package/dist/components/actions/typesetAction.js.map +1 -0
  20. package/dist/components/utils/feedbackUtils.d.ts +0 -1
  21. package/dist/components/utils/feedbackUtils.js +1 -0
  22. package/dist/components/utils/feedbackUtils.js.map +1 -0
  23. package/dist/components/utils/index.d.ts +1 -3
  24. package/dist/components/utils/index.js +2 -2
  25. package/dist/components/utils/index.js.map +1 -0
  26. package/dist/components/utils/stimulusRender.d.ts +0 -1
  27. package/dist/components/utils/stimulusRender.js +1 -0
  28. package/dist/components/utils/stimulusRender.js.map +1 -0
  29. package/dist/components/utils/stylesheetRender.d.ts +0 -1
  30. package/dist/components/utils/stylesheetRender.js +1 -0
  31. package/dist/components/utils/stylesheetRender.js.map +1 -0
  32. package/dist/core/ComponentRegistry.d.ts +10 -2
  33. package/dist/core/ComponentRegistry.js +43 -1
  34. package/dist/core/ComponentRegistry.js.map +1 -0
  35. package/dist/core/Player.d.ts +10 -3
  36. package/dist/core/Player.js +55 -46
  37. package/dist/core/Player.js.map +1 -0
  38. package/dist/core/Plugin.d.ts +0 -1
  39. package/dist/core/Plugin.js +1 -0
  40. package/dist/core/Plugin.js.map +1 -0
  41. package/dist/core/PluginManager.d.ts +0 -1
  42. package/dist/core/PluginManager.js +1 -0
  43. package/dist/core/PluginManager.js.map +1 -0
  44. package/dist/core/constants.d.ts +0 -1
  45. package/dist/core/constants.js +1 -0
  46. package/dist/core/constants.js.map +1 -0
  47. package/dist/core/declarations.d.ts +0 -1
  48. package/dist/core/declarations.js +1 -0
  49. package/dist/core/declarations.js.map +1 -0
  50. package/dist/core/parsingLimits.d.ts +0 -1
  51. package/dist/core/parsingLimits.js +1 -0
  52. package/dist/core/parsingLimits.js.map +1 -0
  53. package/dist/core/random.d.ts +0 -1
  54. package/dist/core/random.js +1 -0
  55. package/dist/core/random.js.map +1 -0
  56. package/dist/core/rolePolicy.d.ts +0 -1
  57. package/dist/core/rolePolicy.js +1 -0
  58. package/dist/core/rolePolicy.js.map +1 -0
  59. package/dist/core/sanitizer.d.ts +0 -1
  60. package/dist/core/sanitizer.js +1 -0
  61. package/dist/core/sanitizer.js.map +1 -0
  62. package/dist/core/trustedTypes.d.ts +0 -1
  63. package/dist/core/trustedTypes.js +1 -0
  64. package/dist/core/trustedTypes.js.map +1 -0
  65. package/dist/core/urlPolicy.d.ts +0 -1
  66. package/dist/core/urlPolicy.js +1 -0
  67. package/dist/core/urlPolicy.js.map +1 -0
  68. package/dist/document/AssessmentItemDocument.d.ts +1 -2
  69. package/dist/document/AssessmentItemDocument.js +1 -0
  70. package/dist/document/AssessmentItemDocument.js.map +1 -0
  71. package/dist/element.d.ts +15 -0
  72. package/dist/element.js +1816 -1625
  73. package/dist/element.js.map +1 -1
  74. package/dist/extensions/MathLiveEditor.d.ts +0 -1
  75. package/dist/extensions/MathLiveEditor.js +1 -0
  76. package/dist/extensions/MathLiveEditor.js.map +1 -0
  77. package/dist/extraction/ExtractionRegistry.d.ts +1 -2
  78. package/dist/extraction/ExtractionRegistry.js +1 -0
  79. package/dist/extraction/ExtractionRegistry.js.map +1 -0
  80. package/dist/extraction/createContext.d.ts +1 -2
  81. package/dist/extraction/createContext.js +1 -0
  82. package/dist/extraction/createContext.js.map +1 -0
  83. package/dist/extraction/index.d.ts +2 -3
  84. package/dist/extraction/index.js +2 -1
  85. package/dist/extraction/index.js.map +1 -0
  86. package/dist/extraction/interactionExtractionPipeline.d.ts +1 -2
  87. package/dist/extraction/interactionExtractionPipeline.js +1 -0
  88. package/dist/extraction/interactionExtractionPipeline.js.map +1 -0
  89. package/dist/extraction/interactionSecurity.d.ts +1 -2
  90. package/dist/extraction/interactionSecurity.js +1 -0
  91. package/dist/extraction/interactionSecurity.js.map +1 -0
  92. package/dist/extraction/types.d.ts +1 -2
  93. package/dist/extraction/types.js +1 -0
  94. package/dist/extraction/types.js.map +1 -0
  95. package/dist/extraction/utils.d.ts +0 -1
  96. package/dist/extraction/utils.js +1 -0
  97. package/dist/extraction/utils.js.map +1 -0
  98. package/dist/iframe/IFramePlayerHost.d.ts +0 -1
  99. package/dist/iframe/IFramePlayerHost.js +1 -0
  100. package/dist/iframe/IFramePlayerHost.js.map +1 -0
  101. package/dist/iframe/index.d.ts +0 -1
  102. package/dist/iframe/index.js +1 -0
  103. package/dist/iframe/index.js.map +1 -0
  104. package/dist/iframe/protocol.d.ts +0 -1
  105. package/dist/iframe/protocol.js +1 -0
  106. package/dist/iframe/protocol.js.map +1 -0
  107. package/dist/index.d.ts +0 -1
  108. package/dist/index.js +1 -0
  109. package/dist/index.js.map +1 -0
  110. package/dist/interactions/associate/extractor.d.ts +0 -1
  111. package/dist/interactions/associate/extractor.js +1 -0
  112. package/dist/interactions/associate/extractor.js.map +1 -0
  113. package/dist/interactions/associate/index.d.ts +0 -1
  114. package/dist/interactions/associate/index.js +1 -0
  115. package/dist/interactions/associate/index.js.map +1 -0
  116. package/dist/interactions/associate/types.d.ts +0 -1
  117. package/dist/interactions/associate/types.js +1 -0
  118. package/dist/interactions/associate/types.js.map +1 -0
  119. package/dist/interactions/choice/extractor.d.ts +0 -1
  120. package/dist/interactions/choice/extractor.js +1 -0
  121. package/dist/interactions/choice/extractor.js.map +1 -0
  122. package/dist/interactions/choice/index.d.ts +0 -1
  123. package/dist/interactions/choice/index.js +1 -0
  124. package/dist/interactions/choice/index.js.map +1 -0
  125. package/dist/interactions/choice/types.d.ts +0 -1
  126. package/dist/interactions/choice/types.js +1 -0
  127. package/dist/interactions/choice/types.js.map +1 -0
  128. package/dist/interactions/custom/extractor.d.ts +0 -1
  129. package/dist/interactions/custom/extractor.js +1 -0
  130. package/dist/interactions/custom/extractor.js.map +1 -0
  131. package/dist/interactions/custom/index.d.ts +0 -1
  132. package/dist/interactions/custom/index.js +1 -0
  133. package/dist/interactions/custom/index.js.map +1 -0
  134. package/dist/interactions/custom/types.d.ts +0 -1
  135. package/dist/interactions/custom/types.js +1 -0
  136. package/dist/interactions/custom/types.js.map +1 -0
  137. package/dist/interactions/drawing/extractor.d.ts +0 -1
  138. package/dist/interactions/drawing/extractor.js +1 -0
  139. package/dist/interactions/drawing/extractor.js.map +1 -0
  140. package/dist/interactions/drawing/index.d.ts +0 -1
  141. package/dist/interactions/drawing/index.js +1 -0
  142. package/dist/interactions/drawing/index.js.map +1 -0
  143. package/dist/interactions/drawing/types.d.ts +0 -1
  144. package/dist/interactions/drawing/types.js +1 -0
  145. package/dist/interactions/drawing/types.js.map +1 -0
  146. package/dist/interactions/end-attempt/extractor.d.ts +0 -1
  147. package/dist/interactions/end-attempt/extractor.js +1 -0
  148. package/dist/interactions/end-attempt/extractor.js.map +1 -0
  149. package/dist/interactions/end-attempt/index.d.ts +0 -1
  150. package/dist/interactions/end-attempt/index.js +1 -0
  151. package/dist/interactions/end-attempt/index.js.map +1 -0
  152. package/dist/interactions/end-attempt/types.d.ts +0 -1
  153. package/dist/interactions/end-attempt/types.js +1 -0
  154. package/dist/interactions/end-attempt/types.js.map +1 -0
  155. package/dist/interactions/extended-text/extractor.d.ts +0 -1
  156. package/dist/interactions/extended-text/extractor.js +1 -0
  157. package/dist/interactions/extended-text/extractor.js.map +1 -0
  158. package/dist/interactions/extended-text/index.d.ts +0 -1
  159. package/dist/interactions/extended-text/index.js +1 -0
  160. package/dist/interactions/extended-text/index.js.map +1 -0
  161. package/dist/interactions/extended-text/types.d.ts +0 -1
  162. package/dist/interactions/extended-text/types.js +1 -0
  163. package/dist/interactions/extended-text/types.js.map +1 -0
  164. package/dist/interactions/gap-match/extractor.d.ts +0 -1
  165. package/dist/interactions/gap-match/extractor.js +1 -0
  166. package/dist/interactions/gap-match/extractor.js.map +1 -0
  167. package/dist/interactions/gap-match/index.d.ts +0 -1
  168. package/dist/interactions/gap-match/index.js +1 -0
  169. package/dist/interactions/gap-match/index.js.map +1 -0
  170. package/dist/interactions/gap-match/types.d.ts +0 -1
  171. package/dist/interactions/gap-match/types.js +1 -0
  172. package/dist/interactions/gap-match/types.js.map +1 -0
  173. package/dist/interactions/graphic-associate/extractor.d.ts +0 -1
  174. package/dist/interactions/graphic-associate/extractor.js +1 -0
  175. package/dist/interactions/graphic-associate/extractor.js.map +1 -0
  176. package/dist/interactions/graphic-associate/index.d.ts +0 -1
  177. package/dist/interactions/graphic-associate/index.js +1 -0
  178. package/dist/interactions/graphic-associate/index.js.map +1 -0
  179. package/dist/interactions/graphic-associate/types.d.ts +0 -1
  180. package/dist/interactions/graphic-associate/types.js +1 -0
  181. package/dist/interactions/graphic-associate/types.js.map +1 -0
  182. package/dist/interactions/graphic-gap-match/extractor.d.ts +0 -1
  183. package/dist/interactions/graphic-gap-match/extractor.js +1 -0
  184. package/dist/interactions/graphic-gap-match/extractor.js.map +1 -0
  185. package/dist/interactions/graphic-gap-match/index.d.ts +0 -1
  186. package/dist/interactions/graphic-gap-match/index.js +1 -0
  187. package/dist/interactions/graphic-gap-match/index.js.map +1 -0
  188. package/dist/interactions/graphic-gap-match/types.d.ts +0 -1
  189. package/dist/interactions/graphic-gap-match/types.js +1 -0
  190. package/dist/interactions/graphic-gap-match/types.js.map +1 -0
  191. package/dist/interactions/graphic-order/extractor.d.ts +0 -1
  192. package/dist/interactions/graphic-order/extractor.js +1 -0
  193. package/dist/interactions/graphic-order/extractor.js.map +1 -0
  194. package/dist/interactions/graphic-order/index.d.ts +0 -1
  195. package/dist/interactions/graphic-order/index.js +1 -0
  196. package/dist/interactions/graphic-order/index.js.map +1 -0
  197. package/dist/interactions/graphic-order/types.d.ts +0 -1
  198. package/dist/interactions/graphic-order/types.js +1 -0
  199. package/dist/interactions/graphic-order/types.js.map +1 -0
  200. package/dist/interactions/hotspot/extractor.d.ts +0 -1
  201. package/dist/interactions/hotspot/extractor.js +1 -0
  202. package/dist/interactions/hotspot/extractor.js.map +1 -0
  203. package/dist/interactions/hotspot/index.d.ts +0 -1
  204. package/dist/interactions/hotspot/index.js +1 -0
  205. package/dist/interactions/hotspot/index.js.map +1 -0
  206. package/dist/interactions/hotspot/types.d.ts +0 -1
  207. package/dist/interactions/hotspot/types.js +1 -0
  208. package/dist/interactions/hotspot/types.js.map +1 -0
  209. package/dist/interactions/hottext/extractor.d.ts +0 -1
  210. package/dist/interactions/hottext/extractor.js +1 -0
  211. package/dist/interactions/hottext/extractor.js.map +1 -0
  212. package/dist/interactions/hottext/index.d.ts +0 -1
  213. package/dist/interactions/hottext/index.js +1 -0
  214. package/dist/interactions/hottext/index.js.map +1 -0
  215. package/dist/interactions/hottext/types.d.ts +0 -1
  216. package/dist/interactions/hottext/types.js +1 -0
  217. package/dist/interactions/hottext/types.js.map +1 -0
  218. package/dist/interactions/index.d.ts +0 -1
  219. package/dist/interactions/index.js +1 -0
  220. package/dist/interactions/index.js.map +1 -0
  221. package/dist/interactions/inline/index.d.ts +0 -1
  222. package/dist/interactions/inline/index.js +1 -0
  223. package/dist/interactions/inline/index.js.map +1 -0
  224. package/dist/interactions/inline/render-plan.d.ts +0 -1
  225. package/dist/interactions/inline/render-plan.js +1 -0
  226. package/dist/interactions/inline/render-plan.js.map +1 -0
  227. package/dist/interactions/inline-choice/extractor.d.ts +0 -1
  228. package/dist/interactions/inline-choice/extractor.js +1 -0
  229. package/dist/interactions/inline-choice/extractor.js.map +1 -0
  230. package/dist/interactions/inline-choice/index.d.ts +0 -1
  231. package/dist/interactions/inline-choice/index.js +1 -0
  232. package/dist/interactions/inline-choice/index.js.map +1 -0
  233. package/dist/interactions/inline-choice/types.d.ts +0 -1
  234. package/dist/interactions/inline-choice/types.js +1 -0
  235. package/dist/interactions/inline-choice/types.js.map +1 -0
  236. package/dist/interactions/match/extractor.d.ts +0 -1
  237. package/dist/interactions/match/extractor.js +1 -0
  238. package/dist/interactions/match/extractor.js.map +1 -0
  239. package/dist/interactions/match/index.d.ts +0 -1
  240. package/dist/interactions/match/index.js +1 -0
  241. package/dist/interactions/match/index.js.map +1 -0
  242. package/dist/interactions/match/types.d.ts +0 -1
  243. package/dist/interactions/match/types.js +1 -0
  244. package/dist/interactions/match/types.js.map +1 -0
  245. package/dist/interactions/media/extractor.d.ts +0 -1
  246. package/dist/interactions/media/extractor.js +1 -0
  247. package/dist/interactions/media/extractor.js.map +1 -0
  248. package/dist/interactions/media/index.d.ts +0 -1
  249. package/dist/interactions/media/index.js +1 -0
  250. package/dist/interactions/media/index.js.map +1 -0
  251. package/dist/interactions/media/types.d.ts +0 -1
  252. package/dist/interactions/media/types.js +1 -0
  253. package/dist/interactions/media/types.js.map +1 -0
  254. package/dist/interactions/modules.d.ts +0 -1
  255. package/dist/interactions/modules.js +1 -0
  256. package/dist/interactions/modules.js.map +1 -0
  257. package/dist/interactions/order/extractor.d.ts +0 -1
  258. package/dist/interactions/order/extractor.js +1 -0
  259. package/dist/interactions/order/extractor.js.map +1 -0
  260. package/dist/interactions/order/index.d.ts +0 -1
  261. package/dist/interactions/order/index.js +1 -0
  262. package/dist/interactions/order/index.js.map +1 -0
  263. package/dist/interactions/order/types.d.ts +0 -1
  264. package/dist/interactions/order/types.js +1 -0
  265. package/dist/interactions/order/types.js.map +1 -0
  266. package/dist/interactions/portable-custom/extractor.d.ts +0 -1
  267. package/dist/interactions/portable-custom/extractor.js +1 -0
  268. package/dist/interactions/portable-custom/extractor.js.map +1 -0
  269. package/dist/interactions/portable-custom/index.d.ts +0 -1
  270. package/dist/interactions/portable-custom/index.js +1 -0
  271. package/dist/interactions/portable-custom/index.js.map +1 -0
  272. package/dist/interactions/portable-custom/types.d.ts +0 -1
  273. package/dist/interactions/portable-custom/types.js +1 -0
  274. package/dist/interactions/portable-custom/types.js.map +1 -0
  275. package/dist/interactions/position-object/extractor.d.ts +0 -1
  276. package/dist/interactions/position-object/extractor.js +1 -0
  277. package/dist/interactions/position-object/extractor.js.map +1 -0
  278. package/dist/interactions/position-object/index.d.ts +0 -1
  279. package/dist/interactions/position-object/index.js +1 -0
  280. package/dist/interactions/position-object/index.js.map +1 -0
  281. package/dist/interactions/position-object/types.d.ts +0 -1
  282. package/dist/interactions/position-object/types.js +1 -0
  283. package/dist/interactions/position-object/types.js.map +1 -0
  284. package/dist/interactions/select-point/extractor.d.ts +0 -1
  285. package/dist/interactions/select-point/extractor.js +1 -0
  286. package/dist/interactions/select-point/extractor.js.map +1 -0
  287. package/dist/interactions/select-point/index.d.ts +0 -1
  288. package/dist/interactions/select-point/index.js +1 -0
  289. package/dist/interactions/select-point/index.js.map +1 -0
  290. package/dist/interactions/select-point/types.d.ts +0 -1
  291. package/dist/interactions/select-point/types.js +1 -0
  292. package/dist/interactions/select-point/types.js.map +1 -0
  293. package/dist/interactions/shared/index.d.ts +0 -1
  294. package/dist/interactions/shared/index.js +1 -0
  295. package/dist/interactions/shared/index.js.map +1 -0
  296. package/dist/interactions/shared/types.d.ts +0 -1
  297. package/dist/interactions/shared/types.js +1 -0
  298. package/dist/interactions/shared/types.js.map +1 -0
  299. package/dist/interactions/slider/extractor.d.ts +0 -1
  300. package/dist/interactions/slider/extractor.js +1 -0
  301. package/dist/interactions/slider/extractor.js.map +1 -0
  302. package/dist/interactions/slider/index.d.ts +0 -1
  303. package/dist/interactions/slider/index.js +1 -0
  304. package/dist/interactions/slider/index.js.map +1 -0
  305. package/dist/interactions/slider/types.d.ts +0 -1
  306. package/dist/interactions/slider/types.js +1 -0
  307. package/dist/interactions/slider/types.js.map +1 -0
  308. package/dist/interactions/text-entry/extractor.d.ts +0 -1
  309. package/dist/interactions/text-entry/extractor.js +1 -0
  310. package/dist/interactions/text-entry/extractor.js.map +1 -0
  311. package/dist/interactions/text-entry/index.d.ts +0 -1
  312. package/dist/interactions/text-entry/index.js +1 -0
  313. package/dist/interactions/text-entry/index.js.map +1 -0
  314. package/dist/interactions/text-entry/types.d.ts +0 -1
  315. package/dist/interactions/text-entry/types.js +1 -0
  316. package/dist/interactions/text-entry/types.js.map +1 -0
  317. package/dist/interactions/upload/extractor.d.ts +0 -1
  318. package/dist/interactions/upload/extractor.js +1 -0
  319. package/dist/interactions/upload/extractor.js.map +1 -0
  320. package/dist/interactions/upload/index.d.ts +0 -1
  321. package/dist/interactions/upload/index.js +1 -0
  322. package/dist/interactions/upload/index.js.map +1 -0
  323. package/dist/interactions/upload/types.d.ts +0 -1
  324. package/dist/interactions/upload/types.js +1 -0
  325. package/dist/interactions/upload/types.js.map +1 -0
  326. package/dist/pci/PciHost.d.ts +0 -1
  327. package/dist/pci/PciHost.js +1 -0
  328. package/dist/pci/PciHost.js.map +1 -0
  329. package/dist/pci/types.d.ts +0 -1
  330. package/dist/pci/types.js +1 -0
  331. package/dist/pci/types.js.map +1 -0
  332. package/dist/pnp/applyPnp.d.ts +0 -1
  333. package/dist/pnp/applyPnp.js +1 -0
  334. package/dist/pnp/applyPnp.js.map +1 -0
  335. package/dist/pnp/parsePnpXml.d.ts +0 -1
  336. package/dist/pnp/parsePnpXml.js +1 -0
  337. package/dist/pnp/parsePnpXml.js.map +1 -0
  338. package/dist/pnp/types.d.ts +0 -1
  339. package/dist/pnp/types.js +1 -0
  340. package/dist/pnp/types.js.map +1 -0
  341. package/dist/presentation/itemPresentationPlan.d.ts +53 -0
  342. package/dist/presentation/itemPresentationPlan.js +98 -0
  343. package/dist/presentation/itemPresentationPlan.js.map +1 -0
  344. package/dist/server.d.ts +0 -1
  345. package/dist/server.js +1 -0
  346. package/dist/server.js.map +1 -0
  347. package/dist/types/index.d.ts +17 -3
  348. package/dist/types/index.js +1 -3
  349. package/dist/types/index.js.map +1 -0
  350. package/dist/types/responseValidation.d.ts +0 -1
  351. package/dist/types/responseValidation.js +1 -0
  352. package/dist/types/responseValidation.js.map +1 -0
  353. package/dist/utils/PerformanceMonitor.d.ts +0 -1
  354. package/dist/utils/PerformanceMonitor.js +1 -0
  355. package/dist/utils/PerformanceMonitor.js.map +1 -0
  356. package/dist/utils/drawingUtils.d.ts +0 -1
  357. package/dist/utils/drawingUtils.js +1 -0
  358. package/dist/utils/drawingUtils.js.map +1 -0
  359. package/dist/utils/responseUtils.d.ts +0 -1
  360. package/dist/utils/responseUtils.js +1 -0
  361. package/dist/utils/responseUtils.js.map +1 -0
  362. package/dist/web-components/QTIInteractionBase.d.ts +1 -2
  363. package/dist/web-components/QTIInteractionBase.js +1 -0
  364. package/dist/web-components/QTIInteractionBase.js.map +1 -0
  365. package/dist/web-components/QTIInteractionElement.d.ts +1 -2
  366. package/dist/web-components/QTIInteractionElement.js +1 -0
  367. package/dist/web-components/QTIInteractionElement.js.map +1 -0
  368. package/dist/web-components/index.d.ts +0 -1
  369. package/dist/web-components/index.js +1 -0
  370. package/dist/web-components/index.js.map +1 -0
  371. package/package.json +7 -14
  372. package/dist/catalog/applyGlossaryTriggers.d.ts.map +0 -1
  373. package/dist/catalog/catalogExtractor.d.ts.map +0 -1
  374. package/dist/catalog/catalogLookup.d.ts.map +0 -1
  375. package/dist/catalog/glossaryAction.d.ts.map +0 -1
  376. package/dist/catalog/types.d.ts.map +0 -1
  377. package/dist/components/actions/typesetAction.d.ts.map +0 -1
  378. package/dist/components/utils/assignProps.d.ts +0 -2
  379. package/dist/components/utils/assignProps.d.ts.map +0 -1
  380. package/dist/components/utils/assignProps.js +0 -1
  381. package/dist/components/utils/feedbackUtils.d.ts.map +0 -1
  382. package/dist/components/utils/index.d.ts.map +0 -1
  383. package/dist/components/utils/stimulusRender.d.ts.map +0 -1
  384. package/dist/components/utils/stylesheetRender.d.ts.map +0 -1
  385. package/dist/core/ComponentRegistry.d.ts.map +0 -1
  386. package/dist/core/ItemRenderer.d.ts +0 -91
  387. package/dist/core/ItemRenderer.d.ts.map +0 -1
  388. package/dist/core/ItemRenderer.js +0 -248
  389. package/dist/core/Player.d.ts.map +0 -1
  390. package/dist/core/Plugin.d.ts.map +0 -1
  391. package/dist/core/PluginManager.d.ts.map +0 -1
  392. package/dist/core/constants.d.ts.map +0 -1
  393. package/dist/core/declarations.d.ts.map +0 -1
  394. package/dist/core/parsingLimits.d.ts.map +0 -1
  395. package/dist/core/random.d.ts.map +0 -1
  396. package/dist/core/rolePolicy.d.ts.map +0 -1
  397. package/dist/core/sanitizer.d.ts.map +0 -1
  398. package/dist/core/trustedTypes.d.ts.map +0 -1
  399. package/dist/core/urlPolicy.d.ts.map +0 -1
  400. package/dist/document/AssessmentItemDocument.d.ts.map +0 -1
  401. package/dist/extensions/MathLiveEditor.d.ts.map +0 -1
  402. package/dist/extraction/ExtractionRegistry.d.ts.map +0 -1
  403. package/dist/extraction/createContext.d.ts.map +0 -1
  404. package/dist/extraction/extractors/associateExtractor.d.ts +0 -2
  405. package/dist/extraction/extractors/associateExtractor.d.ts.map +0 -1
  406. package/dist/extraction/extractors/associateExtractor.js +0 -1
  407. package/dist/extraction/extractors/choiceExtractor.d.ts +0 -2
  408. package/dist/extraction/extractors/choiceExtractor.d.ts.map +0 -1
  409. package/dist/extraction/extractors/choiceExtractor.js +0 -1
  410. package/dist/extraction/extractors/customExtractor.d.ts +0 -2
  411. package/dist/extraction/extractors/customExtractor.d.ts.map +0 -1
  412. package/dist/extraction/extractors/customExtractor.js +0 -1
  413. package/dist/extraction/extractors/drawingExtractor.d.ts +0 -2
  414. package/dist/extraction/extractors/drawingExtractor.d.ts.map +0 -1
  415. package/dist/extraction/extractors/drawingExtractor.js +0 -1
  416. package/dist/extraction/extractors/endAttemptExtractor.d.ts +0 -2
  417. package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +0 -1
  418. package/dist/extraction/extractors/endAttemptExtractor.js +0 -1
  419. package/dist/extraction/extractors/extendedTextExtractor.d.ts +0 -2
  420. package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +0 -1
  421. package/dist/extraction/extractors/extendedTextExtractor.js +0 -1
  422. package/dist/extraction/extractors/gapMatchExtractor.d.ts +0 -2
  423. package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +0 -1
  424. package/dist/extraction/extractors/gapMatchExtractor.js +0 -1
  425. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +0 -2
  426. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +0 -1
  427. package/dist/extraction/extractors/graphicAssociateExtractor.js +0 -1
  428. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +0 -2
  429. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +0 -1
  430. package/dist/extraction/extractors/graphicGapMatchExtractor.js +0 -1
  431. package/dist/extraction/extractors/graphicOrderExtractor.d.ts +0 -2
  432. package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +0 -1
  433. package/dist/extraction/extractors/graphicOrderExtractor.js +0 -1
  434. package/dist/extraction/extractors/hotspotExtractor.d.ts +0 -2
  435. package/dist/extraction/extractors/hotspotExtractor.d.ts.map +0 -1
  436. package/dist/extraction/extractors/hotspotExtractor.js +0 -1
  437. package/dist/extraction/extractors/hottextExtractor.d.ts +0 -2
  438. package/dist/extraction/extractors/hottextExtractor.d.ts.map +0 -1
  439. package/dist/extraction/extractors/hottextExtractor.js +0 -1
  440. package/dist/extraction/extractors/index.d.ts +0 -9
  441. package/dist/extraction/extractors/index.d.ts.map +0 -1
  442. package/dist/extraction/extractors/index.js +0 -8
  443. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +0 -2
  444. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +0 -1
  445. package/dist/extraction/extractors/inlineChoiceExtractor.js +0 -1
  446. package/dist/extraction/extractors/matchExtractor.d.ts +0 -2
  447. package/dist/extraction/extractors/matchExtractor.d.ts.map +0 -1
  448. package/dist/extraction/extractors/matchExtractor.js +0 -1
  449. package/dist/extraction/extractors/mediaExtractor.d.ts +0 -2
  450. package/dist/extraction/extractors/mediaExtractor.d.ts.map +0 -1
  451. package/dist/extraction/extractors/mediaExtractor.js +0 -1
  452. package/dist/extraction/extractors/orderExtractor.d.ts +0 -2
  453. package/dist/extraction/extractors/orderExtractor.d.ts.map +0 -1
  454. package/dist/extraction/extractors/orderExtractor.js +0 -1
  455. package/dist/extraction/extractors/portableCustomExtractor.d.ts +0 -2
  456. package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +0 -1
  457. package/dist/extraction/extractors/portableCustomExtractor.js +0 -1
  458. package/dist/extraction/extractors/positionObjectExtractor.d.ts +0 -2
  459. package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +0 -1
  460. package/dist/extraction/extractors/positionObjectExtractor.js +0 -1
  461. package/dist/extraction/extractors/selectPointExtractor.d.ts +0 -2
  462. package/dist/extraction/extractors/selectPointExtractor.d.ts.map +0 -1
  463. package/dist/extraction/extractors/selectPointExtractor.js +0 -1
  464. package/dist/extraction/extractors/sliderExtractor.d.ts +0 -2
  465. package/dist/extraction/extractors/sliderExtractor.d.ts.map +0 -1
  466. package/dist/extraction/extractors/sliderExtractor.js +0 -1
  467. package/dist/extraction/extractors/textEntryExtractor.d.ts +0 -2
  468. package/dist/extraction/extractors/textEntryExtractor.d.ts.map +0 -1
  469. package/dist/extraction/extractors/textEntryExtractor.js +0 -1
  470. package/dist/extraction/extractors/uploadExtractor.d.ts +0 -2
  471. package/dist/extraction/extractors/uploadExtractor.d.ts.map +0 -1
  472. package/dist/extraction/extractors/uploadExtractor.js +0 -1
  473. package/dist/extraction/index.d.ts.map +0 -1
  474. package/dist/extraction/interactionExtractionPipeline.d.ts.map +0 -1
  475. package/dist/extraction/interactionSecurity.d.ts.map +0 -1
  476. package/dist/extraction/types.d.ts.map +0 -1
  477. package/dist/extraction/utils.d.ts.map +0 -1
  478. package/dist/iframe/IFramePlayerHost.d.ts.map +0 -1
  479. package/dist/iframe/index.d.ts.map +0 -1
  480. package/dist/iframe/protocol.d.ts.map +0 -1
  481. package/dist/index.d.ts.map +0 -1
  482. package/dist/interactions/associate/extractor.d.ts.map +0 -1
  483. package/dist/interactions/associate/index.d.ts.map +0 -1
  484. package/dist/interactions/associate/types.d.ts.map +0 -1
  485. package/dist/interactions/choice/extractor.d.ts.map +0 -1
  486. package/dist/interactions/choice/index.d.ts.map +0 -1
  487. package/dist/interactions/choice/types.d.ts.map +0 -1
  488. package/dist/interactions/custom/extractor.d.ts.map +0 -1
  489. package/dist/interactions/custom/index.d.ts.map +0 -1
  490. package/dist/interactions/custom/types.d.ts.map +0 -1
  491. package/dist/interactions/drawing/extractor.d.ts.map +0 -1
  492. package/dist/interactions/drawing/index.d.ts.map +0 -1
  493. package/dist/interactions/drawing/types.d.ts.map +0 -1
  494. package/dist/interactions/end-attempt/extractor.d.ts.map +0 -1
  495. package/dist/interactions/end-attempt/index.d.ts.map +0 -1
  496. package/dist/interactions/end-attempt/types.d.ts.map +0 -1
  497. package/dist/interactions/extended-text/extractor.d.ts.map +0 -1
  498. package/dist/interactions/extended-text/index.d.ts.map +0 -1
  499. package/dist/interactions/extended-text/types.d.ts.map +0 -1
  500. package/dist/interactions/gap-match/extractor.d.ts.map +0 -1
  501. package/dist/interactions/gap-match/index.d.ts.map +0 -1
  502. package/dist/interactions/gap-match/types.d.ts.map +0 -1
  503. package/dist/interactions/graphic-associate/extractor.d.ts.map +0 -1
  504. package/dist/interactions/graphic-associate/index.d.ts.map +0 -1
  505. package/dist/interactions/graphic-associate/types.d.ts.map +0 -1
  506. package/dist/interactions/graphic-gap-match/extractor.d.ts.map +0 -1
  507. package/dist/interactions/graphic-gap-match/index.d.ts.map +0 -1
  508. package/dist/interactions/graphic-gap-match/types.d.ts.map +0 -1
  509. package/dist/interactions/graphic-order/extractor.d.ts.map +0 -1
  510. package/dist/interactions/graphic-order/index.d.ts.map +0 -1
  511. package/dist/interactions/graphic-order/types.d.ts.map +0 -1
  512. package/dist/interactions/hotspot/extractor.d.ts.map +0 -1
  513. package/dist/interactions/hotspot/index.d.ts.map +0 -1
  514. package/dist/interactions/hotspot/types.d.ts.map +0 -1
  515. package/dist/interactions/hottext/extractor.d.ts.map +0 -1
  516. package/dist/interactions/hottext/index.d.ts.map +0 -1
  517. package/dist/interactions/hottext/types.d.ts.map +0 -1
  518. package/dist/interactions/index.d.ts.map +0 -1
  519. package/dist/interactions/inline/index.d.ts.map +0 -1
  520. package/dist/interactions/inline/render-plan.d.ts.map +0 -1
  521. package/dist/interactions/inline-choice/extractor.d.ts.map +0 -1
  522. package/dist/interactions/inline-choice/index.d.ts.map +0 -1
  523. package/dist/interactions/inline-choice/types.d.ts.map +0 -1
  524. package/dist/interactions/match/extractor.d.ts.map +0 -1
  525. package/dist/interactions/match/index.d.ts.map +0 -1
  526. package/dist/interactions/match/types.d.ts.map +0 -1
  527. package/dist/interactions/media/extractor.d.ts.map +0 -1
  528. package/dist/interactions/media/index.d.ts.map +0 -1
  529. package/dist/interactions/media/types.d.ts.map +0 -1
  530. package/dist/interactions/modules.d.ts.map +0 -1
  531. package/dist/interactions/order/extractor.d.ts.map +0 -1
  532. package/dist/interactions/order/index.d.ts.map +0 -1
  533. package/dist/interactions/order/types.d.ts.map +0 -1
  534. package/dist/interactions/portable-custom/extractor.d.ts.map +0 -1
  535. package/dist/interactions/portable-custom/index.d.ts.map +0 -1
  536. package/dist/interactions/portable-custom/types.d.ts.map +0 -1
  537. package/dist/interactions/position-object/extractor.d.ts.map +0 -1
  538. package/dist/interactions/position-object/index.d.ts.map +0 -1
  539. package/dist/interactions/position-object/types.d.ts.map +0 -1
  540. package/dist/interactions/select-point/extractor.d.ts.map +0 -1
  541. package/dist/interactions/select-point/index.d.ts.map +0 -1
  542. package/dist/interactions/select-point/types.d.ts.map +0 -1
  543. package/dist/interactions/shared/index.d.ts.map +0 -1
  544. package/dist/interactions/shared/types.d.ts.map +0 -1
  545. package/dist/interactions/slider/extractor.d.ts.map +0 -1
  546. package/dist/interactions/slider/index.d.ts.map +0 -1
  547. package/dist/interactions/slider/types.d.ts.map +0 -1
  548. package/dist/interactions/text-entry/extractor.d.ts.map +0 -1
  549. package/dist/interactions/text-entry/index.d.ts.map +0 -1
  550. package/dist/interactions/text-entry/types.d.ts.map +0 -1
  551. package/dist/interactions/upload/extractor.d.ts.map +0 -1
  552. package/dist/interactions/upload/index.d.ts.map +0 -1
  553. package/dist/interactions/upload/types.d.ts.map +0 -1
  554. package/dist/pci/PciHost.d.ts.map +0 -1
  555. package/dist/pci/types.d.ts.map +0 -1
  556. package/dist/pnp/applyPnp.d.ts.map +0 -1
  557. package/dist/pnp/parsePnpXml.d.ts.map +0 -1
  558. package/dist/pnp/types.d.ts.map +0 -1
  559. package/dist/server.d.ts.map +0 -1
  560. package/dist/types/index.d.ts.map +0 -1
  561. package/dist/types/interactions.d.ts +0 -8
  562. package/dist/types/interactions.d.ts.map +0 -1
  563. package/dist/types/interactions.js +0 -7
  564. package/dist/types/responseValidation.d.ts.map +0 -1
  565. package/dist/utils/PerformanceMonitor.d.ts.map +0 -1
  566. package/dist/utils/drawingUtils.d.ts.map +0 -1
  567. package/dist/utils/responseUtils.d.ts.map +0 -1
  568. package/dist/utils/touchDragHelper.d.ts +0 -2
  569. package/dist/utils/touchDragHelper.d.ts.map +0 -1
  570. package/dist/utils/touchDragHelper.js +0 -1
  571. package/dist/web-components/QTIInteractionBase.d.ts.map +0 -1
  572. package/dist/web-components/QTIInteractionElement.d.ts.map +0 -1
  573. package/dist/web-components/index.d.ts.map +0 -1
  574. package/src/__tests__/catalog.test.ts +0 -267
  575. package/src/__tests__/fixtures/pci/echo-pci.js +0 -49
  576. package/src/__tests__/pci.test.ts +0 -353
  577. package/src/__tests__/qti3-attribute-extraction.test.ts +0 -174
  578. package/src/__tests__/qti3-debug.test.ts +0 -140
  579. package/src/__tests__/qti3-extraction.test.ts +0 -309
  580. package/src/catalog/applyGlossaryTriggers.ts +0 -372
  581. package/src/catalog/catalogExtractor.ts +0 -130
  582. package/src/catalog/catalogLookup.ts +0 -53
  583. package/src/catalog/glossaryAction.ts +0 -38
  584. package/src/catalog/types.ts +0 -37
  585. package/src/components/ItemBody.svelte +0 -363
  586. package/src/components/ItemPlayer.svelte +0 -163
  587. package/src/components/ModalFeedbackDisplay.svelte +0 -97
  588. package/src/components/actions/typesetAction.ts +0 -74
  589. package/src/components/index.ts +0 -22
  590. package/src/components/utils/assignProps.ts +0 -2
  591. package/src/components/utils/feedbackUtils.ts +0 -140
  592. package/src/components/utils/index.ts +0 -13
  593. package/src/components/utils/stimulusRender.ts +0 -93
  594. package/src/components/utils/stylesheetRender.ts +0 -58
  595. package/src/core/ComponentRegistry.ts +0 -248
  596. package/src/core/Player.ts +0 -1618
  597. package/src/core/Plugin.ts +0 -123
  598. package/src/core/PluginManager.ts +0 -182
  599. package/src/core/constants.ts +0 -117
  600. package/src/core/declarations.ts +0 -171
  601. package/src/core/parsingLimits.ts +0 -62
  602. package/src/core/random.ts +0 -24
  603. package/src/core/rolePolicy.ts +0 -34
  604. package/src/core/sanitizer.ts +0 -305
  605. package/src/core/trustedTypes.ts +0 -63
  606. package/src/core/urlPolicy.ts +0 -98
  607. package/src/document/AssessmentItemDocument.ts +0 -247
  608. package/src/element.ts +0 -128
  609. package/src/extensions/MathLiveEditor.ts +0 -313
  610. package/src/extraction/ExtractionRegistry.ts +0 -335
  611. package/src/extraction/createContext.ts +0 -52
  612. package/src/extraction/extractors/associateExtractor.ts +0 -1
  613. package/src/extraction/extractors/choiceExtractor.ts +0 -1
  614. package/src/extraction/extractors/conformance-qti3-advanced.test.ts +0 -239
  615. package/src/extraction/extractors/conformance-qti3-basic.test.ts +0 -82
  616. package/src/extraction/extractors/conformance.test.ts +0 -208
  617. package/src/extraction/extractors/customExtractor.ts +0 -1
  618. package/src/extraction/extractors/drawingExtractor.ts +0 -1
  619. package/src/extraction/extractors/endAttemptExtractor.ts +0 -1
  620. package/src/extraction/extractors/extendedTextExtractor.ts +0 -1
  621. package/src/extraction/extractors/gapMatchExtractor.ts +0 -1
  622. package/src/extraction/extractors/graphicAssociateExtractor.ts +0 -1
  623. package/src/extraction/extractors/graphicGapMatchExtractor.ts +0 -1
  624. package/src/extraction/extractors/graphicOrderExtractor.ts +0 -1
  625. package/src/extraction/extractors/hotspotExtractor.ts +0 -1
  626. package/src/extraction/extractors/hottextExtractor.ts +0 -1
  627. package/src/extraction/extractors/index.ts +0 -9
  628. package/src/extraction/extractors/inlineChoiceExtractor.ts +0 -1
  629. package/src/extraction/extractors/matchExtractor.ts +0 -1
  630. package/src/extraction/extractors/mediaExtractor.ts +0 -1
  631. package/src/extraction/extractors/orderExtractor.ts +0 -1
  632. package/src/extraction/extractors/portableCustomExtractor.ts +0 -1
  633. package/src/extraction/extractors/positionObjectExtractor.ts +0 -1
  634. package/src/extraction/extractors/selectPointExtractor.ts +0 -1
  635. package/src/extraction/extractors/sliderExtractor.ts +0 -1
  636. package/src/extraction/extractors/textEntryExtractor.ts +0 -1
  637. package/src/extraction/extractors/uploadExtractor.ts +0 -1
  638. package/src/extraction/index.ts +0 -108
  639. package/src/extraction/interactionExtractionPipeline.ts +0 -70
  640. package/src/extraction/interactionSecurity.ts +0 -60
  641. package/src/extraction/types.ts +0 -246
  642. package/src/extraction/utils.ts +0 -243
  643. package/src/iframe/IFramePlayerHost.ts +0 -265
  644. package/src/iframe/index.ts +0 -11
  645. package/src/iframe/protocol.ts +0 -137
  646. package/src/index.ts +0 -101
  647. package/src/interactions/associate/extractor.ts +0 -133
  648. package/src/interactions/associate/index.ts +0 -2
  649. package/src/interactions/associate/types.ts +0 -1
  650. package/src/interactions/choice/extractor.ts +0 -121
  651. package/src/interactions/choice/index.ts +0 -2
  652. package/src/interactions/choice/types.ts +0 -1
  653. package/src/interactions/custom/extractor.ts +0 -72
  654. package/src/interactions/custom/index.ts +0 -2
  655. package/src/interactions/custom/types.ts +0 -1
  656. package/src/interactions/drawing/extractor.ts +0 -113
  657. package/src/interactions/drawing/index.ts +0 -2
  658. package/src/interactions/drawing/types.ts +0 -1
  659. package/src/interactions/end-attempt/extractor.ts +0 -74
  660. package/src/interactions/end-attempt/index.ts +0 -2
  661. package/src/interactions/end-attempt/types.ts +0 -1
  662. package/src/interactions/extended-text/extractor.ts +0 -92
  663. package/src/interactions/extended-text/index.ts +0 -2
  664. package/src/interactions/extended-text/types.ts +0 -1
  665. package/src/interactions/gap-match/extractor.ts +0 -193
  666. package/src/interactions/gap-match/index.ts +0 -2
  667. package/src/interactions/gap-match/types.ts +0 -1
  668. package/src/interactions/graphic-associate/extractor.ts +0 -192
  669. package/src/interactions/graphic-associate/index.ts +0 -2
  670. package/src/interactions/graphic-associate/types.ts +0 -1
  671. package/src/interactions/graphic-gap-match/extractor.ts +0 -257
  672. package/src/interactions/graphic-gap-match/index.ts +0 -2
  673. package/src/interactions/graphic-gap-match/types.ts +0 -1
  674. package/src/interactions/graphic-order/extractor.ts +0 -162
  675. package/src/interactions/graphic-order/index.ts +0 -2
  676. package/src/interactions/graphic-order/types.ts +0 -1
  677. package/src/interactions/hotspot/extractor.ts +0 -208
  678. package/src/interactions/hotspot/index.ts +0 -2
  679. package/src/interactions/hotspot/types.ts +0 -1
  680. package/src/interactions/hottext/extractor.ts +0 -163
  681. package/src/interactions/hottext/index.ts +0 -2
  682. package/src/interactions/hottext/types.ts +0 -1
  683. package/src/interactions/index.ts +0 -52
  684. package/src/interactions/inline/index.ts +0 -1
  685. package/src/interactions/inline/render-plan.ts +0 -105
  686. package/src/interactions/inline-choice/InlineChoice.svelte +0 -57
  687. package/src/interactions/inline-choice/extractor.ts +0 -105
  688. package/src/interactions/inline-choice/index.ts +0 -2
  689. package/src/interactions/inline-choice/types.ts +0 -1
  690. package/src/interactions/match/extractor.ts +0 -187
  691. package/src/interactions/match/index.ts +0 -2
  692. package/src/interactions/match/types.ts +0 -1
  693. package/src/interactions/media/extractor.ts +0 -168
  694. package/src/interactions/media/index.ts +0 -2
  695. package/src/interactions/media/types.ts +0 -1
  696. package/src/interactions/modules.ts +0 -111
  697. package/src/interactions/order/extractor.ts +0 -120
  698. package/src/interactions/order/index.ts +0 -2
  699. package/src/interactions/order/types.ts +0 -1
  700. package/src/interactions/portable-custom/extractor.ts +0 -122
  701. package/src/interactions/portable-custom/index.ts +0 -2
  702. package/src/interactions/portable-custom/types.ts +0 -1
  703. package/src/interactions/position-object/extractor.ts +0 -243
  704. package/src/interactions/position-object/index.ts +0 -2
  705. package/src/interactions/position-object/types.ts +0 -1
  706. package/src/interactions/select-point/extractor.ts +0 -143
  707. package/src/interactions/select-point/index.ts +0 -2
  708. package/src/interactions/select-point/types.ts +0 -1
  709. package/src/interactions/shared/index.ts +0 -1
  710. package/src/interactions/shared/types.ts +0 -430
  711. package/src/interactions/slider/extractor.ts +0 -102
  712. package/src/interactions/slider/index.ts +0 -2
  713. package/src/interactions/slider/types.ts +0 -1
  714. package/src/interactions/text-entry/InlineTextEntry.svelte +0 -75
  715. package/src/interactions/text-entry/extractor.ts +0 -79
  716. package/src/interactions/text-entry/index.ts +0 -2
  717. package/src/interactions/text-entry/types.ts +0 -1
  718. package/src/interactions/upload/extractor.ts +0 -81
  719. package/src/interactions/upload/index.ts +0 -2
  720. package/src/interactions/upload/types.ts +0 -1
  721. package/src/pci/PciHost.ts +0 -138
  722. package/src/pci/types.ts +0 -70
  723. package/src/pnp/applyPnp.ts +0 -29
  724. package/src/pnp/parsePnpXml.ts +0 -215
  725. package/src/pnp/types.ts +0 -75
  726. package/src/server.ts +0 -14
  727. package/src/types/index.ts +0 -388
  728. package/src/types/interactions.ts +0 -8
  729. package/src/types/responseValidation.ts +0 -29
  730. package/src/types/xmldom.d.ts +0 -12
  731. package/src/utils/PerformanceMonitor.ts +0 -335
  732. package/src/utils/drawingUtils.ts +0 -73
  733. package/src/utils/responseUtils.ts +0 -51
  734. package/src/utils/touchDragHelper.ts +0 -1
  735. package/src/web-components/QTIInteractionBase.ts +0 -303
  736. package/src/web-components/QTIInteractionElement.ts +0 -125
  737. package/src/web-components/index.ts +0 -22
@@ -107,3 +107,4 @@ export const standardSelectPointExtractor = {
107
107
  };
108
108
  },
109
109
  };
110
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/select-point/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyBH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsC;IAC9E,EAAE,EAAE,8BAA8B;IAClC,IAAI,EAAE,uCAAuC;IAC7C,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,wBAAwB,CAAC;IACxC,WAAW,EAAE,qEAAqE;IAElF,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,mDAAmD;QACnD,OAAO,OAAO,CAAC,UAAU,KAAK,wBAAwB,CAAC;IACxD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,gDAAgD;QAChD,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,MAAM,WAAW,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC3D,IAAI,SAAS,GAAqB,IAAI,CAAC;QAEvC,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,GAAG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,CAAC;QAED,sBAAsB;QACtB,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,CAAC;QAED,gFAAgF;QAChF,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAC9D,MAAM,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,UAAU,+CAA+C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAC9G,CAAC;QAED,OAAO;YACN,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI selectPointInteraction extractor\n *\n * Extracts data from selectPointInteraction elements (click point on image)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Image data for select point interaction\n */\nexport interface ImageData {\n\ttype: 'image' | 'svg';\n\tsrc?: string;\n\tcontent?: string;\n\twidth?: string;\n\theight?: string;\n}\n\n/**\n * Select point data extracted from selectPointInteraction elements\n */\nexport interface SelectPointData {\n\timageData: ImageData | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI select point interaction extractor\n * Handles selectPointInteraction elements (clicking points on an image)\n */\nexport const standardSelectPointExtractor: ElementExtractor<SelectPointData> = {\n\tid: 'qti:select-point-interaction',\n\tname: 'QTI Standard Select Point Interaction',\n\tpriority: 10,\n\telementTypes: ['selectPointInteraction'],\n\tdescription: 'Extracts standard QTI selectPointInteraction (click point on image)',\n\n\tcanHandle(element, _context) {\n\t\t// All selectPointInteraction elements are standard\n\t\treturn element.rawTagName === 'selectPointInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract image data from object or img element\n\t\tconst objectElements = utils.getChildrenByTag(element, 'object');\n\t\tconst imgElements = utils.getChildrenByTag(element, 'img');\n\t\tlet imageData: ImageData | null = null;\n\n\t\tif (objectElements.length > 0) {\n\t\t\tconst objectElement = objectElements[0];\n\t\t\tconst type = utils.getAttribute(objectElement, 'type', '');\n\t\t\tconst data = utils.getAttribute(objectElement, 'data', '');\n\t\t\tconst width = utils.getAttribute(objectElement, 'width', '500');\n\t\t\tconst height = utils.getAttribute(objectElement, 'height', '300');\n\n\t\t\tif (type.startsWith('image/svg')) {\n\t\t\t\t// Extract inline SVG content - get full content including <svg> tag\n\t\t\t\tconst content = utils.getHtmlContent(objectElement);\n\t\t\t\timageData = {\n\t\t\t\t\ttype: 'svg',\n\t\t\t\t\tcontent,\n\t\t\t\t\twidth,\n\t\t\t\t\theight,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// External image reference\n\t\t\t\timageData = {\n\t\t\t\t\ttype: 'image',\n\t\t\t\t\tsrc: data,\n\t\t\t\t\twidth,\n\t\t\t\t\theight,\n\t\t\t\t};\n\t\t\t}\n\t\t} else if (imgElements.length > 0) {\n\t\t\t// Handle img element as fallback\n\t\t\tconst imgElement = imgElements[0];\n\t\t\tconst src = utils.getAttribute(imgElement, 'src', '');\n\t\t\tconst width = utils.getAttribute(imgElement, 'width', '500');\n\t\t\tconst height = utils.getAttribute(imgElement, 'height', '300');\n\t\t\timageData = {\n\t\t\t\ttype: 'image',\n\t\t\t\tsrc,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t};\n\t\t}\n\n\t\t// Extract attributes\n\t\tconst maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);\n\t\tconst minChoices = utils.getNumberAttribute(element, 'minChoices', 0);\n\n\t\t// Extract prompt (optional)\n\t\tconst promptElements = utils.getChildrenByTag(element, 'prompt');\n\t\tconst prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;\n\n\t\treturn {\n\t\t\timageData,\n\t\t\tmaxChoices,\n\t\t\tminChoices,\n\t\t\tprompt,\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate image data\n\t\tif (!data.imageData) {\n\t\t\twarnings.push('selectPointInteraction has no image data');\n\t\t} else if (data.imageData.type === 'image' && !data.imageData.src) {\n\t\t\terrors.push('selectPointInteraction must have an image URL');\n\t\t} else if (data.imageData.type === 'svg' && !data.imageData.content) {\n\t\t\terrors.push('selectPointInteraction must have SVG content');\n\t\t}\n\n\t\t// Validate maxChoices — 0 means unlimited per QTI spec\n\t\tif (data.maxChoices < 0) {\n\t\t\terrors.push('maxChoices must be non-negative');\n\t\t}\n\n\t\t// Validate minChoices\n\t\tif (data.minChoices < 0) {\n\t\t\terrors.push('minChoices must be non-negative');\n\t\t}\n\n\t\t// Validate minChoices <= maxChoices (skip when maxChoices=0, meaning unlimited)\n\t\tif (data.maxChoices > 0 && data.minChoices > data.maxChoices) {\n\t\t\terrors.push(`minChoices (${data.minChoices}) must be less than or equal to maxChoices (${data.maxChoices})`);\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: errors.length === 0,\n\t\t\terrors: errors.length > 0 ? errors : undefined,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { SelectPointInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/select-point/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { SelectPointInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { SelectPointInteractionData, Point, ImageData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/select-point/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { SelectPointInteractionData, Point, ImageData } from '../shared/types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type * from './types.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/shared/index.ts"],"names":[],"mappings":"","sourcesContent":["export type * from './types.js';\n"]}
@@ -410,4 +410,3 @@ export interface InteractionValueMap {
410
410
  }>;
411
411
  endAttemptInteraction: boolean;
412
412
  }
413
- //# sourceMappingURL=types.d.ts.map
@@ -5,3 +5,4 @@
5
5
  * interaction renderer registry, ensuring compile-time type safety.
6
6
  */
7
7
  export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/shared/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Interaction type mappings for strongly-typed registry\n *\n * This file defines the complete type system for the plugin-based\n * interaction renderer registry, ensuring compile-time type safety.\n */\n\nimport type { HTMLElement } from 'node-html-parser';\nimport type { HtmlContent, QTIFileResponse } from '../../types/index.js';\n\n/**\n * Type alias for parsed QTI XML elements\n * Uses node-html-parser's HTMLElement type directly\n */\nexport type QTIElement = HTMLElement;\n\nexport interface BaseInteractionData {\n\ttype: string;\n\tresponseId: string;\n}\n\nexport interface ChoiceInteractionData extends BaseInteractionData {\n\ttype: 'choiceInteraction';\n\tshuffle: boolean;\n\tmaxChoices: number;\n\tminChoices: number;\n\tprompt: string | null;\n\tchoices: Array<{ identifier: string; text: HtmlContent; fixed?: boolean; classes?: string[] }>;\n\t/** CSS classes from the choiceInteraction element for custom renderer detection */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxChoices (data-max-selections-message) */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minChoices (data-min-selections-message) */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface TextEntryInteractionData extends BaseInteractionData {\n\ttype: 'textEntryInteraction';\n\texpectedLength: number;\n\tpatternMask: string | null;\n\tplaceholderText: string;\n\tformat?: string;\n\t/** CSS classes from the textEntryInteraction element (e.g. qti-input-width-N) */\n\tinteractionClasses?: string[];\n\t/** Pattern mask validation message (data-patternmask-message) */\n\tpatternMaskMessage?: string | null;\n}\n\nexport interface ExtendedTextInteractionData extends BaseInteractionData {\n\ttype: 'extendedTextInteraction';\n\texpectedLines: number;\n\texpectedLength: number;\n\tprompt: string | null;\n\tplaceholderText: string;\n\tformat: string;\n\tpatternMask?: string | null;\n\tpatternMaskMessage?: string | null;\n\t/** CSS classes from the extendedTextInteraction element (e.g. qti-height-lines-N) */\n\tinteractionClasses?: string[];\n}\n\nexport interface InlineChoiceInteractionData extends BaseInteractionData {\n\ttype: 'inlineChoiceInteraction';\n\tshuffle: boolean;\n\t/** Placeholder label from the QTI <label> child element; shown as the unselected \"Select…\" option */\n\tlabel: string | null;\n\t/** Placeholder text from data-prompt attribute; alternative to <label> for dropdown default option */\n\tdataPrompt?: string | null;\n\tchoices: Array<{ identifier: string; text: string; fixed?: boolean }>;\n\t/** CSS classes from the inlineChoiceInteraction element (e.g. qti-input-width-N) */\n\tinteractionClasses?: string[];\n}\n\nexport interface OrderInteractionData extends BaseInteractionData {\n\ttype: 'orderInteraction';\n\tshuffle: boolean;\n\tminChoices: number;\n\tmaxChoices: number;\n\tprompt: string | null;\n\tchoices: Array<{ identifier: string; text: string; fixed?: boolean }>;\n}\n\nexport interface AssociableChoice {\n\tidentifier: string;\n\ttext: string;\n\tmatchMax: number;\n\t/** Minimum number of times this choice must appear in the response (QTI matchMin) */\n\tmatchMin?: number;\n\t/** Pairing constraint: choice can only be paired with others sharing a group value (QTI matchGroup) */\n\tmatchGroup?: string[];\n\t/** CSS classes from the choice element for custom renderer detection */\n\tclasses?: string[];\n}\n\nexport interface MatchInteractionData extends BaseInteractionData {\n\ttype: 'matchInteraction';\n\tshuffle: boolean;\n\tmaxAssociations: number;\n\tminAssociations?: number;\n\tprompt: string | null;\n\tsourceSet: AssociableChoice[];\n\ttargetSet: AssociableChoice[];\n\t/** CSS classes from the matchInteraction element (e.g. qti-choices-top, qti-match-tabular) */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxAssociations */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minAssociations */\n\tminSelectionsMessage?: string | null;\n\t/** Label for first column header in tabular mode (data-qti-first-column-header) */\n\tfirstColumnHeader?: string | null;\n}\n\nexport interface AssociateInteractionData extends BaseInteractionData {\n\ttype: 'associateInteraction';\n\tshuffle: boolean;\n\tmaxAssociations: number;\n\tminAssociations?: number;\n\tprompt: string | null;\n\tchoices: AssociableChoice[];\n}\n\nexport interface GapMatchInteractionData extends BaseInteractionData {\n\ttype: 'gapMatchInteraction';\n\tshuffle: boolean;\n\tprompt: string | null;\n\tgapTexts: Array<{ identifier: string; text: string; matchMax: number; matchGroup?: string[]; inputWidth?: number }>;\n\tgaps: Array<{ identifier: string; index: number }>;\n\tpromptText: string;\n\t/** CSS classes from the gapMatchInteraction element (e.g. qti-choices-top, qti-choices-bottom) */\n\tinteractionClasses?: string[];\n\t/** Width of the choice container in px (data-choices-container-width) */\n\tchoicesContainerWidth?: string | null;\n\t/** Message shown when candidate exceeds max associations */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below min associations */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface SliderInteractionData extends BaseInteractionData {\n\ttype: 'sliderInteraction';\n\tlowerBound: number;\n\tupperBound: number;\n\tstep: number;\n\torientation: string;\n\treverse: boolean;\n\tprompt: string | null;\n}\n\nexport interface ImageData {\n\ttype: 'svg' | 'image';\n\tcontent?: HtmlContent;\n\tsrc?: string;\n\twidth: string;\n\theight: string;\n}\n\nexport interface HotspotChoice {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\t/** Author-provided label for the hotspot; used as accessible aria-label */\n\thotspotLabel?: string;\n}\n\nexport interface HotspotInteractionData extends BaseInteractionData {\n\ttype: 'hotspotInteraction';\n\tmaxChoices: number;\n\tminChoices?: number;\n\tprompt: string | null;\n\timageData: ImageData | null;\n\thotspotChoices: HotspotChoice[];\n\t/** CSS classes from the hotspotInteraction element (e.g. qti-selections-light, qti-selections-dark) */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxChoices */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minChoices */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface AssociableHotspot {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\tmatchMax: number;\n}\n\nexport interface GraphicGapMatchInteractionData extends BaseInteractionData {\n\ttype: 'graphicGapMatchInteraction';\n\tprompt: string | null;\n\timageData: ImageData | null;\n\tmaxAssociations: number;\n\tgapTexts: Array<{ identifier: string; text: string; matchMax: number; matchGroup?: string[] }>;\n\t/** Image-based draggable labels (gapImg elements); rendered as <img> in the choice pool */\n\tgapImages: Array<{ identifier: string; src: string; alt: string; matchMax: number; matchGroup?: string[]; width?: number; height?: number }>;\n\thotspots: AssociableHotspot[];\n\t/** CSS classes from the graphicGapMatchInteraction element (e.g. qti-choices-top, qti-selections-dark) */\n\tinteractionClasses?: string[];\n\t/** Width of the choice container in px (data-choices-container-width) */\n\tchoicesContainerWidth?: string | null;\n\t/** Message shown when candidate exceeds max associations */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below min associations */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface UploadInteractionData extends BaseInteractionData {\n\ttype: 'uploadInteraction';\n\tprompt: string | null;\n\t/** Allowed MIME types / extensions (vendor-dependent); empty = accept any */\n\tfileTypes: string[];\n\trawAttributes: Record<string, string>;\n}\n\nexport interface DrawingInteractionData extends BaseInteractionData {\n\ttype: 'drawingInteraction';\n\tprompt: string | null;\n\t/** Optional background image/SVG to draw on top of */\n\timageData: ImageData | null;\n\trawAttributes: Record<string, string>;\n}\n\nexport interface CustomInteractionData extends BaseInteractionData {\n\ttype: 'customInteraction';\n\tprompt: string | null;\n\trawAttributes: Record<string, string>;\n\t/** Outer XML snippet for debugging (best-effort) */\n\txml: string;\n}\n\nexport interface MediaElement {\n\ttype: 'audio' | 'video' | 'object';\n\tsrc: string;\n\tmimeType: string;\n\twidth?: number;\n\theight?: number;\n}\n\nexport interface MediaInteractionData extends BaseInteractionData {\n\ttype: 'mediaInteraction';\n\tprompt: string | null;\n\tautostart: boolean;\n\tminPlays: number;\n\tmaxPlays: number; // 0 = unlimited\n\tloop: boolean;\n\tmediaElement: MediaElement;\n\t/** Whether the renderer should allow <object> embeds for this interaction (default false) */\n\tallowObjectEmbeds?: boolean;\n}\n\nexport interface HottextChoice {\n\tidentifier: string;\n\ttext: string;\n}\n\nexport interface HottextInteractionData extends BaseInteractionData {\n\ttype: 'hottextInteraction';\n\tprompt: string | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\tcontentHtml: HtmlContent;\n\thottextChoices: HottextChoice[];\n\t/** CSS classes from the hottextInteraction element (e.g. qti-input-control-hidden) */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxChoices */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minChoices */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface Point {\n\tx: number;\n\ty: number;\n}\n\nexport interface SelectPointInteractionData extends BaseInteractionData {\n\ttype: 'selectPointInteraction';\n\tprompt: string | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\timageData: ImageData | null;\n}\n\nexport interface GraphicOrderChoice {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\tlabel: string;\n}\n\nexport interface GraphicOrderInteractionData extends BaseInteractionData {\n\ttype: 'graphicOrderInteraction';\n\tprompt: string | null;\n\timageData: ImageData | null;\n\thotspotChoices: GraphicOrderChoice[];\n}\n\nexport interface GraphicAssociateHotspot {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\tmatchMax: number;\n\tlabel: string;\n\t/** Pairing constraint: hotspot can only be associated with others sharing a group value (QTI matchGroup) */\n\tmatchGroup?: string[];\n}\n\nexport interface GraphicAssociateInteractionData extends BaseInteractionData {\n\ttype: 'graphicAssociateInteraction';\n\tprompt: string | null;\n\tmaxAssociations: number;\n\tminAssociations: number;\n\timageData: ImageData | null;\n\tassociableHotspots: GraphicAssociateHotspot[];\n}\n\nexport interface PositionObjectStage {\n\tidentifier: string;\n\tmatchMax: number;\n\tobjectData: {\n\t\ttype: 'image' | 'svg';\n\t\tsrc?: string;\n\t\tcontent?: HtmlContent;\n\t\twidth?: string;\n\t\theight?: string;\n\t} | null;\n\tlabel: string;\n}\n\nexport interface PositionObjectInteractionData extends BaseInteractionData {\n\ttype: 'positionObjectInteraction';\n\tprompt: string | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\tcenterPoint: boolean;\n\timageData: ImageData | null;\n\tpositionObjectStages: PositionObjectStage[];\n}\n\nexport interface EndAttemptInteractionData extends BaseInteractionData {\n\ttype: 'endAttemptInteraction';\n\tprompt: string | null;\n\ttitle: string;\n\t/** Whether this interaction counts as an attempt (default: true) */\n\tcountAttempt: boolean;\n}\n\nexport type InteractionData =\n\t| ChoiceInteractionData\n\t| TextEntryInteractionData\n\t| ExtendedTextInteractionData\n\t| InlineChoiceInteractionData\n\t| OrderInteractionData\n\t| MatchInteractionData\n\t| AssociateInteractionData\n\t| GapMatchInteractionData\n\t| SliderInteractionData\n\t| HotspotInteractionData\n\t| GraphicGapMatchInteractionData\n\t| UploadInteractionData\n\t| DrawingInteractionData\n\t| CustomInteractionData\n\t| MediaInteractionData\n\t| HottextInteractionData\n\t| SelectPointInteractionData\n\t| GraphicOrderInteractionData\n\t| GraphicAssociateInteractionData\n\t| PositionObjectInteractionData\n\t| EndAttemptInteractionData;\n\n/**\n * QTI interaction type identifier\n * Extensible string type allows custom interaction types\n */\nexport type InteractionType = string;\n\n/**\n * Map interaction types to their data structures\n * TypeScript will ensure registrations use the correct data type\n */\nexport interface InteractionDataMap {\n\tchoiceInteraction: ChoiceInteractionData;\n\ttextEntryInteraction: TextEntryInteractionData;\n\textendedTextInteraction: ExtendedTextInteractionData;\n\tinlineChoiceInteraction: InlineChoiceInteractionData;\n\torderInteraction: OrderInteractionData;\n\tmatchInteraction: MatchInteractionData;\n\tassociateInteraction: AssociateInteractionData;\n\tgapMatchInteraction: GapMatchInteractionData;\n\tsliderInteraction: SliderInteractionData;\n\thotspotInteraction: HotspotInteractionData;\n\tgraphicGapMatchInteraction: GraphicGapMatchInteractionData;\n\tuploadInteraction: UploadInteractionData;\n\tdrawingInteraction: DrawingInteractionData;\n\tcustomInteraction: CustomInteractionData;\n\tmediaInteraction: MediaInteractionData;\n\thottextInteraction: HottextInteractionData;\n\tselectPointInteraction: SelectPointInteractionData;\n\tgraphicOrderInteraction: GraphicOrderInteractionData;\n\tgraphicAssociateInteraction: GraphicAssociateInteractionData;\n\tpositionObjectInteraction: PositionObjectInteractionData;\n\tendAttemptInteraction: EndAttemptInteractionData;\n}\n\n/**\n * Map interaction types to their response value types\n * Ensures getValue/setValue use the correct types\n */\nexport interface InteractionValueMap {\n\tchoiceInteraction: string | string[];\n\ttextEntryInteraction: string;\n\textendedTextInteraction: string;\n\tinlineChoiceInteraction: string;\n\torderInteraction: string[];\n\tmatchInteraction: Record<string, string>;\n\tassociateInteraction: Array<[string, string]>;\n\tgapMatchInteraction: Record<string, string>;\n\tsliderInteraction: number;\n\thotspotInteraction: string[];\n\tgraphicGapMatchInteraction: Record<string, string>;\n\tuploadInteraction: QTIFileResponse | null;\n\tdrawingInteraction: string;\n\tcustomInteraction: any;\n\tmediaInteraction: any;\n\thottextInteraction: string[];\n\tselectPointInteraction: Array<{ x: number; y: number }>;\n\tgraphicOrderInteraction: string[];\n\tgraphicAssociateInteraction: Array<[string, string]>;\n\tpositionObjectInteraction: Record<string, { x: number; y: number }>;\n\tendAttemptInteraction: boolean;\n}\n"]}
@@ -21,4 +21,3 @@ export interface SliderData {
21
21
  * Handles sliderInteraction elements (slider for numeric input)
22
22
  */
23
23
  export declare const standardSliderExtractor: ElementExtractor<SliderData>;
24
- //# sourceMappingURL=extractor.d.ts.map
@@ -71,3 +71,4 @@ export const standardSliderExtractor = {
71
71
  };
72
72
  },
73
73
  };
74
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/slider/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACpE,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,iCAAiC;IACvC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,mBAAmB,CAAC;IACnC,WAAW,EAAE,wDAAwD;IAErE,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,8CAA8C;QAC9C,OAAO,OAAO,CAAC,UAAU,KAAK,mBAAmB,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,8BAA8B;QAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;QACxE,MAAM,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AAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAChF,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAC/D,CAAC;QAED,oCAAoC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAChD,IAAI,IAAI,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,+BAA+B,KAAK,GAAG,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACpC,2CAA2C;YAC3C,QAAQ,CAAC,IAAI,CACZ,QAAQ,IAAI,CAAC,IAAI,iCAAiC,KAAK,KAAK,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,UAAU,GAAG,CACpG,CAAC;QACH,CAAC;QAED,OAAO;YACN,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI sliderInteraction extractor\n *\n * Extracts data from sliderInteraction elements (slider input)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Slider data extracted from sliderInteraction elements\n */\nexport interface SliderData {\n\tlowerBound: number;\n\tupperBound: number;\n\tstep: number;\n\tstepLabel?: boolean;\n\torientation: string;\n\treverse: boolean;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI slider interaction extractor\n * Handles sliderInteraction elements (slider for numeric input)\n */\nexport const standardSliderExtractor: ElementExtractor<SliderData> = {\n\tid: 'qti:slider-interaction',\n\tname: 'QTI Standard Slider Interaction',\n\tpriority: 10,\n\telementTypes: ['sliderInteraction'],\n\tdescription: 'Extracts standard QTI sliderInteraction (slider input)',\n\n\tcanHandle(element, _context) {\n\t\t// All sliderInteraction elements are standard\n\t\treturn element.rawTagName === 'sliderInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract required attributes\n\t\tconst lowerBound = utils.getNumberAttribute(element, 'lowerBound', 0);\n\t\tconst upperBound = utils.getNumberAttribute(element, 'upperBound', 100);\n\t\tconst step = utils.getNumberAttribute(element, 'step', 1);\n\t\tconst orientation = utils.getAttribute(element, 'orientation', 'horizontal');\n\t\tconst reverse = utils.getBooleanAttribute(element, 'reverse', false);\n\n\t\t// Extract optional attributes\n\t\tconst stepLabel = utils.getBooleanAttribute(element, 'stepLabel');\n\n\t\t// Extract prompt (optional)\n\t\tconst promptElements = utils.getChildrenByTag(element, 'prompt');\n\t\tconst prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;\n\n\t\treturn {\n\t\t\tlowerBound,\n\t\t\tupperBound,\n\t\t\tstep,\n\t\t\torientation,\n\t\t\treverse,\n\t\t\t...(stepLabel ? { stepLabel } : {}),\n\t\t\tprompt,\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate bounds\n\t\tif (data.lowerBound >= data.upperBound) {\n\t\t\terrors.push('lowerBound must be less than upperBound');\n\t\t}\n\n\t\t// Validate step\n\t\tif (data.step <= 0) {\n\t\t\terrors.push('step must be greater than 0');\n\t\t}\n\n\t\t// Validate orientation\n\t\tif (data.orientation && !['horizontal', 'vertical'].includes(data.orientation)) {\n\t\t\terrors.push('orientation must be \"horizontal\" or \"vertical\"');\n\t\t}\n\n\t\t// Warn if step is larger than range\n\t\tconst range = data.upperBound - data.lowerBound;\n\t\tif (data.step > range) {\n\t\t\twarnings.push(`step (${data.step}) is larger than the range (${range})`);\n\t\t} else if (range % data.step !== 0) {\n\t\t\t// Warn if step doesn't evenly divide range\n\t\t\twarnings.push(\n\t\t\t\t`step ${data.step} does not evenly divide range ${range} (${data.lowerBound} to ${data.upperBound})`\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: errors.length === 0,\n\t\t\terrors: errors.length > 0 ? errors : undefined,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { SliderInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/slider/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { SliderInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { SliderInteractionData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/slider/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { SliderInteractionData } from '../shared/types.js';\n"]}
@@ -18,4 +18,3 @@ export interface TextEntryData {
18
18
  * Handles textEntryInteraction elements (inline text input)
19
19
  */
20
20
  export declare const standardTextEntryExtractor: ElementExtractor<TextEntryData>;
21
- //# sourceMappingURL=extractor.d.ts.map
@@ -52,3 +52,4 @@ export const standardTextEntryExtractor = {
52
52
  };
53
53
  },
54
54
  };
55
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/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,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChE,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrD,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI;QACZ,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,0BAA0B;QAC1B,IAAI,IAAI,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,IAAI,CAAC,cAAc,GAAG,IAAI,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CACZ,mBAAmB,IAAI,CAAC,cAAc,0DAA0D,CAChG,CAAC;QACH,CAAC;QAED,OAAO;YACN,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI textEntryInteraction extractor\n *\n * Extracts data from textEntryInteraction elements (inline text input)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Text entry data extracted from textEntryInteraction elements\n */\nexport interface TextEntryData {\n\texpectedLength: number;\n\tpatternMask: string | null;\n\tplaceholderText: string;\n\tformat?: string;\n}\n\n/**\n * Standard QTI text entry interaction extractor\n * Handles textEntryInteraction elements (inline text input)\n */\nexport const standardTextEntryExtractor: ElementExtractor<TextEntryData> = {\n\tid: 'qti:text-entry-interaction',\n\tname: 'QTI Standard Text Entry Interaction',\n\tpriority: 10,\n\telementTypes: ['textEntryInteraction'],\n\tdescription: 'Extracts standard QTI textEntryInteraction (inline text input)',\n\n\tcanHandle(element, _context) {\n\t\t// All textEntryInteraction elements are standard (both QTI 2.x and 3.0)\n\t\treturn (\n\t\t\telement.rawTagName === 'textEntryInteraction' || element.rawTagName === 'qti-text-entry-interaction'\n\t\t);\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract attributes\n\t\tconst expectedLength = utils.getNumberAttribute(element, 'expectedLength', 20);\n\t\tconst patternMask = utils.getAttribute(element, 'patternMask', '');\n\t\tconst placeholderText = utils.getAttribute(element, 'placeholderText', '');\n\t\tconst format = utils.getAttribute(element, 'format', '');\n\t\tconst interactionClasses = utils.getClasses(element);\n\t\tconst patternMaskMessage = utils.getAttribute(element, 'data-patternmask-message', '') || null;\n\n\t\treturn {\n\t\t\texpectedLength,\n\t\t\tpatternMask: patternMask || null,\n\t\t\tplaceholderText,\n\t\t\t...(format ? { format } : {}),\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t\t...(patternMaskMessage ? { patternMaskMessage } : {}),\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate expectedLength\n\t\tif (data.expectedLength < 1) {\n\t\t\terrors.push('expectedLength must be positive');\n\t\t}\n\n\t\tif (data.expectedLength > 1000) {\n\t\t\twarnings.push(\n\t\t\t\t`expectedLength (${data.expectedLength}) is very large - consider using extendedTextInteraction`\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: errors.length === 0,\n\t\t\terrors: errors.length > 0 ? errors : undefined,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { TextEntryInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/text-entry/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { TextEntryInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { TextEntryInteractionData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/text-entry/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { TextEntryInteractionData } from '../shared/types.js';\n"]}
@@ -17,4 +17,3 @@ export interface UploadData {
17
17
  * Handles uploadInteraction elements (file upload)
18
18
  */
19
19
  export declare const standardUploadExtractor: ElementExtractor<UploadData>;
20
- //# sourceMappingURL=extractor.d.ts.map
@@ -57,3 +57,4 @@ export const standardUploadExtractor = {
57
57
  };
58
58
  },
59
59
  };
60
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/upload/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACpE,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,iCAAiC;IACvC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,mBAAmB,CAAC;IACnC,WAAW,EAAE,uDAAuD;IAEpE,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,8CAA8C;QAC9C,OAAO,OAAO,CAAC,UAAU,KAAK,mBAAmB,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,G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;QAE9B,oCAAoC;QACpC,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,QAAQ,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO;YACN,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI uploadInteraction extractor\n *\n * Extracts data from uploadInteraction elements (file upload)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Upload data extracted from uploadInteraction elements\n */\nexport interface UploadData {\n\tfileTypes: string[];\n\trawAttributes: Record<string, string>;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI upload interaction extractor\n * Handles uploadInteraction elements (file upload)\n */\nexport const standardUploadExtractor: ElementExtractor<UploadData> = {\n\tid: 'qti:upload-interaction',\n\tname: 'QTI Standard Upload Interaction',\n\tpriority: 10,\n\telementTypes: ['uploadInteraction'],\n\tdescription: 'Extracts standard QTI uploadInteraction (file upload)',\n\n\tcanHandle(element, _context) {\n\t\t// All uploadInteraction elements are standard\n\t\treturn element.rawTagName === 'uploadInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract fileType child elements (vendor / QTI 3.0 style)\n\t\tconst fileTypeElements = utils.getChildrenByTag(element, 'fileType');\n\t\tlet fileTypes = fileTypeElements.map((el) => utils.getTextContent(el));\n\n\t\t// Fall back to QTI 2.x `type` attribute when no <fileType> children are present\n\t\tif (fileTypes.length === 0) {\n\t\t\tconst typeAttr = utils.getAttribute(element, 'type', '');\n\t\t\tif (typeAttr) {\n\t\t\t\tfileTypes = typeAttr.split(/\\s+/).filter(Boolean);\n\t\t\t}\n\t\t}\n\n\t\t// Extract all attributes\n\t\tconst rawAttributes: Record<string, string> = {};\n\t\tif (element.attributes) {\n\t\t\tfor (const [key, value] of Object.entries(element.attributes)) {\n\t\t\t\trawAttributes[key] = String(value);\n\t\t\t}\n\t\t}\n\n\t\t// Extract prompt (optional)\n\t\tconst promptElements = utils.getChildrenByTag(element, 'prompt');\n\t\tconst prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;\n\n\t\treturn {\n\t\t\tfileTypes,\n\t\t\trawAttributes,\n\t\t\tprompt,\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst warnings: string[] = [];\n\n\t\t// Warn if no file type restrictions\n\t\tif (!data.fileTypes || data.fileTypes.length === 0) {\n\t\t\twarnings.push('uploadInteraction has no fileTypes - any file type will be accepted');\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { UploadInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/upload/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { UploadInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { UploadInteractionData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/upload/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { UploadInteractionData } from '../shared/types.js';\n"]}
@@ -50,4 +50,3 @@ export declare class PciHost {
50
50
  */
51
51
  private extractPciInterface;
52
52
  }
53
- //# sourceMappingURL=PciHost.d.ts.map
@@ -114,3 +114,4 @@ export class PciHost {
114
114
  return candidate;
115
115
  }
116
116
  }
117
+ //# sourceMappingURL=PciHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PciHost.js","sourceRoot":"","sources":["../../src/pci/PciHost.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,OAAO,OAAO;IAOnB,YAAY,IAAkB,EAAE,OAAe;QAJvC,WAAM,GAAqB,IAAI,CAAC;QAChC,cAAS,GAAY,IAAI,CAAC;QAC1B,sBAAiB,GAA0D,IAAI,CAAC;QAGvF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,gBAAgB,CAAC,QAAsD;QAC7E,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QAChB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,CAAC;YACJ,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;YAC5C,OAAO;QACR,CAAC;QAAC,OAAO,UAAU,EAAE,CAAC;YACrB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC7B,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,UAAmB,CAAC,CAAC;YAC/E,CAAC;QACF,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAa,CAAC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;IACxB,CAAC;IAED,yBAAyB;IAClB,MAAM;QACZ,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IACvB,CAAC;IAED,mDAAmD;IAC5C,OAAO;QACb,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,8EAA8E;IAC9E,kBAAkB;IAClB,8EAA8E;IAE9E,iEAAiE;IACvD,aAAa,CAAC,GAAW;QAClC,OAAO,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QACnE,yCAAyC;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QAC5E,OAAO,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACK,mBAAmB,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,WAAW,EAAE,EAAE,IAAI,GAAG,CAAC;QAC9D,IAAI,OAAO,SAAS,EAAE,UAAU,KAAK,UAAU,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CACd,kBAAkB,IAAI,CAAC,IAAI,CAAC,WAAW,gDAAgD;gBACtF,iFAAiF,CAClF,CAAC;QACH,CAAC;QACD,OAAO,SAAsB,CAAC;IAC/B,CAAC;CACD","sourcesContent":["import type { ExtractedPci, PciBoundTo, PciModule } from './types.js';\nimport { PciLoadError } from './types.js';\n\n/**\n * Loads, initializes, and manages the lifecycle of a single PCI module.\n *\n * Usage:\n * const host = new PciHost(extractedData, baseUrl);\n * await host.load();\n * host.initialize(domNode);\n * host.getResponse(); // returns current response\n * host.destroy(); // cleanup on player teardown\n */\nexport class PciHost {\n\tprivate readonly data: ExtractedPci;\n\tprivate readonly baseUrl: string;\n\tprivate module: PciModule | null = null;\n\tprivate _response: unknown = null;\n\tprivate _onResponseChange: ((responseId: string, value: unknown) => void) | null = null;\n\n\tconstructor(data: ExtractedPci, baseUrl: string) {\n\t\tthis.data = data;\n\t\tthis.baseUrl = baseUrl;\n\t}\n\n\t/**\n\t * Register a callback to fire when the PCI's response changes.\n\t * The player calls this to wire the PCI into its internal response map.\n\t */\n\tpublic onResponseChange(callback: (responseId: string, value: unknown) => void): void {\n\t\tthis._onResponseChange = callback;\n\t}\n\n\t/**\n\t * Load the PCI module from primaryPath, falling back to fallbackPath.\n\t * Throws PciLoadError if both fail.\n\t */\n\tpublic async load(): Promise<void> {\n\t\tconst primary = this.resolveUrl(this.data.primaryPath);\n\t\ttry {\n\t\t\tconst mod = await this.dynamicImport(primary);\n\t\t\tthis.module = this.extractPciInterface(mod);\n\t\t\treturn;\n\t\t} catch (primaryErr) {\n\t\t\tif (!this.data.fallbackPath) {\n\t\t\t\tthrow new PciLoadError(this.data.primaryPath, undefined, primaryErr as Error);\n\t\t\t}\n\t\t}\n\n\t\tconst fallback = this.resolveUrl(this.data.fallbackPath!);\n\t\ttry {\n\t\t\tconst mod = await this.dynamicImport(fallback);\n\t\t\tthis.module = this.extractPciInterface(mod);\n\t\t} catch (fallbackErr) {\n\t\t\tthrow new PciLoadError(\n\t\t\t\tthis.data.primaryPath,\n\t\t\t\tthis.data.fallbackPath,\n\t\t\t\tfallbackErr as Error\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the PCI inside the given DOM element.\n\t * Must be called after load() resolves.\n\t */\n\tpublic initialize(dom: HTMLElement): void {\n\t\tif (!this.module) return;\n\n\t\tconst boundTo: PciBoundTo = {\n\t\t\tonReady: () => {},\n\t\t\tonResponseChange: (value: unknown) => {\n\t\t\t\tthis._response = value;\n\t\t\t\tthis._onResponseChange?.(this.data.responseIdentifier, value);\n\t\t\t},\n\t\t};\n\n\t\tthis.module.initialize(dom, this.data.config, boundTo);\n\t}\n\n\t/** Return the current response value from the PCI module. */\n\tpublic getResponse(): unknown {\n\t\treturn this.module ? this.module.getResponse() : this._response;\n\t}\n\n\t/** Restore a response value into the PCI module (e.g. from session state). */\n\tpublic setResponse(value: unknown): void {\n\t\tthis._response = value;\n\t\tthis.module?.setResponse(value);\n\t}\n\n\t/** Disable the PCI (e.g. when role is not candidate, or after final submission). */\n\tpublic disable(): void {\n\t\tthis.module?.disable();\n\t}\n\n\t/** Re-enable the PCI. */\n\tpublic enable(): void {\n\t\tthis.module?.enable();\n\t}\n\n\t/** Tear down the PCI and release all resources. */\n\tpublic destroy(): void {\n\t\tthis.module?.destroy();\n\t\tthis.module = null;\n\t}\n\n\t// ---------------------------------------------------------------------------\n\t// Private helpers\n\t// ---------------------------------------------------------------------------\n\n\t/** Thin wrapper around dynamic import — overridable in tests. */\n\tprotected dynamicImport(url: string): Promise<any> {\n\t\treturn import(/* @vite-ignore */ url);\n\t}\n\n\tprivate resolveUrl(path: string): string {\n\t\tif (/^https?:\\/\\//.test(path) || path.startsWith('/')) return path;\n\t\t// Relative path: resolve against baseUrl\n\t\tconst base = this.baseUrl.endsWith('/') ? this.baseUrl : this.baseUrl + '/';\n\t\treturn base + path;\n\t}\n\n\t/**\n\t * Extract a PciModule from a dynamic import result.\n\t * Supports: default export, named `getInstance` export, or the module itself.\n\t */\n\tprivate extractPciInterface(mod: any): PciModule {\n\t\tconst candidate = mod?.default ?? mod?.getInstance?.() ?? mod;\n\t\tif (typeof candidate?.initialize !== 'function') {\n\t\t\tthrow new Error(\n\t\t\t\t`PCI module at '${this.data.primaryPath}' does not export a valid PciModule interface ` +\n\t\t\t\t\t'(expected .initialize, .getResponse, .setResponse, .disable, .enable, .destroy)'\n\t\t\t);\n\t\t}\n\t\treturn candidate as PciModule;\n\t}\n}\n"]}
@@ -54,4 +54,3 @@ export declare class PciLoadError extends Error {
54
54
  readonly fallbackPath: string | undefined;
55
55
  constructor(primaryPath: string, fallbackPath: string | undefined, cause?: Error);
56
56
  }
57
- //# sourceMappingURL=types.d.ts.map
package/dist/pci/types.js CHANGED
@@ -17,3 +17,4 @@ export class PciLoadError extends Error {
17
17
  Object.defineProperty(this, 'cause', { value: cause, writable: true, configurable: true });
18
18
  }
19
19
  }
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pci/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YACiB,WAAmB,EACnB,YAAgC,EAChD,KAAa;QAEb,KAAK,CACJ,YAAY;YACX,CAAC,CAAC,mCAAmC,WAAW,mBAAmB,YAAY,GAAG;YAClF,CAAC,CAAC,mCAAmC,WAAW,GAAG,CACpD,CAAC;QARc,gBAAW,GAAX,WAAW,CAAQ;QACnB,iBAAY,GAAZ,YAAY,CAAoB;QAQhD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,KAAK;YAAE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IACvG,CAAC;CACD","sourcesContent":["/**\n * QTI 3.0 Portable Custom Interaction (PCI) types.\n * Based on IMS QTI 3.0 Portable Custom Interaction specification.\n */\n\n/**\n * Callbacks the player provides to a PCI module so it can signal state changes.\n */\nexport interface PciBoundTo {\n\t/** Called when the PCI has finished initializing and is ready to accept responses. */\n\tonReady(): void;\n\t/** Called whenever the candidate's response changes. */\n\tonResponseChange(value: unknown): void;\n}\n\n/**\n * Contract that every PCI module must fulfill.\n * The module's default export (or named `getInstance` export) must implement this interface.\n */\nexport interface PciModule {\n\t/** Initialize the PCI inside the given DOM element. */\n\tinitialize(dom: HTMLElement, config: Record<string, string>, boundTo: PciBoundTo): void;\n\t/** Return the current response value. */\n\tgetResponse(): unknown;\n\t/** Restore a previously-captured response value. */\n\tsetResponse(value: unknown): void;\n\t/** Disable candidate interaction (e.g. after submission or when role is not candidate). */\n\tdisable(): void;\n\t/** Re-enable candidate interaction. */\n\tenable(): void;\n\t/** Tear down: remove event listeners, cancel timers, free resources. */\n\tdestroy(): void;\n}\n\n/**\n * Extracted data from a <qti-portable-custom-interaction> element.\n */\nexport interface ExtractedPci {\n\t/** responseIdentifier attribute value. */\n\tresponseIdentifier: string;\n\t/** customInteractionTypeIdentifier attribute value (URN identifying the PCI type). */\n\tcustomInteractionTypeIdentifier: string;\n\t/** Primary JS module path (required). */\n\tprimaryPath: string;\n\t/** Fallback JS module path (optional). */\n\tfallbackPath?: string;\n\t/** Inner HTML of the <qti-interaction-markup> element. */\n\tmarkup: string;\n\t/** Key/value pairs from <qti-pci-properties>/<qti-pci-property>. */\n\tconfig: Record<string, string>;\n}\n\n/**\n * Thrown when a PCI module fails to load from both primary and fallback paths.\n */\nexport class PciLoadError extends Error {\n\tconstructor(\n\t\tpublic readonly primaryPath: string,\n\t\tpublic readonly fallbackPath: string | undefined,\n\t\tcause?: Error\n\t) {\n\t\tsuper(\n\t\t\tfallbackPath\n\t\t\t\t? `PCI module failed to load from '${primaryPath}' and fallback '${fallbackPath}'`\n\t\t\t\t: `PCI module failed to load from '${primaryPath}'`\n\t\t);\n\t\tthis.name = 'PciLoadError';\n\t\tif (cause) Object.defineProperty(this, 'cause', { value: cause, writable: true, configurable: true });\n\t}\n}\n"]}
@@ -6,4 +6,3 @@ import type { PnpProfile } from './types.js';
6
6
  * Magnification is intentionally deferred — host stylesheets / browser zoom are sufficient for now.
7
7
  */
8
8
  export declare function applyPnpToRoot(rootEl: HTMLElement, pnp: PnpProfile | undefined): void;
9
- //# sourceMappingURL=applyPnp.d.ts.map
@@ -24,3 +24,4 @@ export function applyPnpToRoot(rootEl, pnp) {
24
24
  rootEl.style?.removeProperty?.('--qti-magnification');
25
25
  }
26
26
  }
27
+ //# sourceMappingURL=applyPnp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPnp.js","sourceRoot":"","sources":["../../src/pnp/applyPnp.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,GAA2B;IAC9E,MAAM,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC;IAEzC,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,EAAE,OAAO,EAAE,aAAa,CAAC;IAClD,IAAI,aAAa,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;QACxF,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,qBAAqB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3E,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACvD,CAAC;AACF,CAAC","sourcesContent":["import type { PnpProfile } from './types.js';\n\nconst ATTR = 'data-qti-colorscheme';\nconst MAGNIFICATION_ATTR = 'data-qti-magnification';\n\n/**\n * Apply a PNP profile to the player root element.\n *\n * Currently handles color scheme (data-qti-colorscheme attribute).\n * Magnification is intentionally deferred — host stylesheets / browser zoom are sufficient for now.\n */\nexport function applyPnpToRoot(rootEl: HTMLElement, pnp: PnpProfile | undefined): void {\n\tconst scheme = pnp?.display?.colorScheme;\n\n\tif (!scheme || scheme === 'default') {\n\t\trootEl.removeAttribute(ATTR);\n\t} else {\n\t\trootEl.setAttribute(ATTR, scheme);\n\t}\n\n\tconst magnification = pnp?.display?.magnification;\n\tif (magnification !== undefined && Number.isFinite(magnification) && magnification > 0) {\n\t\trootEl.setAttribute(MAGNIFICATION_ATTR, String(magnification));\n\t\trootEl.style?.setProperty?.('--qti-magnification', String(magnification));\n\t} else {\n\t\trootEl.removeAttribute(MAGNIFICATION_ATTR);\n\t\trootEl.style?.removeProperty?.('--qti-magnification');\n\t}\n}\n"]}
@@ -6,4 +6,3 @@ import type { PnpProfile } from './types.js';
6
6
  * Unknown child elements are silently ignored for forward-compatibility.
7
7
  */
8
8
  export declare function parsePnpXml(xml: string | Element): PnpProfile;
9
- //# sourceMappingURL=parsePnpXml.d.ts.map
@@ -187,3 +187,4 @@ function catalogSupportPreferenceKey(usage) {
187
187
  return usage;
188
188
  }
189
189
  }
190
+ //# sourceMappingURL=parsePnpXml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsePnpXml.js","sourceRoot":"","sources":["../../src/pnp/parsePnpXml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAItD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAqB;IAChD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,2EAA2E;QAC3E,OAAO,WAAW,CAAE,GAAe,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE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;AAED,SAAS,2BAA2B,CAAC,KAAa;IACjD,QAAQ,KAAK,EAAE,CAAC;QACf,KAAK,mBAAmB;YACvB,OAAO,kBAAkB,CAAC;QAC3B,KAAK,oBAAoB;YACxB,OAAO,mBAAmB,CAAC;QAC5B,KAAK,cAAc;YAClB,OAAO,aAAa,CAAC;QACtB,KAAK,mBAAmB;YACvB,OAAO,kBAAkB,CAAC;QAC3B,KAAK,sBAAsB;YAC1B,OAAO,qBAAqB,CAAC;QAC9B;YACC,OAAO,KAAK,CAAC;IACf,CAAC;AACF,CAAC","sourcesContent":["import { parse as parseHtml } from 'node-html-parser';\nimport type { HTMLElement as NhpElement } from 'node-html-parser';\nimport type { CatalogSupportPreference, PnpProfile } from './types.js';\n\n/**\n * Parse a QTI 3.0 <personalNeedsProfile> element (or legacy <pnp> element) into a PnpProfile.\n *\n * Accepts either an XML/HTML string containing the profile element, or a live DOM Element.\n * Unknown child elements are silently ignored for forward-compatibility.\n */\nexport function parsePnpXml(xml: string | Element): PnpProfile {\n\tif (typeof xml !== 'string') {\n\t\t// Live DOM Element — serialise to string and re-parse via node-html-parser\n\t\treturn parsePnpXml((xml as Element).outerHTML ?? '');\n\t}\n\n\tconst trimmed = xml.trim();\n\tif (!trimmed) return {};\n\n\t// Wrap so node-html-parser treats the outer tag as the root\n\tconst doc = parseHtml(`<root>${trimmed}</root>`, { lowerCaseTagName: true });\n\tconst root = doc.querySelector('personalneedsprofile') ?? doc.querySelector('pnp');\n\tif (!root) return {};\n\n\treturn extractProfile(root);\n}\n\nfunction extractProfile(root: NhpElement): PnpProfile {\n\tconst profile: PnpProfile = {};\n\n\t// <display>\n\tconst displayEl = findChild(root, ['display']);\n\tif (displayEl) {\n\t\tprofile.display = {};\n\n\t\tconst colorSchemeEl = findChild(displayEl, ['colorscheme', 'color-scheme']);\n\t\tif (colorSchemeEl) {\n\t\t\tconst val = (colorSchemeEl.getAttribute('value') ?? colorSchemeEl.text ?? '').trim().toLowerCase();\n\t\t\tif (isColorScheme(val)) profile.display.colorScheme = val;\n\t\t}\n\n\t\tconst magEl = findChild(displayEl, ['magnification']);\n\t\tif (magEl) {\n\t\t\tconst val = parseFloat(magEl.getAttribute('value') ?? magEl.text ?? '');\n\t\t\tif (Number.isFinite(val) && val > 0) profile.display.magnification = val;\n\t\t}\n\t}\n\n\t// <content>\n\tconst contentEl = findChild(root, ['content']);\n\tif (contentEl) {\n\t\tprofile.content = {};\n\n\t\tconst glossaryEl = findChild(contentEl, ['glossaryonscreen', 'glossary-on-screen']);\n\t\tif (glossaryEl) {\n\t\t\tprofile.content.glossaryOnScreen = parseBool(glossaryEl.getAttribute('enabled') ?? glossaryEl.text ?? 'true');\n\t\t}\n\n\t\tconst kwEl = findChild(contentEl, ['keywordtranslation', 'keyword-translation']);\n\t\tif (kwEl) {\n\t\t\tconst active = parseBool(kwEl.getAttribute('active') ?? 'true');\n\t\t\tconst languageCode = (kwEl.getAttribute('languagecode') ?? kwEl.getAttribute('language-code') ?? kwEl.getAttribute('lang') ?? '').trim();\n\t\t\tif (languageCode) profile.content.keywordTranslation = { active, languageCode };\n\t\t}\n\n\t\tconst illustratedEl = findChild(contentEl, [\n\t\t\t'illustratedglossary',\n\t\t\t'illustrated-glossary',\n\t\t\t'ext:sbacglossaryillustration',\n\t\t\t'ext:sbac-glossary-illustration',\n\t\t]);\n\t\tif (illustratedEl) {\n\t\t\tprofile.content.illustratedGlossary = parseBool(\n\t\t\t\tillustratedEl.getAttribute('enabled') ?? illustratedEl.getAttribute('active') ?? illustratedEl.text ?? 'true'\n\t\t\t);\n\t\t}\n\n\t\tconst catalogSupportMap = [\n\t\t\t['ttsPronunciation', ['ttspronunciation', 'tts-pronunciation']],\n\t\t\t['signingDefinition', ['signingdefinition', 'signing-definition']],\n\t\t\t['brailleText', ['brailletext', 'braille-text']],\n\t\t\t['audioDescription', ['audiodescription', 'audio-description']],\n\t\t\t['extendedDescription', ['extendeddescription', 'extended-description']],\n\t\t] as const;\n\t\tfor (const [key, names] of catalogSupportMap) {\n\t\t\tconst el = findChild(contentEl, names);\n\t\t\tif (el) {\n\t\t\t\tprofile.content.catalogSupports ??= {};\n\t\t\t\tprofile.content.catalogSupports[key] = parseCatalogSupportPreference(el);\n\t\t\t}\n\t\t}\n\n\t\tfor (const el of findChildren(contentEl, ['catalogsupport', 'catalog-support', 'qti-catalog-support'])) {\n\t\t\tconst usage = normalizeCatalogUsage(\n\t\t\t\tel.getAttribute('usage') ?? el.getAttribute('support') ?? el.getAttribute('name') ?? ''\n\t\t\t);\n\t\t\tif (!usage) continue;\n\t\t\tconst key = catalogSupportPreferenceKey(usage);\n\t\t\tprofile.content.catalogSupports ??= {};\n\t\t\tprofile.content.catalogSupports[key] = parseCatalogSupportPreference(el);\n\t\t}\n\n\t\tconst etEl = findChild(contentEl, ['extendedtime', 'extended-time']);\n\t\tif (etEl) {\n\t\t\tconst active = parseBool(etEl.getAttribute('active') ?? 'true');\n\t\t\tconst rawMultiplier = etEl.getAttribute('multiplier') ?? etEl.text ?? '';\n\t\t\tconst multiplier = rawMultiplier.trim().toLowerCase() === 'infinity'\n\t\t\t\t? Infinity\n\t\t\t\t: parseFloat(rawMultiplier);\n\t\t\tif (Number.isFinite(multiplier) || multiplier === Infinity) {\n\t\t\t\tprofile.content.extendedTime = { active, multiplier };\n\t\t\t}\n\t\t}\n\t}\n\n\t// <cognitive>\n\tconst cogEl = findChild(root, ['cognitive']);\n\tif (cogEl) {\n\t\tprofile.cognitive = {};\n\n\t\tconst elTool = findChild(cogEl, ['eliminationtool', 'elimination-tool']);\n\t\tif (elTool) {\n\t\t\tprofile.cognitive.eliminationTool = parseBool(\n\t\t\t\telTool.getAttribute('enabled') ?? elTool.getAttribute('active') ?? elTool.text ?? 'true'\n\t\t\t);\n\t\t}\n\t}\n\n\treturn profile;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction findChild(parent: NhpElement, names: readonly string[]): NhpElement | null {\n\treturn findChildren(parent, names)[0] ?? null;\n}\n\nfunction findChildren(parent: NhpElement, names: readonly string[]): NhpElement[] {\n\tconst matches: NhpElement[] = [];\n\tfor (const child of parent.childNodes) {\n\t\tif (child.nodeType !== 1) continue; // element nodes only\n\t\tconst el = child as NhpElement;\n\t\tconst tag = (el.rawTagName ?? '').toLowerCase();\n\t\tif (names.includes(tag)) matches.push(el);\n\t}\n\treturn matches;\n}\n\nfunction parseBool(value: string): boolean {\n\tconst v = (value ?? '').trim().toLowerCase();\n\treturn v !== 'false' && v !== '0' && v !== 'no';\n}\n\nfunction parseCatalogSupportPreference(el: NhpElement): CatalogSupportPreference {\n\tconst active = parseBool(el.getAttribute('enabled') ?? el.getAttribute('active') ?? el.text ?? 'true');\n\tconst languageCode = normalizeLanguageCode(\n\t\tel.getAttribute('languagecode') ?? el.getAttribute('language-code') ?? el.getAttribute('lang') ?? ''\n\t);\n\treturn languageCode ? { active, languageCode } : active;\n}\n\ntype ColorScheme = PnpProfile['display'] extends { colorScheme?: infer C } ? Exclude<C, undefined> : never;\nconst COLOR_SCHEMES = new Set<string>([\n\t'default',\n\t'defaultreverse',\n\t'blackwhite',\n\t'whiteblack',\n\t'blackrose',\n\t'roseblack',\n\t'yellowblue',\n\t'blueyellow',\n\t'mgraydgray',\n\t'dgraymgray',\n\t'blackcyan',\n\t'cyanblack',\n\t'blackcream',\n\t'creamblack',\n\t'whitenav',\n\t'medgray',\n]);\nfunction isColorScheme(v: string): v is ColorScheme {\n\treturn COLOR_SCHEMES.has(v);\n}\n\nfunction normalizeCatalogUsage(value: string): string | null {\n\tconst usage = value.trim().toLowerCase();\n\tif (!/^[a-z][a-z0-9._-]*$/.test(usage)) return null;\n\treturn usage;\n}\n\nfunction normalizeLanguageCode(value: string): string | undefined {\n\tconst languageCode = value.trim();\n\tif (!languageCode) return undefined;\n\tif (!/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/.test(languageCode)) return undefined;\n\treturn languageCode;\n}\n\nfunction catalogSupportPreferenceKey(usage: string): string {\n\tswitch (usage) {\n\t\tcase 'tts-pronunciation':\n\t\t\treturn 'ttsPronunciation';\n\t\tcase 'signing-definition':\n\t\t\treturn 'signingDefinition';\n\t\tcase 'braille-text':\n\t\t\treturn 'brailleText';\n\t\tcase 'audio-description':\n\t\t\treturn 'audioDescription';\n\t\tcase 'extended-description':\n\t\t\treturn 'extendedDescription';\n\t\tdefault:\n\t\t\treturn usage;\n\t}\n}\n"]}
@@ -60,4 +60,3 @@ export interface CatalogSupportPreferenceOptions {
60
60
  /** Preferred catalog entry language for this support, such as "en-US" or "es". */
61
61
  languageCode?: string;
62
62
  }
63
- //# sourceMappingURL=types.d.ts.map
package/dist/pnp/types.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pnp/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * QTI 3.0 §6.2 Personal Needs and Preferences profile.\n * All fields are optional; absent means \"use platform default\".\n */\nexport interface PnpProfile {\n\tdisplay?: {\n\t\t/**\n\t\t * Named color scheme. Maps to the data-qti-colorscheme attribute on the player root.\n\t\t * 'default' or undefined → attribute removed (browser/host default).\n\t\t */\n\t\tcolorScheme?:\n\t\t\t| 'default'\n\t\t\t| 'defaultreverse'\n\t\t\t| 'blackwhite'\n\t\t\t| 'whiteblack'\n\t\t\t| 'blackrose'\n\t\t\t| 'roseblack'\n\t\t\t| 'yellowblue'\n\t\t\t| 'blueyellow'\n\t\t\t| 'mgraydgray'\n\t\t\t| 'dgraymgray'\n\t\t\t| 'blackcyan'\n\t\t\t| 'cyanblack'\n\t\t\t| 'blackcream'\n\t\t\t| 'creamblack'\n\t\t\t| 'whitenav'\n\t\t\t| 'medgray';\n\t\t/**\n\t\t * CSS zoom factor (1.0 = 100%). Deferred — set by browser zoom or host stylesheet.\n\t\t * Stored here for forward-compatibility but not yet applied by the player.\n\t\t */\n\t\tmagnification?: number;\n\t};\n\tcontent?: {\n\t\t/** Show glossary trigger buttons on [data-catalog-idref] terms (G-10). */\n\t\tglossaryOnScreen?: boolean;\n\t\t/** Show keyword-translation trigger buttons using the given language code. */\n\t\tkeywordTranslation?: { active: boolean; languageCode: string };\n\t\t/** Show illustrated glossary supports when catalog entries provide them. */\n\t\tillustratedGlossary?: boolean;\n\t\t/** Enable user-initiated host-routed catalog supports. */\n\t\tcatalogSupports?: CatalogSupportPreferences;\n\t\t/**\n\t\t * Scale assessment time limits. multiplier: 1.5 means 50% extra time.\n\t\t * multiplier: Infinity removes the time limit entirely.\n\t\t */\n\t\textendedTime?: { active: boolean; multiplier: number };\n\t};\n\tcognitive?: {\n\t\t/** Render per-choice elimination toggle buttons in choiceInteraction and orderInteraction. */\n\t\teliminationTool?: boolean;\n\t};\n}\n\nexport interface CatalogSupportPreferences {\n\tttsPronunciation?: CatalogSupportPreference;\n\tsigningDefinition?: CatalogSupportPreference;\n\tbrailleText?: CatalogSupportPreference;\n\taudioDescription?: CatalogSupportPreference;\n\textendedDescription?: CatalogSupportPreference;\n\t/**\n\t * Host-defined catalog usage names. Use QTI/catalog usage strings such as\n\t * \"custom-audio\" rather than DOM event names or implementation-specific APIs.\n\t */\n\t[usage: string]: CatalogSupportPreference | undefined;\n}\n\nexport type CatalogSupportPreference = boolean | CatalogSupportPreferenceOptions;\n\nexport interface CatalogSupportPreferenceOptions {\n\t/** Defaults to true when omitted. */\n\tactive?: boolean;\n\t/** Preferred catalog entry language for this support, such as \"en-US\" or \"es\". */\n\tlanguageCode?: string;\n}\n"]}
@@ -0,0 +1,53 @@
1
+ import type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';
2
+ import { type QtiHeuristicsConfig } from '@pie-qti/ims-cp-core';
3
+ import type { PnpProfile } from '../pnp/types.js';
4
+ import { type RoleCapabilities } from '../core/rolePolicy.js';
5
+ import type { InteractionData, HtmlContent, QTIRole } from '../types/index.js';
6
+ import { type InlineRenderSegment } from '../interactions/inline/render-plan.js';
7
+ export type ItemPresentationResponseValue = unknown;
8
+ export type ItemPresentationResponseMap = Record<string, ItemPresentationResponseValue>;
9
+ export interface ItemPresentationComponentRegistry {
10
+ getTagName(interaction: InteractionData): string;
11
+ }
12
+ export interface ItemPresentationPlayer {
13
+ getComponentRegistry(): ItemPresentationComponentRegistry;
14
+ getInteractionData(): InteractionData[];
15
+ getCorrectResponses(): Record<string, unknown>;
16
+ getItemBodyHtml(): HtmlContent;
17
+ getDeliveryContext(): ResolvedItemDeliveryContext | undefined;
18
+ sanitizeHtmlContent(html: string): string;
19
+ getPnp(): PnpProfile | undefined;
20
+ }
21
+ export interface CreateItemPresentationPlanOptions {
22
+ player: ItemPresentationPlayer;
23
+ responses?: ItemPresentationResponseMap;
24
+ disabled?: boolean;
25
+ role?: QTIRole;
26
+ outcomeValues?: Record<string, unknown>;
27
+ heuristicsConfig?: QtiHeuristicsConfig;
28
+ stimulusContent?: Record<string, string>;
29
+ deliveryContext?: ResolvedItemDeliveryContext;
30
+ itemBodyScopeSelector?: string;
31
+ onComponentError?: (interaction: InteractionData, error: unknown) => void;
32
+ }
33
+ export interface BlockInteractionPresentation {
34
+ interaction: InteractionData;
35
+ tagName: string;
36
+ key: string;
37
+ response: ItemPresentationResponseValue | null;
38
+ correctResponse: unknown;
39
+ pnp: PnpProfile | undefined;
40
+ eliminationTool: boolean;
41
+ disabled: boolean;
42
+ componentRole: 'scorer' | undefined;
43
+ }
44
+ export interface ItemPresentationPlan {
45
+ roleCapabilities: RoleCapabilities;
46
+ effectiveDisabled: boolean;
47
+ correctResponses: Record<string, unknown>;
48
+ itemBodyHtml: string;
49
+ inlineSegments: InlineRenderSegment[];
50
+ blockInteractions: BlockInteractionPresentation[];
51
+ }
52
+ export declare function createItemPresentationPlan({ player, responses, disabled, role, outcomeValues, heuristicsConfig, stimulusContent, deliveryContext, itemBodyScopeSelector, onComponentError, }: CreateItemPresentationPlanOptions): ItemPresentationPlan;
53
+ export declare function interactionKey(interaction: InteractionData): string;
@@ -0,0 +1,98 @@
1
+ import { normalizeHeuristicsConfig, } from '@pie-qti/ims-cp-core';
2
+ import { getRoleCapabilities } from '../core/rolePolicy.js';
3
+ import { processFeedbackInline } from '../components/utils/feedbackUtils.js';
4
+ import { buildScopedStylesheetCss } from '../components/utils/stylesheetRender.js';
5
+ import { buildEffectiveStimulusContent, injectStimulusContent } from '../components/utils/stimulusRender.js';
6
+ import { createInlineRenderPlan, isInlineInteractionTagName, isInlineInteractionType, } from '../interactions/inline/render-plan.js';
7
+ export function createItemPresentationPlan({ player, responses = {}, disabled = false, role = 'candidate', outcomeValues = {}, heuristicsConfig, stimulusContent = {}, deliveryContext, itemBodyScopeSelector = '[data-qti-item-body-scope]', onComponentError, }) {
8
+ const interactions = player.getInteractionData();
9
+ const roleCapabilities = getRoleCapabilities(role);
10
+ const effectiveDisabled = disabled || roleCapabilities.isReadOnly;
11
+ const correctResponses = roleCapabilities.canViewCorrectResponses ? player.getCorrectResponses() : {};
12
+ const itemBodyHtml = buildItemBodyPresentationHtml({
13
+ player,
14
+ outcomeValues,
15
+ heuristicsConfig,
16
+ stimulusContent,
17
+ deliveryContext,
18
+ itemBodyScopeSelector,
19
+ });
20
+ return {
21
+ roleCapabilities,
22
+ effectiveDisabled,
23
+ correctResponses,
24
+ itemBodyHtml,
25
+ inlineSegments: createInlineRenderPlan(itemBodyHtml, interactions),
26
+ blockInteractions: createBlockInteractionPresentations({
27
+ interactions,
28
+ player,
29
+ responses,
30
+ correctResponses,
31
+ roleCapabilities,
32
+ effectiveDisabled,
33
+ onComponentError,
34
+ }),
35
+ };
36
+ }
37
+ function buildItemBodyPresentationHtml({ player, outcomeValues, heuristicsConfig, stimulusContent, deliveryContext, itemBodyScopeSelector, }) {
38
+ let html = String(player.getItemBodyHtml());
39
+ const resolvedDeliveryContext = deliveryContext ?? player.getDeliveryContext();
40
+ const stylesheetCss = buildScopedStylesheetCss(resolvedDeliveryContext, itemBodyScopeSelector);
41
+ const effectiveStimulusContent = buildEffectiveStimulusContent(resolvedDeliveryContext, stimulusContent, (content) => player.sanitizeHtmlContent(content));
42
+ html = injectStimulusContent(html, effectiveStimulusContent);
43
+ if (stylesheetCss) {
44
+ html = `<style data-qti-stylesheets="resolved">${stylesheetCss}</style>${html}`;
45
+ }
46
+ const heuristics = normalizeHeuristicsConfig(heuristicsConfig);
47
+ html = processFeedbackInline(html, {
48
+ outcomeValues,
49
+ applyHeuristics: heuristics.feedbackTextFormatting,
50
+ wrapWithSpan: false,
51
+ });
52
+ return hideBlockInteractionMarkup(html);
53
+ }
54
+ function hideBlockInteractionMarkup(html) {
55
+ return html.replace(/<(\w+Interaction|qti-[\w-]+-interaction)(\s[^>]*)?>[\s\S]*?<\/\1>/gi, (match, tagName) => {
56
+ const lower = tagName.toLowerCase();
57
+ if (isInlineInteractionTagName(lower))
58
+ return match;
59
+ return `<span class="qti-hidden-interaction">${match}</span>`;
60
+ });
61
+ }
62
+ function createBlockInteractionPresentations({ interactions, player, responses, correctResponses, roleCapabilities, effectiveDisabled, onComponentError, }) {
63
+ const componentRegistry = player.getComponentRegistry();
64
+ return interactions
65
+ .filter((interaction) => !isInlineInteractionType(interaction.type))
66
+ .map((interaction) => {
67
+ try {
68
+ const block = {
69
+ interaction,
70
+ tagName: componentRegistry.getTagName(interaction),
71
+ key: interactionKey(interaction),
72
+ response: responses[interaction.responseId] ?? null,
73
+ correctResponse: roleCapabilities.canViewCorrectResponses
74
+ ? (correctResponses[interaction.responseId] ?? null)
75
+ : null,
76
+ pnp: player.getPnp(),
77
+ eliminationTool: player.getPnp()?.cognitive?.eliminationTool === true,
78
+ disabled: effectiveDisabled,
79
+ componentRole: roleCapabilities.canViewCorrectResponses ? 'scorer' : undefined,
80
+ };
81
+ return block;
82
+ }
83
+ catch (error) {
84
+ onComponentError?.(interaction, error);
85
+ return null;
86
+ }
87
+ })
88
+ .filter((item) => item !== null);
89
+ }
90
+ export function interactionKey(interaction) {
91
+ const anyInteraction = interaction;
92
+ const ids = Array.isArray(anyInteraction?.choices) && anyInteraction.choices.length > 0
93
+ ? anyInteraction.choices.map((choice) => choice?.identifier).filter(Boolean).join(',')
94
+ : '';
95
+ const prompt = typeof anyInteraction?.prompt === 'string' ? anyInteraction.prompt : '';
96
+ return `${interaction.type}|${interaction.responseId}|${ids}|${prompt}`;
97
+ }
98
+ //# sourceMappingURL=itemPresentationPlan.js.map