@pie-qti/item-player 0.1.1 → 0.1.4

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 (469) hide show
  1. package/README.md +1 -1
  2. package/dist/components/actions/typesetAction.d.ts +24 -0
  3. package/dist/components/actions/typesetAction.d.ts.map +1 -0
  4. package/dist/components/actions/typesetAction.js +59 -0
  5. package/dist/components/utils/assignProps.d.ts +2 -0
  6. package/dist/components/utils/assignProps.d.ts.map +1 -0
  7. package/dist/components/utils/assignProps.js +1 -0
  8. package/dist/components/utils/feedbackUtils.d.ts +73 -0
  9. package/dist/components/utils/feedbackUtils.d.ts.map +1 -0
  10. package/dist/components/utils/feedbackUtils.js +93 -0
  11. package/dist/components/utils/index.d.ts +6 -0
  12. package/dist/components/utils/index.d.ts.map +1 -0
  13. package/dist/components/utils/index.js +5 -0
  14. package/dist/core/ComponentRegistry.d.ts +119 -0
  15. package/dist/core/ComponentRegistry.d.ts.map +1 -0
  16. package/dist/core/ComponentRegistry.js +123 -0
  17. package/dist/core/ItemRenderer.d.ts +91 -0
  18. package/dist/core/ItemRenderer.d.ts.map +1 -0
  19. package/dist/core/ItemRenderer.js +258 -0
  20. package/dist/core/Player.d.ts +143 -0
  21. package/dist/core/Player.d.ts.map +1 -0
  22. package/dist/core/Player.js +1081 -0
  23. package/dist/core/Plugin.d.ts +105 -0
  24. package/dist/core/Plugin.d.ts.map +1 -0
  25. package/dist/core/Plugin.js +7 -0
  26. package/dist/core/PluginManager.d.ts +56 -0
  27. package/dist/core/PluginManager.d.ts.map +1 -0
  28. package/dist/core/PluginManager.js +147 -0
  29. package/dist/core/constants.d.ts +68 -0
  30. package/dist/core/constants.d.ts.map +1 -0
  31. package/dist/core/constants.js +106 -0
  32. package/dist/core/declarations.d.ts +45 -0
  33. package/dist/core/declarations.d.ts.map +1 -0
  34. package/dist/core/declarations.js +133 -0
  35. package/dist/core/parsingLimits.d.ts +12 -0
  36. package/dist/core/parsingLimits.d.ts.map +1 -0
  37. package/dist/core/parsingLimits.js +45 -0
  38. package/dist/core/random.d.ts +12 -0
  39. package/dist/core/random.d.ts.map +1 -0
  40. package/dist/core/random.js +21 -0
  41. package/dist/core/sanitizer.d.ts +34 -0
  42. package/dist/core/sanitizer.d.ts.map +1 -0
  43. package/dist/core/sanitizer.js +198 -0
  44. package/dist/core/trustedTypes.d.ts +16 -0
  45. package/dist/core/trustedTypes.d.ts.map +1 -0
  46. package/dist/core/trustedTypes.js +55 -0
  47. package/dist/core/urlPolicy.d.ts +8 -0
  48. package/dist/core/urlPolicy.d.ts.map +1 -0
  49. package/dist/core/urlPolicy.js +87 -0
  50. package/dist/extensions/MathLiveEditor.d.ts +32 -0
  51. package/dist/extensions/MathLiveEditor.d.ts.map +1 -0
  52. package/dist/extensions/MathLiveEditor.js +249 -0
  53. package/dist/extraction/ExtractionRegistry.d.ts +112 -0
  54. package/dist/extraction/ExtractionRegistry.d.ts.map +1 -0
  55. package/dist/extraction/ExtractionRegistry.js +258 -0
  56. package/dist/extraction/createContext.d.ts +30 -0
  57. package/dist/extraction/createContext.d.ts.map +1 -0
  58. package/dist/extraction/createContext.js +39 -0
  59. package/dist/extraction/extractors/associateExtractor.d.ts +28 -0
  60. package/dist/extraction/extractors/associateExtractor.d.ts.map +1 -0
  61. package/dist/extraction/extractors/associateExtractor.js +94 -0
  62. package/dist/extraction/extractors/choiceExtractor.d.ts +25 -0
  63. package/dist/extraction/extractors/choiceExtractor.d.ts.map +1 -0
  64. package/dist/extraction/extractors/choiceExtractor.js +83 -0
  65. package/dist/extraction/extractors/customExtractor.d.ts +20 -0
  66. package/dist/extraction/extractors/customExtractor.d.ts.map +1 -0
  67. package/dist/extraction/extractors/customExtractor.js +51 -0
  68. package/dist/extraction/extractors/drawingExtractor.d.ts +30 -0
  69. package/dist/extraction/extractors/drawingExtractor.d.ts.map +1 -0
  70. package/dist/extraction/extractors/drawingExtractor.js +78 -0
  71. package/dist/extraction/extractors/endAttemptExtractor.d.ts +20 -0
  72. package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +1 -0
  73. package/dist/extraction/extractors/endAttemptExtractor.js +53 -0
  74. package/dist/extraction/extractors/extendedTextExtractor.d.ts +21 -0
  75. package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +1 -0
  76. package/dist/extraction/extractors/extendedTextExtractor.js +57 -0
  77. package/dist/extraction/extractors/gapMatchExtractor.d.ts +28 -0
  78. package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +1 -0
  79. package/dist/extraction/extractors/gapMatchExtractor.js +142 -0
  80. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +40 -0
  81. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +1 -0
  82. package/dist/extraction/extractors/graphicAssociateExtractor.js +140 -0
  83. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +42 -0
  84. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +1 -0
  85. package/dist/extraction/extractors/graphicGapMatchExtractor.js +144 -0
  86. package/dist/extraction/extractors/graphicOrderExtractor.d.ts +37 -0
  87. package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +1 -0
  88. package/dist/extraction/extractors/graphicOrderExtractor.js +121 -0
  89. package/dist/extraction/extractors/hotspotExtractor.d.ts +38 -0
  90. package/dist/extraction/extractors/hotspotExtractor.d.ts.map +1 -0
  91. package/dist/extraction/extractors/hotspotExtractor.js +140 -0
  92. package/dist/extraction/extractors/hottextExtractor.d.ts +26 -0
  93. package/dist/extraction/extractors/hottextExtractor.d.ts.map +1 -0
  94. package/dist/extraction/extractors/hottextExtractor.js +120 -0
  95. package/dist/extraction/extractors/index.d.ts +62 -0
  96. package/dist/extraction/extractors/index.d.ts.map +1 -0
  97. package/dist/extraction/extractors/index.js +84 -0
  98. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +22 -0
  99. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +1 -0
  100. package/dist/extraction/extractors/inlineChoiceExtractor.js +67 -0
  101. package/dist/extraction/extractors/matchExtractor.d.ts +32 -0
  102. package/dist/extraction/extractors/matchExtractor.d.ts.map +1 -0
  103. package/dist/extraction/extractors/matchExtractor.js +134 -0
  104. package/dist/extraction/extractors/mediaExtractor.d.ts +33 -0
  105. package/dist/extraction/extractors/mediaExtractor.d.ts.map +1 -0
  106. package/dist/extraction/extractors/mediaExtractor.js +125 -0
  107. package/dist/extraction/extractors/orderExtractor.d.ts +26 -0
  108. package/dist/extraction/extractors/orderExtractor.d.ts.map +1 -0
  109. package/dist/extraction/extractors/orderExtractor.js +86 -0
  110. package/dist/extraction/extractors/positionObjectExtractor.d.ts +59 -0
  111. package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +1 -0
  112. package/dist/extraction/extractors/positionObjectExtractor.js +191 -0
  113. package/dist/extraction/extractors/selectPointExtractor.d.ts +31 -0
  114. package/dist/extraction/extractors/selectPointExtractor.d.ts.map +1 -0
  115. package/dist/extraction/extractors/selectPointExtractor.js +109 -0
  116. package/dist/extraction/extractors/sliderExtractor.d.ts +24 -0
  117. package/dist/extraction/extractors/sliderExtractor.d.ts.map +1 -0
  118. package/dist/extraction/extractors/sliderExtractor.js +73 -0
  119. package/dist/extraction/extractors/textEntryExtractor.d.ts +20 -0
  120. package/dist/extraction/extractors/textEntryExtractor.d.ts.map +1 -0
  121. package/dist/extraction/extractors/textEntryExtractor.js +48 -0
  122. package/dist/extraction/extractors/uploadExtractor.d.ts +20 -0
  123. package/dist/extraction/extractors/uploadExtractor.d.ts.map +1 -0
  124. package/dist/extraction/extractors/uploadExtractor.js +52 -0
  125. package/dist/extraction/index.d.ts +49 -0
  126. package/dist/extraction/index.d.ts.map +1 -0
  127. package/dist/extraction/index.js +49 -0
  128. package/dist/extraction/types.d.ts +209 -0
  129. package/dist/extraction/types.d.ts.map +1 -0
  130. package/dist/extraction/types.js +30 -0
  131. package/dist/extraction/utils.d.ts +15 -0
  132. package/dist/extraction/utils.d.ts.map +1 -0
  133. package/dist/extraction/utils.js +178 -0
  134. package/dist/iframe/IFramePlayerHost.d.ts +122 -0
  135. package/dist/iframe/IFramePlayerHost.d.ts.map +1 -0
  136. package/dist/iframe/IFramePlayerHost.js +172 -0
  137. package/dist/iframe/index.d.ts +9 -0
  138. package/dist/iframe/index.d.ts.map +1 -0
  139. package/dist/iframe/index.js +8 -0
  140. package/dist/iframe/protocol.d.ts +75 -0
  141. package/dist/iframe/protocol.d.ts.map +1 -0
  142. package/dist/iframe/protocol.js +53 -0
  143. package/dist/index.d.ts +28 -0
  144. package/dist/index.d.ts.map +1 -0
  145. package/dist/index.js +35 -0
  146. package/dist/server.d.ts +10 -0
  147. package/dist/server.d.ts.map +1 -0
  148. package/dist/server.js +10 -0
  149. package/dist/types/index.d.ts +290 -0
  150. package/dist/types/index.d.ts.map +1 -0
  151. package/dist/types/index.js +7 -0
  152. package/dist/types/interactions.d.ts +323 -0
  153. package/dist/types/interactions.d.ts.map +1 -0
  154. package/dist/types/interactions.js +7 -0
  155. package/dist/types/responseValidation.d.ts +25 -0
  156. package/dist/types/responseValidation.d.ts.map +1 -0
  157. package/dist/types/responseValidation.js +1 -0
  158. package/dist/utils/PerformanceMonitor.d.ts +170 -0
  159. package/dist/utils/PerformanceMonitor.d.ts.map +1 -0
  160. package/dist/utils/PerformanceMonitor.js +242 -0
  161. package/dist/utils/drawingUtils.d.ts +39 -0
  162. package/dist/utils/drawingUtils.d.ts.map +1 -0
  163. package/dist/utils/drawingUtils.js +57 -0
  164. package/dist/utils/responseUtils.d.ts +16 -0
  165. package/dist/utils/responseUtils.d.ts.map +1 -0
  166. package/dist/utils/responseUtils.js +45 -0
  167. package/dist/utils/touchDragHelper.d.ts +2 -0
  168. package/dist/utils/touchDragHelper.d.ts.map +1 -0
  169. package/dist/utils/touchDragHelper.js +1 -0
  170. package/dist/web-components/QTIInteractionBase.d.ts +120 -0
  171. package/dist/web-components/QTIInteractionBase.d.ts.map +1 -0
  172. package/dist/web-components/QTIInteractionBase.js +243 -0
  173. package/dist/web-components/QTIInteractionElement.d.ts +77 -0
  174. package/dist/web-components/QTIInteractionElement.d.ts.map +1 -0
  175. package/dist/web-components/QTIInteractionElement.js +61 -0
  176. package/dist/web-components/index.d.ts +8 -0
  177. package/dist/web-components/index.d.ts.map +1 -0
  178. package/dist/web-components/index.js +10 -0
  179. package/package.json +94 -76
  180. package/src/__tests__/qti3-attribute-extraction.test.ts +174 -0
  181. package/src/__tests__/qti3-debug.test.ts +140 -0
  182. package/src/__tests__/qti3-extraction.test.ts +309 -0
  183. package/src/components/ItemBody.svelte +3 -1
  184. package/src/components/utils/assignProps.ts +1 -23
  185. package/src/core/Player.ts +138 -34
  186. package/src/core/parsingLimits.ts +1 -1
  187. package/src/extensions/MathLiveEditor.ts +6 -3
  188. package/src/extraction/ExtractionRegistry.ts +46 -10
  189. package/src/extraction/createContext.ts +6 -1
  190. package/src/extraction/extractors/extendedTextExtractor.ts +5 -2
  191. package/src/extraction/extractors/matchExtractor.ts +2 -2
  192. package/src/extraction/extractors/textEntryExtractor.ts +4 -2
  193. package/src/extraction/utils.ts +99 -16
  194. package/src/index.ts +2 -0
  195. package/src/types/index.ts +28 -8
  196. package/src/types/xmldom.d.ts +12 -0
  197. package/src/utils/drawingUtils.ts +73 -0
  198. package/src/utils/touchDragHelper.ts +1 -211
  199. package/.turbo/turbo-build.log +0 -1
  200. package/CHANGELOG.md +0 -9
  201. package/docs/QTI-COMPLIANCE.md +0 -197
  202. package/docs/WCAG-2.2-COMPLIANCE.md +0 -466
  203. package/docs/custom-extractors.md +0 -679
  204. package/docs/iframe-mode.md +0 -78
  205. package/docs/security-audit.md +0 -236
  206. package/docs/server-api.md +0 -691
  207. package/tests/conformance/FIXTURE_POLICY.md +0 -29
  208. package/tests/conformance/README.md +0 -70
  209. package/tests/conformance/fixtures/baseTypes_all/cases.json +0 -61
  210. package/tests/conformance/fixtures/baseTypes_all/item.xml +0 -131
  211. package/tests/conformance/fixtures/baseTypes_all/manifest.json +0 -7
  212. package/tests/conformance/fixtures/choice_match_correct/cases.json +0 -17
  213. package/tests/conformance/fixtures/choice_match_correct/item.xml +0 -55
  214. package/tests/conformance/fixtures/choice_match_correct/manifest.json +0 -14
  215. package/tests/conformance/fixtures/contains_multiple/cases.json +0 -12
  216. package/tests/conformance/fixtures/contains_multiple/item.xml +0 -37
  217. package/tests/conformance/fixtures/contains_multiple/manifest.json +0 -13
  218. package/tests/conformance/fixtures/isNull_isNotNull/cases.json +0 -9
  219. package/tests/conformance/fixtures/isNull_isNotNull/item.xml +0 -41
  220. package/tests/conformance/fixtures/isNull_isNotNull/manifest.json +0 -23
  221. package/tests/conformance/fixtures/mapResponse_bounds_default_duplicates/cases.json +0 -27
  222. package/tests/conformance/fixtures/mapResponse_bounds_default_duplicates/item.xml +0 -30
  223. package/tests/conformance/fixtures/mapResponse_bounds_default_duplicates/manifest.json +0 -15
  224. package/tests/conformance/fixtures/mapResponse_integer_mapKey/cases.json +0 -11
  225. package/tests/conformance/fixtures/mapResponse_integer_mapKey/item.xml +0 -26
  226. package/tests/conformance/fixtures/mapResponse_integer_mapKey/manifest.json +0 -13
  227. package/tests/conformance/fixtures/mapResponse_mapEntry_caseSensitive_override/cases.json +0 -27
  228. package/tests/conformance/fixtures/mapResponse_mapEntry_caseSensitive_override/item.xml +0 -32
  229. package/tests/conformance/fixtures/mapResponse_mapEntry_caseSensitive_override/manifest.json +0 -7
  230. package/tests/conformance/fixtures/mapResponse_mapping_caseSensitive_defaultValue/cases.json +0 -9
  231. package/tests/conformance/fixtures/mapResponse_mapping_caseSensitive_defaultValue/item.xml +0 -25
  232. package/tests/conformance/fixtures/mapResponse_mapping_caseSensitive_defaultValue/manifest.json +0 -12
  233. package/tests/conformance/fixtures/mapResponse_multiple_cardinality/cases.json +0 -12
  234. package/tests/conformance/fixtures/mapResponse_multiple_cardinality/item.xml +0 -35
  235. package/tests/conformance/fixtures/mapResponse_multiple_cardinality/manifest.json +0 -11
  236. package/tests/conformance/fixtures/mapping_bounds_upperLower/cases.json +0 -12
  237. package/tests/conformance/fixtures/mapping_bounds_upperLower/item.xml +0 -37
  238. package/tests/conformance/fixtures/mapping_bounds_upperLower/manifest.json +0 -11
  239. package/tests/conformance/fixtures/mapping_mapResponse/cases.json +0 -22
  240. package/tests/conformance/fixtures/mapping_mapResponse/item.xml +0 -53
  241. package/tests/conformance/fixtures/mapping_mapResponse/manifest.json +0 -16
  242. package/tests/conformance/fixtures/member_multiple/cases.json +0 -12
  243. package/tests/conformance/fixtures/member_multiple/item.xml +0 -37
  244. package/tests/conformance/fixtures/member_multiple/manifest.json +0 -13
  245. package/tests/conformance/fixtures/modalFeedback_basic/cases.json +0 -17
  246. package/tests/conformance/fixtures/modalFeedback_basic/item.xml +0 -52
  247. package/tests/conformance/fixtures/modalFeedback_basic/manifest.json +0 -13
  248. package/tests/conformance/fixtures/multiple_unordered_match/cases.json +0 -17
  249. package/tests/conformance/fixtures/multiple_unordered_match/item.xml +0 -44
  250. package/tests/conformance/fixtures/multiple_unordered_match/manifest.json +0 -11
  251. package/tests/conformance/fixtures/ordered_match/cases.json +0 -17
  252. package/tests/conformance/fixtures/ordered_match/item.xml +0 -48
  253. package/tests/conformance/fixtures/ordered_match/manifest.json +0 -13
  254. package/tests/conformance/fixtures/outcomeProcessing_derive_percent_passfail/cases.json +0 -27
  255. package/tests/conformance/fixtures/outcomeProcessing_derive_percent_passfail/item.xml +0 -103
  256. package/tests/conformance/fixtures/outcomeProcessing_derive_percent_passfail/manifest.json +0 -7
  257. package/tests/conformance/fixtures/outcomeProcessing_exitTest/cases.json +0 -15
  258. package/tests/conformance/fixtures/outcomeProcessing_exitTest/item.xml +0 -33
  259. package/tests/conformance/fixtures/outcomeProcessing_exitTest/manifest.json +0 -10
  260. package/tests/conformance/fixtures/outcomeProcessing_numberExpressions/cases.json +0 -14
  261. package/tests/conformance/fixtures/outcomeProcessing_numberExpressions/item.xml +0 -26
  262. package/tests/conformance/fixtures/outcomeProcessing_numberExpressions/manifest.json +0 -8
  263. package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_equal/cases.json +0 -17
  264. package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_equal/item.xml +0 -43
  265. package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_equal/manifest.json +0 -16
  266. package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_toBoolean/cases.json +0 -27
  267. package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_toBoolean/item.xml +0 -37
  268. package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_toBoolean/manifest.json +0 -16
  269. package/tests/conformance/fixtures/outcomeProcessing_outcomeMaximum/cases.json +0 -14
  270. package/tests/conformance/fixtures/outcomeProcessing_outcomeMaximum/item.xml +0 -35
  271. package/tests/conformance/fixtures/outcomeProcessing_outcomeMaximum/manifest.json +0 -8
  272. package/tests/conformance/fixtures/outcomeProcessing_outcomeMinimum/cases.json +0 -14
  273. package/tests/conformance/fixtures/outcomeProcessing_outcomeMinimum/item.xml +0 -35
  274. package/tests/conformance/fixtures/outcomeProcessing_outcomeMinimum/manifest.json +0 -8
  275. package/tests/conformance/fixtures/outcomeProcessing_outcomeProcessingFragment/cases.json +0 -15
  276. package/tests/conformance/fixtures/outcomeProcessing_outcomeProcessingFragment/item.xml +0 -39
  277. package/tests/conformance/fixtures/outcomeProcessing_outcomeProcessingFragment/manifest.json +0 -11
  278. package/tests/conformance/fixtures/outcomeProcessing_testVariables/cases.json +0 -14
  279. package/tests/conformance/fixtures/outcomeProcessing_testVariables/item.xml +0 -35
  280. package/tests/conformance/fixtures/outcomeProcessing_testVariables/manifest.json +0 -8
  281. package/tests/conformance/fixtures/pair_unordered_match/cases.json +0 -22
  282. package/tests/conformance/fixtures/pair_unordered_match/item.xml +0 -44
  283. package/tests/conformance/fixtures/pair_unordered_match/manifest.json +0 -13
  284. package/tests/conformance/fixtures/positionObject_coordinateSystem_aspectRatio/cases.json +0 -95
  285. package/tests/conformance/fixtures/positionObject_coordinateSystem_aspectRatio/item.xml +0 -53
  286. package/tests/conformance/fixtures/positionObject_mapResponsePoint_scoring/cases.json +0 -115
  287. package/tests/conformance/fixtures/positionObject_mapResponsePoint_scoring/item.xml +0 -45
  288. package/tests/conformance/fixtures/positionObject_mapResponse_wrong/cases.json +0 -29
  289. package/tests/conformance/fixtures/positionObject_mapResponse_wrong/item.xml +0 -40
  290. package/tests/conformance/fixtures/responseCondition_elseIf_chain/cases.json +0 -10
  291. package/tests/conformance/fixtures/responseCondition_elseIf_chain/item.xml +0 -49
  292. package/tests/conformance/fixtures/responseCondition_elseIf_chain/manifest.json +0 -15
  293. package/tests/conformance/fixtures/responseProcessing_anyN/cases.json +0 -27
  294. package/tests/conformance/fixtures/responseProcessing_anyN/item.xml +0 -47
  295. package/tests/conformance/fixtures/responseProcessing_anyN/manifest.json +0 -16
  296. package/tests/conformance/fixtures/responseProcessing_anyN_allN/cases.json +0 -27
  297. package/tests/conformance/fixtures/responseProcessing_anyN_allN/item.xml +0 -69
  298. package/tests/conformance/fixtures/responseProcessing_anyN_allN/manifest.json +0 -23
  299. package/tests/conformance/fixtures/responseProcessing_arithmetic_nulls/cases.json +0 -15
  300. package/tests/conformance/fixtures/responseProcessing_arithmetic_nulls/item.xml +0 -58
  301. package/tests/conformance/fixtures/responseProcessing_arithmetic_nulls/manifest.json +0 -15
  302. package/tests/conformance/fixtures/responseProcessing_boolean_compare_ops/cases.json +0 -37
  303. package/tests/conformance/fixtures/responseProcessing_boolean_compare_ops/item.xml +0 -94
  304. package/tests/conformance/fixtures/responseProcessing_boolean_compare_ops/manifest.json +0 -27
  305. package/tests/conformance/fixtures/responseProcessing_containerSize_index/cases.json +0 -33
  306. package/tests/conformance/fixtures/responseProcessing_containerSize_index/item.xml +0 -79
  307. package/tests/conformance/fixtures/responseProcessing_containerSize_index/manifest.json +0 -16
  308. package/tests/conformance/fixtures/responseProcessing_customOperator/cases.json +0 -15
  309. package/tests/conformance/fixtures/responseProcessing_customOperator/item.xml +0 -30
  310. package/tests/conformance/fixtures/responseProcessing_customOperator/manifest.json +0 -12
  311. package/tests/conformance/fixtures/responseProcessing_default_expression/cases.json +0 -12
  312. package/tests/conformance/fixtures/responseProcessing_default_expression/item.xml +0 -48
  313. package/tests/conformance/fixtures/responseProcessing_default_expression/manifest.json +0 -13
  314. package/tests/conformance/fixtures/responseProcessing_deleteValue_repeat/cases.json +0 -29
  315. package/tests/conformance/fixtures/responseProcessing_deleteValue_repeat/item.xml +0 -68
  316. package/tests/conformance/fixtures/responseProcessing_deleteValue_repeat/manifest.json +0 -17
  317. package/tests/conformance/fixtures/responseProcessing_equalRounded_tolerance/cases.json +0 -39
  318. package/tests/conformance/fixtures/responseProcessing_equalRounded_tolerance/item.xml +0 -39
  319. package/tests/conformance/fixtures/responseProcessing_equalRounded_tolerance/manifest.json +0 -17
  320. package/tests/conformance/fixtures/responseProcessing_exitResponse/cases.json +0 -12
  321. package/tests/conformance/fixtures/responseProcessing_exitResponse/item.xml +0 -25
  322. package/tests/conformance/fixtures/responseProcessing_exitResponse/manifest.json +0 -12
  323. package/tests/conformance/fixtures/responseProcessing_inside_duration_statsOperator/cases.json +0 -26
  324. package/tests/conformance/fixtures/responseProcessing_inside_duration_statsOperator/item.xml +0 -134
  325. package/tests/conformance/fixtures/responseProcessing_inside_duration_statsOperator/manifest.json +0 -16
  326. package/tests/conformance/fixtures/responseProcessing_lookupTable_interpolationTable/cases.json +0 -27
  327. package/tests/conformance/fixtures/responseProcessing_lookupTable_interpolationTable/item.xml +0 -33
  328. package/tests/conformance/fixtures/responseProcessing_lookupTable_interpolationTable/manifest.json +0 -13
  329. package/tests/conformance/fixtures/responseProcessing_lookupTable_matchTable/cases.json +0 -22
  330. package/tests/conformance/fixtures/responseProcessing_lookupTable_matchTable/item.xml +0 -33
  331. package/tests/conformance/fixtures/responseProcessing_lookupTable_matchTable/manifest.json +0 -13
  332. package/tests/conformance/fixtures/responseProcessing_mapOutcome_basic/cases.json +0 -27
  333. package/tests/conformance/fixtures/responseProcessing_mapOutcome_basic/item.xml +0 -40
  334. package/tests/conformance/fixtures/responseProcessing_mapOutcome_basic/manifest.json +0 -18
  335. package/tests/conformance/fixtures/responseProcessing_mapResponsePoint_basic/cases.json +0 -22
  336. package/tests/conformance/fixtures/responseProcessing_mapResponsePoint_basic/item.xml +0 -33
  337. package/tests/conformance/fixtures/responseProcessing_mapResponsePoint_basic/manifest.json +0 -12
  338. package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_ordered/cases.json +0 -29
  339. package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_ordered/item.xml +0 -26
  340. package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_ordered/manifest.json +0 -7
  341. package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_whitespace/cases.json +0 -23
  342. package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_whitespace/item.xml +0 -28
  343. package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_whitespace/manifest.json +0 -11
  344. package/tests/conformance/fixtures/responseProcessing_mapResponse_pair_unordered/cases.json +0 -29
  345. package/tests/conformance/fixtures/responseProcessing_mapResponse_pair_unordered/item.xml +0 -26
  346. package/tests/conformance/fixtures/responseProcessing_mapResponse_pair_unordered/manifest.json +0 -7
  347. package/tests/conformance/fixtures/responseProcessing_mathOperator_integerUtils/cases.json +0 -31
  348. package/tests/conformance/fixtures/responseProcessing_mathOperator_integerUtils/item.xml +0 -102
  349. package/tests/conformance/fixtures/responseProcessing_mathOperator_integerUtils/manifest.json +0 -18
  350. package/tests/conformance/fixtures/responseProcessing_math_max_min_round_truncate/cases.json +0 -22
  351. package/tests/conformance/fixtures/responseProcessing_math_max_min_round_truncate/item.xml +0 -45
  352. package/tests/conformance/fixtures/responseProcessing_math_max_min_round_truncate/manifest.json +0 -21
  353. package/tests/conformance/fixtures/responseProcessing_misc_math_string_stats/cases.json +0 -26
  354. package/tests/conformance/fixtures/responseProcessing_misc_math_string_stats/item.xml +0 -157
  355. package/tests/conformance/fixtures/responseProcessing_misc_math_string_stats/manifest.json +0 -22
  356. package/tests/conformance/fixtures/responseProcessing_notEqual_basic/cases.json +0 -22
  357. package/tests/conformance/fixtures/responseProcessing_notEqual_basic/item.xml +0 -39
  358. package/tests/conformance/fixtures/responseProcessing_notEqual_basic/manifest.json +0 -18
  359. package/tests/conformance/fixtures/responseProcessing_patternMatch_caseSensitive/cases.json +0 -22
  360. package/tests/conformance/fixtures/responseProcessing_patternMatch_caseSensitive/item.xml +0 -51
  361. package/tests/conformance/fixtures/responseProcessing_patternMatch_caseSensitive/manifest.json +0 -19
  362. package/tests/conformance/fixtures/responseProcessing_preCondition/cases.json +0 -31
  363. package/tests/conformance/fixtures/responseProcessing_preCondition/item.xml +0 -44
  364. package/tests/conformance/fixtures/responseProcessing_preCondition/manifest.json +0 -12
  365. package/tests/conformance/fixtures/responseProcessing_random_lookupOutcomeValue/cases.json +0 -27
  366. package/tests/conformance/fixtures/responseProcessing_random_lookupOutcomeValue/item.xml +0 -42
  367. package/tests/conformance/fixtures/responseProcessing_random_lookupOutcomeValue/manifest.json +0 -14
  368. package/tests/conformance/fixtures/responseProcessing_record_fieldValue/cases.json +0 -12
  369. package/tests/conformance/fixtures/responseProcessing_record_fieldValue/item.xml +0 -40
  370. package/tests/conformance/fixtures/responseProcessing_record_fieldValue/manifest.json +0 -17
  371. package/tests/conformance/fixtures/responseProcessing_responseCondition_toBoolean/cases.json +0 -17
  372. package/tests/conformance/fixtures/responseProcessing_responseCondition_toBoolean/item.xml +0 -63
  373. package/tests/conformance/fixtures/responseProcessing_responseCondition_toBoolean/manifest.json +0 -9
  374. package/tests/conformance/fixtures/responseProcessing_responseProcessingFragment/cases.json +0 -12
  375. package/tests/conformance/fixtures/responseProcessing_responseProcessingFragment/item.xml +0 -40
  376. package/tests/conformance/fixtures/responseProcessing_responseProcessingFragment/manifest.json +0 -13
  377. package/tests/conformance/fixtures/responseProcessing_setDefaultValue/cases.json +0 -15
  378. package/tests/conformance/fixtures/responseProcessing_setDefaultValue/item.xml +0 -67
  379. package/tests/conformance/fixtures/responseProcessing_setDefaultValue/manifest.json +0 -9
  380. package/tests/conformance/fixtures/responseProcessing_setResponseValue_setDefaultValue/cases.json +0 -27
  381. package/tests/conformance/fixtures/responseProcessing_setResponseValue_setDefaultValue/item.xml +0 -69
  382. package/tests/conformance/fixtures/responseProcessing_setResponseValue_setDefaultValue/manifest.json +0 -10
  383. package/tests/conformance/fixtures/responseProcessing_subtract_divide/cases.json +0 -15
  384. package/tests/conformance/fixtures/responseProcessing_subtract_divide/item.xml +0 -35
  385. package/tests/conformance/fixtures/responseProcessing_subtract_divide/manifest.json +0 -11
  386. package/tests/conformance/fixtures/responseProcessing_template_map_response/cases.json +0 -17
  387. package/tests/conformance/fixtures/responseProcessing_template_map_response/item.xml +0 -31
  388. package/tests/conformance/fixtures/responseProcessing_template_map_response/manifest.json +0 -8
  389. package/tests/conformance/fixtures/responseProcessing_template_map_response_point/cases.json +0 -22
  390. package/tests/conformance/fixtures/responseProcessing_template_map_response_point/item.xml +0 -27
  391. package/tests/conformance/fixtures/responseProcessing_template_map_response_point/manifest.json +0 -8
  392. package/tests/conformance/fixtures/responseProcessing_template_match_correct/cases.json +0 -17
  393. package/tests/conformance/fixtures/responseProcessing_template_match_correct/item.xml +0 -34
  394. package/tests/conformance/fixtures/responseProcessing_template_match_correct/manifest.json +0 -8
  395. package/tests/conformance/fixtures/responseProcessing_template_match_correct_directedPair/cases.json +0 -22
  396. package/tests/conformance/fixtures/responseProcessing_template_match_correct_directedPair/item.xml +0 -30
  397. package/tests/conformance/fixtures/responseProcessing_template_match_correct_directedPair/manifest.json +0 -7
  398. package/tests/conformance/fixtures/responseProcessing_template_match_correct_two_responses/cases.json +0 -17
  399. package/tests/conformance/fixtures/responseProcessing_template_match_correct_two_responses/item.xml +0 -30
  400. package/tests/conformance/fixtures/responseProcessing_template_match_correct_two_responses/manifest.json +0 -9
  401. package/tests/conformance/fixtures/responseProcessing_template_match_nothing/cases.json +0 -17
  402. package/tests/conformance/fixtures/responseProcessing_template_match_nothing/item.xml +0 -30
  403. package/tests/conformance/fixtures/responseProcessing_template_match_nothing/manifest.json +0 -8
  404. package/tests/conformance/fixtures/responseProcessing_xiInclude/cases.json +0 -14
  405. package/tests/conformance/fixtures/responseProcessing_xiInclude/item.xml +0 -25
  406. package/tests/conformance/fixtures/responseProcessing_xiInclude/manifest.json +0 -9
  407. package/tests/conformance/fixtures/stringMatch_caseSensitive_substring/cases.json +0 -12
  408. package/tests/conformance/fixtures/stringMatch_caseSensitive_substring/item.xml +0 -52
  409. package/tests/conformance/fixtures/stringMatch_caseSensitive_substring/manifest.json +0 -14
  410. package/tests/conformance/fixtures/templateProcessing_exitTemplate/cases.json +0 -12
  411. package/tests/conformance/fixtures/templateProcessing_exitTemplate/item.xml +0 -48
  412. package/tests/conformance/fixtures/templateProcessing_exitTemplate/manifest.json +0 -13
  413. package/tests/conformance/fixtures/templateProcessing_setCorrectResponse/cases.json +0 -27
  414. package/tests/conformance/fixtures/templateProcessing_setCorrectResponse/item.xml +0 -74
  415. package/tests/conformance/fixtures/templateProcessing_setCorrectResponse/manifest.json +0 -22
  416. package/tests/conformance/fixtures/templateProcessing_templateCondition_branching/cases.json +0 -17
  417. package/tests/conformance/fixtures/templateProcessing_templateCondition_branching/item.xml +0 -133
  418. package/tests/conformance/fixtures/templateProcessing_templateCondition_branching/manifest.json +0 -22
  419. package/tests/conformance/fixtures/templateProcessing_templateCondition_toBoolean/cases.json +0 -12
  420. package/tests/conformance/fixtures/templateProcessing_templateCondition_toBoolean/item.xml +0 -107
  421. package/tests/conformance/fixtures/templateProcessing_templateCondition_toBoolean/manifest.json +0 -16
  422. package/tests/conformance/fixtures/templateProcessing_templateConstraint/cases.json +0 -15
  423. package/tests/conformance/fixtures/templateProcessing_templateConstraint/item.xml +0 -52
  424. package/tests/conformance/fixtures/templateProcessing_templateConstraint/manifest.json +0 -14
  425. package/tests/conformance/fixtures/template_randomFloat_roundTo_mathConstant/cases.json +0 -16
  426. package/tests/conformance/fixtures/template_randomFloat_roundTo_mathConstant/item.xml +0 -49
  427. package/tests/conformance/fixtures/template_randomFloat_roundTo_mathConstant/manifest.json +0 -15
  428. package/tests/conformance/fixtures/template_randomInteger_printedVariable/cases.json +0 -16
  429. package/tests/conformance/fixtures/template_randomInteger_printedVariable/item.xml +0 -38
  430. package/tests/conformance/fixtures/template_randomInteger_printedVariable/manifest.json +0 -13
  431. package/tests/conformance/harness.ts +0 -84
  432. package/tests/conformance/run-fixtures.test.ts +0 -127
  433. package/tests/conformance/scripts/normalize-covers.ts +0 -152
  434. package/tests/conformance/types.ts +0 -53
  435. package/tests/core/Player.test.ts +0 -563
  436. package/tests/core/adaptiveItems.test.ts +0 -442
  437. package/tests/core/correctResponse.test.ts +0 -280
  438. package/tests/core/interaction-plumbing.test.ts +0 -141
  439. package/tests/core/modalFeedback.test.ts +0 -308
  440. package/tests/core/outcome-reset.test.ts +0 -43
  441. package/tests/extraction/extractors/associateExtractor.test.ts +0 -182
  442. package/tests/extraction/extractors/choiceExtractor.test.ts +0 -239
  443. package/tests/extraction/extractors/customExtractor.test.ts +0 -83
  444. package/tests/extraction/extractors/drawingExtractor.test.ts +0 -94
  445. package/tests/extraction/extractors/endAttemptExtractor.test.ts +0 -188
  446. package/tests/extraction/extractors/extendedTextExtractor.test.ts +0 -178
  447. package/tests/extraction/extractors/gapMatchExtractor.test.ts +0 -318
  448. package/tests/extraction/extractors/graphicAssociateExtractor.test.ts +0 -260
  449. package/tests/extraction/extractors/graphicGapMatchExtractor.test.ts +0 -320
  450. package/tests/extraction/extractors/graphicOrderExtractor.test.ts +0 -223
  451. package/tests/extraction/extractors/hotspotExtractor.test.ts +0 -298
  452. package/tests/extraction/extractors/hottextExtractor.test.ts +0 -240
  453. package/tests/extraction/extractors/inlineChoiceExtractor.test.ts +0 -292
  454. package/tests/extraction/extractors/matchExtractor.test.ts +0 -241
  455. package/tests/extraction/extractors/mediaExtractor.test.ts +0 -295
  456. package/tests/extraction/extractors/orderExtractor.test.ts +0 -212
  457. package/tests/extraction/extractors/positionObjectExtractor.test.ts +0 -363
  458. package/tests/extraction/extractors/selectPointExtractor.test.ts +0 -214
  459. package/tests/extraction/extractors/sliderExtractor.test.ts +0 -293
  460. package/tests/extraction/extractors/textEntryExtractor.test.ts +0 -133
  461. package/tests/extraction/extractors/uploadExtractor.test.ts +0 -119
  462. package/tests/extraction/test-utils.ts +0 -57
  463. package/tests/iframe/host.test.ts +0 -145
  464. package/tests/iframe/protocol.test.ts +0 -42
  465. package/tests/performance/player-benchmarks.bench.ts +0 -191
  466. package/tests/security/dos-limits.test.ts +0 -56
  467. package/tests/security/xss-prevention.test.ts +0 -522
  468. package/tsconfig.json +0 -20
  469. package/tsconfig.svelte.json +0 -14
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Standard QTI graphicOrderInteraction extractor
3
+ *
4
+ * Extracts data from graphicOrderInteraction elements (order items on image)
5
+ */
6
+ /**
7
+ * Standard QTI graphic order interaction extractor
8
+ * Handles graphicOrderInteraction elements (ordering hotspots on an image)
9
+ */
10
+ export const standardGraphicOrderExtractor = {
11
+ id: 'qti:graphic-order-interaction',
12
+ name: 'QTI Standard Graphic Order Interaction',
13
+ priority: 10,
14
+ elementTypes: ['graphicOrderInteraction'],
15
+ description: 'Extracts standard QTI graphicOrderInteraction (order items on image)',
16
+ canHandle(element, _context) {
17
+ // All graphicOrderInteraction elements are standard
18
+ return element.rawTagName === 'graphicOrderInteraction';
19
+ },
20
+ extract(element, context) {
21
+ const { utils } = context;
22
+ // Extract image data from object element
23
+ const objectElements = utils.getChildrenByTag(element, 'object');
24
+ let imageData = null;
25
+ if (objectElements.length > 0) {
26
+ const objectElement = objectElements[0];
27
+ const type = utils.getAttribute(objectElement, 'type', '');
28
+ const data = utils.getAttribute(objectElement, 'data', '');
29
+ const width = utils.getAttribute(objectElement, 'width', '500');
30
+ const height = utils.getAttribute(objectElement, 'height', '300');
31
+ if (type.startsWith('image/svg')) {
32
+ // Extract inline SVG content - get full content including <svg> tag
33
+ const content = utils.getHtmlContent(objectElement);
34
+ imageData = {
35
+ type: 'svg',
36
+ content,
37
+ width,
38
+ height,
39
+ };
40
+ }
41
+ else {
42
+ // External image reference
43
+ imageData = {
44
+ type: 'image',
45
+ src: data,
46
+ width,
47
+ height,
48
+ };
49
+ }
50
+ }
51
+ // Extract hotspotChoice children
52
+ const hotspotElements = utils.getChildrenByTag(element, 'hotspotChoice');
53
+ const hotspotChoices = hotspotElements.map((hotspot) => {
54
+ const classes = utils.getClasses(hotspot);
55
+ const identifier = utils.getAttribute(hotspot, 'identifier', '');
56
+ const shape = utils.getAttribute(hotspot, 'shape', 'rect');
57
+ const coords = utils.getAttribute(hotspot, 'coords', '0,0,50,50');
58
+ const fixed = utils.getBooleanAttribute(hotspot, 'fixed');
59
+ // Get text content as label, use identifier as fallback
60
+ const textContent = utils.getTextContent(hotspot).trim();
61
+ const label = textContent || identifier;
62
+ return {
63
+ identifier,
64
+ label,
65
+ shape,
66
+ coords,
67
+ ...(fixed ? { fixed } : {}),
68
+ ...(classes.length > 0 ? { classes } : {}),
69
+ };
70
+ });
71
+ // Extract prompt (optional)
72
+ const promptElements = utils.getChildrenByTag(element, 'prompt');
73
+ const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
74
+ return {
75
+ imageData,
76
+ hotspotChoices,
77
+ prompt,
78
+ };
79
+ },
80
+ validate(data) {
81
+ const errors = [];
82
+ const warnings = [];
83
+ // Validate image data
84
+ if (!data.imageData) {
85
+ warnings.push('graphicOrderInteraction has no image data');
86
+ }
87
+ else if (data.imageData.type === 'image' && !data.imageData.src) {
88
+ errors.push('graphicOrderInteraction must have an image URL');
89
+ }
90
+ else if (data.imageData.type === 'svg' && !data.imageData.content) {
91
+ errors.push('graphicOrderInteraction must have SVG content');
92
+ }
93
+ // Validate hotspot choices exist
94
+ if (!data.hotspotChoices || data.hotspotChoices.length < 2) {
95
+ errors.push('graphicOrderInteraction must have at least 2 hotspots');
96
+ }
97
+ // Validate hotspot choice identifiers and coords
98
+ if (data.hotspotChoices) {
99
+ const identifiers = new Set();
100
+ for (const hotspot of data.hotspotChoices) {
101
+ if (!hotspot.identifier) {
102
+ errors.push('All hotspot choices must have an identifier');
103
+ }
104
+ else if (identifiers.has(hotspot.identifier)) {
105
+ errors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);
106
+ }
107
+ else {
108
+ identifiers.add(hotspot.identifier);
109
+ }
110
+ if (!hotspot.coords) {
111
+ errors.push(`Hotspot ${hotspot.identifier} must have coords`);
112
+ }
113
+ }
114
+ }
115
+ return {
116
+ valid: errors.length === 0,
117
+ errors: errors.length > 0 ? errors : undefined,
118
+ warnings: warnings.length > 0 ? warnings : undefined,
119
+ };
120
+ },
121
+ };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Standard QTI hotspotInteraction extractor
3
+ *
4
+ * Extracts data from hotspotInteraction elements (clickable areas on image)
5
+ */
6
+ import type { ElementExtractor } from '../types.js';
7
+ /**
8
+ * Image data for hotspot interaction
9
+ */
10
+ export interface ImageData {
11
+ type: 'image' | 'svg';
12
+ src?: string;
13
+ content?: string;
14
+ width?: string;
15
+ height?: string;
16
+ }
17
+ /**
18
+ * Hotspot data extracted from hotspotInteraction elements
19
+ */
20
+ export interface HotspotData {
21
+ imageData: ImageData | null;
22
+ hotspotChoices: Array<{
23
+ identifier: string;
24
+ shape: 'circle' | 'rect' | 'poly' | 'ellipse' | 'default';
25
+ coords: string;
26
+ hotspotLabel?: string;
27
+ classes?: string[];
28
+ }>;
29
+ maxChoices: number;
30
+ minChoices?: number;
31
+ prompt: string | null;
32
+ }
33
+ /**
34
+ * Standard QTI hotspot interaction extractor
35
+ * Handles hotspotInteraction elements (clickable areas on an image)
36
+ */
37
+ export declare const standardHotspotExtractor: ElementExtractor<HotspotData>;
38
+ //# sourceMappingURL=hotspotExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hotspotExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/hotspotExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;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,WAAW;IAC3B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,KAAK,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;QAC1D,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,WAAW,CAqJlE,CAAC"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Standard QTI hotspotInteraction extractor
3
+ *
4
+ * Extracts data from hotspotInteraction elements (clickable areas on image)
5
+ */
6
+ /**
7
+ * Standard QTI hotspot interaction extractor
8
+ * Handles hotspotInteraction elements (clickable areas on an image)
9
+ */
10
+ export const standardHotspotExtractor = {
11
+ id: 'qti:hotspot-interaction',
12
+ name: 'QTI Standard Hotspot Interaction',
13
+ priority: 10,
14
+ elementTypes: ['hotspotInteraction'],
15
+ description: 'Extracts standard QTI hotspotInteraction (clickable areas on image)',
16
+ canHandle(element, _context) {
17
+ // All hotspotInteraction elements are standard
18
+ return element.rawTagName === 'hotspotInteraction';
19
+ },
20
+ extract(element, context) {
21
+ const { utils } = context;
22
+ // Extract image data from object element
23
+ const objectElements = utils.getChildrenByTag(element, 'object');
24
+ let imageData = null;
25
+ if (objectElements.length > 0) {
26
+ const objectElement = objectElements[0];
27
+ const type = utils.getAttribute(objectElement, 'type', '');
28
+ const data = utils.getAttribute(objectElement, 'data', '');
29
+ const width = utils.getAttribute(objectElement, 'width', 'auto');
30
+ const height = utils.getAttribute(objectElement, 'height', 'auto');
31
+ if (type.startsWith('image/svg')) {
32
+ // Extract inline SVG content - keep the full <svg>...</svg> markup.
33
+ // (Using the innerHTML of the <svg> element would drop the wrapper tag and render as plain text.)
34
+ const content = utils.getHtmlContent(objectElement);
35
+ imageData = {
36
+ type: 'svg',
37
+ content,
38
+ width,
39
+ height,
40
+ };
41
+ }
42
+ else {
43
+ // External image reference
44
+ imageData = {
45
+ type: 'image',
46
+ src: data,
47
+ width,
48
+ height,
49
+ };
50
+ }
51
+ }
52
+ // Extract hotspotChoice children
53
+ const hotspotElements = utils.getChildrenByTag(element, 'hotspotChoice');
54
+ const hotspotChoices = hotspotElements.map((hotspot) => {
55
+ const classes = utils.getClasses(hotspot);
56
+ const shape = utils.getAttribute(hotspot, 'shape', 'rect');
57
+ const coords = utils.getAttribute(hotspot, 'coords', '');
58
+ const hotspotLabel = utils.getAttribute(hotspot, 'hotspotLabel', '');
59
+ return {
60
+ identifier: utils.getAttribute(hotspot, 'identifier', ''),
61
+ shape: shape,
62
+ coords,
63
+ ...(hotspotLabel ? { hotspotLabel } : {}),
64
+ ...(classes.length > 0 ? { classes } : {}),
65
+ };
66
+ });
67
+ // Extract attributes
68
+ const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
69
+ const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
70
+ // Extract prompt (optional)
71
+ const promptElements = utils.getChildrenByTag(element, 'prompt');
72
+ const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
73
+ return {
74
+ imageData,
75
+ hotspotChoices,
76
+ maxChoices,
77
+ ...(minChoices > 0 ? { minChoices } : {}),
78
+ prompt,
79
+ };
80
+ },
81
+ validate(data) {
82
+ const errors = [];
83
+ const warnings = [];
84
+ // Validate image data
85
+ if (!data.imageData) {
86
+ warnings.push('hotspotInteraction has no image data');
87
+ }
88
+ else if (data.imageData.type === 'image' && !data.imageData.src) {
89
+ errors.push('hotspotInteraction must have an image URL');
90
+ }
91
+ else if (data.imageData.type === 'svg' && !data.imageData.content) {
92
+ errors.push('hotspotInteraction must have SVG content');
93
+ }
94
+ // Validate hotspots exist
95
+ if (!data.hotspotChoices || data.hotspotChoices.length === 0) {
96
+ errors.push('hotspotInteraction must have at least one hotspot');
97
+ }
98
+ // Validate hotspot identifiers and coords
99
+ if (data.hotspotChoices && data.hotspotChoices.length > 0) {
100
+ const identifiers = new Set();
101
+ for (const hotspot of data.hotspotChoices) {
102
+ if (!hotspot.identifier) {
103
+ errors.push('All hotspots must have an identifier');
104
+ }
105
+ else if (identifiers.has(hotspot.identifier)) {
106
+ errors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);
107
+ }
108
+ else {
109
+ identifiers.add(hotspot.identifier);
110
+ }
111
+ if (!hotspot.coords) {
112
+ errors.push(`Hotspot ${hotspot.identifier} must have coords`);
113
+ }
114
+ }
115
+ // Warn if maxChoices exceeds hotspot count
116
+ if (data.maxChoices > data.hotspotChoices.length) {
117
+ warnings.push(`maxChoices (${data.maxChoices}) exceeds the number of hotspots (${data.hotspotChoices.length})`);
118
+ }
119
+ }
120
+ // Validate maxChoices
121
+ if (data.maxChoices < 0) {
122
+ errors.push('maxChoices must be non-negative');
123
+ }
124
+ // Validate minChoices
125
+ if (data.minChoices !== undefined && data.minChoices < 0) {
126
+ errors.push('minChoices must be non-negative');
127
+ }
128
+ // Validate minChoices <= maxChoices
129
+ if (data.minChoices !== undefined &&
130
+ data.maxChoices > 0 &&
131
+ data.minChoices > data.maxChoices) {
132
+ errors.push('minChoices cannot exceed maxChoices');
133
+ }
134
+ return {
135
+ valid: errors.length === 0,
136
+ errors: errors.length > 0 ? errors : undefined,
137
+ warnings: warnings.length > 0 ? warnings : undefined,
138
+ };
139
+ },
140
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Standard QTI hottextInteraction extractor
3
+ *
4
+ * Extracts data from hottextInteraction elements (select text spans)
5
+ */
6
+ import type { ElementExtractor } from '../types.js';
7
+ /**
8
+ * Hottext data extracted from hottextInteraction elements
9
+ */
10
+ export interface HottextData {
11
+ hottextChoices: Array<{
12
+ identifier: string;
13
+ text: string;
14
+ classes?: string[];
15
+ }>;
16
+ contentHtml: string;
17
+ maxChoices: number;
18
+ minChoices?: number;
19
+ prompt: string | null;
20
+ }
21
+ /**
22
+ * Standard QTI hottext interaction extractor
23
+ * Handles hottextInteraction elements (selectable text spans)
24
+ */
25
+ export declare const standardHottextExtractor: ElementExtractor<HottextData>;
26
+ //# sourceMappingURL=hottextExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hottextExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/hottextExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,cAAc,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAChF,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,WAAW,CA+HlE,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Standard QTI hottextInteraction extractor
3
+ *
4
+ * Extracts data from hottextInteraction elements (select text spans)
5
+ */
6
+ import { sanitizeHtml } from '../../core/sanitizer.js';
7
+ /**
8
+ * Standard QTI hottext interaction extractor
9
+ * Handles hottextInteraction elements (selectable text spans)
10
+ */
11
+ export const standardHottextExtractor = {
12
+ id: 'qti:hottext-interaction',
13
+ name: 'QTI Standard Hottext Interaction',
14
+ priority: 10,
15
+ elementTypes: ['hottextInteraction'],
16
+ description: 'Extracts standard QTI hottextInteraction (select text spans)',
17
+ canHandle(element, _context) {
18
+ // All hottextInteraction elements are standard
19
+ return element.rawTagName === 'hottextInteraction';
20
+ },
21
+ extract(element, context) {
22
+ const { utils } = context;
23
+ // Extract hottext children (selectable text spans) - recursively search entire tree
24
+ const findHottextElements = (el) => {
25
+ const results = [];
26
+ if (el.rawTagName === 'hottext') {
27
+ results.push(el);
28
+ }
29
+ if (el.childNodes) {
30
+ for (const child of el.childNodes) {
31
+ if (typeof child !== 'string') {
32
+ results.push(...findHottextElements(child));
33
+ }
34
+ }
35
+ }
36
+ return results;
37
+ };
38
+ const hottextElements = findHottextElements(element);
39
+ const hottextChoices = hottextElements.map((hottext) => {
40
+ const classes = utils.getClasses(hottext);
41
+ return {
42
+ identifier: utils.getAttribute(hottext, 'identifier', ''),
43
+ text: utils.getTextContent(hottext),
44
+ ...(classes.length > 0 ? { classes } : {}),
45
+ };
46
+ });
47
+ // Extract attributes
48
+ const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
49
+ const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
50
+ // Extract prompt (optional)
51
+ const promptElements = utils.getChildrenByTag(element, 'prompt');
52
+ const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
53
+ // Extract content HTML (all content except prompt)
54
+ let contentHtml = '';
55
+ for (const child of element.childNodes) {
56
+ // Skip prompt elements
57
+ if (typeof child !== 'string' && child.rawTagName !== 'prompt') {
58
+ contentHtml += child.outerHTML || child.toString();
59
+ }
60
+ else if (typeof child === 'string') {
61
+ contentHtml += child;
62
+ }
63
+ }
64
+ // Sanitize extracted HTML before rendering via {@html} in the component.
65
+ contentHtml = sanitizeHtml(contentHtml, { security: context.config.security });
66
+ return {
67
+ hottextChoices,
68
+ contentHtml,
69
+ maxChoices,
70
+ ...(minChoices > 0 ? { minChoices } : {}),
71
+ prompt,
72
+ };
73
+ },
74
+ validate(data) {
75
+ const errors = [];
76
+ const warnings = [];
77
+ // Validate hottextChoices exist
78
+ if (!data.hottextChoices || data.hottextChoices.length === 0) {
79
+ errors.push('hottextInteraction must have at least one hottext');
80
+ }
81
+ // Validate hottext identifiers
82
+ if (data.hottextChoices) {
83
+ const identifiers = new Set();
84
+ for (const hottext of data.hottextChoices) {
85
+ if (!hottext.identifier) {
86
+ errors.push('All hottext elements must have an identifier');
87
+ }
88
+ else if (identifiers.has(hottext.identifier)) {
89
+ errors.push(`Duplicate hottext identifier: ${hottext.identifier}`);
90
+ }
91
+ else {
92
+ identifiers.add(hottext.identifier);
93
+ }
94
+ }
95
+ }
96
+ // Validate maxChoices
97
+ if (data.maxChoices < 0) {
98
+ errors.push('maxChoices must be non-negative');
99
+ }
100
+ // Warn if maxChoices exceeds hottext count
101
+ if (data.hottextChoices && data.maxChoices > data.hottextChoices.length) {
102
+ warnings.push(`maxChoices (${data.maxChoices}) exceeds the number of hottext choices (${data.hottextChoices.length})`);
103
+ }
104
+ // Validate minChoices
105
+ if (data.minChoices !== undefined && data.minChoices < 0) {
106
+ errors.push('minChoices must be non-negative');
107
+ }
108
+ // Validate minChoices <= maxChoices
109
+ if (data.minChoices !== undefined &&
110
+ data.maxChoices > 0 &&
111
+ data.minChoices > data.maxChoices) {
112
+ errors.push('minChoices cannot exceed maxChoices');
113
+ }
114
+ return {
115
+ valid: errors.length === 0,
116
+ errors: errors.length > 0 ? errors : undefined,
117
+ warnings: warnings.length > 0 ? warnings : undefined,
118
+ };
119
+ },
120
+ };
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Standard QTI Extractors
3
+ *
4
+ * Exports all standard QTI 2.2 interaction extractors
5
+ */
6
+ import type { ElementExtractor } from '../types.js';
7
+ export type { AssociateData } from './associateExtractor.js';
8
+ export { standardAssociateExtractor } from './associateExtractor.js';
9
+ export type { ChoiceData } from './choiceExtractor.js';
10
+ export { standardChoiceExtractor } from './choiceExtractor.js';
11
+ export type { CustomData } from './customExtractor.js';
12
+ export { standardCustomExtractor } from './customExtractor.js';
13
+ export type { DrawingData } from './drawingExtractor.js';
14
+ export { standardDrawingExtractor } from './drawingExtractor.js';
15
+ export type { EndAttemptData } from './endAttemptExtractor.js';
16
+ export { standardEndAttemptExtractor } from './endAttemptExtractor.js';
17
+ export type { ExtendedTextData } from './extendedTextExtractor.js';
18
+ export { standardExtendedTextExtractor } from './extendedTextExtractor.js';
19
+ export type { GapMatchData } from './gapMatchExtractor.js';
20
+ export { standardGapMatchExtractor } from './gapMatchExtractor.js';
21
+ export type { GraphicAssociateData } from './graphicAssociateExtractor.js';
22
+ export { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
23
+ export type { GraphicGapMatchData } from './graphicGapMatchExtractor.js';
24
+ export { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
25
+ export type { GraphicOrderData } from './graphicOrderExtractor.js';
26
+ export { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
27
+ export type { HotspotData } from './hotspotExtractor.js';
28
+ export { standardHotspotExtractor } from './hotspotExtractor.js';
29
+ export type { HottextData } from './hottextExtractor.js';
30
+ export { standardHottextExtractor } from './hottextExtractor.js';
31
+ export type { InlineChoiceData } from './inlineChoiceExtractor.js';
32
+ export { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
33
+ export type { MatchData } from './matchExtractor.js';
34
+ export { standardMatchExtractor } from './matchExtractor.js';
35
+ export type { MediaData } from './mediaExtractor.js';
36
+ export { standardMediaExtractor } from './mediaExtractor.js';
37
+ export type { OrderData } from './orderExtractor.js';
38
+ export { standardOrderExtractor } from './orderExtractor.js';
39
+ export type { PositionObjectData } from './positionObjectExtractor.js';
40
+ export { standardPositionObjectExtractor } from './positionObjectExtractor.js';
41
+ export type { SelectPointData } from './selectPointExtractor.js';
42
+ export { standardSelectPointExtractor } from './selectPointExtractor.js';
43
+ export type { SliderData } from './sliderExtractor.js';
44
+ export { standardSliderExtractor } from './sliderExtractor.js';
45
+ export type { TextEntryData } from './textEntryExtractor.js';
46
+ export { standardTextEntryExtractor } from './textEntryExtractor.js';
47
+ export type { UploadData } from './uploadExtractor.js';
48
+ export { standardUploadExtractor } from './uploadExtractor.js';
49
+ /**
50
+ * All standard QTI extractors
51
+ * Register these with ExtractionRegistry to enable standard QTI support
52
+ *
53
+ * @example
54
+ * import { ALL_STANDARD_EXTRACTORS } from '@pie-qti/item-player';
55
+ *
56
+ * const registry = new ExtractionRegistry();
57
+ * for (const extractor of ALL_STANDARD_EXTRACTORS) {
58
+ * registry.register(extractor);
59
+ * }
60
+ */
61
+ export declare const ALL_STANDARD_EXTRACTORS: ElementExtractor[];
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA0BpD,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AACnF,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACjF,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAAgB,EAuBrD,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Standard QTI Extractors
3
+ *
4
+ * Exports all standard QTI 2.2 interaction extractors
5
+ */
6
+ // Import extractors
7
+ import { standardAssociateExtractor } from './associateExtractor.js';
8
+ import { standardChoiceExtractor } from './choiceExtractor.js';
9
+ import { standardCustomExtractor } from './customExtractor.js';
10
+ import { standardDrawingExtractor } from './drawingExtractor.js';
11
+ import { standardEndAttemptExtractor } from './endAttemptExtractor.js';
12
+ import { standardExtendedTextExtractor } from './extendedTextExtractor.js';
13
+ import { standardGapMatchExtractor } from './gapMatchExtractor.js';
14
+ import { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
15
+ import { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
16
+ import { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
17
+ import { standardHotspotExtractor } from './hotspotExtractor.js';
18
+ import { standardHottextExtractor } from './hottextExtractor.js';
19
+ import { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
20
+ import { standardMatchExtractor } from './matchExtractor.js';
21
+ import { standardMediaExtractor } from './mediaExtractor.js';
22
+ import { standardOrderExtractor } from './orderExtractor.js';
23
+ import { standardPositionObjectExtractor } from './positionObjectExtractor.js';
24
+ import { standardSelectPointExtractor } from './selectPointExtractor.js';
25
+ import { standardSliderExtractor } from './sliderExtractor.js';
26
+ import { standardTextEntryExtractor } from './textEntryExtractor.js';
27
+ import { standardUploadExtractor } from './uploadExtractor.js';
28
+ export { standardAssociateExtractor } from './associateExtractor.js';
29
+ export { standardChoiceExtractor } from './choiceExtractor.js';
30
+ export { standardCustomExtractor } from './customExtractor.js';
31
+ export { standardDrawingExtractor } from './drawingExtractor.js';
32
+ export { standardEndAttemptExtractor } from './endAttemptExtractor.js';
33
+ export { standardExtendedTextExtractor } from './extendedTextExtractor.js';
34
+ export { standardGapMatchExtractor } from './gapMatchExtractor.js';
35
+ export { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
36
+ export { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
37
+ export { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
38
+ export { standardHotspotExtractor } from './hotspotExtractor.js';
39
+ export { standardHottextExtractor } from './hottextExtractor.js';
40
+ export { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
41
+ export { standardMatchExtractor } from './matchExtractor.js';
42
+ export { standardMediaExtractor } from './mediaExtractor.js';
43
+ export { standardOrderExtractor } from './orderExtractor.js';
44
+ export { standardPositionObjectExtractor } from './positionObjectExtractor.js';
45
+ export { standardSelectPointExtractor } from './selectPointExtractor.js';
46
+ export { standardSliderExtractor } from './sliderExtractor.js';
47
+ export { standardTextEntryExtractor } from './textEntryExtractor.js';
48
+ export { standardUploadExtractor } from './uploadExtractor.js';
49
+ /**
50
+ * All standard QTI extractors
51
+ * Register these with ExtractionRegistry to enable standard QTI support
52
+ *
53
+ * @example
54
+ * import { ALL_STANDARD_EXTRACTORS } from '@pie-qti/item-player';
55
+ *
56
+ * const registry = new ExtractionRegistry();
57
+ * for (const extractor of ALL_STANDARD_EXTRACTORS) {
58
+ * registry.register(extractor);
59
+ * }
60
+ */
61
+ export const ALL_STANDARD_EXTRACTORS = [
62
+ // All 21 standard QTI 2.2 interaction extractors (Phase 2 - Complete)
63
+ standardChoiceExtractor,
64
+ standardTextEntryExtractor,
65
+ standardExtendedTextExtractor,
66
+ standardInlineChoiceExtractor,
67
+ standardOrderExtractor,
68
+ standardMatchExtractor,
69
+ standardAssociateExtractor,
70
+ standardGapMatchExtractor,
71
+ standardSliderExtractor,
72
+ standardHotspotExtractor,
73
+ standardGraphicGapMatchExtractor,
74
+ standardUploadExtractor,
75
+ standardDrawingExtractor,
76
+ standardCustomExtractor,
77
+ standardMediaExtractor,
78
+ standardHottextExtractor,
79
+ standardSelectPointExtractor,
80
+ standardGraphicOrderExtractor,
81
+ standardGraphicAssociateExtractor,
82
+ standardPositionObjectExtractor,
83
+ standardEndAttemptExtractor,
84
+ ];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Standard QTI inlineChoiceInteraction extractor
3
+ *
4
+ * Extracts data from inlineChoiceInteraction elements (dropdown in text)
5
+ */
6
+ import type { ElementExtractor } from '../types.js';
7
+ /**
8
+ * Inline choice data extracted from inlineChoiceInteraction elements
9
+ */
10
+ export interface InlineChoiceData {
11
+ choices: Array<{
12
+ identifier: string;
13
+ text: string;
14
+ }>;
15
+ shuffle: boolean;
16
+ }
17
+ /**
18
+ * Standard QTI inline choice interaction extractor
19
+ * Handles inlineChoiceInteraction elements (dropdown selections within text)
20
+ */
21
+ export declare const standardInlineChoiceExtractor: ElementExtractor<InlineChoiceData>;
22
+ //# sourceMappingURL=inlineChoiceExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlineChoiceExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/inlineChoiceExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,gBAAgB,CAAC,gBAAgB,CAmE5E,CAAC"}