@pie-qti/item-player 0.1.10 → 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 (572) hide show
  1. package/dist/catalog/applyGlossaryTriggers.d.ts +0 -1
  2. package/dist/catalog/applyGlossaryTriggers.js +1 -0
  3. package/dist/catalog/applyGlossaryTriggers.js.map +1 -0
  4. package/dist/catalog/catalogExtractor.d.ts +0 -1
  5. package/dist/catalog/catalogExtractor.js +1 -0
  6. package/dist/catalog/catalogExtractor.js.map +1 -0
  7. package/dist/catalog/catalogLookup.d.ts +0 -1
  8. package/dist/catalog/catalogLookup.js +1 -0
  9. package/dist/catalog/catalogLookup.js.map +1 -0
  10. package/dist/catalog/glossaryAction.d.ts +0 -1
  11. package/dist/catalog/glossaryAction.js +1 -0
  12. package/dist/catalog/glossaryAction.js.map +1 -0
  13. package/dist/catalog/types.d.ts +0 -1
  14. package/dist/catalog/types.js +1 -0
  15. package/dist/catalog/types.js.map +1 -0
  16. package/dist/components/actions/typesetAction.d.ts +0 -1
  17. package/dist/components/actions/typesetAction.js +1 -0
  18. package/dist/components/actions/typesetAction.js.map +1 -0
  19. package/dist/components/utils/feedbackUtils.d.ts +0 -1
  20. package/dist/components/utils/feedbackUtils.js +1 -0
  21. package/dist/components/utils/feedbackUtils.js.map +1 -0
  22. package/dist/components/utils/index.d.ts +0 -1
  23. package/dist/components/utils/index.js +1 -0
  24. package/dist/components/utils/index.js.map +1 -0
  25. package/dist/components/utils/stimulusRender.d.ts +0 -1
  26. package/dist/components/utils/stimulusRender.js +1 -0
  27. package/dist/components/utils/stimulusRender.js.map +1 -0
  28. package/dist/components/utils/stylesheetRender.d.ts +0 -1
  29. package/dist/components/utils/stylesheetRender.js +1 -0
  30. package/dist/components/utils/stylesheetRender.js.map +1 -0
  31. package/dist/core/ComponentRegistry.d.ts +0 -1
  32. package/dist/core/ComponentRegistry.js +1 -0
  33. package/dist/core/ComponentRegistry.js.map +1 -0
  34. package/dist/core/Player.d.ts +0 -1
  35. package/dist/core/Player.js +1 -0
  36. package/dist/core/Player.js.map +1 -0
  37. package/dist/core/Plugin.d.ts +0 -1
  38. package/dist/core/Plugin.js +1 -0
  39. package/dist/core/Plugin.js.map +1 -0
  40. package/dist/core/PluginManager.d.ts +0 -1
  41. package/dist/core/PluginManager.js +1 -0
  42. package/dist/core/PluginManager.js.map +1 -0
  43. package/dist/core/constants.d.ts +0 -1
  44. package/dist/core/constants.js +1 -0
  45. package/dist/core/constants.js.map +1 -0
  46. package/dist/core/declarations.d.ts +0 -1
  47. package/dist/core/declarations.js +1 -0
  48. package/dist/core/declarations.js.map +1 -0
  49. package/dist/core/parsingLimits.d.ts +0 -1
  50. package/dist/core/parsingLimits.js +1 -0
  51. package/dist/core/parsingLimits.js.map +1 -0
  52. package/dist/core/random.d.ts +0 -1
  53. package/dist/core/random.js +1 -0
  54. package/dist/core/random.js.map +1 -0
  55. package/dist/core/rolePolicy.d.ts +0 -1
  56. package/dist/core/rolePolicy.js +1 -0
  57. package/dist/core/rolePolicy.js.map +1 -0
  58. package/dist/core/sanitizer.d.ts +0 -1
  59. package/dist/core/sanitizer.js +1 -0
  60. package/dist/core/sanitizer.js.map +1 -0
  61. package/dist/core/trustedTypes.d.ts +0 -1
  62. package/dist/core/trustedTypes.js +1 -0
  63. package/dist/core/trustedTypes.js.map +1 -0
  64. package/dist/core/urlPolicy.d.ts +0 -1
  65. package/dist/core/urlPolicy.js +1 -0
  66. package/dist/core/urlPolicy.js.map +1 -0
  67. package/dist/document/AssessmentItemDocument.d.ts +0 -1
  68. package/dist/document/AssessmentItemDocument.js +1 -0
  69. package/dist/document/AssessmentItemDocument.js.map +1 -0
  70. package/dist/element.js +8 -9
  71. package/dist/element.js.map +1 -1
  72. package/dist/extensions/MathLiveEditor.d.ts +0 -1
  73. package/dist/extensions/MathLiveEditor.js +1 -0
  74. package/dist/extensions/MathLiveEditor.js.map +1 -0
  75. package/dist/extraction/ExtractionRegistry.d.ts +0 -1
  76. package/dist/extraction/ExtractionRegistry.js +1 -0
  77. package/dist/extraction/ExtractionRegistry.js.map +1 -0
  78. package/dist/extraction/createContext.d.ts +0 -1
  79. package/dist/extraction/createContext.js +1 -0
  80. package/dist/extraction/createContext.js.map +1 -0
  81. package/dist/extraction/index.d.ts +0 -1
  82. package/dist/extraction/index.js +1 -0
  83. package/dist/extraction/index.js.map +1 -0
  84. package/dist/extraction/interactionExtractionPipeline.d.ts +0 -1
  85. package/dist/extraction/interactionExtractionPipeline.js +1 -0
  86. package/dist/extraction/interactionExtractionPipeline.js.map +1 -0
  87. package/dist/extraction/interactionSecurity.d.ts +0 -1
  88. package/dist/extraction/interactionSecurity.js +1 -0
  89. package/dist/extraction/interactionSecurity.js.map +1 -0
  90. package/dist/extraction/types.d.ts +0 -1
  91. package/dist/extraction/types.js +1 -0
  92. package/dist/extraction/types.js.map +1 -0
  93. package/dist/extraction/utils.d.ts +0 -1
  94. package/dist/extraction/utils.js +1 -0
  95. package/dist/extraction/utils.js.map +1 -0
  96. package/dist/iframe/IFramePlayerHost.d.ts +0 -1
  97. package/dist/iframe/IFramePlayerHost.js +1 -0
  98. package/dist/iframe/IFramePlayerHost.js.map +1 -0
  99. package/dist/iframe/index.d.ts +0 -1
  100. package/dist/iframe/index.js +1 -0
  101. package/dist/iframe/index.js.map +1 -0
  102. package/dist/iframe/protocol.d.ts +0 -1
  103. package/dist/iframe/protocol.js +1 -0
  104. package/dist/iframe/protocol.js.map +1 -0
  105. package/dist/index.d.ts +0 -1
  106. package/dist/index.js +1 -0
  107. package/dist/index.js.map +1 -0
  108. package/dist/interactions/associate/extractor.d.ts +0 -1
  109. package/dist/interactions/associate/extractor.js +1 -0
  110. package/dist/interactions/associate/extractor.js.map +1 -0
  111. package/dist/interactions/associate/index.d.ts +0 -1
  112. package/dist/interactions/associate/index.js +1 -0
  113. package/dist/interactions/associate/index.js.map +1 -0
  114. package/dist/interactions/associate/types.d.ts +0 -1
  115. package/dist/interactions/associate/types.js +1 -0
  116. package/dist/interactions/associate/types.js.map +1 -0
  117. package/dist/interactions/choice/extractor.d.ts +0 -1
  118. package/dist/interactions/choice/extractor.js +1 -0
  119. package/dist/interactions/choice/extractor.js.map +1 -0
  120. package/dist/interactions/choice/index.d.ts +0 -1
  121. package/dist/interactions/choice/index.js +1 -0
  122. package/dist/interactions/choice/index.js.map +1 -0
  123. package/dist/interactions/choice/types.d.ts +0 -1
  124. package/dist/interactions/choice/types.js +1 -0
  125. package/dist/interactions/choice/types.js.map +1 -0
  126. package/dist/interactions/custom/extractor.d.ts +0 -1
  127. package/dist/interactions/custom/extractor.js +1 -0
  128. package/dist/interactions/custom/extractor.js.map +1 -0
  129. package/dist/interactions/custom/index.d.ts +0 -1
  130. package/dist/interactions/custom/index.js +1 -0
  131. package/dist/interactions/custom/index.js.map +1 -0
  132. package/dist/interactions/custom/types.d.ts +0 -1
  133. package/dist/interactions/custom/types.js +1 -0
  134. package/dist/interactions/custom/types.js.map +1 -0
  135. package/dist/interactions/drawing/extractor.d.ts +0 -1
  136. package/dist/interactions/drawing/extractor.js +1 -0
  137. package/dist/interactions/drawing/extractor.js.map +1 -0
  138. package/dist/interactions/drawing/index.d.ts +0 -1
  139. package/dist/interactions/drawing/index.js +1 -0
  140. package/dist/interactions/drawing/index.js.map +1 -0
  141. package/dist/interactions/drawing/types.d.ts +0 -1
  142. package/dist/interactions/drawing/types.js +1 -0
  143. package/dist/interactions/drawing/types.js.map +1 -0
  144. package/dist/interactions/end-attempt/extractor.d.ts +0 -1
  145. package/dist/interactions/end-attempt/extractor.js +1 -0
  146. package/dist/interactions/end-attempt/extractor.js.map +1 -0
  147. package/dist/interactions/end-attempt/index.d.ts +0 -1
  148. package/dist/interactions/end-attempt/index.js +1 -0
  149. package/dist/interactions/end-attempt/index.js.map +1 -0
  150. package/dist/interactions/end-attempt/types.d.ts +0 -1
  151. package/dist/interactions/end-attempt/types.js +1 -0
  152. package/dist/interactions/end-attempt/types.js.map +1 -0
  153. package/dist/interactions/extended-text/extractor.d.ts +0 -1
  154. package/dist/interactions/extended-text/extractor.js +1 -0
  155. package/dist/interactions/extended-text/extractor.js.map +1 -0
  156. package/dist/interactions/extended-text/index.d.ts +0 -1
  157. package/dist/interactions/extended-text/index.js +1 -0
  158. package/dist/interactions/extended-text/index.js.map +1 -0
  159. package/dist/interactions/extended-text/types.d.ts +0 -1
  160. package/dist/interactions/extended-text/types.js +1 -0
  161. package/dist/interactions/extended-text/types.js.map +1 -0
  162. package/dist/interactions/gap-match/extractor.d.ts +0 -1
  163. package/dist/interactions/gap-match/extractor.js +1 -0
  164. package/dist/interactions/gap-match/extractor.js.map +1 -0
  165. package/dist/interactions/gap-match/index.d.ts +0 -1
  166. package/dist/interactions/gap-match/index.js +1 -0
  167. package/dist/interactions/gap-match/index.js.map +1 -0
  168. package/dist/interactions/gap-match/types.d.ts +0 -1
  169. package/dist/interactions/gap-match/types.js +1 -0
  170. package/dist/interactions/gap-match/types.js.map +1 -0
  171. package/dist/interactions/graphic-associate/extractor.d.ts +0 -1
  172. package/dist/interactions/graphic-associate/extractor.js +1 -0
  173. package/dist/interactions/graphic-associate/extractor.js.map +1 -0
  174. package/dist/interactions/graphic-associate/index.d.ts +0 -1
  175. package/dist/interactions/graphic-associate/index.js +1 -0
  176. package/dist/interactions/graphic-associate/index.js.map +1 -0
  177. package/dist/interactions/graphic-associate/types.d.ts +0 -1
  178. package/dist/interactions/graphic-associate/types.js +1 -0
  179. package/dist/interactions/graphic-associate/types.js.map +1 -0
  180. package/dist/interactions/graphic-gap-match/extractor.d.ts +0 -1
  181. package/dist/interactions/graphic-gap-match/extractor.js +1 -0
  182. package/dist/interactions/graphic-gap-match/extractor.js.map +1 -0
  183. package/dist/interactions/graphic-gap-match/index.d.ts +0 -1
  184. package/dist/interactions/graphic-gap-match/index.js +1 -0
  185. package/dist/interactions/graphic-gap-match/index.js.map +1 -0
  186. package/dist/interactions/graphic-gap-match/types.d.ts +0 -1
  187. package/dist/interactions/graphic-gap-match/types.js +1 -0
  188. package/dist/interactions/graphic-gap-match/types.js.map +1 -0
  189. package/dist/interactions/graphic-order/extractor.d.ts +0 -1
  190. package/dist/interactions/graphic-order/extractor.js +1 -0
  191. package/dist/interactions/graphic-order/extractor.js.map +1 -0
  192. package/dist/interactions/graphic-order/index.d.ts +0 -1
  193. package/dist/interactions/graphic-order/index.js +1 -0
  194. package/dist/interactions/graphic-order/index.js.map +1 -0
  195. package/dist/interactions/graphic-order/types.d.ts +0 -1
  196. package/dist/interactions/graphic-order/types.js +1 -0
  197. package/dist/interactions/graphic-order/types.js.map +1 -0
  198. package/dist/interactions/hotspot/extractor.d.ts +0 -1
  199. package/dist/interactions/hotspot/extractor.js +1 -0
  200. package/dist/interactions/hotspot/extractor.js.map +1 -0
  201. package/dist/interactions/hotspot/index.d.ts +0 -1
  202. package/dist/interactions/hotspot/index.js +1 -0
  203. package/dist/interactions/hotspot/index.js.map +1 -0
  204. package/dist/interactions/hotspot/types.d.ts +0 -1
  205. package/dist/interactions/hotspot/types.js +1 -0
  206. package/dist/interactions/hotspot/types.js.map +1 -0
  207. package/dist/interactions/hottext/extractor.d.ts +0 -1
  208. package/dist/interactions/hottext/extractor.js +1 -0
  209. package/dist/interactions/hottext/extractor.js.map +1 -0
  210. package/dist/interactions/hottext/index.d.ts +0 -1
  211. package/dist/interactions/hottext/index.js +1 -0
  212. package/dist/interactions/hottext/index.js.map +1 -0
  213. package/dist/interactions/hottext/types.d.ts +0 -1
  214. package/dist/interactions/hottext/types.js +1 -0
  215. package/dist/interactions/hottext/types.js.map +1 -0
  216. package/dist/interactions/index.d.ts +0 -1
  217. package/dist/interactions/index.js +1 -0
  218. package/dist/interactions/index.js.map +1 -0
  219. package/dist/interactions/inline/index.d.ts +0 -1
  220. package/dist/interactions/inline/index.js +1 -0
  221. package/dist/interactions/inline/index.js.map +1 -0
  222. package/dist/interactions/inline/render-plan.d.ts +0 -1
  223. package/dist/interactions/inline/render-plan.js +1 -0
  224. package/dist/interactions/inline/render-plan.js.map +1 -0
  225. package/dist/interactions/inline-choice/extractor.d.ts +0 -1
  226. package/dist/interactions/inline-choice/extractor.js +1 -0
  227. package/dist/interactions/inline-choice/extractor.js.map +1 -0
  228. package/dist/interactions/inline-choice/index.d.ts +0 -1
  229. package/dist/interactions/inline-choice/index.js +1 -0
  230. package/dist/interactions/inline-choice/index.js.map +1 -0
  231. package/dist/interactions/inline-choice/types.d.ts +0 -1
  232. package/dist/interactions/inline-choice/types.js +1 -0
  233. package/dist/interactions/inline-choice/types.js.map +1 -0
  234. package/dist/interactions/match/extractor.d.ts +0 -1
  235. package/dist/interactions/match/extractor.js +1 -0
  236. package/dist/interactions/match/extractor.js.map +1 -0
  237. package/dist/interactions/match/index.d.ts +0 -1
  238. package/dist/interactions/match/index.js +1 -0
  239. package/dist/interactions/match/index.js.map +1 -0
  240. package/dist/interactions/match/types.d.ts +0 -1
  241. package/dist/interactions/match/types.js +1 -0
  242. package/dist/interactions/match/types.js.map +1 -0
  243. package/dist/interactions/media/extractor.d.ts +0 -1
  244. package/dist/interactions/media/extractor.js +1 -0
  245. package/dist/interactions/media/extractor.js.map +1 -0
  246. package/dist/interactions/media/index.d.ts +0 -1
  247. package/dist/interactions/media/index.js +1 -0
  248. package/dist/interactions/media/index.js.map +1 -0
  249. package/dist/interactions/media/types.d.ts +0 -1
  250. package/dist/interactions/media/types.js +1 -0
  251. package/dist/interactions/media/types.js.map +1 -0
  252. package/dist/interactions/modules.d.ts +0 -1
  253. package/dist/interactions/modules.js +1 -0
  254. package/dist/interactions/modules.js.map +1 -0
  255. package/dist/interactions/order/extractor.d.ts +0 -1
  256. package/dist/interactions/order/extractor.js +1 -0
  257. package/dist/interactions/order/extractor.js.map +1 -0
  258. package/dist/interactions/order/index.d.ts +0 -1
  259. package/dist/interactions/order/index.js +1 -0
  260. package/dist/interactions/order/index.js.map +1 -0
  261. package/dist/interactions/order/types.d.ts +0 -1
  262. package/dist/interactions/order/types.js +1 -0
  263. package/dist/interactions/order/types.js.map +1 -0
  264. package/dist/interactions/portable-custom/extractor.d.ts +0 -1
  265. package/dist/interactions/portable-custom/extractor.js +1 -0
  266. package/dist/interactions/portable-custom/extractor.js.map +1 -0
  267. package/dist/interactions/portable-custom/index.d.ts +0 -1
  268. package/dist/interactions/portable-custom/index.js +1 -0
  269. package/dist/interactions/portable-custom/index.js.map +1 -0
  270. package/dist/interactions/portable-custom/types.d.ts +0 -1
  271. package/dist/interactions/portable-custom/types.js +1 -0
  272. package/dist/interactions/portable-custom/types.js.map +1 -0
  273. package/dist/interactions/position-object/extractor.d.ts +0 -1
  274. package/dist/interactions/position-object/extractor.js +1 -0
  275. package/dist/interactions/position-object/extractor.js.map +1 -0
  276. package/dist/interactions/position-object/index.d.ts +0 -1
  277. package/dist/interactions/position-object/index.js +1 -0
  278. package/dist/interactions/position-object/index.js.map +1 -0
  279. package/dist/interactions/position-object/types.d.ts +0 -1
  280. package/dist/interactions/position-object/types.js +1 -0
  281. package/dist/interactions/position-object/types.js.map +1 -0
  282. package/dist/interactions/select-point/extractor.d.ts +0 -1
  283. package/dist/interactions/select-point/extractor.js +1 -0
  284. package/dist/interactions/select-point/extractor.js.map +1 -0
  285. package/dist/interactions/select-point/index.d.ts +0 -1
  286. package/dist/interactions/select-point/index.js +1 -0
  287. package/dist/interactions/select-point/index.js.map +1 -0
  288. package/dist/interactions/select-point/types.d.ts +0 -1
  289. package/dist/interactions/select-point/types.js +1 -0
  290. package/dist/interactions/select-point/types.js.map +1 -0
  291. package/dist/interactions/shared/index.d.ts +0 -1
  292. package/dist/interactions/shared/index.js +1 -0
  293. package/dist/interactions/shared/index.js.map +1 -0
  294. package/dist/interactions/shared/types.d.ts +0 -1
  295. package/dist/interactions/shared/types.js +1 -0
  296. package/dist/interactions/shared/types.js.map +1 -0
  297. package/dist/interactions/slider/extractor.d.ts +0 -1
  298. package/dist/interactions/slider/extractor.js +1 -0
  299. package/dist/interactions/slider/extractor.js.map +1 -0
  300. package/dist/interactions/slider/index.d.ts +0 -1
  301. package/dist/interactions/slider/index.js +1 -0
  302. package/dist/interactions/slider/index.js.map +1 -0
  303. package/dist/interactions/slider/types.d.ts +0 -1
  304. package/dist/interactions/slider/types.js +1 -0
  305. package/dist/interactions/slider/types.js.map +1 -0
  306. package/dist/interactions/text-entry/extractor.d.ts +0 -1
  307. package/dist/interactions/text-entry/extractor.js +1 -0
  308. package/dist/interactions/text-entry/extractor.js.map +1 -0
  309. package/dist/interactions/text-entry/index.d.ts +0 -1
  310. package/dist/interactions/text-entry/index.js +1 -0
  311. package/dist/interactions/text-entry/index.js.map +1 -0
  312. package/dist/interactions/text-entry/types.d.ts +0 -1
  313. package/dist/interactions/text-entry/types.js +1 -0
  314. package/dist/interactions/text-entry/types.js.map +1 -0
  315. package/dist/interactions/upload/extractor.d.ts +0 -1
  316. package/dist/interactions/upload/extractor.js +1 -0
  317. package/dist/interactions/upload/extractor.js.map +1 -0
  318. package/dist/interactions/upload/index.d.ts +0 -1
  319. package/dist/interactions/upload/index.js +1 -0
  320. package/dist/interactions/upload/index.js.map +1 -0
  321. package/dist/interactions/upload/types.d.ts +0 -1
  322. package/dist/interactions/upload/types.js +1 -0
  323. package/dist/interactions/upload/types.js.map +1 -0
  324. package/dist/pci/PciHost.d.ts +0 -1
  325. package/dist/pci/PciHost.js +1 -0
  326. package/dist/pci/PciHost.js.map +1 -0
  327. package/dist/pci/types.d.ts +0 -1
  328. package/dist/pci/types.js +1 -0
  329. package/dist/pci/types.js.map +1 -0
  330. package/dist/pnp/applyPnp.d.ts +0 -1
  331. package/dist/pnp/applyPnp.js +1 -0
  332. package/dist/pnp/applyPnp.js.map +1 -0
  333. package/dist/pnp/parsePnpXml.d.ts +0 -1
  334. package/dist/pnp/parsePnpXml.js +1 -0
  335. package/dist/pnp/parsePnpXml.js.map +1 -0
  336. package/dist/pnp/types.d.ts +0 -1
  337. package/dist/pnp/types.js +1 -0
  338. package/dist/pnp/types.js.map +1 -0
  339. package/dist/presentation/itemPresentationPlan.d.ts +0 -1
  340. package/dist/presentation/itemPresentationPlan.js +2 -2
  341. package/dist/presentation/itemPresentationPlan.js.map +1 -0
  342. package/dist/server.d.ts +0 -1
  343. package/dist/server.js +1 -0
  344. package/dist/server.js.map +1 -0
  345. package/dist/types/index.d.ts +0 -1
  346. package/dist/types/index.js +1 -0
  347. package/dist/types/index.js.map +1 -0
  348. package/dist/types/responseValidation.d.ts +0 -1
  349. package/dist/types/responseValidation.js +1 -0
  350. package/dist/types/responseValidation.js.map +1 -0
  351. package/dist/utils/PerformanceMonitor.d.ts +0 -1
  352. package/dist/utils/PerformanceMonitor.js +1 -0
  353. package/dist/utils/PerformanceMonitor.js.map +1 -0
  354. package/dist/utils/drawingUtils.d.ts +0 -1
  355. package/dist/utils/drawingUtils.js +1 -0
  356. package/dist/utils/drawingUtils.js.map +1 -0
  357. package/dist/utils/responseUtils.d.ts +0 -1
  358. package/dist/utils/responseUtils.js +1 -0
  359. package/dist/utils/responseUtils.js.map +1 -0
  360. package/dist/web-components/QTIInteractionBase.d.ts +0 -1
  361. package/dist/web-components/QTIInteractionBase.js +1 -0
  362. package/dist/web-components/QTIInteractionBase.js.map +1 -0
  363. package/dist/web-components/QTIInteractionElement.d.ts +0 -1
  364. package/dist/web-components/QTIInteractionElement.js +1 -0
  365. package/dist/web-components/QTIInteractionElement.js.map +1 -0
  366. package/dist/web-components/index.d.ts +0 -1
  367. package/dist/web-components/index.js +1 -0
  368. package/dist/web-components/index.js.map +1 -0
  369. package/package.json +6 -6
  370. package/dist/catalog/applyGlossaryTriggers.d.ts.map +0 -1
  371. package/dist/catalog/catalogExtractor.d.ts.map +0 -1
  372. package/dist/catalog/catalogLookup.d.ts.map +0 -1
  373. package/dist/catalog/glossaryAction.d.ts.map +0 -1
  374. package/dist/catalog/types.d.ts.map +0 -1
  375. package/dist/components/actions/typesetAction.d.ts.map +0 -1
  376. package/dist/components/utils/assignProps.d.ts +0 -2
  377. package/dist/components/utils/assignProps.d.ts.map +0 -1
  378. package/dist/components/utils/assignProps.js +0 -1
  379. package/dist/components/utils/feedbackUtils.d.ts.map +0 -1
  380. package/dist/components/utils/index.d.ts.map +0 -1
  381. package/dist/components/utils/stimulusRender.d.ts.map +0 -1
  382. package/dist/components/utils/stylesheetRender.d.ts.map +0 -1
  383. package/dist/core/ComponentRegistry.d.ts.map +0 -1
  384. package/dist/core/ItemRenderer.d.ts +0 -91
  385. package/dist/core/ItemRenderer.d.ts.map +0 -1
  386. package/dist/core/ItemRenderer.js +0 -248
  387. package/dist/core/Player.d.ts.map +0 -1
  388. package/dist/core/Plugin.d.ts.map +0 -1
  389. package/dist/core/PluginManager.d.ts.map +0 -1
  390. package/dist/core/constants.d.ts.map +0 -1
  391. package/dist/core/declarations.d.ts.map +0 -1
  392. package/dist/core/parsingLimits.d.ts.map +0 -1
  393. package/dist/core/random.d.ts.map +0 -1
  394. package/dist/core/rolePolicy.d.ts.map +0 -1
  395. package/dist/core/sanitizer.d.ts.map +0 -1
  396. package/dist/core/trustedTypes.d.ts.map +0 -1
  397. package/dist/core/urlPolicy.d.ts.map +0 -1
  398. package/dist/document/AssessmentItemDocument.d.ts.map +0 -1
  399. package/dist/extensions/MathLiveEditor.d.ts.map +0 -1
  400. package/dist/extraction/ExtractionRegistry.d.ts.map +0 -1
  401. package/dist/extraction/createContext.d.ts.map +0 -1
  402. package/dist/extraction/extractors/associateExtractor.d.ts +0 -2
  403. package/dist/extraction/extractors/associateExtractor.d.ts.map +0 -1
  404. package/dist/extraction/extractors/associateExtractor.js +0 -1
  405. package/dist/extraction/extractors/choiceExtractor.d.ts +0 -2
  406. package/dist/extraction/extractors/choiceExtractor.d.ts.map +0 -1
  407. package/dist/extraction/extractors/choiceExtractor.js +0 -1
  408. package/dist/extraction/extractors/customExtractor.d.ts +0 -2
  409. package/dist/extraction/extractors/customExtractor.d.ts.map +0 -1
  410. package/dist/extraction/extractors/customExtractor.js +0 -1
  411. package/dist/extraction/extractors/drawingExtractor.d.ts +0 -2
  412. package/dist/extraction/extractors/drawingExtractor.d.ts.map +0 -1
  413. package/dist/extraction/extractors/drawingExtractor.js +0 -1
  414. package/dist/extraction/extractors/endAttemptExtractor.d.ts +0 -2
  415. package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +0 -1
  416. package/dist/extraction/extractors/endAttemptExtractor.js +0 -1
  417. package/dist/extraction/extractors/extendedTextExtractor.d.ts +0 -2
  418. package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +0 -1
  419. package/dist/extraction/extractors/extendedTextExtractor.js +0 -1
  420. package/dist/extraction/extractors/gapMatchExtractor.d.ts +0 -2
  421. package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +0 -1
  422. package/dist/extraction/extractors/gapMatchExtractor.js +0 -1
  423. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +0 -2
  424. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +0 -1
  425. package/dist/extraction/extractors/graphicAssociateExtractor.js +0 -1
  426. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +0 -2
  427. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +0 -1
  428. package/dist/extraction/extractors/graphicGapMatchExtractor.js +0 -1
  429. package/dist/extraction/extractors/graphicOrderExtractor.d.ts +0 -2
  430. package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +0 -1
  431. package/dist/extraction/extractors/graphicOrderExtractor.js +0 -1
  432. package/dist/extraction/extractors/hotspotExtractor.d.ts +0 -2
  433. package/dist/extraction/extractors/hotspotExtractor.d.ts.map +0 -1
  434. package/dist/extraction/extractors/hotspotExtractor.js +0 -1
  435. package/dist/extraction/extractors/hottextExtractor.d.ts +0 -2
  436. package/dist/extraction/extractors/hottextExtractor.d.ts.map +0 -1
  437. package/dist/extraction/extractors/hottextExtractor.js +0 -1
  438. package/dist/extraction/extractors/index.d.ts +0 -9
  439. package/dist/extraction/extractors/index.d.ts.map +0 -1
  440. package/dist/extraction/extractors/index.js +0 -8
  441. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +0 -2
  442. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +0 -1
  443. package/dist/extraction/extractors/inlineChoiceExtractor.js +0 -1
  444. package/dist/extraction/extractors/matchExtractor.d.ts +0 -2
  445. package/dist/extraction/extractors/matchExtractor.d.ts.map +0 -1
  446. package/dist/extraction/extractors/matchExtractor.js +0 -1
  447. package/dist/extraction/extractors/mediaExtractor.d.ts +0 -2
  448. package/dist/extraction/extractors/mediaExtractor.d.ts.map +0 -1
  449. package/dist/extraction/extractors/mediaExtractor.js +0 -1
  450. package/dist/extraction/extractors/orderExtractor.d.ts +0 -2
  451. package/dist/extraction/extractors/orderExtractor.d.ts.map +0 -1
  452. package/dist/extraction/extractors/orderExtractor.js +0 -1
  453. package/dist/extraction/extractors/portableCustomExtractor.d.ts +0 -2
  454. package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +0 -1
  455. package/dist/extraction/extractors/portableCustomExtractor.js +0 -1
  456. package/dist/extraction/extractors/positionObjectExtractor.d.ts +0 -2
  457. package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +0 -1
  458. package/dist/extraction/extractors/positionObjectExtractor.js +0 -1
  459. package/dist/extraction/extractors/selectPointExtractor.d.ts +0 -2
  460. package/dist/extraction/extractors/selectPointExtractor.d.ts.map +0 -1
  461. package/dist/extraction/extractors/selectPointExtractor.js +0 -1
  462. package/dist/extraction/extractors/sliderExtractor.d.ts +0 -2
  463. package/dist/extraction/extractors/sliderExtractor.d.ts.map +0 -1
  464. package/dist/extraction/extractors/sliderExtractor.js +0 -1
  465. package/dist/extraction/extractors/textEntryExtractor.d.ts +0 -2
  466. package/dist/extraction/extractors/textEntryExtractor.d.ts.map +0 -1
  467. package/dist/extraction/extractors/textEntryExtractor.js +0 -1
  468. package/dist/extraction/extractors/uploadExtractor.d.ts +0 -2
  469. package/dist/extraction/extractors/uploadExtractor.d.ts.map +0 -1
  470. package/dist/extraction/extractors/uploadExtractor.js +0 -1
  471. package/dist/extraction/index.d.ts.map +0 -1
  472. package/dist/extraction/interactionExtractionPipeline.d.ts.map +0 -1
  473. package/dist/extraction/interactionSecurity.d.ts.map +0 -1
  474. package/dist/extraction/types.d.ts.map +0 -1
  475. package/dist/extraction/utils.d.ts.map +0 -1
  476. package/dist/iframe/IFramePlayerHost.d.ts.map +0 -1
  477. package/dist/iframe/index.d.ts.map +0 -1
  478. package/dist/iframe/protocol.d.ts.map +0 -1
  479. package/dist/index.d.ts.map +0 -1
  480. package/dist/interactions/associate/extractor.d.ts.map +0 -1
  481. package/dist/interactions/associate/index.d.ts.map +0 -1
  482. package/dist/interactions/associate/types.d.ts.map +0 -1
  483. package/dist/interactions/choice/extractor.d.ts.map +0 -1
  484. package/dist/interactions/choice/index.d.ts.map +0 -1
  485. package/dist/interactions/choice/types.d.ts.map +0 -1
  486. package/dist/interactions/custom/extractor.d.ts.map +0 -1
  487. package/dist/interactions/custom/index.d.ts.map +0 -1
  488. package/dist/interactions/custom/types.d.ts.map +0 -1
  489. package/dist/interactions/drawing/extractor.d.ts.map +0 -1
  490. package/dist/interactions/drawing/index.d.ts.map +0 -1
  491. package/dist/interactions/drawing/types.d.ts.map +0 -1
  492. package/dist/interactions/end-attempt/extractor.d.ts.map +0 -1
  493. package/dist/interactions/end-attempt/index.d.ts.map +0 -1
  494. package/dist/interactions/end-attempt/types.d.ts.map +0 -1
  495. package/dist/interactions/extended-text/extractor.d.ts.map +0 -1
  496. package/dist/interactions/extended-text/index.d.ts.map +0 -1
  497. package/dist/interactions/extended-text/types.d.ts.map +0 -1
  498. package/dist/interactions/gap-match/extractor.d.ts.map +0 -1
  499. package/dist/interactions/gap-match/index.d.ts.map +0 -1
  500. package/dist/interactions/gap-match/types.d.ts.map +0 -1
  501. package/dist/interactions/graphic-associate/extractor.d.ts.map +0 -1
  502. package/dist/interactions/graphic-associate/index.d.ts.map +0 -1
  503. package/dist/interactions/graphic-associate/types.d.ts.map +0 -1
  504. package/dist/interactions/graphic-gap-match/extractor.d.ts.map +0 -1
  505. package/dist/interactions/graphic-gap-match/index.d.ts.map +0 -1
  506. package/dist/interactions/graphic-gap-match/types.d.ts.map +0 -1
  507. package/dist/interactions/graphic-order/extractor.d.ts.map +0 -1
  508. package/dist/interactions/graphic-order/index.d.ts.map +0 -1
  509. package/dist/interactions/graphic-order/types.d.ts.map +0 -1
  510. package/dist/interactions/hotspot/extractor.d.ts.map +0 -1
  511. package/dist/interactions/hotspot/index.d.ts.map +0 -1
  512. package/dist/interactions/hotspot/types.d.ts.map +0 -1
  513. package/dist/interactions/hottext/extractor.d.ts.map +0 -1
  514. package/dist/interactions/hottext/index.d.ts.map +0 -1
  515. package/dist/interactions/hottext/types.d.ts.map +0 -1
  516. package/dist/interactions/index.d.ts.map +0 -1
  517. package/dist/interactions/inline/index.d.ts.map +0 -1
  518. package/dist/interactions/inline/render-plan.d.ts.map +0 -1
  519. package/dist/interactions/inline-choice/extractor.d.ts.map +0 -1
  520. package/dist/interactions/inline-choice/index.d.ts.map +0 -1
  521. package/dist/interactions/inline-choice/types.d.ts.map +0 -1
  522. package/dist/interactions/match/extractor.d.ts.map +0 -1
  523. package/dist/interactions/match/index.d.ts.map +0 -1
  524. package/dist/interactions/match/types.d.ts.map +0 -1
  525. package/dist/interactions/media/extractor.d.ts.map +0 -1
  526. package/dist/interactions/media/index.d.ts.map +0 -1
  527. package/dist/interactions/media/types.d.ts.map +0 -1
  528. package/dist/interactions/modules.d.ts.map +0 -1
  529. package/dist/interactions/order/extractor.d.ts.map +0 -1
  530. package/dist/interactions/order/index.d.ts.map +0 -1
  531. package/dist/interactions/order/types.d.ts.map +0 -1
  532. package/dist/interactions/portable-custom/extractor.d.ts.map +0 -1
  533. package/dist/interactions/portable-custom/index.d.ts.map +0 -1
  534. package/dist/interactions/portable-custom/types.d.ts.map +0 -1
  535. package/dist/interactions/position-object/extractor.d.ts.map +0 -1
  536. package/dist/interactions/position-object/index.d.ts.map +0 -1
  537. package/dist/interactions/position-object/types.d.ts.map +0 -1
  538. package/dist/interactions/select-point/extractor.d.ts.map +0 -1
  539. package/dist/interactions/select-point/index.d.ts.map +0 -1
  540. package/dist/interactions/select-point/types.d.ts.map +0 -1
  541. package/dist/interactions/shared/index.d.ts.map +0 -1
  542. package/dist/interactions/shared/types.d.ts.map +0 -1
  543. package/dist/interactions/slider/extractor.d.ts.map +0 -1
  544. package/dist/interactions/slider/index.d.ts.map +0 -1
  545. package/dist/interactions/slider/types.d.ts.map +0 -1
  546. package/dist/interactions/text-entry/extractor.d.ts.map +0 -1
  547. package/dist/interactions/text-entry/index.d.ts.map +0 -1
  548. package/dist/interactions/text-entry/types.d.ts.map +0 -1
  549. package/dist/interactions/upload/extractor.d.ts.map +0 -1
  550. package/dist/interactions/upload/index.d.ts.map +0 -1
  551. package/dist/interactions/upload/types.d.ts.map +0 -1
  552. package/dist/pci/PciHost.d.ts.map +0 -1
  553. package/dist/pci/types.d.ts.map +0 -1
  554. package/dist/pnp/applyPnp.d.ts.map +0 -1
  555. package/dist/pnp/parsePnpXml.d.ts.map +0 -1
  556. package/dist/pnp/types.d.ts.map +0 -1
  557. package/dist/presentation/itemPresentationPlan.d.ts.map +0 -1
  558. package/dist/server.d.ts.map +0 -1
  559. package/dist/types/index.d.ts.map +0 -1
  560. package/dist/types/interactions.d.ts +0 -8
  561. package/dist/types/interactions.d.ts.map +0 -1
  562. package/dist/types/interactions.js +0 -7
  563. package/dist/types/responseValidation.d.ts.map +0 -1
  564. package/dist/utils/PerformanceMonitor.d.ts.map +0 -1
  565. package/dist/utils/drawingUtils.d.ts.map +0 -1
  566. package/dist/utils/responseUtils.d.ts.map +0 -1
  567. package/dist/utils/touchDragHelper.d.ts +0 -2
  568. package/dist/utils/touchDragHelper.d.ts.map +0 -1
  569. package/dist/utils/touchDragHelper.js +0 -1
  570. package/dist/web-components/QTIInteractionBase.d.ts.map +0 -1
  571. package/dist/web-components/QTIInteractionElement.d.ts.map +0 -1
  572. package/dist/web-components/index.d.ts.map +0 -1
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/custom/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { CustomInteractionData } from '../shared/types.js';\n"]}
@@ -27,4 +27,3 @@ export interface DrawingData {
27
27
  * Handles drawingInteraction elements (drawing on a canvas)
28
28
  */
29
29
  export declare const standardDrawingExtractor: ElementExtractor<DrawingData>;
30
- //# sourceMappingURL=extractor.d.ts.map
@@ -76,3 +76,4 @@ export const standardDrawingExtractor = {
76
76
  };
77
77
  },
78
78
  };
79
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/drawing/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkC;IACtE,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,kCAAkC;IACxC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,oBAAoB,CAAC;IACpC,WAAW,EAAE,8DAA8D;IAE3E,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,+CAA+C;QAC/C,OAAO,OAAO,CAAC,UAAU,KAAK,oBAAoB,CAAC;IACpD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,+DAA+D;QAC/D,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,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,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,M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AAU,CAAC,EAAE,CAAC;gBAC/D,aAAa,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC;QACF,CAAC;QAED,4BAA4B;QAC5B,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE1F,OAAO;YACN,SAAS;YACT,aAAa;YACb,MAAM;SACN,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI;QACZ,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,8BAA8B;QAC9B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CACZ,mFAAmF,CACnF,CAAC;QACH,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 drawingInteraction extractor\n *\n * Extracts data from drawingInteraction elements (drawing on canvas)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Image data for drawing 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 * Drawing data extracted from drawingInteraction elements\n */\nexport interface DrawingData {\n\timageData: ImageData | null;\n\trawAttributes: Record<string, string>;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI drawing interaction extractor\n * Handles drawingInteraction elements (drawing on a canvas)\n */\nexport const standardDrawingExtractor: ElementExtractor<DrawingData> = {\n\tid: 'qti:drawing-interaction',\n\tname: 'QTI Standard Drawing Interaction',\n\tpriority: 10,\n\telementTypes: ['drawingInteraction'],\n\tdescription: 'Extracts standard QTI drawingInteraction (drawing on canvas)',\n\n\tcanHandle(element, _context) {\n\t\t// All drawingInteraction elements are standard\n\t\treturn element.rawTagName === 'drawingInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract background image data from object element (optional)\n\t\tconst objectElements = utils.getChildrenByTag(element, 'object');\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', '');\n\t\t\tconst height = utils.getAttribute(objectElement, 'height', '');\n\n\t\t\tif (type.startsWith('image/svg')) {\n\t\t\t\t// Extract inline SVG content\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\t...(width ? { width } : {}),\n\t\t\t\t\t...(height ? { height } : {}),\n\t\t\t\t};\n\t\t\t} else if (data) {\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\t...(width ? { width } : {}),\n\t\t\t\t\t...(height ? { height } : {}),\n\t\t\t\t};\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\timageData,\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 background image\n\t\tif (!data.imageData) {\n\t\t\twarnings.push(\n\t\t\t\t'drawingInteraction has no background image - students will draw on a blank canvas'\n\t\t\t);\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 { DrawingInteractionData } 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/drawing/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { DrawingInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { DrawingInteractionData } 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/drawing/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { DrawingInteractionData } from '../shared/types.js';\n"]}
@@ -17,4 +17,3 @@ export interface EndAttemptData {
17
17
  * Handles endAttemptInteraction elements (button to end the attempt)
18
18
  */
19
19
  export declare const standardEndAttemptExtractor: ElementExtractor<EndAttemptData>;
20
- //# sourceMappingURL=extractor.d.ts.map
@@ -51,3 +51,4 @@ export const standardEndAttemptExtractor = {
51
51
  };
52
52
  },
53
53
  };
54
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/end-attempt/extractor.ts"],"names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7C,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACxD,CAAC;QAED,iDAAiD;QACjD,IAAI,IAAI,CAAC,YAAY,KAAK,KAAK,EAAE,CAAC;YACjC,QAAQ,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;QAC/F,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 endAttemptInteraction extractor\n *\n * Extracts data from endAttemptInteraction elements (end attempt button)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * End attempt data extracted from endAttemptInteraction elements\n */\nexport interface EndAttemptData {\n\ttitle?: string;\n\tcountAttempt?: boolean;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI end attempt interaction extractor\n * Handles endAttemptInteraction elements (button to end the attempt)\n */\nexport const standardEndAttemptExtractor: ElementExtractor<EndAttemptData> = {\n\tid: 'qti:end-attempt-interaction',\n\tname: 'QTI Standard End Attempt Interaction',\n\tpriority: 10,\n\telementTypes: ['endAttemptInteraction'],\n\tdescription: 'Extracts standard QTI endAttemptInteraction (end attempt button)',\n\n\tcanHandle(element, _context) {\n\t\t// All endAttemptInteraction elements are standard\n\t\treturn element.rawTagName === 'endAttemptInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract attributes with defaults\n\t\tconst title = utils.getAttribute(element, 'title', 'End Attempt');\n\t\tconst countAttempt = element.hasAttribute('countAttempt')\n\t\t\t? utils.getBooleanAttribute(element, 'countAttempt')\n\t\t\t: true;\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\ttitle,\n\t\t\tcountAttempt,\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 title is not empty\n\t\tif (!data.title || data.title.trim() === '') {\n\t\t\terrors.push('endAttemptInteraction must have a title');\n\t\t}\n\n\t\t// Warn if countAttempt is false (uncommon usage)\n\t\tif (data.countAttempt === false) {\n\t\t\twarnings.push('endAttemptInteraction has countAttempt=false - make sure this is intentional');\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 { EndAttemptInteractionData } 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/end-attempt/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { EndAttemptInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { EndAttemptInteractionData } 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/end-attempt/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { EndAttemptInteractionData } from '../shared/types.js';\n"]}
@@ -19,4 +19,3 @@ export interface ExtendedTextData {
19
19
  * Handles extendedTextInteraction elements (multi-line text input)
20
20
  */
21
21
  export declare const standardExtendedTextExtractor: ElementExtractor<ExtendedTextData>;
22
- //# sourceMappingURL=extractor.d.ts.map
@@ -63,3 +63,4 @@ export const standardExtendedTextExtractor = {
63
63
  };
64
64
  },
65
65
  };
66
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/extended-text/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAuC;IAChF,EAAE,EAAE,+BAA+B;IACnC,IAAI,EAAE,wCAAwC;IAC9C,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,yBAAyB,CAAC;IACzC,WAAW,EAAE,uEAAuE;IAEpF,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,2EAA2E;QAC3E,OAAO,CACN,OAAO,CAAC,UAAU,KAAK,yBAAyB;YAChD,OAAO,CAAC,UAAU,KAAK,+BAA+B,CACtD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,qBAAqB;QACrB,MAAM,aAAa,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;QAC5E,MAAM,cAAc,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC;QAChF,MAAM,eAAe,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,C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,CAAC,MAAM,4CAA4C,CAC/E,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 extendedTextInteraction extractor\n *\n * Extracts data from extendedTextInteraction elements (multi-line text input)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Extended text data extracted from extendedTextInteraction elements\n */\nexport interface ExtendedTextData {\n\texpectedLines: number;\n\texpectedLength: number;\n\tprompt: string | null;\n\tplaceholderText: string;\n\tformat: string;\n}\n\n/**\n * Standard QTI extended text interaction extractor\n * Handles extendedTextInteraction elements (multi-line text input)\n */\nexport const standardExtendedTextExtractor: ElementExtractor<ExtendedTextData> = {\n\tid: 'qti:extended-text-interaction',\n\tname: 'QTI Standard Extended Text Interaction',\n\tpriority: 10,\n\telementTypes: ['extendedTextInteraction'],\n\tdescription: 'Extracts standard QTI extendedTextInteraction (multi-line text input)',\n\n\tcanHandle(element, _context) {\n\t\t// All extendedTextInteraction elements are standard (both QTI 2.x and 3.0)\n\t\treturn (\n\t\t\telement.rawTagName === 'extendedTextInteraction' ||\n\t\t\telement.rawTagName === 'qti-extended-text-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 expectedLines = utils.getNumberAttribute(element, 'expectedLines', 3);\n\t\tconst expectedLength = utils.getNumberAttribute(element, 'expectedLength', 200);\n\t\tconst placeholderText = utils.getAttribute(element, 'placeholderText', '');\n\t\tconst format = utils.getAttribute(element, 'format', 'plain');\n\t\tconst patternMask = utils.getAttribute(element, 'patternMask', '') || null;\n\t\tconst patternMaskMessage = utils.getAttribute(element, 'patternMaskMessage', '') || null;\n\t\tconst interactionClasses = utils.getClasses(element);\n\t\tconst prompt = utils.getPrompt(element);\n\n\t\treturn {\n\t\t\texpectedLines,\n\t\t\texpectedLength,\n\t\t\tprompt,\n\t\t\tplaceholderText,\n\t\t\tformat,\n\t\t\t...(patternMask ? { patternMask } : {}),\n\t\t\t...(patternMaskMessage ? { patternMaskMessage } : {}),\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate expectedLines\n\t\tif (data.expectedLines < 1) {\n\t\t\terrors.push('expectedLines must be at least 1');\n\t\t}\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\t// Validate format\n\t\tconst validFormats = ['plain', 'preFormatted', 'xhtml'];\n\t\tif (!validFormats.includes(data.format)) {\n\t\t\twarnings.push(\n\t\t\t\t`Unrecognized format \"${data.format}\" - expected plain, preFormatted, or xhtml`\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 { ExtendedTextInteractionData } 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/extended-text/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { ExtendedTextInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { ExtendedTextInteractionData } 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/extended-text/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { ExtendedTextInteractionData } from '../shared/types.js';\n"]}
@@ -26,4 +26,3 @@ export interface GapMatchData {
26
26
  * Handles gapMatchInteraction elements (drag words into gaps in text)
27
27
  */
28
28
  export declare const standardGapMatchExtractor: ElementExtractor<GapMatchData>;
29
- //# sourceMappingURL=extractor.d.ts.map
@@ -153,3 +153,4 @@ export const standardGapMatchExtractor = {
153
153
  };
154
154
  },
155
155
  };
156
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/gap-match/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAmC;IACxE,EAAE,EAAE,2BAA2B;IAC/B,IAAI,EAAE,oCAAoC;IAC1C,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,qBAAqB,CAAC;IACrC,WAAW,EAAE,kEAAkE;IAE/E,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,gDAAgD;QAChD,OAAO,OAAO,CAAC,UAAU,KAAK,qBAAqB,CAAC;IACrD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,6CAA6C;QAC7C,MAAM,eAAe,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YAChD,MAAM,OAAO,GAAG,KAAK,CAAC,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BACrC,CAAC;gBAED,oBAAoB;gBACpB,IAAI,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;oBAC1B,MAAM,CAAC,IAAI,CAAC,6CAA6C,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;gBAChF,CAAC;YACF,CAAC;QACF,CAAC;QAED,2BAA2B;QAC3B,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;YACtC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC7B,IAAI,CAAC,GAAG,EAAE,CAAC;oBACV,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;gBACjD,CAAC;qBAAM,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBACjC,MAAM,CAAC,IAAI,CAAC,6BAA6B,GAAG,EAAE,CAAC,CAAC;gBACjD,CAAC;qBAAM,CAAC;oBACP,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACtB,CAAC;YACF,CAAC;QACF,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;SAC9C,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI gapMatchInteraction extractor\n *\n * Extracts data from gapMatchInteraction elements (drag words into gaps)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Gap match data extracted from gapMatchInteraction elements\n */\nexport interface GapMatchData {\n\tgapTexts: Array<{\n\t\tidentifier: string;\n\t\ttext: string;\n\t\tmatchMax: number;\n\t\tmatchMin?: number;\n\t\tmatchGroup?: string[];\n\t\tclasses?: string[];\n\t}>;\n\tgaps: string[];\n\tshuffle: boolean;\n\tprompt: string | null;\n\tpromptText: string;\n}\n\n/**\n * Standard QTI gap match interaction extractor\n * Handles gapMatchInteraction elements (drag words into gaps in text)\n */\nexport const standardGapMatchExtractor: ElementExtractor<GapMatchData> = {\n\tid: 'qti:gap-match-interaction',\n\tname: 'QTI Standard Gap Match Interaction',\n\tpriority: 10,\n\telementTypes: ['gapMatchInteraction'],\n\tdescription: 'Extracts standard QTI gapMatchInteraction (drag words into gaps)',\n\n\tcanHandle(element, _context) {\n\t\t// All gapMatchInteraction elements are standard\n\t\treturn element.rawTagName === 'gapMatchInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract gapText children (draggable items)\n\t\tconst gapTextElements = utils.getChildrenByTag(element, 'gapText');\n\t\tconst gapTexts = gapTextElements.map((gapText) => {\n\t\t\tconst classes = utils.getClasses(gapText);\n\t\t\tconst matchMax = utils.getNumberAttribute(gapText, 'matchMax', 1);\n\t\t\tconst matchMin = utils.getNumberAttribute(gapText, 'matchMin', 0);\n\t\t\tconst matchGroupRaw = utils.getAttribute(gapText, 'matchGroup', '');\n\t\t\tconst matchGroup = matchGroupRaw.split(/\\s+/).filter(Boolean);\n\n\t\t\treturn {\n\t\t\t\tidentifier: utils.getAttribute(gapText, 'identifier', ''),\n\t\t\t\ttext: utils.getTextContent(gapText),\n\t\t\t\tmatchMax,\n\t\t\t\t...(matchMin > 0 ? { matchMin } : {}),\n\t\t\t\t...(matchGroup.length > 0 ? { matchGroup } : {}),\n\t\t\t\t...(classes.length > 0 ? { classes } : {}),\n\t\t\t};\n\t\t});\n\n\t\t// Extract prompt (optional) and process gap placeholders.\n\t\t// NOTE: Many QTI items place `<gap>` elements in the interaction content (e.g. a `<p>`/`<blockquote>`)\n\t\t// rather than inside a `<prompt>` element. Support both patterns.\n\t\tconst promptElements = utils.getChildrenByTag(element, 'prompt');\n\t\tlet prompt: string | null = null;\n\t\tlet promptText = '';\n\t\tconst gaps: string[] = [];\n\n\t\tif (promptElements.length > 0) {\n\t\t\tconst promptElement = promptElements[0];\n\t\t\tprompt = utils.getHtmlContent(promptElement);\n\n\t\t\t// Get the raw HTML content and extract gaps\n\t\t\tconst promptHtml = promptElement.outerHTML || promptElement.toString();\n\n\t\t\t// Extract gap elements from prompt children\n\t\t\tconst gapElements = utils.getChildrenByTag(promptElement, 'gap');\n\t\t\tfor (const gap of gapElements) {\n\t\t\t\tgaps.push(utils.getAttribute(gap, 'identifier', ''));\n\t\t\t}\n\n\t\t\t// Replace gap elements with placeholders in the text\n\t\t\tpromptText = promptHtml\n\t\t\t\t.replace(/<qti-prompt[^>]*>|<prompt[^>]*>/, '')\n\t\t\t\t.replace(/<\\/qti-prompt>|<\\/prompt>/, '')\n\t\t\t\t.replace(/<(?:qti-)?gap\\s+identifier=\"([^\"]+)\"[^>]*>/g, '[GAP:$1]')\n\t\t\t\t.replace(/<(?:qti-)?gap\\s+identifier='([^']+)'[^>]*>/g, '[GAP:$1]')\n\t\t\t\t.replace(/<\\/(?:qti-)?gap>/g, '')\n\t\t\t\t.trim();\n\t\t}\n\n\t\t// If gaps were not found inside a <prompt>, search the full interaction body.\n\t\t// This handles items where <gap> elements appear in <p>/<blockquote> siblings of <prompt>.\n\t\tif (gaps.length === 0) {\n\t\t\tconst interactionHtml = element.outerHTML || element.toString();\n\t\t\tconst gapIdMatches = Array.from(\n\t\t\t\tinteractionHtml.matchAll(/<(?:qti-)?gap\\s+identifier=(?:\"([^\"]+)\"|'([^']+)')[^>]*\\/?>/gi)\n\t\t\t);\n\t\t\tfor (const m of gapIdMatches) {\n\t\t\t\tconst id = (m[1] || m[2] || '').trim();\n\t\t\t\tif (id) gaps.push(id);\n\t\t\t}\n\n\t\t\tif (!promptText) {\n\t\t\t\t// No prompt element either: build promptText from full interaction content.\n\t\t\t\tconst interactionHtml2 = element.outerHTML || element.toString();\n\t\t\t\tpromptText = interactionHtml2\n\t\t\t\t\t.replace(/<(?:qti-)?gap-match-interaction[^>]*>|<gapMatchInteraction[^>]*>/, '')\n\t\t\t\t\t.replace(/<\\/(?:qti-)?gap-match-interaction>|<\\/gapMatchInteraction>/, '')\n\t\t\t\t\t.replace(/<(?:qti-)?gap-text[\\s\\S]*?<\\/(?:qti-)?gap-text>|<gapText[\\s\\S]*?<\\/gapText>/g, '')\n\t\t\t\t\t.replace(/<(?:qti-)?gap\\s+identifier=\"([^\"]+)\"[^>]*\\/?>/g, '[GAP:$1]')\n\t\t\t\t\t.replace(/<(?:qti-)?gap\\s+identifier='([^']+)'[^>]*\\/?>/g, '[GAP:$1]')\n\t\t\t\t\t.replace(/<\\/(?:qti-)?gap>/g, '')\n\t\t\t\t\t.trim();\n\t\t\t}\n\t\t}\n\n\t\t// Extract attributes\n\t\tconst shuffle = utils.getBooleanAttribute(element, 'shuffle');\n\t\tconst interactionClasses = utils.getClasses(element);\n\t\tconst choicesContainerWidth = utils.getAttribute(element, 'data-choices-container-width', '') || null;\n\t\tconst maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;\n\t\tconst minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;\n\n\t\treturn {\n\t\t\tgapTexts,\n\t\t\tgaps,\n\t\t\tshuffle,\n\t\t\tprompt,\n\t\t\tpromptText,\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t\t...(choicesContainerWidth ? { choicesContainerWidth } : {}),\n\t\t\t...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),\n\t\t\t...(minSelectionsMessage ? { minSelectionsMessage } : {}),\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\n\t\t// Validate gapTexts exist\n\t\tif (!data.gapTexts || data.gapTexts.length === 0) {\n\t\t\terrors.push('gapMatchInteraction must have at least one gapText');\n\t\t}\n\n\t\t// Validate gaps exist\n\t\tif (!data.gaps || data.gaps.length === 0) {\n\t\t\terrors.push('gapMatchInteraction must have at least one gap in the prompt');\n\t\t}\n\n\t\t// Validate gapText identifiers\n\t\tif (data.gapTexts) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const gapText of data.gapTexts) {\n\t\t\t\tif (!gapText.identifier) {\n\t\t\t\t\terrors.push('All gapTexts must have an identifier');\n\t\t\t\t} else if (identifiers.has(gapText.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate gapText identifier: ${gapText.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(gapText.identifier);\n\t\t\t\t}\n\n\t\t\t\t// Validate matchMax\n\t\t\t\tif (gapText.matchMax < 0) {\n\t\t\t\t\terrors.push(`matchMax must be non-negative for gapText ${gapText.identifier}`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate gap identifiers\n\t\tif (data.gaps) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const gap of data.gaps) {\n\t\t\t\tif (!gap) {\n\t\t\t\t\terrors.push('All gaps must have an identifier');\n\t\t\t\t} else if (identifiers.has(gap)) {\n\t\t\t\t\terrors.push(`Duplicate gap identifier: ${gap}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(gap);\n\t\t\t\t}\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};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { GapMatchInteractionData } 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/gap-match/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { GapMatchInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { GapMatchInteractionData } 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/gap-match/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { GapMatchInteractionData } from '../shared/types.js';\n"]}
@@ -38,4 +38,3 @@ export interface GraphicAssociateData {
38
38
  * Handles graphicAssociateInteraction elements (creating associations between hotspots)
39
39
  */
40
40
  export declare const standardGraphicAssociateExtractor: ElementExtractor<GraphicAssociateData>;
41
- //# sourceMappingURL=extractor.d.ts.map
@@ -141,3 +141,4 @@ export const standardGraphicAssociateExtractor = {
141
141
  };
142
142
  },
143
143
  };
144
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/graphic-associate/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmCH;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAA2C;IACxF,EAAE,EAAE,mCAAmC;IACvC,IAAI,EAAE,4CAA4C;IAClD,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,6BAA6B,CAAC;IAC7C,WAAW,EAAE,8EAA8E;IAE3F,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,wDAAwD;QACxD,OAAO,OAAO,CAAC,UAAU,KAAK,6BAA6B,CAAC;IAC7D,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,yCAAyC;QACzC,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,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,KAAK,CAAC,YAAY,C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;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI graphicAssociateInteraction extractor\n *\n * Extracts data from graphicAssociateInteraction elements (associate items on image)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Image data for graphic associate 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 * Graphic associate data extracted from graphicAssociateInteraction elements\n */\nexport interface GraphicAssociateData {\n\timageData: ImageData | null;\n\tassociableHotspots: Array<{\n\t\tidentifier: string;\n\t\tlabel: string;\n\t\tshape: string;\n\t\tcoords: string;\n\t\tmatchMax: number;\n\t\tmatchMin?: number;\n\t\tmatchGroup?: string[];\n\t\tclasses?: string[];\n\t}>;\n\tmaxAssociations: number;\n\tminAssociations: number;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI graphic associate interaction extractor\n * Handles graphicAssociateInteraction elements (creating associations between hotspots)\n */\nexport const standardGraphicAssociateExtractor: ElementExtractor<GraphicAssociateData> = {\n\tid: 'qti:graphic-associate-interaction',\n\tname: 'QTI Standard Graphic Associate Interaction',\n\tpriority: 10,\n\telementTypes: ['graphicAssociateInteraction'],\n\tdescription: 'Extracts standard QTI graphicAssociateInteraction (associate items on image)',\n\n\tcanHandle(element, _context) {\n\t\t// All graphicAssociateInteraction elements are standard\n\t\treturn element.rawTagName === 'graphicAssociateInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract image data from object element\n\t\tconst objectElements = utils.getChildrenByTag(element, 'object');\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}\n\n\t\t// Extract associableHotspot children\n\t\tconst hotspotElements = utils.getChildrenByTag(element, 'associableHotspot');\n\t\tconst associableHotspots = hotspotElements.map((hotspot) => {\n\t\t\tconst classes = utils.getClasses(hotspot);\n\t\t\tconst identifier = utils.getAttribute(hotspot, 'identifier', '');\n\t\t\tconst shape = utils.getAttribute(hotspot, 'shape', 'rect');\n\t\t\tconst coords = utils.getAttribute(hotspot, 'coords', '0,0,50,50');\n\t\t\tconst matchMax = utils.getNumberAttribute(hotspot, 'matchMax', 1);\n\t\t\tconst matchMin = utils.getNumberAttribute(hotspot, 'matchMin', 0);\n\t\t\tconst matchGroupRaw = utils.getAttribute(hotspot, 'matchGroup', '');\n\t\t\tconst matchGroup = matchGroupRaw.split(/\\s+/).filter(Boolean);\n\n\t\t\t// Get text content as label, use identifier as fallback\n\t\t\tconst textContent = utils.getTextContent(hotspot).trim();\n\t\t\tconst label = textContent || identifier;\n\n\t\t\treturn {\n\t\t\t\tidentifier,\n\t\t\t\tlabel,\n\t\t\t\tshape,\n\t\t\t\tcoords,\n\t\t\t\tmatchMax,\n\t\t\t\t...(matchMin > 0 ? { matchMin } : {}),\n\t\t\t\t...(matchGroup.length > 0 ? { matchGroup } : {}),\n\t\t\t\t...(classes.length > 0 ? { classes } : {}),\n\t\t\t};\n\t\t});\n\n\t\t// Extract attributes with proper defaults\n\t\tconst maxAssociations = utils.getNumberAttribute(element, 'maxAssociations', 1);\n\t\tconst minAssociations = utils.getNumberAttribute(element, 'minAssociations', 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\tassociableHotspots,\n\t\t\tmaxAssociations,\n\t\t\tminAssociations,\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('graphicAssociateInteraction has no image data');\n\t\t} else if (data.imageData.type === 'image' && !data.imageData.src) {\n\t\t\terrors.push('graphicAssociateInteraction must have an image URL');\n\t\t} else if (data.imageData.type === 'svg' && !data.imageData.content) {\n\t\t\terrors.push('graphicAssociateInteraction must have SVG content');\n\t\t}\n\n\t\t// Validate hotspots exist\n\t\tif (!data.associableHotspots || data.associableHotspots.length < 2) {\n\t\t\terrors.push('graphicAssociateInteraction must have at least 2 hotspots');\n\t\t}\n\n\t\t// Validate hotspot identifiers and coords\n\t\tif (data.associableHotspots && data.associableHotspots.length > 0) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const hotspot of data.associableHotspots) {\n\t\t\t\tif (!hotspot.identifier) {\n\t\t\t\t\terrors.push('All hotspots must have an identifier');\n\t\t\t\t} else if (identifiers.has(hotspot.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(hotspot.identifier);\n\t\t\t\t}\n\n\t\t\t\tif (!hotspot.coords) {\n\t\t\t\t\terrors.push(`Hotspot ${hotspot.identifier} must have coords`);\n\t\t\t\t}\n\n\t\t\t\t// Validate matchMax\n\t\t\t\tif (hotspot.matchMax < 0) {\n\t\t\t\t\terrors.push(`matchMax must be non-negative for hotspot ${hotspot.identifier}`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate maxAssociations\n\t\tif (data.maxAssociations < 0) {\n\t\t\terrors.push('maxAssociations must be non-negative');\n\t\t}\n\n\t\t// Validate minAssociations\n\t\tif (data.minAssociations < 0) {\n\t\t\terrors.push('minAssociations must be non-negative');\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 { GraphicAssociateInteractionData } 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/graphic-associate/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { GraphicAssociateInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { GraphicAssociateInteractionData, GraphicAssociateHotspot } 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/graphic-associate/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { GraphicAssociateInteractionData, GraphicAssociateHotspot } from '../shared/types.js';\n"]}
@@ -50,4 +50,3 @@ export interface GraphicGapMatchData {
50
50
  * Handles graphicGapMatchInteraction elements (drag text/images into gaps on an image)
51
51
  */
52
52
  export declare const standardGraphicGapMatchExtractor: ElementExtractor<GraphicGapMatchData>;
53
- //# sourceMappingURL=extractor.d.ts.map
@@ -203,3 +203,4 @@ export const standardGraphicGapMatchExtractor = {
203
203
  };
204
204
  },
205
205
  };
206
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/graphic-gap-match/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0CH;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAA0C;IACtF,EAAE,EAAE,mCAAmC;IACvC,IAAI,EAAE,4CAA4C;IAClD,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,4BAA4B,CAAC;IAC5C,WAAW,EAAE,+EAA+E;IAE5F,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,uDAAuD;QACvD,OAAO,OAAO,CAAC,UAAU,KAAK,4BAA4B,CAAC;IAC5D,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,yCAAyC;QACzC,MAAM,cAAc,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,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,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YAC3D,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YAC3D,MAAM,KAAK,GAAG,KAAK,CAAC,kBAAkB,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAClE,MAAM,MAAM,GAAG,KAAK,CAAC,kBAAkB,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;YAEpE,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,CA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,CAAC,UAAU,CAAC,CAAC;gBACrC,CAAC;YACF,CAAC;QACF,CAAC;QAED,+BAA+B;QAC/B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;YACtC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACrC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;oBACzB,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;gBACrD,CAAC;qBAAM,IAAI,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;oBAChD,MAAM,CAAC,IAAI,CAAC,iCAAiC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;gBACpE,CAAC;qBAAM,CAAC;oBACP,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBACrC,CAAC;gBAED,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;oBACrB,MAAM,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,UAAU,mBAAmB,CAAC,CAAC;gBAC/D,CAAC;YACF,CAAC;QACF,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 graphicGapMatchInteraction extractor\n *\n * Extracts data from graphicGapMatchInteraction elements (drag text/images into gaps on image)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Image data for graphic gap match interaction\n */\nexport interface ImageData {\n\ttype: 'image' | 'svg';\n\tsrc?: string;\n\tcontent?: string;\n\twidth?: number;\n\theight?: number;\n}\n\n/**\n * Graphic gap match data extracted from graphicGapMatchInteraction elements\n */\nexport interface GraphicGapMatchData {\n\timageData: ImageData | null;\n\tmaxAssociations: number;\n\tgapTexts: Array<{\n\t\tidentifier: string;\n\t\ttext: string;\n\t\tmatchMax: number;\n\t\tmatchMin?: number;\n\t\tmatchGroup?: string[];\n\t\tclasses?: string[];\n\t}>;\n\tgapImages: Array<{\n\t\tidentifier: string;\n\t\tsrc: string;\n\t\talt: string;\n\t\tmatchMax: number;\n\t\tmatchGroup?: string[];\n\t\twidth?: number;\n\t\theight?: number;\n\t}>;\n\thotspots: Array<{ identifier: string; shape: string; coords: string; matchMax: number }>;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI graphic gap match interaction extractor\n * Handles graphicGapMatchInteraction elements (drag text/images into gaps on an image)\n */\nexport const standardGraphicGapMatchExtractor: ElementExtractor<GraphicGapMatchData> = {\n\tid: 'qti:graphic-gap-match-interaction',\n\tname: 'QTI Standard Graphic Gap Match Interaction',\n\tpriority: 10,\n\telementTypes: ['graphicGapMatchInteraction'],\n\tdescription: 'Extracts standard QTI graphicGapMatchInteraction (drag text/images into gaps)',\n\n\tcanHandle(element, _context) {\n\t\t// All graphicGapMatchInteraction elements are standard\n\t\treturn element.rawTagName === 'graphicGapMatchInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract image data from object element\n\t\tconst objectElements = utils.getChildrenByTag(element, 'object');\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.getNumberAttribute(objectElement, 'width', 0);\n\t\t\tconst height = utils.getNumberAttribute(objectElement, 'height', 0);\n\n\t\t\tif (type.startsWith('image/svg')) {\n\t\t\t\t// Inline SVG: <object type=\"image/svg+xml\"><svg>...</svg></object>\n\t\t\t\t// External SVG: <object type=\"image/svg+xml\" data=\"path/to/file.svg\"/>\n\t\t\t\t// The <object> may contain alt text (not SVG markup) — only treat as inline if content has <svg.\n\t\t\t\tconst content = utils.getHtmlContent(objectElement);\n\t\t\t\tconst hasSvgMarkup = /<svg[\\s>]/i.test(content);\n\t\t\t\tif (hasSvgMarkup) {\n\t\t\t\t\timageData = {\n\t\t\t\t\t\ttype: 'svg',\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\t...(width > 0 ? { width } : {}),\n\t\t\t\t\t\t...(height > 0 ? { height } : {}),\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\t// External SVG file reference — render via <img src>\n\t\t\t\t\timageData = {\n\t\t\t\t\t\ttype: 'image',\n\t\t\t\t\t\tsrc: data,\n\t\t\t\t\t\t...(width > 0 ? { width } : {}),\n\t\t\t\t\t\t...(height > 0 ? { height } : {}),\n\t\t\t\t\t};\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\t...(width > 0 ? { width } : {}),\n\t\t\t\t\t...(height > 0 ? { height } : {}),\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Extract interaction-level attributes\n\t\tconst maxAssociations = utils.getNumberAttribute(element, 'maxAssociations', 0);\n\n\t\t// Extract gapText children (draggable text labels)\n\t\tconst gapTextElements = utils.getChildrenByTag(element, 'gapText');\n\t\tconst gapTexts = gapTextElements.map((gapText) => {\n\t\t\tconst classes = utils.getClasses(gapText);\n\t\t\tconst matchMax = utils.getNumberAttribute(gapText, 'matchMax', 1);\n\t\t\tconst matchMin = utils.getNumberAttribute(gapText, 'matchMin', 0);\n\t\t\tconst matchGroupRaw = utils.getAttribute(gapText, 'matchGroup', '');\n\t\t\tconst matchGroup = matchGroupRaw.split(/\\s+/).filter(Boolean);\n\t\t\tconst text = utils.getHtmlContent(gapText);\n\n\t\t\treturn {\n\t\t\t\tidentifier: utils.getAttribute(gapText, 'identifier', ''),\n\t\t\t\ttext,\n\t\t\t\tmatchMax,\n\t\t\t\t...(matchMin > 0 ? { matchMin } : {}),\n\t\t\t\t...(matchGroup.length > 0 ? { matchGroup } : {}),\n\t\t\t\t...(classes.length > 0 ? { classes } : {}),\n\t\t\t};\n\t\t});\n\n\t\t// Extract gapImg children (draggable image labels)\n\t\tconst gapImgElements = utils.getChildrenByTag(element, 'gapImg');\n\t\tconst gapImages = gapImgElements.map((gapImg) => {\n\t\t\tconst matchMax = utils.getNumberAttribute(gapImg, 'matchMax', 1);\n\t\t\tconst matchGroupRaw = utils.getAttribute(gapImg, 'matchGroup', '');\n\t\t\tconst matchGroup = matchGroupRaw.split(/\\s+/).filter(Boolean);\n\t\t\tconst objectChildren = utils.getChildrenByTag(gapImg, 'object');\n\t\t\tlet src = '';\n\t\t\tlet alt = '';\n\t\t\tlet width: number | undefined;\n\t\t\tlet height: number | undefined;\n\t\t\tif (objectChildren.length > 0) {\n\t\t\t\tconst obj = objectChildren[0];\n\t\t\t\tsrc = utils.getAttribute(obj, 'data', '');\n\t\t\t\talt = utils.getTextContent(obj);\n\t\t\t\tconst w = utils.getNumberAttribute(obj, 'width', 0);\n\t\t\t\tconst h = utils.getNumberAttribute(obj, 'height', 0);\n\t\t\t\tif (w > 0) width = w;\n\t\t\t\tif (h > 0) height = h;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tidentifier: utils.getAttribute(gapImg, 'identifier', ''),\n\t\t\t\tsrc,\n\t\t\t\talt,\n\t\t\t\tmatchMax,\n\t\t\t\t...(matchGroup.length > 0 ? { matchGroup } : {}),\n\t\t\t\t...(width !== undefined ? { width } : {}),\n\t\t\t\t...(height !== undefined ? { height } : {}),\n\t\t\t};\n\t\t});\n\n\t\t// Extract associableHotspot elements (gap targets)\n\t\tconst hotspotElements = utils.getChildrenByTag(element, 'associableHotspot');\n\t\tconst hotspots = hotspotElements.map((hotspot) => ({\n\t\t\tidentifier: utils.getAttribute(hotspot, 'identifier', ''),\n\t\t\tshape: utils.getAttribute(hotspot, 'shape', 'rect'),\n\t\t\tcoords: utils.getAttribute(hotspot, 'coords', ''),\n\t\t\tmatchMax: utils.getNumberAttribute(hotspot, 'matchMax', 1),\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\tconst interactionClasses = utils.getClasses(element);\n\t\tconst choicesContainerWidth = utils.getAttribute(element, 'data-choices-container-width', '') || null;\n\t\tconst maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;\n\t\tconst minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;\n\n\t\treturn {\n\t\t\timageData,\n\t\t\tmaxAssociations,\n\t\t\tgapTexts,\n\t\t\tgapImages,\n\t\t\thotspots,\n\t\t\tprompt,\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t\t...(choicesContainerWidth ? { choicesContainerWidth } : {}),\n\t\t\t...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),\n\t\t\t...(minSelectionsMessage ? { minSelectionsMessage } : {}),\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 (optional but recommended)\n\t\tif (!data.imageData) {\n\t\t\twarnings.push('graphicGapMatchInteraction has no background image');\n\t\t} else if (data.imageData.type === 'image' && !data.imageData.src) {\n\t\t\terrors.push('graphicGapMatchInteraction must have an image URL');\n\t\t} else if (data.imageData.type === 'svg' && !data.imageData.content) {\n\t\t\terrors.push('graphicGapMatchInteraction must have SVG content');\n\t\t}\n\n\t\t// Validate that at least one draggable choice type is present\n\t\tif ((!data.gapTexts || data.gapTexts.length === 0) && (!data.gapImages || data.gapImages.length === 0)) {\n\t\t\terrors.push('graphicGapMatchInteraction must have at least one gapText or gapImg');\n\t\t}\n\n\t\t// Validate hotspots exist\n\t\tif (!data.hotspots || data.hotspots.length === 0) {\n\t\t\terrors.push('graphicGapMatchInteraction must have at least one hotspot');\n\t\t}\n\n\t\t// Validate gapText identifiers\n\t\tif (data.gapTexts) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const gapText of data.gapTexts) {\n\t\t\t\tif (!gapText.identifier) {\n\t\t\t\t\terrors.push('All gapTexts must have an identifier');\n\t\t\t\t} else if (identifiers.has(gapText.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate gapText identifier: ${gapText.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(gapText.identifier);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate hotspot identifiers\n\t\tif (data.hotspots) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const hotspot of data.hotspots) {\n\t\t\t\tif (!hotspot.identifier) {\n\t\t\t\t\terrors.push('All hotspots must have an identifier');\n\t\t\t\t} else if (identifiers.has(hotspot.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(hotspot.identifier);\n\t\t\t\t}\n\n\t\t\t\tif (!hotspot.coords) {\n\t\t\t\t\terrors.push(`Hotspot ${hotspot.identifier} must have coords`);\n\t\t\t\t}\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 { GraphicGapMatchInteractionData } 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/graphic-gap-match/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { GraphicGapMatchInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { GraphicGapMatchInteractionData, AssociableHotspot, 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/graphic-gap-match/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { GraphicGapMatchInteractionData, AssociableHotspot, ImageData } from '../shared/types.js';\n"]}
@@ -34,4 +34,3 @@ export interface GraphicOrderData {
34
34
  * Handles graphicOrderInteraction elements (ordering hotspots on an image)
35
35
  */
36
36
  export declare const standardGraphicOrderExtractor: ElementExtractor<GraphicOrderData>;
37
- //# sourceMappingURL=extractor.d.ts.map
@@ -119,3 +119,4 @@ export const standardGraphicOrderExtractor = {
119
119
  };
120
120
  },
121
121
  };
122
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/graphic-order/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA+BH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAuC;IAChF,EAAE,EAAE,+BAA+B;IACnC,IAAI,EAAE,wCAAwC;IAC9C,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,yBAAyB,CAAC;IACzC,WAAW,EAAE,sEAAsE;IAEnF,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,oDAAoD;QACpD,OAAO,OAAO,CAAC,UAAU,KAAK,yBAAyB,CAAC;IACzD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE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O,CAAC,MAAM,EAAE,CAAC;oBACrB,MAAM,CAAC,IAAI,CAAC,WAAW,OAAO,CAAC,UAAU,mBAAmB,CAAC,CAAC;gBAC/D,CAAC;YACF,CAAC;QACF,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 graphicOrderInteraction extractor\n *\n * Extracts data from graphicOrderInteraction elements (order items on image)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Image data for graphic order 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 * Graphic order data extracted from graphicOrderInteraction elements\n */\nexport interface GraphicOrderData {\n\timageData: ImageData | null;\n\thotspotChoices: Array<{\n\t\tidentifier: string;\n\t\tlabel: string;\n\t\tshape: string;\n\t\tcoords: string;\n\t\tfixed?: boolean;\n\t\tclasses?: string[];\n\t}>;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI graphic order interaction extractor\n * Handles graphicOrderInteraction elements (ordering hotspots on an image)\n */\nexport const standardGraphicOrderExtractor: ElementExtractor<GraphicOrderData> = {\n\tid: 'qti:graphic-order-interaction',\n\tname: 'QTI Standard Graphic Order Interaction',\n\tpriority: 10,\n\telementTypes: ['graphicOrderInteraction'],\n\tdescription: 'Extracts standard QTI graphicOrderInteraction (order items on image)',\n\n\tcanHandle(element, _context) {\n\t\t// All graphicOrderInteraction elements are standard\n\t\treturn element.rawTagName === 'graphicOrderInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract image data from object element\n\t\tconst objectElements = utils.getChildrenByTag(element, 'object');\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}\n\n\t\t// Extract hotspotChoice children\n\t\tconst hotspotElements = utils.getChildrenByTag(element, 'hotspotChoice');\n\t\tconst hotspotChoices = hotspotElements.map((hotspot) => {\n\t\t\tconst classes = utils.getClasses(hotspot);\n\t\t\tconst identifier = utils.getAttribute(hotspot, 'identifier', '');\n\t\t\tconst shape = utils.getAttribute(hotspot, 'shape', 'rect');\n\t\t\tconst coords = utils.getAttribute(hotspot, 'coords', '0,0,50,50');\n\t\t\tconst fixed = utils.getBooleanAttribute(hotspot, 'fixed');\n\n\t\t\t// Get text content as label, use identifier as fallback\n\t\t\tconst textContent = utils.getTextContent(hotspot).trim();\n\t\t\tconst label = textContent || identifier;\n\n\t\t\treturn {\n\t\t\t\tidentifier,\n\t\t\t\tlabel,\n\t\t\t\tshape,\n\t\t\t\tcoords,\n\t\t\t\t...(fixed ? { fixed } : {}),\n\t\t\t\t...(classes.length > 0 ? { classes } : {}),\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\timageData,\n\t\t\thotspotChoices,\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('graphicOrderInteraction has no image data');\n\t\t} else if (data.imageData.type === 'image' && !data.imageData.src) {\n\t\t\terrors.push('graphicOrderInteraction must have an image URL');\n\t\t} else if (data.imageData.type === 'svg' && !data.imageData.content) {\n\t\t\terrors.push('graphicOrderInteraction must have SVG content');\n\t\t}\n\n\t\t// Validate hotspot choices exist\n\t\tif (!data.hotspotChoices || data.hotspotChoices.length < 2) {\n\t\t\terrors.push('graphicOrderInteraction must have at least 2 hotspots');\n\t\t}\n\n\t\t// Validate hotspot choice identifiers and coords\n\t\tif (data.hotspotChoices) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const hotspot of data.hotspotChoices) {\n\t\t\t\tif (!hotspot.identifier) {\n\t\t\t\t\terrors.push('All hotspot choices must have an identifier');\n\t\t\t\t} else if (identifiers.has(hotspot.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(hotspot.identifier);\n\t\t\t\t}\n\n\t\t\t\tif (!hotspot.coords) {\n\t\t\t\t\terrors.push(`Hotspot ${hotspot.identifier} must have coords`);\n\t\t\t\t}\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 { GraphicOrderInteractionData } 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/graphic-order/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { GraphicOrderInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { GraphicOrderInteractionData, GraphicOrderChoice } 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/graphic-order/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { GraphicOrderInteractionData, GraphicOrderChoice } from '../shared/types.js';\n"]}
@@ -35,4 +35,3 @@ export interface HotspotData {
35
35
  * Handles hotspotInteraction elements (clickable areas on an image)
36
36
  */
37
37
  export declare const standardHotspotExtractor: ElementExtractor<HotspotData>;
38
- //# sourceMappingURL=extractor.d.ts.map
@@ -157,3 +157,4 @@ export const standardHotspotExtractor = {
157
157
  };
158
158
  },
159
159
  };
160
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/hotspot/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgCH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkC;IACtE,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,kCAAkC;IACxC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,oBAAoB,CAAC;IACpC,WAAW,EAAE,qEAAqE;IAElF,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,+CAA+C;QAC/C,OA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,IAAI,CAAC,WAAW,OAAO,CAAC,UAAU,mBAAmB,CAAC,CAAC;gBAC/D,CAAC;YACF,CAAC;YAED,2CAA2C;YAC3C,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;gBAClD,QAAQ,CAAC,IAAI,CACZ,eAAe,IAAI,CAAC,UAAU,qCAAqC,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAChG,CAAC;YACH,CAAC;QACF,CAAC;QAED,sBAAsB;QACtB,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,CAAC;QAED,sBAAsB;QACtB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YAC1D,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,CAAC;QAED,oCAAoC;QACpC,IACC,IAAI,CAAC,UAAU,KAAK,SAAS;YAC7B,IAAI,CAAC,UAAU,GAAG,CAAC;YACnB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAChC,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACpD,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 hotspotInteraction extractor\n *\n * Extracts data from hotspotInteraction elements (clickable areas on image)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Image data for hotspot 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 * Hotspot data extracted from hotspotInteraction elements\n */\nexport interface HotspotData {\n\timageData: ImageData | null;\n\thotspotChoices: Array<{\n\t\tidentifier: string;\n\t\tshape: 'circle' | 'rect' | 'poly' | 'ellipse' | 'default';\n\t\tcoords: string;\n\t\thotspotLabel?: string;\n\t\tclasses?: string[];\n\t}>;\n\tmaxChoices: number;\n\tminChoices?: number;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI hotspot interaction extractor\n * Handles hotspotInteraction elements (clickable areas on an image)\n */\nexport const standardHotspotExtractor: ElementExtractor<HotspotData> = {\n\tid: 'qti:hotspot-interaction',\n\tname: 'QTI Standard Hotspot Interaction',\n\tpriority: 10,\n\telementTypes: ['hotspotInteraction'],\n\tdescription: 'Extracts standard QTI hotspotInteraction (clickable areas on image)',\n\n\tcanHandle(element, _context) {\n\t\t// All hotspotInteraction elements are standard\n\t\treturn element.rawTagName === 'hotspotInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract image data from object element\n\t\tconst objectElements = utils.getChildrenByTag(element, 'object');\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', 'auto');\n\t\t\tconst height = utils.getAttribute(objectElement, 'height', 'auto');\n\n\t\t\tif (type.startsWith('image/svg')) {\n\t\t\t\t// Inline SVG: <object type=\"image/svg+xml\"><svg>...</svg></object>\n\t\t\t\t// External SVG: <object type=\"image/svg+xml\" data=\"path/to/file.svg\"/>\n\t\t\t\t// The <object> may contain alt text (not SVG markup) — only treat as inline if content has <svg.\n\t\t\t\tconst content = utils.getHtmlContent(objectElement);\n\t\t\t\tconst hasSvgMarkup = /<svg[\\s>]/i.test(content);\n\t\t\t\tif (hasSvgMarkup) {\n\t\t\t\t\timageData = {\n\t\t\t\t\t\ttype: 'svg',\n\t\t\t\t\t\tcontent,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\t// External SVG file reference — render via <img src> (SVG renders in img tags)\n\t\t\t\t\timageData = {\n\t\t\t\t\t\ttype: 'image',\n\t\t\t\t\t\tsrc: data,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t};\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}\n\n\t\t// Extract hotspotChoice children\n\t\tconst hotspotElements = utils.getChildrenByTag(element, 'hotspotChoice');\n\t\tconst hotspotChoices = hotspotElements.map((hotspot) => {\n\t\t\tconst classes = utils.getClasses(hotspot);\n\t\t\tconst shape = utils.getAttribute(hotspot, 'shape', 'rect');\n\t\t\tconst coords = utils.getAttribute(hotspot, 'coords', '');\n\t\t\tconst hotspotLabel = utils.getAttribute(hotspot, 'hotspotLabel', '');\n\n\t\t\treturn {\n\t\t\t\tidentifier: utils.getAttribute(hotspot, 'identifier', ''),\n\t\t\t\tshape: shape as 'circle' | 'rect' | 'poly' | 'ellipse' | 'default',\n\t\t\t\tcoords,\n\t\t\t\t...(hotspotLabel ? { hotspotLabel } : {}),\n\t\t\t\t...(classes.length > 0 ? { classes } : {}),\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\t\tconst interactionClasses = utils.getClasses(element);\n\t\tconst maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;\n\t\tconst minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;\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\thotspotChoices,\n\t\t\tmaxChoices,\n\t\t\t...(minChoices > 0 ? { minChoices } : {}),\n\t\t\tprompt,\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t\t...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),\n\t\t\t...(minSelectionsMessage ? { minSelectionsMessage } : {}),\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('hotspotInteraction has no image data');\n\t\t} else if (data.imageData.type === 'image' && !data.imageData.src) {\n\t\t\terrors.push('hotspotInteraction must have an image URL');\n\t\t} else if (data.imageData.type === 'svg' && !data.imageData.content) {\n\t\t\terrors.push('hotspotInteraction must have SVG content');\n\t\t}\n\n\t\t// Validate hotspots exist\n\t\tif (!data.hotspotChoices || data.hotspotChoices.length === 0) {\n\t\t\terrors.push('hotspotInteraction must have at least one hotspot');\n\t\t}\n\n\t\t// Validate hotspot identifiers and coords\n\t\tif (data.hotspotChoices && data.hotspotChoices.length > 0) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const hotspot of data.hotspotChoices) {\n\t\t\t\tif (!hotspot.identifier) {\n\t\t\t\t\terrors.push('All hotspots must have an identifier');\n\t\t\t\t} else if (identifiers.has(hotspot.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(hotspot.identifier);\n\t\t\t\t}\n\n\t\t\t\tif (!hotspot.coords) {\n\t\t\t\t\terrors.push(`Hotspot ${hotspot.identifier} must have coords`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Warn if maxChoices exceeds hotspot count\n\t\t\tif (data.maxChoices > data.hotspotChoices.length) {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`maxChoices (${data.maxChoices}) exceeds the number of hotspots (${data.hotspotChoices.length})`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Validate maxChoices\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 !== undefined && data.minChoices < 0) {\n\t\t\terrors.push('minChoices must be non-negative');\n\t\t}\n\n\t\t// Validate minChoices <= maxChoices\n\t\tif (\n\t\t\tdata.minChoices !== undefined &&\n\t\t\tdata.maxChoices > 0 &&\n\t\t\tdata.minChoices > data.maxChoices\n\t\t) {\n\t\t\terrors.push('minChoices cannot exceed 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 { HotspotInteractionData } 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/hotspot/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { HotspotInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { HotspotInteractionData, HotspotChoice, 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/hotspot/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { HotspotInteractionData, HotspotChoice, ImageData } from '../shared/types.js';\n"]}
@@ -23,4 +23,3 @@ export interface HottextData {
23
23
  * Handles hottextInteraction elements (selectable text spans)
24
24
  */
25
25
  export declare const standardHottextExtractor: ElementExtractor<HottextData>;
26
- //# sourceMappingURL=extractor.d.ts.map
@@ -126,3 +126,4 @@ export const standardHottextExtractor = {
126
126
  };
127
127
  },
128
128
  };
129
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/hottext/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAevD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkC;IACtE,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,kCAAkC;IACxC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,oBAAoB,CAAC;IACpC,WAAW,EAAE,8DAA8D;IAE3E,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,+CAA+C;QAC/C,OAAO,OAAO,CAAC,UAAU,KAAK,oBAAoB,IAAI,OAAO,CAAC,UAAU,KAAK,yBAAyB,CAAC;IACxG,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,oFAAoF;QACpF,MAAM,mBAAmB,GAAG,CAAC,EAAO,EAAS,EAAE;YAC9C,MAAM,OAAO,GAAU,EAAE,CAAC;YAC1B,IAAI,EAAE,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,CAAC,UAAU,KAAK,aAAa,EAAE,CAAC;gBACpE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClB,C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QACH,CAAC;QAED,sBAAsB;QACtB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;YAC1D,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,CAAC;QAED,oCAAoC;QACpC,IACC,IAAI,CAAC,UAAU,KAAK,SAAS;YAC7B,IAAI,CAAC,UAAU,GAAG,CAAC;YACnB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAChC,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACpD,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 hottextInteraction extractor\n *\n * Extracts data from hottextInteraction elements (select text spans)\n */\n\nimport { sanitizeHtml } from '../../core/sanitizer.js';\nimport type { QTIElement } from '../shared/types.js';\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Hottext data extracted from hottextInteraction elements\n */\nexport interface HottextData {\n\thottextChoices: Array<{ identifier: string; text: string; classes?: string[] }>;\n\tcontentHtml: string;\n\tmaxChoices: number;\n\tminChoices: number;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI hottext interaction extractor\n * Handles hottextInteraction elements (selectable text spans)\n */\nexport const standardHottextExtractor: ElementExtractor<HottextData> = {\n\tid: 'qti:hottext-interaction',\n\tname: 'QTI Standard Hottext Interaction',\n\tpriority: 10,\n\telementTypes: ['hottextInteraction'],\n\tdescription: 'Extracts standard QTI hottextInteraction (select text spans)',\n\n\tcanHandle(element, _context) {\n\t\t// All hottextInteraction elements are standard\n\t\treturn element.rawTagName === 'hottextInteraction' || element.rawTagName === 'qti-hottext-interaction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract hottext children (selectable text spans) - recursively search entire tree\n\t\tconst findHottextElements = (el: any): any[] => {\n\t\t\tconst results: any[] = [];\n\t\t\tif (el.rawTagName === 'hottext' || el.rawTagName === 'qti-hottext') {\n\t\t\t\tresults.push(el);\n\t\t\t}\n\t\t\tif (el.childNodes) {\n\t\t\t\tfor (const child of el.childNodes) {\n\t\t\t\t\tif (typeof child !== 'string') {\n\t\t\t\t\t\tresults.push(...findHottextElements(child));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t\tconst hottextElements = findHottextElements(element);\n\t\tconst hottextChoices = hottextElements.map((hottext) => {\n\t\t\tconst classes = utils.getClasses(hottext);\n\t\t\treturn {\n\t\t\t\tidentifier: utils.getAttribute(hottext, 'identifier', ''),\n\t\t\t\ttext: utils.getTextContent(hottext),\n\t\t\t\t...(classes.length > 0 ? { classes } : {}),\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\t\tconst interactionClasses = utils.getClasses(element);\n\t\tconst maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;\n\t\tconst minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;\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\t// Extract content HTML (all content except prompt)\n\t\tlet contentHtml = '';\n\t\tfor (const child of element.childNodes) {\n\t\t\t// Skip prompt elements\n\t\t\tif (\n\t\t\t\ttypeof child !== 'string' &&\n\t\t\t\t(child as QTIElement).rawTagName !== 'prompt' &&\n\t\t\t\t(child as QTIElement).rawTagName !== 'qti-prompt'\n\t\t\t) {\n\t\t\t\tcontentHtml += (child as QTIElement).outerHTML || child.toString();\n\t\t\t} else if (typeof child === 'string') {\n\t\t\t\tcontentHtml += child;\n\t\t\t}\n\t\t}\n\n\t\t// Sanitize extracted HTML before rendering via {@html} in the component.\n\t\tcontentHtml = sanitizeHtml(contentHtml, { security: context.config.security });\n\n\t\treturn {\n\t\t\thottextChoices,\n\t\t\tcontentHtml,\n\t\t\tmaxChoices,\n\t\t\tminChoices,\n\t\t\tprompt,\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t\t...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),\n\t\t\t...(minSelectionsMessage ? { minSelectionsMessage } : {}),\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate hottextChoices exist\n\t\tif (!data.hottextChoices || data.hottextChoices.length === 0) {\n\t\t\terrors.push('hottextInteraction must have at least one hottext');\n\t\t}\n\n\t\t// Validate hottext identifiers\n\t\tif (data.hottextChoices) {\n\t\t\tconst identifiers = new Set<string>();\n\t\t\tfor (const hottext of data.hottextChoices) {\n\t\t\t\tif (!hottext.identifier) {\n\t\t\t\t\terrors.push('All hottext elements must have an identifier');\n\t\t\t\t} else if (identifiers.has(hottext.identifier)) {\n\t\t\t\t\terrors.push(`Duplicate hottext identifier: ${hottext.identifier}`);\n\t\t\t\t} else {\n\t\t\t\t\tidentifiers.add(hottext.identifier);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Validate maxChoices\n\t\tif (data.maxChoices < 0) {\n\t\t\terrors.push('maxChoices must be non-negative');\n\t\t}\n\n\t\t// Warn if maxChoices exceeds hottext count\n\t\tif (data.hottextChoices && data.maxChoices > data.hottextChoices.length) {\n\t\t\twarnings.push(\n\t\t\t\t`maxChoices (${data.maxChoices}) exceeds the number of hottext choices (${data.hottextChoices.length})`\n\t\t\t);\n\t\t}\n\n\t\t// Validate minChoices\n\t\tif (data.minChoices !== undefined && data.minChoices < 0) {\n\t\t\terrors.push('minChoices must be non-negative');\n\t\t}\n\n\t\t// Validate minChoices <= maxChoices\n\t\tif (\n\t\t\tdata.minChoices !== undefined &&\n\t\t\tdata.maxChoices > 0 &&\n\t\t\tdata.minChoices > data.maxChoices\n\t\t) {\n\t\t\terrors.push('minChoices cannot exceed 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 { HottextInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map