@pie-qti/item-player 0.1.4 → 0.1.6

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 (498) hide show
  1. package/README.md +21 -18
  2. package/dist/catalog/applyGlossaryTriggers.d.ts +15 -0
  3. package/dist/catalog/applyGlossaryTriggers.d.ts.map +1 -0
  4. package/dist/catalog/applyGlossaryTriggers.js +193 -0
  5. package/dist/catalog/catalogExtractor.d.ts +18 -0
  6. package/dist/catalog/catalogExtractor.d.ts.map +1 -0
  7. package/dist/catalog/catalogExtractor.js +114 -0
  8. package/dist/catalog/catalogLookup.d.ts +18 -0
  9. package/dist/catalog/catalogLookup.d.ts.map +1 -0
  10. package/dist/catalog/catalogLookup.js +44 -0
  11. package/dist/catalog/glossaryAction.d.ts +17 -0
  12. package/dist/catalog/glossaryAction.d.ts.map +1 -0
  13. package/dist/catalog/glossaryAction.js +21 -0
  14. package/dist/catalog/types.d.ts +26 -0
  15. package/dist/catalog/types.d.ts.map +1 -0
  16. package/dist/catalog/types.js +6 -0
  17. package/dist/core/ComponentRegistry.d.ts +14 -4
  18. package/dist/core/ComponentRegistry.d.ts.map +1 -1
  19. package/dist/core/ComponentRegistry.js +25 -4
  20. package/dist/core/ItemRenderer.d.ts.map +1 -1
  21. package/dist/core/ItemRenderer.js +8 -18
  22. package/dist/core/Player.d.ts +53 -1
  23. package/dist/core/Player.d.ts.map +1 -1
  24. package/dist/core/Player.js +195 -142
  25. package/dist/core/rolePolicy.d.ts +16 -0
  26. package/dist/core/rolePolicy.d.ts.map +1 -0
  27. package/dist/core/rolePolicy.js +15 -0
  28. package/dist/core/urlPolicy.d.ts.map +1 -1
  29. package/dist/core/urlPolicy.js +5 -2
  30. package/dist/document/AssessmentItemDocument.d.ts +42 -0
  31. package/dist/document/AssessmentItemDocument.d.ts.map +1 -0
  32. package/dist/document/AssessmentItemDocument.js +116 -0
  33. package/dist/element.d.ts +22 -0
  34. package/dist/element.js +5548 -0
  35. package/dist/element.js.map +1 -0
  36. package/dist/extraction/ExtractionRegistry.d.ts.map +1 -1
  37. package/dist/extraction/ExtractionRegistry.js +3 -1
  38. package/dist/extraction/extractors/associateExtractor.d.ts +1 -27
  39. package/dist/extraction/extractors/associateExtractor.d.ts.map +1 -1
  40. package/dist/extraction/extractors/associateExtractor.js +1 -94
  41. package/dist/extraction/extractors/choiceExtractor.d.ts +1 -24
  42. package/dist/extraction/extractors/choiceExtractor.d.ts.map +1 -1
  43. package/dist/extraction/extractors/choiceExtractor.js +1 -83
  44. package/dist/extraction/extractors/customExtractor.d.ts +1 -19
  45. package/dist/extraction/extractors/customExtractor.d.ts.map +1 -1
  46. package/dist/extraction/extractors/customExtractor.js +1 -51
  47. package/dist/extraction/extractors/drawingExtractor.d.ts +1 -29
  48. package/dist/extraction/extractors/drawingExtractor.d.ts.map +1 -1
  49. package/dist/extraction/extractors/drawingExtractor.js +1 -78
  50. package/dist/extraction/extractors/endAttemptExtractor.d.ts +1 -19
  51. package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +1 -1
  52. package/dist/extraction/extractors/endAttemptExtractor.js +1 -53
  53. package/dist/extraction/extractors/extendedTextExtractor.d.ts +1 -20
  54. package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +1 -1
  55. package/dist/extraction/extractors/extendedTextExtractor.js +1 -57
  56. package/dist/extraction/extractors/gapMatchExtractor.d.ts +1 -27
  57. package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +1 -1
  58. package/dist/extraction/extractors/gapMatchExtractor.js +1 -142
  59. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +1 -39
  60. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +1 -1
  61. package/dist/extraction/extractors/graphicAssociateExtractor.js +1 -140
  62. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +1 -41
  63. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +1 -1
  64. package/dist/extraction/extractors/graphicGapMatchExtractor.js +1 -144
  65. package/dist/extraction/extractors/graphicOrderExtractor.d.ts +1 -36
  66. package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +1 -1
  67. package/dist/extraction/extractors/graphicOrderExtractor.js +1 -121
  68. package/dist/extraction/extractors/hotspotExtractor.d.ts +1 -37
  69. package/dist/extraction/extractors/hotspotExtractor.d.ts.map +1 -1
  70. package/dist/extraction/extractors/hotspotExtractor.js +1 -140
  71. package/dist/extraction/extractors/hottextExtractor.d.ts +1 -25
  72. package/dist/extraction/extractors/hottextExtractor.d.ts.map +1 -1
  73. package/dist/extraction/extractors/hottextExtractor.js +1 -120
  74. package/dist/extraction/extractors/index.d.ts +5 -58
  75. package/dist/extraction/extractors/index.d.ts.map +1 -1
  76. package/dist/extraction/extractors/index.js +5 -81
  77. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +1 -21
  78. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +1 -1
  79. package/dist/extraction/extractors/inlineChoiceExtractor.js +1 -67
  80. package/dist/extraction/extractors/matchExtractor.d.ts +1 -31
  81. package/dist/extraction/extractors/matchExtractor.d.ts.map +1 -1
  82. package/dist/extraction/extractors/matchExtractor.js +1 -134
  83. package/dist/extraction/extractors/mediaExtractor.d.ts +1 -32
  84. package/dist/extraction/extractors/mediaExtractor.d.ts.map +1 -1
  85. package/dist/extraction/extractors/mediaExtractor.js +1 -125
  86. package/dist/extraction/extractors/orderExtractor.d.ts +1 -25
  87. package/dist/extraction/extractors/orderExtractor.d.ts.map +1 -1
  88. package/dist/extraction/extractors/orderExtractor.js +1 -86
  89. package/dist/extraction/extractors/portableCustomExtractor.d.ts +2 -0
  90. package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +1 -0
  91. package/dist/extraction/extractors/portableCustomExtractor.js +1 -0
  92. package/dist/extraction/extractors/positionObjectExtractor.d.ts +1 -58
  93. package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +1 -1
  94. package/dist/extraction/extractors/positionObjectExtractor.js +1 -191
  95. package/dist/extraction/extractors/selectPointExtractor.d.ts +1 -30
  96. package/dist/extraction/extractors/selectPointExtractor.d.ts.map +1 -1
  97. package/dist/extraction/extractors/selectPointExtractor.js +1 -109
  98. package/dist/extraction/extractors/sliderExtractor.d.ts +1 -23
  99. package/dist/extraction/extractors/sliderExtractor.d.ts.map +1 -1
  100. package/dist/extraction/extractors/sliderExtractor.js +1 -73
  101. package/dist/extraction/extractors/textEntryExtractor.d.ts +1 -19
  102. package/dist/extraction/extractors/textEntryExtractor.d.ts.map +1 -1
  103. package/dist/extraction/extractors/textEntryExtractor.js +1 -48
  104. package/dist/extraction/extractors/uploadExtractor.d.ts +1 -19
  105. package/dist/extraction/extractors/uploadExtractor.d.ts.map +1 -1
  106. package/dist/extraction/extractors/uploadExtractor.js +1 -52
  107. package/dist/extraction/index.d.ts +1 -1
  108. package/dist/extraction/index.d.ts.map +1 -1
  109. package/dist/extraction/index.js +2 -2
  110. package/dist/extraction/interactionExtractionPipeline.d.ts +13 -0
  111. package/dist/extraction/interactionExtractionPipeline.d.ts.map +1 -0
  112. package/dist/extraction/interactionExtractionPipeline.js +39 -0
  113. package/dist/extraction/interactionSecurity.d.ts +4 -0
  114. package/dist/extraction/interactionSecurity.d.ts.map +1 -0
  115. package/dist/extraction/interactionSecurity.js +48 -0
  116. package/dist/index.d.ts +12 -2
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +11 -4
  119. package/dist/interactions/associate/extractor.d.ts +29 -0
  120. package/dist/interactions/associate/extractor.d.ts.map +1 -0
  121. package/dist/interactions/associate/extractor.js +97 -0
  122. package/dist/interactions/associate/index.d.ts +3 -0
  123. package/dist/interactions/associate/index.d.ts.map +1 -0
  124. package/dist/interactions/associate/index.js +1 -0
  125. package/dist/interactions/associate/types.d.ts +2 -0
  126. package/dist/interactions/associate/types.d.ts.map +1 -0
  127. package/dist/interactions/associate/types.js +1 -0
  128. package/dist/interactions/choice/extractor.d.ts +27 -0
  129. package/dist/interactions/choice/extractor.d.ts.map +1 -0
  130. package/dist/interactions/choice/extractor.js +93 -0
  131. package/dist/interactions/choice/index.d.ts +3 -0
  132. package/dist/interactions/choice/index.d.ts.map +1 -0
  133. package/dist/interactions/choice/index.js +1 -0
  134. package/dist/interactions/choice/types.d.ts +2 -0
  135. package/dist/interactions/choice/types.d.ts.map +1 -0
  136. package/dist/interactions/choice/types.js +1 -0
  137. package/dist/interactions/custom/extractor.d.ts +20 -0
  138. package/dist/interactions/custom/extractor.d.ts.map +1 -0
  139. package/dist/interactions/custom/extractor.js +51 -0
  140. package/dist/interactions/custom/index.d.ts +3 -0
  141. package/dist/interactions/custom/index.d.ts.map +1 -0
  142. package/dist/interactions/custom/index.js +1 -0
  143. package/dist/interactions/custom/types.d.ts +2 -0
  144. package/dist/interactions/custom/types.d.ts.map +1 -0
  145. package/dist/interactions/custom/types.js +1 -0
  146. package/dist/interactions/drawing/extractor.d.ts +30 -0
  147. package/dist/interactions/drawing/extractor.d.ts.map +1 -0
  148. package/dist/interactions/drawing/extractor.js +78 -0
  149. package/dist/interactions/drawing/index.d.ts +3 -0
  150. package/dist/interactions/drawing/index.d.ts.map +1 -0
  151. package/dist/interactions/drawing/index.js +1 -0
  152. package/dist/interactions/drawing/types.d.ts +2 -0
  153. package/dist/interactions/drawing/types.d.ts.map +1 -0
  154. package/dist/interactions/drawing/types.js +1 -0
  155. package/dist/interactions/end-attempt/extractor.d.ts +20 -0
  156. package/dist/interactions/end-attempt/extractor.d.ts.map +1 -0
  157. package/dist/interactions/end-attempt/extractor.js +53 -0
  158. package/dist/interactions/end-attempt/index.d.ts +3 -0
  159. package/dist/interactions/end-attempt/index.d.ts.map +1 -0
  160. package/dist/interactions/end-attempt/index.js +1 -0
  161. package/dist/interactions/end-attempt/types.d.ts +2 -0
  162. package/dist/interactions/end-attempt/types.d.ts.map +1 -0
  163. package/dist/interactions/end-attempt/types.js +1 -0
  164. package/dist/interactions/extended-text/extractor.d.ts +21 -0
  165. package/dist/interactions/extended-text/extractor.d.ts.map +1 -0
  166. package/dist/interactions/extended-text/extractor.js +63 -0
  167. package/dist/interactions/extended-text/index.d.ts +3 -0
  168. package/dist/interactions/extended-text/index.d.ts.map +1 -0
  169. package/dist/interactions/extended-text/index.js +1 -0
  170. package/dist/interactions/extended-text/types.d.ts +2 -0
  171. package/dist/interactions/extended-text/types.d.ts.map +1 -0
  172. package/dist/interactions/extended-text/types.js +1 -0
  173. package/dist/interactions/gap-match/extractor.d.ts +29 -0
  174. package/dist/interactions/gap-match/extractor.d.ts.map +1 -0
  175. package/dist/interactions/gap-match/extractor.js +155 -0
  176. package/dist/interactions/gap-match/index.d.ts +3 -0
  177. package/dist/interactions/gap-match/index.d.ts.map +1 -0
  178. package/dist/interactions/gap-match/index.js +1 -0
  179. package/dist/interactions/gap-match/types.d.ts +2 -0
  180. package/dist/interactions/gap-match/types.d.ts.map +1 -0
  181. package/dist/interactions/gap-match/types.js +1 -0
  182. package/dist/interactions/graphic-associate/extractor.d.ts +41 -0
  183. package/dist/interactions/graphic-associate/extractor.d.ts.map +1 -0
  184. package/dist/interactions/graphic-associate/extractor.js +143 -0
  185. package/dist/interactions/graphic-associate/index.d.ts +3 -0
  186. package/dist/interactions/graphic-associate/index.d.ts.map +1 -0
  187. package/dist/interactions/graphic-associate/index.js +1 -0
  188. package/dist/interactions/graphic-associate/types.d.ts +2 -0
  189. package/dist/interactions/graphic-associate/types.d.ts.map +1 -0
  190. package/dist/interactions/graphic-associate/types.js +1 -0
  191. package/dist/interactions/graphic-gap-match/extractor.d.ts +53 -0
  192. package/dist/interactions/graphic-gap-match/extractor.d.ts.map +1 -0
  193. package/dist/interactions/graphic-gap-match/extractor.js +205 -0
  194. package/dist/interactions/graphic-gap-match/index.d.ts +3 -0
  195. package/dist/interactions/graphic-gap-match/index.d.ts.map +1 -0
  196. package/dist/interactions/graphic-gap-match/index.js +1 -0
  197. package/dist/interactions/graphic-gap-match/types.d.ts +2 -0
  198. package/dist/interactions/graphic-gap-match/types.d.ts.map +1 -0
  199. package/dist/interactions/graphic-gap-match/types.js +1 -0
  200. package/dist/interactions/graphic-order/extractor.d.ts +37 -0
  201. package/dist/interactions/graphic-order/extractor.d.ts.map +1 -0
  202. package/dist/interactions/graphic-order/extractor.js +121 -0
  203. package/dist/interactions/graphic-order/index.d.ts +3 -0
  204. package/dist/interactions/graphic-order/index.d.ts.map +1 -0
  205. package/dist/interactions/graphic-order/index.js +1 -0
  206. package/dist/interactions/graphic-order/types.d.ts +2 -0
  207. package/dist/interactions/graphic-order/types.d.ts.map +1 -0
  208. package/dist/interactions/graphic-order/types.js +1 -0
  209. package/dist/interactions/hotspot/extractor.d.ts +38 -0
  210. package/dist/interactions/hotspot/extractor.d.ts.map +1 -0
  211. package/dist/interactions/hotspot/extractor.js +159 -0
  212. package/dist/interactions/hotspot/index.d.ts +3 -0
  213. package/dist/interactions/hotspot/index.d.ts.map +1 -0
  214. package/dist/interactions/hotspot/index.js +1 -0
  215. package/dist/interactions/hotspot/types.d.ts +2 -0
  216. package/dist/interactions/hotspot/types.d.ts.map +1 -0
  217. package/dist/interactions/hotspot/types.js +1 -0
  218. package/dist/interactions/hottext/extractor.d.ts +26 -0
  219. package/dist/interactions/hottext/extractor.d.ts.map +1 -0
  220. package/dist/interactions/hottext/extractor.js +128 -0
  221. package/dist/interactions/hottext/index.d.ts +3 -0
  222. package/dist/interactions/hottext/index.d.ts.map +1 -0
  223. package/dist/interactions/hottext/index.js +1 -0
  224. package/dist/interactions/hottext/types.d.ts +2 -0
  225. package/dist/interactions/hottext/types.d.ts.map +1 -0
  226. package/dist/interactions/hottext/types.js +1 -0
  227. package/dist/interactions/index.d.ts +33 -0
  228. package/dist/interactions/index.d.ts.map +1 -0
  229. package/dist/interactions/index.js +30 -0
  230. package/dist/interactions/inline/index.d.ts +2 -0
  231. package/dist/interactions/inline/index.d.ts.map +1 -0
  232. package/dist/interactions/inline/index.js +1 -0
  233. package/dist/interactions/inline/render-plan.d.ts +19 -0
  234. package/dist/interactions/inline/render-plan.d.ts.map +1 -0
  235. package/dist/interactions/inline/render-plan.js +59 -0
  236. package/dist/interactions/inline-choice/extractor.d.ts +25 -0
  237. package/dist/interactions/inline-choice/extractor.d.ts.map +1 -0
  238. package/dist/interactions/inline-choice/extractor.js +80 -0
  239. package/dist/interactions/inline-choice/index.d.ts +3 -0
  240. package/dist/interactions/inline-choice/index.d.ts.map +1 -0
  241. package/dist/interactions/inline-choice/index.js +1 -0
  242. package/dist/interactions/inline-choice/types.d.ts +2 -0
  243. package/dist/interactions/inline-choice/types.d.ts.map +1 -0
  244. package/dist/interactions/inline-choice/types.js +1 -0
  245. package/dist/interactions/match/extractor.d.ts +37 -0
  246. package/dist/interactions/match/extractor.d.ts.map +1 -0
  247. package/dist/interactions/match/extractor.js +160 -0
  248. package/dist/interactions/match/index.d.ts +3 -0
  249. package/dist/interactions/match/index.d.ts.map +1 -0
  250. package/dist/interactions/match/index.js +1 -0
  251. package/dist/interactions/match/types.d.ts +2 -0
  252. package/dist/interactions/match/types.d.ts.map +1 -0
  253. package/dist/interactions/match/types.js +1 -0
  254. package/dist/interactions/media/extractor.d.ts +33 -0
  255. package/dist/interactions/media/extractor.d.ts.map +1 -0
  256. package/dist/interactions/media/extractor.js +125 -0
  257. package/dist/interactions/media/index.d.ts +3 -0
  258. package/dist/interactions/media/index.d.ts.map +1 -0
  259. package/dist/interactions/media/index.js +1 -0
  260. package/dist/interactions/media/types.d.ts +2 -0
  261. package/dist/interactions/media/types.d.ts.map +1 -0
  262. package/dist/interactions/media/types.js +1 -0
  263. package/dist/interactions/modules.d.ts +105 -0
  264. package/dist/interactions/modules.d.ts.map +1 -0
  265. package/dist/interactions/modules.js +86 -0
  266. package/dist/interactions/order/extractor.d.ts +28 -0
  267. package/dist/interactions/order/extractor.d.ts.map +1 -0
  268. package/dist/interactions/order/extractor.js +90 -0
  269. package/dist/interactions/order/index.d.ts +3 -0
  270. package/dist/interactions/order/index.d.ts.map +1 -0
  271. package/dist/interactions/order/index.js +1 -0
  272. package/dist/interactions/order/types.d.ts +2 -0
  273. package/dist/interactions/order/types.d.ts.map +1 -0
  274. package/dist/interactions/order/types.js +1 -0
  275. package/dist/interactions/portable-custom/extractor.d.ts +14 -0
  276. package/dist/interactions/portable-custom/extractor.d.ts.map +1 -0
  277. package/dist/interactions/portable-custom/extractor.js +96 -0
  278. package/dist/interactions/portable-custom/index.d.ts +3 -0
  279. package/dist/interactions/portable-custom/index.d.ts.map +1 -0
  280. package/dist/interactions/portable-custom/index.js +1 -0
  281. package/dist/interactions/portable-custom/types.d.ts +2 -0
  282. package/dist/interactions/portable-custom/types.d.ts.map +1 -0
  283. package/dist/interactions/portable-custom/types.js +1 -0
  284. package/dist/interactions/position-object/extractor.d.ts +59 -0
  285. package/dist/interactions/position-object/extractor.d.ts.map +1 -0
  286. package/dist/interactions/position-object/extractor.js +191 -0
  287. package/dist/interactions/position-object/index.d.ts +3 -0
  288. package/dist/interactions/position-object/index.d.ts.map +1 -0
  289. package/dist/interactions/position-object/index.js +1 -0
  290. package/dist/interactions/position-object/types.d.ts +2 -0
  291. package/dist/interactions/position-object/types.d.ts.map +1 -0
  292. package/dist/interactions/position-object/types.js +1 -0
  293. package/dist/interactions/select-point/extractor.d.ts +31 -0
  294. package/dist/interactions/select-point/extractor.d.ts.map +1 -0
  295. package/dist/interactions/select-point/extractor.js +109 -0
  296. package/dist/interactions/select-point/index.d.ts +3 -0
  297. package/dist/interactions/select-point/index.d.ts.map +1 -0
  298. package/dist/interactions/select-point/index.js +1 -0
  299. package/dist/interactions/select-point/types.d.ts +2 -0
  300. package/dist/interactions/select-point/types.d.ts.map +1 -0
  301. package/dist/interactions/select-point/types.js +1 -0
  302. package/dist/interactions/shared/index.d.ts +2 -0
  303. package/dist/interactions/shared/index.d.ts.map +1 -0
  304. package/dist/interactions/shared/index.js +1 -0
  305. package/dist/interactions/shared/types.d.ts +412 -0
  306. package/dist/interactions/shared/types.d.ts.map +1 -0
  307. package/dist/interactions/shared/types.js +7 -0
  308. package/dist/interactions/slider/extractor.d.ts +24 -0
  309. package/dist/interactions/slider/extractor.d.ts.map +1 -0
  310. package/dist/interactions/slider/extractor.js +73 -0
  311. package/dist/interactions/slider/index.d.ts +3 -0
  312. package/dist/interactions/slider/index.d.ts.map +1 -0
  313. package/dist/interactions/slider/index.js +1 -0
  314. package/dist/interactions/slider/types.d.ts +2 -0
  315. package/dist/interactions/slider/types.d.ts.map +1 -0
  316. package/dist/interactions/slider/types.js +1 -0
  317. package/dist/interactions/text-entry/extractor.d.ts +21 -0
  318. package/dist/interactions/text-entry/extractor.d.ts.map +1 -0
  319. package/dist/interactions/text-entry/extractor.js +54 -0
  320. package/dist/interactions/text-entry/index.d.ts +3 -0
  321. package/dist/interactions/text-entry/index.d.ts.map +1 -0
  322. package/dist/interactions/text-entry/index.js +1 -0
  323. package/dist/interactions/text-entry/types.d.ts +2 -0
  324. package/dist/interactions/text-entry/types.d.ts.map +1 -0
  325. package/dist/interactions/text-entry/types.js +1 -0
  326. package/dist/interactions/upload/extractor.d.ts +20 -0
  327. package/dist/interactions/upload/extractor.d.ts.map +1 -0
  328. package/dist/interactions/upload/extractor.js +59 -0
  329. package/dist/interactions/upload/index.d.ts +3 -0
  330. package/dist/interactions/upload/index.d.ts.map +1 -0
  331. package/dist/interactions/upload/index.js +1 -0
  332. package/dist/interactions/upload/types.d.ts +2 -0
  333. package/dist/interactions/upload/types.d.ts.map +1 -0
  334. package/dist/interactions/upload/types.js +1 -0
  335. package/dist/pci/PciHost.d.ts +53 -0
  336. package/dist/pci/PciHost.d.ts.map +1 -0
  337. package/dist/pci/PciHost.js +116 -0
  338. package/dist/pci/types.d.ts +57 -0
  339. package/dist/pci/types.d.ts.map +1 -0
  340. package/dist/pci/types.js +19 -0
  341. package/dist/pnp/applyPnp.d.ts +9 -0
  342. package/dist/pnp/applyPnp.d.ts.map +1 -0
  343. package/dist/pnp/applyPnp.js +19 -0
  344. package/dist/pnp/parsePnpXml.d.ts +9 -0
  345. package/dist/pnp/parsePnpXml.d.ts.map +1 -0
  346. package/dist/pnp/parsePnpXml.js +101 -0
  347. package/dist/pnp/types.d.ts +40 -0
  348. package/dist/pnp/types.d.ts.map +1 -0
  349. package/dist/pnp/types.js +1 -0
  350. package/dist/types/index.d.ts +22 -8
  351. package/dist/types/index.d.ts.map +1 -1
  352. package/dist/types/interactions.d.ts +4 -319
  353. package/dist/types/interactions.d.ts.map +1 -1
  354. package/dist/types/interactions.js +3 -3
  355. package/dist/web-components/QTIInteractionBase.d.ts +5 -5
  356. package/dist/web-components/QTIInteractionBase.d.ts.map +1 -1
  357. package/dist/web-components/QTIInteractionElement.d.ts +11 -8
  358. package/dist/web-components/QTIInteractionElement.d.ts.map +1 -1
  359. package/dist/web-components/index.d.ts +1 -1
  360. package/dist/web-components/index.d.ts.map +1 -1
  361. package/package.json +19 -9
  362. package/src/__tests__/catalog.test.ts +267 -0
  363. package/src/__tests__/fixtures/pci/echo-pci.js +49 -0
  364. package/src/__tests__/glossaryTriggers.test.ts +411 -0
  365. package/src/__tests__/pci.test.ts +353 -0
  366. package/src/__tests__/pnp.test.ts +250 -0
  367. package/src/__tests__/qti3-extraction.test.ts +5 -5
  368. package/src/catalog/applyGlossaryTriggers.ts +232 -0
  369. package/src/catalog/catalogExtractor.ts +130 -0
  370. package/src/catalog/catalogLookup.ts +53 -0
  371. package/src/catalog/glossaryAction.ts +28 -0
  372. package/src/catalog/types.ts +37 -0
  373. package/src/components/ItemBody.svelte +105 -135
  374. package/src/components/ItemPlayer.svelte +15 -7
  375. package/src/components/ModalFeedbackDisplay.svelte +15 -5
  376. package/src/components/index.ts +3 -0
  377. package/src/core/ComponentRegistry.ts +36 -7
  378. package/src/core/Player.ts +212 -157
  379. package/src/core/rolePolicy.ts +34 -0
  380. package/src/core/urlPolicy.ts +5 -2
  381. package/src/document/AssessmentItemDocument.ts +178 -0
  382. package/src/element.ts +128 -0
  383. package/src/extraction/ExtractionRegistry.ts +5 -1
  384. package/src/extraction/extractors/associateExtractor.ts +1 -129
  385. package/src/extraction/extractors/choiceExtractor.ts +1 -110
  386. package/src/extraction/extractors/conformance-qti3-advanced.test.ts +239 -0
  387. package/src/extraction/extractors/conformance-qti3-basic.test.ts +82 -0
  388. package/src/extraction/extractors/conformance.test.ts +208 -0
  389. package/src/extraction/extractors/customExtractor.ts +1 -72
  390. package/src/extraction/extractors/drawingExtractor.ts +1 -113
  391. package/src/extraction/extractors/endAttemptExtractor.ts +1 -74
  392. package/src/extraction/extractors/extendedTextExtractor.ts +1 -83
  393. package/src/extraction/extractors/gapMatchExtractor.ts +1 -178
  394. package/src/extraction/extractors/graphicAssociateExtractor.ts +1 -188
  395. package/src/extraction/extractors/graphicGapMatchExtractor.ts +1 -185
  396. package/src/extraction/extractors/graphicOrderExtractor.ts +1 -162
  397. package/src/extraction/extractors/hotspotExtractor.ts +1 -190
  398. package/src/extraction/extractors/hottextExtractor.ts +1 -153
  399. package/src/extraction/extractors/index.ts +5 -107
  400. package/src/extraction/extractors/inlineChoiceExtractor.ts +1 -88
  401. package/src/extraction/extractors/matchExtractor.ts +1 -160
  402. package/src/extraction/extractors/mediaExtractor.ts +1 -168
  403. package/src/extraction/extractors/orderExtractor.ts +1 -114
  404. package/src/extraction/extractors/portableCustomExtractor.ts +1 -0
  405. package/src/extraction/extractors/positionObjectExtractor.ts +1 -243
  406. package/src/extraction/extractors/selectPointExtractor.ts +1 -143
  407. package/src/extraction/extractors/sliderExtractor.ts +1 -102
  408. package/src/extraction/extractors/textEntryExtractor.ts +1 -72
  409. package/src/extraction/extractors/uploadExtractor.ts +1 -73
  410. package/src/extraction/index.ts +1 -2
  411. package/src/extraction/interactionExtractionPipeline.ts +70 -0
  412. package/src/extraction/interactionSecurity.ts +60 -0
  413. package/src/index.ts +19 -8
  414. package/src/interactions/associate/extractor.ts +133 -0
  415. package/src/interactions/associate/index.ts +2 -0
  416. package/src/interactions/associate/types.ts +1 -0
  417. package/src/interactions/choice/extractor.ts +121 -0
  418. package/src/interactions/choice/index.ts +2 -0
  419. package/src/interactions/choice/types.ts +1 -0
  420. package/src/interactions/custom/extractor.ts +72 -0
  421. package/src/interactions/custom/index.ts +2 -0
  422. package/src/interactions/custom/types.ts +1 -0
  423. package/src/interactions/drawing/extractor.ts +113 -0
  424. package/src/interactions/drawing/index.ts +2 -0
  425. package/src/interactions/drawing/types.ts +1 -0
  426. package/src/interactions/end-attempt/extractor.ts +74 -0
  427. package/src/interactions/end-attempt/index.ts +2 -0
  428. package/src/interactions/end-attempt/types.ts +1 -0
  429. package/src/interactions/extended-text/extractor.ts +89 -0
  430. package/src/interactions/extended-text/index.ts +2 -0
  431. package/src/interactions/extended-text/types.ts +1 -0
  432. package/src/interactions/gap-match/extractor.ts +193 -0
  433. package/src/interactions/gap-match/index.ts +2 -0
  434. package/src/interactions/gap-match/types.ts +1 -0
  435. package/src/interactions/graphic-associate/extractor.ts +192 -0
  436. package/src/interactions/graphic-associate/index.ts +2 -0
  437. package/src/interactions/graphic-associate/types.ts +1 -0
  438. package/src/interactions/graphic-gap-match/extractor.ts +257 -0
  439. package/src/interactions/graphic-gap-match/index.ts +2 -0
  440. package/src/interactions/graphic-gap-match/types.ts +1 -0
  441. package/src/interactions/graphic-order/extractor.ts +162 -0
  442. package/src/interactions/graphic-order/index.ts +2 -0
  443. package/src/interactions/graphic-order/types.ts +1 -0
  444. package/src/interactions/hotspot/extractor.ts +208 -0
  445. package/src/interactions/hotspot/index.ts +2 -0
  446. package/src/interactions/hotspot/types.ts +1 -0
  447. package/src/interactions/hottext/extractor.ts +163 -0
  448. package/src/interactions/hottext/index.ts +2 -0
  449. package/src/interactions/hottext/types.ts +1 -0
  450. package/src/interactions/index.ts +52 -0
  451. package/src/interactions/inline/index.ts +1 -0
  452. package/src/interactions/inline/render-plan.ts +105 -0
  453. package/src/interactions/inline-choice/InlineChoice.svelte +57 -0
  454. package/src/interactions/inline-choice/extractor.ts +105 -0
  455. package/src/interactions/inline-choice/index.ts +2 -0
  456. package/src/interactions/inline-choice/types.ts +1 -0
  457. package/src/interactions/match/extractor.ts +187 -0
  458. package/src/interactions/match/index.ts +2 -0
  459. package/src/interactions/match/types.ts +1 -0
  460. package/src/interactions/media/extractor.ts +168 -0
  461. package/src/interactions/media/index.ts +2 -0
  462. package/src/interactions/media/types.ts +1 -0
  463. package/src/interactions/modules.ts +111 -0
  464. package/src/interactions/order/extractor.ts +120 -0
  465. package/src/interactions/order/index.ts +2 -0
  466. package/src/interactions/order/types.ts +1 -0
  467. package/src/interactions/portable-custom/extractor.ts +122 -0
  468. package/src/interactions/portable-custom/index.ts +2 -0
  469. package/src/interactions/portable-custom/types.ts +1 -0
  470. package/src/interactions/position-object/extractor.ts +243 -0
  471. package/src/interactions/position-object/index.ts +2 -0
  472. package/src/interactions/position-object/types.ts +1 -0
  473. package/src/interactions/select-point/extractor.ts +143 -0
  474. package/src/interactions/select-point/index.ts +2 -0
  475. package/src/interactions/select-point/types.ts +1 -0
  476. package/src/interactions/shared/index.ts +1 -0
  477. package/src/interactions/shared/types.ts +429 -0
  478. package/src/interactions/slider/extractor.ts +102 -0
  479. package/src/interactions/slider/index.ts +2 -0
  480. package/src/interactions/slider/types.ts +1 -0
  481. package/src/interactions/text-entry/InlineTextEntry.svelte +75 -0
  482. package/src/interactions/text-entry/extractor.ts +79 -0
  483. package/src/interactions/text-entry/index.ts +2 -0
  484. package/src/interactions/text-entry/types.ts +1 -0
  485. package/src/interactions/upload/extractor.ts +81 -0
  486. package/src/interactions/upload/index.ts +2 -0
  487. package/src/interactions/upload/types.ts +1 -0
  488. package/src/pci/PciHost.ts +138 -0
  489. package/src/pci/types.ts +70 -0
  490. package/src/pnp/applyPnp.ts +23 -0
  491. package/src/pnp/parsePnpXml.ts +118 -0
  492. package/src/pnp/types.ts +33 -0
  493. package/src/types/index.ts +22 -8
  494. package/src/types/interactions.ts +4 -350
  495. package/src/web-components/QTIInteractionBase.ts +6 -5
  496. package/src/web-components/QTIInteractionElement.ts +15 -8
  497. package/src/web-components/index.ts +1 -0
  498. package/src/core/ItemRenderer.ts +0 -367
@@ -0,0 +1,86 @@
1
+ import { standardAssociateExtractor } from './associate/index.js';
2
+ import { standardChoiceExtractor } from './choice/index.js';
3
+ import { standardCustomExtractor } from './custom/index.js';
4
+ import { standardDrawingExtractor } from './drawing/index.js';
5
+ import { standardEndAttemptExtractor } from './end-attempt/index.js';
6
+ import { standardExtendedTextExtractor } from './extended-text/index.js';
7
+ import { standardGapMatchExtractor } from './gap-match/index.js';
8
+ import { standardGraphicAssociateExtractor } from './graphic-associate/index.js';
9
+ import { standardGraphicGapMatchExtractor } from './graphic-gap-match/index.js';
10
+ import { standardGraphicOrderExtractor } from './graphic-order/index.js';
11
+ import { standardHotspotExtractor } from './hotspot/index.js';
12
+ import { standardHottextExtractor } from './hottext/index.js';
13
+ import { standardInlineChoiceExtractor } from './inline-choice/index.js';
14
+ import { standardMatchExtractor } from './match/index.js';
15
+ import { standardMediaExtractor } from './media/index.js';
16
+ import { standardOrderExtractor } from './order/index.js';
17
+ import { standardPositionObjectExtractor } from './position-object/index.js';
18
+ import { standardSelectPointExtractor } from './select-point/index.js';
19
+ import { standardSliderExtractor } from './slider/index.js';
20
+ import { standardTextEntryExtractor } from './text-entry/index.js';
21
+ import { standardUploadExtractor } from './upload/index.js';
22
+ export const STANDARD_INTERACTION_MODULES = [
23
+ { type: 'choiceInteraction', extractor: standardChoiceExtractor, placement: 'block' },
24
+ { type: 'textEntryInteraction', extractor: standardTextEntryExtractor, placement: 'inline' },
25
+ { type: 'extendedTextInteraction', extractor: standardExtendedTextExtractor, placement: 'block' },
26
+ { type: 'inlineChoiceInteraction', extractor: standardInlineChoiceExtractor, placement: 'inline' },
27
+ { type: 'orderInteraction', extractor: standardOrderExtractor, placement: 'block' },
28
+ { type: 'matchInteraction', extractor: standardMatchExtractor, placement: 'block' },
29
+ { type: 'associateInteraction', extractor: standardAssociateExtractor, placement: 'block' },
30
+ { type: 'gapMatchInteraction', extractor: standardGapMatchExtractor, placement: 'block' },
31
+ { type: 'sliderInteraction', extractor: standardSliderExtractor, placement: 'block' },
32
+ { type: 'hotspotInteraction', extractor: standardHotspotExtractor, placement: 'block' },
33
+ { type: 'graphicGapMatchInteraction', extractor: standardGraphicGapMatchExtractor, placement: 'block' },
34
+ { type: 'uploadInteraction', extractor: standardUploadExtractor, placement: 'block' },
35
+ { type: 'drawingInteraction', extractor: standardDrawingExtractor, placement: 'block' },
36
+ { type: 'customInteraction', extractor: standardCustomExtractor, placement: 'block' },
37
+ { type: 'mediaInteraction', extractor: standardMediaExtractor, placement: 'block' },
38
+ { type: 'hottextInteraction', extractor: standardHottextExtractor, placement: 'block' },
39
+ { type: 'selectPointInteraction', extractor: standardSelectPointExtractor, placement: 'block' },
40
+ { type: 'graphicOrderInteraction', extractor: standardGraphicOrderExtractor, placement: 'block' },
41
+ { type: 'graphicAssociateInteraction', extractor: standardGraphicAssociateExtractor, placement: 'block' },
42
+ { type: 'positionObjectInteraction', extractor: standardPositionObjectExtractor, placement: 'block' },
43
+ { type: 'endAttemptInteraction', extractor: standardEndAttemptExtractor, placement: 'block' },
44
+ ];
45
+ export function getStandardInteractionModules() {
46
+ return STANDARD_INTERACTION_MODULES;
47
+ }
48
+ export function getStandardBlockInteractionModules() {
49
+ return STANDARD_INTERACTION_MODULES.filter((module) => module.placement === 'block');
50
+ }
51
+ export function getStandardInlineInteractionModules() {
52
+ return STANDARD_INTERACTION_MODULES.filter((module) => module.placement === 'inline');
53
+ }
54
+ export function getStandardInteractionExtractors() {
55
+ return STANDARD_INTERACTION_MODULES.map((module) => module.extractor);
56
+ }
57
+ export function getStandardInteractionElementTypes() {
58
+ const elementTypes = new Set();
59
+ for (const module of STANDARD_INTERACTION_MODULES) {
60
+ for (const elementType of module.extractor.elementTypes) {
61
+ elementTypes.add(elementType);
62
+ }
63
+ }
64
+ return [...elementTypes];
65
+ }
66
+ const STANDARD_TYPE_BY_LOWERCASE = new Map(STANDARD_INTERACTION_MODULES.map((module) => [module.type.toLowerCase(), module.type]));
67
+ export function normalizeInteractionTypeFromTagName(tagName) {
68
+ const lowerTagName = tagName.toLowerCase();
69
+ if (lowerTagName.startsWith('qti-')) {
70
+ return lowerTagName.slice(4).replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
71
+ }
72
+ return STANDARD_TYPE_BY_LOWERCASE.get(lowerTagName) ?? tagName;
73
+ }
74
+ export function getStandardInteractionModule(type) {
75
+ const normalizedType = normalizeInteractionTypeFromTagName(type);
76
+ return STANDARD_INTERACTION_MODULES.find((module) => module.type === normalizedType) ?? null;
77
+ }
78
+ export function isStandardInlineInteractionType(type) {
79
+ return getStandardInteractionModule(type)?.placement === 'inline';
80
+ }
81
+ export function isStandardBlockInteractionType(type) {
82
+ return getStandardInteractionModule(type)?.placement === 'block';
83
+ }
84
+ export function isStandardInlineInteractionTagName(tagName) {
85
+ return isStandardInlineInteractionType(normalizeInteractionTypeFromTagName(tagName));
86
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Standard QTI orderInteraction extractor
3
+ *
4
+ * Extracts data from orderInteraction elements (ordering/ranking tasks)
5
+ */
6
+ import type { ElementExtractor } from '../../extraction/types.js';
7
+ /**
8
+ * Order data extracted from orderInteraction elements
9
+ */
10
+ export interface OrderData {
11
+ choices: Array<{
12
+ identifier: string;
13
+ text: string;
14
+ fixed?: boolean;
15
+ classes?: string[];
16
+ }>;
17
+ shuffle: boolean;
18
+ minChoices: number;
19
+ maxChoices: number;
20
+ orientation?: string;
21
+ prompt: string | null;
22
+ }
23
+ /**
24
+ * Standard QTI order interaction extractor
25
+ * Handles orderInteraction elements with simpleChoice children
26
+ */
27
+ export declare const standardOrderExtractor: ElementExtractor<OrderData>;
28
+ //# sourceMappingURL=extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/order/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC1F,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,SAAS,CA+F9D,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Standard QTI orderInteraction extractor
3
+ *
4
+ * Extracts data from orderInteraction elements (ordering/ranking tasks)
5
+ */
6
+ /**
7
+ * Standard QTI order interaction extractor
8
+ * Handles orderInteraction elements with simpleChoice children
9
+ */
10
+ export const standardOrderExtractor = {
11
+ id: 'qti:order-interaction',
12
+ name: 'QTI Standard Order Interaction',
13
+ priority: 10,
14
+ elementTypes: ['orderInteraction'],
15
+ description: 'Extracts standard QTI orderInteraction (ordering/ranking tasks)',
16
+ canHandle(element, context) {
17
+ // Standard QTI order interactions have simpleChoice children
18
+ return context.utils.hasChildWithTag(element, 'simpleChoice');
19
+ },
20
+ extract(element, context) {
21
+ const { utils } = context;
22
+ // Extract choices
23
+ const simpleChoices = utils.getChildrenByTag(element, 'simpleChoice');
24
+ const choices = simpleChoices.map((choice) => {
25
+ const classes = utils.getClasses(choice);
26
+ const fixed = utils.getBooleanAttribute(choice, 'fixed');
27
+ return {
28
+ identifier: utils.getAttribute(choice, 'identifier', ''),
29
+ text: utils.getHtmlContent(choice),
30
+ ...(fixed ? { fixed } : {}),
31
+ ...(classes.length > 0 ? { classes } : {}),
32
+ };
33
+ });
34
+ // Extract prompt
35
+ const promptElement = utils.querySelector(element, 'prompt');
36
+ const prompt = promptElement ? utils.getHtmlContent(promptElement) : null;
37
+ // Extract attributes
38
+ const shuffle = utils.getBooleanAttribute(element, 'shuffle');
39
+ const orientation = utils.getAttribute(element, 'orientation', 'vertical');
40
+ const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
41
+ const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 0);
42
+ return {
43
+ choices,
44
+ shuffle,
45
+ orientation,
46
+ minChoices,
47
+ maxChoices,
48
+ prompt,
49
+ };
50
+ },
51
+ validate(data) {
52
+ const errors = [];
53
+ const warnings = [];
54
+ // Validate choices exist
55
+ if (!data.choices || data.choices.length < 2) {
56
+ errors.push('orderInteraction must have at least 2 choices');
57
+ }
58
+ // Warn if too many choices (difficult to order)
59
+ if (data.choices && data.choices.length > 10) {
60
+ warnings.push(`orderInteraction has ${data.choices.length} choices - this may be difficult for users to order`);
61
+ }
62
+ // Validate choice identifiers
63
+ if (data.choices) {
64
+ const identifiers = new Set();
65
+ for (const choice of data.choices) {
66
+ if (!choice.identifier) {
67
+ errors.push('All choices must have an identifier');
68
+ }
69
+ else if (identifiers.has(choice.identifier)) {
70
+ errors.push(`Duplicate choice identifier: ${choice.identifier}`);
71
+ }
72
+ else {
73
+ identifiers.add(choice.identifier);
74
+ }
75
+ }
76
+ }
77
+ // Validate orientation (only if provided)
78
+ if (data.orientation) {
79
+ const validOrientations = ['vertical', 'horizontal'];
80
+ if (!validOrientations.includes(data.orientation)) {
81
+ warnings.push(`orientation '${data.orientation}' is not standard (expected: ${validOrientations.join(', ')})`);
82
+ }
83
+ }
84
+ return {
85
+ valid: errors.length === 0,
86
+ errors: errors.length > 0 ? errors : undefined,
87
+ warnings: warnings.length > 0 ? warnings : undefined,
88
+ };
89
+ },
90
+ };
@@ -0,0 +1,3 @@
1
+ export * from './extractor.js';
2
+ export type { OrderInteractionData } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/order/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './extractor.js';
@@ -0,0 +1,2 @@
1
+ export type { OrderInteractionData } from '../shared/types.js';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/order/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { ElementExtractor } from '../../extraction/types.js';
2
+ import type { ExtractedPci } from '../../pci/types.js';
3
+ /**
4
+ * Extractor for <qti-portable-custom-interaction> (QTI 3.0) and
5
+ * <portableCustomInteraction> (QTI 2.x vendor extension).
6
+ *
7
+ * Extracts the module paths, markup, and config properties needed by PciHost
8
+ * to load and initialize the PCI JavaScript module.
9
+ *
10
+ * Priority 20 > standardCustomExtractor priority 10, so this runs first when
11
+ * both would match the same element.
12
+ */
13
+ export declare const portableCustomExtractor: ElementExtractor<ExtractedPci>;
14
+ //# sourceMappingURL=extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/portable-custom/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAAgB,CAAC,YAAY,CA4GlE,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Extractor for <qti-portable-custom-interaction> (QTI 3.0) and
3
+ * <portableCustomInteraction> (QTI 2.x vendor extension).
4
+ *
5
+ * Extracts the module paths, markup, and config properties needed by PciHost
6
+ * to load and initialize the PCI JavaScript module.
7
+ *
8
+ * Priority 20 > standardCustomExtractor priority 10, so this runs first when
9
+ * both would match the same element.
10
+ */
11
+ export const portableCustomExtractor = {
12
+ id: 'qti:portable-custom-interaction',
13
+ name: 'QTI Portable Custom Interaction',
14
+ priority: 20,
15
+ elementTypes: [
16
+ 'portableCustomInteraction',
17
+ 'qti-portable-custom-interaction',
18
+ ],
19
+ description: 'Extracts QTI 3.0 portable custom interaction module paths, markup, and config',
20
+ canHandle(element, _context) {
21
+ const tag = element.rawTagName?.toLowerCase() ?? '';
22
+ return (tag === 'qti-portable-custom-interaction' ||
23
+ tag === 'portablecustominteraction');
24
+ },
25
+ extract(element, context) {
26
+ const { utils } = context;
27
+ const responseIdentifier = utils.getAttribute(element, 'responseIdentifier') ||
28
+ utils.getAttribute(element, 'response-identifier') || '';
29
+ const customInteractionTypeIdentifier = utils.getAttribute(element, 'customInteractionTypeIdentifier') ||
30
+ utils.getAttribute(element, 'custom-interaction-type-identifier') || '';
31
+ // --- Module paths from <qti-interaction-modules>/<qti-interaction-module> ---
32
+ // These element names ARE in the standard QTI 3.0 element mapper so utils.querySelector works.
33
+ let primaryPath = '';
34
+ let fallbackPath;
35
+ const modulesEl = utils.querySelector(element, 'qti-interaction-modules') ??
36
+ utils.querySelector(element, 'interactionmodules');
37
+ if (modulesEl) {
38
+ const moduleEl = utils.querySelector(modulesEl, 'qti-interaction-module') ??
39
+ utils.querySelector(modulesEl, 'interactionmodule');
40
+ if (moduleEl) {
41
+ primaryPath =
42
+ utils.getAttribute(moduleEl, 'primaryPath') ||
43
+ utils.getAttribute(moduleEl, 'primary-path') || '';
44
+ const fb = utils.getAttribute(moduleEl, 'fallbackPath') ||
45
+ utils.getAttribute(moduleEl, 'fallback-path') || '';
46
+ if (fb)
47
+ fallbackPath = fb;
48
+ }
49
+ }
50
+ // --- Markup from <qti-interaction-markup> ---
51
+ const markupEl = utils.querySelector(element, 'qti-interaction-markup') ??
52
+ utils.querySelector(element, 'interactionmarkup');
53
+ const markup = markupEl ? utils.getHtmlContent(markupEl) : '';
54
+ // --- Config from <qti-pci-properties>/<qti-pci-property> ---
55
+ // qti-pci-properties is NOT in the standard QTI 3.0 element mapper, so we use the
56
+ // native node-html-parser querySelector (available as element.querySelector on the raw element).
57
+ const config = {};
58
+ const rawEl = element;
59
+ const propsEl = rawEl.querySelector?.('qti-pci-properties') ??
60
+ rawEl.querySelector?.('pciproperties');
61
+ if (propsEl) {
62
+ const propEls = [
63
+ ...(propsEl.querySelectorAll?.('qti-pci-property') ?? []),
64
+ ...(propsEl.querySelectorAll?.('pciproperty') ?? []),
65
+ ];
66
+ for (const propEl of propEls) {
67
+ const key = propEl.getAttribute?.('key') || propEl.getAttribute?.('name') || '';
68
+ const value = propEl.getAttribute?.('value') || (propEl.textContent ?? '').trim() || '';
69
+ if (key)
70
+ config[key] = value;
71
+ }
72
+ }
73
+ return {
74
+ responseIdentifier,
75
+ customInteractionTypeIdentifier,
76
+ primaryPath,
77
+ fallbackPath,
78
+ markup,
79
+ config,
80
+ };
81
+ },
82
+ validate(data) {
83
+ const errors = [];
84
+ const warnings = [];
85
+ if (!data.responseIdentifier) {
86
+ errors.push('portableCustomInteraction is missing responseIdentifier');
87
+ }
88
+ if (!data.customInteractionTypeIdentifier) {
89
+ warnings.push('portableCustomInteraction is missing customInteractionTypeIdentifier');
90
+ }
91
+ if (!data.primaryPath) {
92
+ errors.push('portableCustomInteraction has no primaryPath in qti-interaction-modules');
93
+ }
94
+ return { valid: errors.length === 0, errors: errors.length ? errors : undefined, warnings: warnings.length ? warnings : undefined };
95
+ },
96
+ };
@@ -0,0 +1,3 @@
1
+ export * from './extractor.js';
2
+ export type { CustomInteractionData } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/portable-custom/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './extractor.js';
@@ -0,0 +1,2 @@
1
+ export type { CustomInteractionData } from '../shared/types.js';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/portable-custom/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Standard QTI positionObjectInteraction extractor
3
+ *
4
+ * Extracts data from positionObjectInteraction elements (drag objects to positions)
5
+ *
6
+ * ⚠️ IMPORTANT: QTI 2.2 positionObjectInteraction Limitations
7
+ *
8
+ * This interaction has severe limitations that make it impractical for most educational scenarios:
9
+ *
10
+ * 1. Response format is baseType="point" - only stores coordinates ["158 168"]
11
+ * 2. NO way to track which specific object was placed where
12
+ * 3. Designed ONLY for placing multiple copies of the SAME object (e.g., airport icons)
13
+ * 4. Cannot support "place labeled objects on map" use cases
14
+ *
15
+ * The official QTI 2.2 spec example shows:
16
+ * - ONE positionObjectStage (container) with background image
17
+ * - ONE positionObjectInteraction with ONE draggable object
18
+ * - maxChoices determines how many times the object can be placed
19
+ * - Scoring uses areaMapping to check if ANY placement hits target zones
20
+ *
21
+ * This extractor supports a NON-STANDARD extension with multiple positionObjectStage
22
+ * elements (each with identifiers), but the response format cannot preserve object identity.
23
+ * For labeled-object placement, use graphicGapMatchInteraction instead.
24
+ */
25
+ import type { ElementExtractor } from '../../extraction/types.js';
26
+ /**
27
+ * Image data for position object interaction
28
+ */
29
+ export interface ImageData {
30
+ type: 'image' | 'svg';
31
+ src?: string;
32
+ content?: string;
33
+ width?: string;
34
+ height?: string;
35
+ }
36
+ /**
37
+ * Position object data extracted from positionObjectInteraction elements
38
+ */
39
+ export interface PositionObjectData {
40
+ imageData: ImageData | null;
41
+ positionObjectStages: Array<{
42
+ identifier: string;
43
+ label: string;
44
+ matchMax: number;
45
+ matchMin?: number;
46
+ objectData: ImageData | null;
47
+ classes?: string[];
48
+ }>;
49
+ centerPoint: boolean;
50
+ maxChoices: number;
51
+ minChoices: number;
52
+ prompt: string | null;
53
+ }
54
+ /**
55
+ * Standard QTI position object interaction extractor
56
+ * Handles positionObjectInteraction elements (dragging an object to a position)
57
+ */
58
+ export declare const standardPositionObjectExtractor: ElementExtractor<PositionObjectData>;
59
+ //# sourceMappingURL=extractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/position-object/extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,oBAAoB,EAAE,KAAK,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,SAAS,GAAG,IAAI,CAAC;QAC7B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE,gBAAgB,CAAC,kBAAkB,CAqLhF,CAAC"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Standard QTI positionObjectInteraction extractor
3
+ *
4
+ * Extracts data from positionObjectInteraction elements (drag objects to positions)
5
+ *
6
+ * ⚠️ IMPORTANT: QTI 2.2 positionObjectInteraction Limitations
7
+ *
8
+ * This interaction has severe limitations that make it impractical for most educational scenarios:
9
+ *
10
+ * 1. Response format is baseType="point" - only stores coordinates ["158 168"]
11
+ * 2. NO way to track which specific object was placed where
12
+ * 3. Designed ONLY for placing multiple copies of the SAME object (e.g., airport icons)
13
+ * 4. Cannot support "place labeled objects on map" use cases
14
+ *
15
+ * The official QTI 2.2 spec example shows:
16
+ * - ONE positionObjectStage (container) with background image
17
+ * - ONE positionObjectInteraction with ONE draggable object
18
+ * - maxChoices determines how many times the object can be placed
19
+ * - Scoring uses areaMapping to check if ANY placement hits target zones
20
+ *
21
+ * This extractor supports a NON-STANDARD extension with multiple positionObjectStage
22
+ * elements (each with identifiers), but the response format cannot preserve object identity.
23
+ * For labeled-object placement, use graphicGapMatchInteraction instead.
24
+ */
25
+ /**
26
+ * Standard QTI position object interaction extractor
27
+ * Handles positionObjectInteraction elements (dragging an object to a position)
28
+ */
29
+ export const standardPositionObjectExtractor = {
30
+ id: 'qti:position-object-interaction',
31
+ name: 'QTI Standard Position Object Interaction',
32
+ priority: 10,
33
+ elementTypes: ['positionObjectInteraction'],
34
+ description: 'Extracts standard QTI positionObjectInteraction (drag object to position)',
35
+ canHandle(element, _context) {
36
+ // All positionObjectInteraction elements are standard
37
+ return element.rawTagName === 'positionObjectInteraction';
38
+ },
39
+ extract(element, context) {
40
+ const { utils } = context;
41
+ // Extract background image data from object element (direct child)
42
+ const objectElements = utils.getChildrenByTag(element, 'object');
43
+ let imageData = null;
44
+ if (objectElements.length > 0) {
45
+ const objectElement = objectElements[0];
46
+ const type = utils.getAttribute(objectElement, 'type', '');
47
+ const data = utils.getAttribute(objectElement, 'data', '');
48
+ const width = utils.getAttribute(objectElement, 'width', '500');
49
+ const height = utils.getAttribute(objectElement, 'height', '300');
50
+ if (type.startsWith('image/svg')) {
51
+ // Extract inline SVG content - get full content including <svg> tag
52
+ const content = utils.getHtmlContent(objectElement);
53
+ imageData = {
54
+ type: 'svg',
55
+ content,
56
+ width,
57
+ height,
58
+ };
59
+ }
60
+ else {
61
+ // External image reference
62
+ imageData = {
63
+ type: 'image',
64
+ src: data,
65
+ width,
66
+ height,
67
+ };
68
+ }
69
+ }
70
+ // Extract positionObjectStage children
71
+ const stageElements = utils.getChildrenByTag(element, 'positionObjectStage');
72
+ const positionObjectStages = stageElements.map((stage) => {
73
+ const classes = utils.getClasses(stage);
74
+ const identifier = utils.getAttribute(stage, 'identifier', '');
75
+ const matchMax = utils.getNumberAttribute(stage, 'matchMax', 1);
76
+ const matchMin = utils.getNumberAttribute(stage, 'matchMin', 0);
77
+ // Get text content as label, use identifier as fallback
78
+ const textContent = utils.getTextContent(stage).trim();
79
+ const label = textContent || identifier;
80
+ // Extract object data from nested object element
81
+ const stageObjectElements = utils.getChildrenByTag(stage, 'object');
82
+ let objectData = null;
83
+ if (stageObjectElements.length > 0) {
84
+ const objElement = stageObjectElements[0];
85
+ const objType = utils.getAttribute(objElement, 'type', '');
86
+ const objData = utils.getAttribute(objElement, 'data', '');
87
+ const objWidth = utils.getAttribute(objElement, 'width', '50');
88
+ const objHeight = utils.getAttribute(objElement, 'height', '50');
89
+ if (objType.startsWith('image/svg')) {
90
+ // Extract inline SVG content
91
+ const content = utils.getHtmlContent(objElement);
92
+ objectData = {
93
+ type: 'svg',
94
+ content,
95
+ width: objWidth,
96
+ height: objHeight,
97
+ };
98
+ }
99
+ else {
100
+ // External image reference
101
+ objectData = {
102
+ type: 'image',
103
+ src: objData,
104
+ width: objWidth,
105
+ height: objHeight,
106
+ };
107
+ }
108
+ }
109
+ return {
110
+ identifier,
111
+ label,
112
+ matchMax,
113
+ ...(matchMin > 0 ? { matchMin } : {}),
114
+ objectData,
115
+ ...(classes.length > 0 ? { classes } : {}),
116
+ };
117
+ });
118
+ // Extract attributes
119
+ // centerPoint defaults to true when not specified
120
+ const centerPoint = utils.getBooleanAttribute(element, 'centerPoint', true);
121
+ const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 0);
122
+ const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
123
+ // Extract prompt (optional)
124
+ const promptElements = utils.getChildrenByTag(element, 'prompt');
125
+ const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
126
+ return {
127
+ imageData,
128
+ positionObjectStages,
129
+ centerPoint,
130
+ maxChoices,
131
+ minChoices,
132
+ prompt,
133
+ };
134
+ },
135
+ validate(data) {
136
+ const errors = [];
137
+ const warnings = [];
138
+ // Validate image data
139
+ if (!data.imageData) {
140
+ warnings.push('positionObjectInteraction has no background image');
141
+ }
142
+ else if (data.imageData.type === 'image' && !data.imageData.src) {
143
+ errors.push('positionObjectInteraction must have an image URL');
144
+ }
145
+ else if (data.imageData.type === 'svg' && !data.imageData.content) {
146
+ errors.push('positionObjectInteraction must have SVG content');
147
+ }
148
+ // Warn about dimension consistency (cannot verify actual file dimensions at extraction time)
149
+ if (data.imageData && data.imageData.type === 'image') {
150
+ warnings.push('IMPORTANT: Ensure declared width/height match actual image file dimensions. ' +
151
+ 'Mismatched dimensions cause coordinate system errors in mapResponsePoint scoring. ' +
152
+ `Declared: ${data.imageData.width || 'unspecified'}×${data.imageData.height || 'unspecified'}`);
153
+ }
154
+ // Validate positionObjectStages exist
155
+ if (!data.positionObjectStages || data.positionObjectStages.length === 0) {
156
+ errors.push('positionObjectInteraction must have at least one positionObjectStage');
157
+ }
158
+ // Validate positionObjectStage identifiers
159
+ if (data.positionObjectStages) {
160
+ const identifiers = new Set();
161
+ for (const stage of data.positionObjectStages) {
162
+ if (!stage.identifier) {
163
+ errors.push('All positionObjectStages must have an identifier');
164
+ }
165
+ else if (identifiers.has(stage.identifier)) {
166
+ errors.push(`Duplicate positionObjectStage identifier: ${stage.identifier}`);
167
+ }
168
+ else {
169
+ identifiers.add(stage.identifier);
170
+ }
171
+ }
172
+ }
173
+ // Validate maxChoices
174
+ if (data.maxChoices < 0) {
175
+ errors.push('maxChoices must be non-negative');
176
+ }
177
+ // Validate minChoices
178
+ if (data.minChoices < 0) {
179
+ errors.push('minChoices must be non-negative');
180
+ }
181
+ // Validate minChoices <= maxChoices
182
+ if (data.maxChoices > 0 && data.minChoices > data.maxChoices) {
183
+ errors.push('minChoices cannot exceed maxChoices');
184
+ }
185
+ return {
186
+ valid: errors.length === 0,
187
+ errors: errors.length > 0 ? errors : undefined,
188
+ warnings: warnings.length > 0 ? warnings : undefined,
189
+ };
190
+ },
191
+ };
@@ -0,0 +1,3 @@
1
+ export * from './extractor.js';
2
+ export type { PositionObjectInteractionData } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/position-object/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './extractor.js';
@@ -0,0 +1,2 @@
1
+ export type { PositionObjectInteractionData, PositionObjectStage } from '../shared/types.js';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/position-object/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};