@pie-qti/item-player 0.1.4 → 0.1.5
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.
- package/README.md +21 -18
- package/dist/catalog/applyGlossaryTriggers.d.ts +15 -0
- package/dist/catalog/applyGlossaryTriggers.d.ts.map +1 -0
- package/dist/catalog/applyGlossaryTriggers.js +193 -0
- package/dist/catalog/catalogExtractor.d.ts +18 -0
- package/dist/catalog/catalogExtractor.d.ts.map +1 -0
- package/dist/catalog/catalogExtractor.js +114 -0
- package/dist/catalog/catalogLookup.d.ts +18 -0
- package/dist/catalog/catalogLookup.d.ts.map +1 -0
- package/dist/catalog/catalogLookup.js +44 -0
- package/dist/catalog/glossaryAction.d.ts +17 -0
- package/dist/catalog/glossaryAction.d.ts.map +1 -0
- package/dist/catalog/glossaryAction.js +21 -0
- package/dist/catalog/types.d.ts +26 -0
- package/dist/catalog/types.d.ts.map +1 -0
- package/dist/catalog/types.js +6 -0
- package/dist/core/ComponentRegistry.d.ts +9 -0
- package/dist/core/ComponentRegistry.d.ts.map +1 -1
- package/dist/core/ComponentRegistry.js +14 -0
- package/dist/core/ItemRenderer.d.ts.map +1 -1
- package/dist/core/ItemRenderer.js +3 -0
- package/dist/core/Player.d.ts +52 -0
- package/dist/core/Player.d.ts.map +1 -1
- package/dist/core/Player.js +158 -4
- package/dist/core/rolePolicy.d.ts +16 -0
- package/dist/core/rolePolicy.d.ts.map +1 -0
- package/dist/core/rolePolicy.js +15 -0
- package/dist/core/urlPolicy.d.ts.map +1 -1
- package/dist/core/urlPolicy.js +5 -2
- package/dist/element.d.ts +22 -0
- package/dist/element.js +5327 -0
- package/dist/element.js.map +1 -0
- package/dist/extraction/ExtractionRegistry.d.ts.map +1 -1
- package/dist/extraction/ExtractionRegistry.js +3 -1
- package/dist/extraction/extractors/associateExtractor.d.ts +1 -0
- package/dist/extraction/extractors/associateExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/associateExtractor.js +3 -0
- package/dist/extraction/extractors/choiceExtractor.d.ts +2 -0
- package/dist/extraction/extractors/choiceExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/choiceExtractor.js +10 -0
- package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/extendedTextExtractor.js +6 -0
- package/dist/extraction/extractors/gapMatchExtractor.d.ts +1 -0
- package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/gapMatchExtractor.js +33 -20
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +1 -0
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicAssociateExtractor.js +3 -0
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +11 -0
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicGapMatchExtractor.js +71 -10
- package/dist/extraction/extractors/hotspotExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/hotspotExtractor.js +27 -8
- package/dist/extraction/extractors/hottextExtractor.d.ts +1 -1
- package/dist/extraction/extractors/hottextExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/hottextExtractor.js +12 -4
- package/dist/extraction/extractors/index.d.ts +1 -0
- package/dist/extraction/extractors/index.d.ts.map +1 -1
- package/dist/extraction/extractors/index.js +4 -0
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +3 -0
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/inlineChoiceExtractor.js +17 -4
- package/dist/extraction/extractors/matchExtractor.d.ts +5 -0
- package/dist/extraction/extractors/matchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/matchExtractor.js +26 -0
- package/dist/extraction/extractors/orderExtractor.d.ts +2 -0
- package/dist/extraction/extractors/orderExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/orderExtractor.js +4 -0
- package/dist/extraction/extractors/portableCustomExtractor.d.ts +14 -0
- package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/portableCustomExtractor.js +96 -0
- package/dist/extraction/extractors/selectPointExtractor.js +5 -5
- package/dist/extraction/extractors/textEntryExtractor.d.ts +1 -0
- package/dist/extraction/extractors/textEntryExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/textEntryExtractor.js +6 -0
- package/dist/extraction/extractors/uploadExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/uploadExtractor.js +9 -2
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/pci/PciHost.d.ts +53 -0
- package/dist/pci/PciHost.d.ts.map +1 -0
- package/dist/pci/PciHost.js +116 -0
- package/dist/pci/types.d.ts +57 -0
- package/dist/pci/types.d.ts.map +1 -0
- package/dist/pci/types.js +19 -0
- package/dist/pnp/applyPnp.d.ts +9 -0
- package/dist/pnp/applyPnp.d.ts.map +1 -0
- package/dist/pnp/applyPnp.js +19 -0
- package/dist/pnp/parsePnpXml.d.ts +9 -0
- package/dist/pnp/parsePnpXml.d.ts.map +1 -0
- package/dist/pnp/parsePnpXml.js +101 -0
- package/dist/pnp/types.d.ts +40 -0
- package/dist/pnp/types.d.ts.map +1 -0
- package/dist/pnp/types.js +1 -0
- package/dist/types/index.d.ts +22 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interactions.d.ts +90 -1
- package/dist/types/interactions.d.ts.map +1 -1
- package/package.json +19 -9
- package/src/__tests__/catalog.test.ts +267 -0
- package/src/__tests__/fixtures/pci/echo-pci.js +49 -0
- package/src/__tests__/glossaryTriggers.test.ts +411 -0
- package/src/__tests__/pci.test.ts +353 -0
- package/src/__tests__/pnp.test.ts +250 -0
- package/src/__tests__/qti3-extraction.test.ts +5 -5
- package/src/catalog/applyGlossaryTriggers.ts +232 -0
- package/src/catalog/catalogExtractor.ts +130 -0
- package/src/catalog/catalogLookup.ts +53 -0
- package/src/catalog/glossaryAction.ts +28 -0
- package/src/catalog/types.ts +37 -0
- package/src/components/ItemBody.svelte +134 -26
- package/src/components/ItemPlayer.svelte +6 -2
- package/src/components/index.ts +3 -0
- package/src/core/ComponentRegistry.ts +14 -0
- package/src/core/ItemRenderer.ts +4 -0
- package/src/core/Player.ts +174 -4
- package/src/core/rolePolicy.ts +34 -0
- package/src/core/urlPolicy.ts +5 -2
- package/src/element.ts +128 -0
- package/src/extraction/ExtractionRegistry.ts +5 -1
- package/src/extraction/extractors/associateExtractor.ts +4 -0
- package/src/extraction/extractors/choiceExtractor.ts +12 -1
- package/src/extraction/extractors/conformance-qti3-advanced.test.ts +239 -0
- package/src/extraction/extractors/conformance-qti3-basic.test.ts +82 -0
- package/src/extraction/extractors/conformance.test.ts +208 -0
- package/src/extraction/extractors/extendedTextExtractor.ts +6 -0
- package/src/extraction/extractors/gapMatchExtractor.ts +36 -21
- package/src/extraction/extractors/graphicAssociateExtractor.ts +4 -0
- package/src/extraction/extractors/graphicGapMatchExtractor.ts +82 -10
- package/src/extraction/extractors/hotspotExtractor.ts +26 -8
- package/src/extraction/extractors/hottextExtractor.ts +15 -5
- package/src/extraction/extractors/index.ts +4 -0
- package/src/extraction/extractors/inlineChoiceExtractor.ts +22 -5
- package/src/extraction/extractors/matchExtractor.ts +31 -4
- package/src/extraction/extractors/orderExtractor.ts +6 -0
- package/src/extraction/extractors/portableCustomExtractor.ts +122 -0
- package/src/extraction/extractors/selectPointExtractor.ts +5 -5
- package/src/extraction/extractors/textEntryExtractor.ts +7 -0
- package/src/extraction/extractors/uploadExtractor.ts +10 -2
- package/src/index.ts +17 -1
- package/src/pci/PciHost.ts +138 -0
- package/src/pci/types.ts +70 -0
- package/src/pnp/applyPnp.ts +23 -0
- package/src/pnp/parsePnpXml.ts +118 -0
- package/src/pnp/types.ts +33 -0
- package/src/types/index.ts +22 -8
- package/src/types/interactions.ts +81 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtractionRegistry.d.ts","sourceRoot":"","sources":["../../src/extraction/ExtractionRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EACX,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEhB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,qBAAa,kBAAkB;IAC9B,sCAAsC;IACtC,OAAO,CAAC,cAAc,CAAuC;IAE7D,yDAAyD;IACzD,OAAO,CAAC,gBAAgB,CAAyC;IAEjE,wEAAwE;IACxE,OAAO,CAAC,cAAc,CAA+C;IAErE,4DAA4D;IAC5D,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAE9C,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAgC;gBAEvC,iBAAiB,CAAC,EAAE,iBAAiB;IAIjD;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB,EACrE,SAAS,EAAE,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,GAC1C,IAAI;IA+CP;;;;;OAKG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IA0B/B;;;;;;;OAOG;IACH,aAAa,CACZ,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,iBAAiB,GACxB,gBAAgB,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"ExtractionRegistry.d.ts","sourceRoot":"","sources":["../../src/extraction/ExtractionRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EACX,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEhB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,qBAAa,kBAAkB;IAC9B,sCAAsC;IACtC,OAAO,CAAC,cAAc,CAAuC;IAE7D,yDAAyD;IACzD,OAAO,CAAC,gBAAgB,CAAyC;IAEjE,wEAAwE;IACxE,OAAO,CAAC,cAAc,CAA+C;IAErE,4DAA4D;IAC5D,OAAO,CAAC,iBAAiB,CAAC,CAAoB;IAE9C,+EAA+E;IAC/E,OAAO,CAAC,WAAW,CAAgC;gBAEvC,iBAAiB,CAAC,EAAE,iBAAiB;IAIjD;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,SAAS,iBAAiB,GAAG,iBAAiB,EACrE,SAAS,EAAE,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,GAC1C,IAAI;IA+CP;;;;;OAKG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IA0B/B;;;;;;;OAOG;IACH,aAAa,CACZ,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,iBAAiB,GACxB,gBAAgB,GAAG,IAAI;IAmD1B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,KAAK,EACZ,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,iBAAiB,GACxB,gBAAgB,CAAC,KAAK,CAAC;IAsD1B;;;OAGG;IACH,aAAa,IAAI,aAAa,CAAC,gBAAgB,CAAC;IAMhD;;;;OAIG;IACH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAAC,gBAAgB,CAAC;IAM1E;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIjC;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKb;;;OAGG;IACH,KAAK,IAAI,kBAAkB;CAO3B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,kBAAkB,CAElG"}
|
|
@@ -138,7 +138,9 @@ export class ExtractionRegistry {
|
|
|
138
138
|
// Evaluate canHandle in priority order (O(M) where M = extractors for this type)
|
|
139
139
|
for (const extractor of extractors) {
|
|
140
140
|
try {
|
|
141
|
-
|
|
141
|
+
const canHandle = extractor.canHandle(element, context);
|
|
142
|
+
const typeMatchedThroughMapper = !!this.elementNameMapper && extractor.elementTypes.some((type) => this.qti2xMapper.toCanonical(type) === lookupKey);
|
|
143
|
+
if (canHandle || typeMatchedThroughMapper) {
|
|
142
144
|
// Cache the result
|
|
143
145
|
this.extractorCache.set(element, extractor);
|
|
144
146
|
return extractor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"associateExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/associateExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,KAAK,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"associateExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/associateExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,KAAK,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,aAAa,CAsGtE,CAAC"}
|
|
@@ -26,11 +26,14 @@ export const standardAssociateExtractor = {
|
|
|
26
26
|
const classes = utils.getClasses(choice);
|
|
27
27
|
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
28
28
|
const matchMin = utils.getNumberAttribute(choice, 'matchMin', 0);
|
|
29
|
+
const matchGroupRaw = utils.getAttribute(choice, 'matchGroup', '');
|
|
30
|
+
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
29
31
|
return {
|
|
30
32
|
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
31
33
|
text: utils.getHtmlContent(choice),
|
|
32
34
|
matchMax,
|
|
33
35
|
...(matchMin > 0 ? { matchMin } : {}),
|
|
36
|
+
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
34
37
|
...(classes.length > 0 ? { classes } : {}),
|
|
35
38
|
};
|
|
36
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choiceExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/choiceExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"choiceExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/choiceExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,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,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAAgB,CAAC,UAAU,CAgGhE,CAAC"}
|
|
@@ -23,9 +23,11 @@ export const standardChoiceExtractor = {
|
|
|
23
23
|
const simpleChoices = utils.getChildrenByTag(element, 'simpleChoice');
|
|
24
24
|
const choices = simpleChoices.map((choice) => {
|
|
25
25
|
const classes = utils.getClasses(choice);
|
|
26
|
+
const fixed = utils.getBooleanAttribute(choice, 'fixed');
|
|
26
27
|
return {
|
|
27
28
|
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
28
29
|
text: utils.getHtmlContent(choice),
|
|
30
|
+
...(fixed ? { fixed } : {}),
|
|
29
31
|
...(classes.length > 0 ? { classes } : {}),
|
|
30
32
|
};
|
|
31
33
|
});
|
|
@@ -35,11 +37,19 @@ export const standardChoiceExtractor = {
|
|
|
35
37
|
// Extract attributes
|
|
36
38
|
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
37
39
|
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
40
|
+
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
41
|
+
const interactionClasses = utils.getClasses(element);
|
|
42
|
+
const maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;
|
|
43
|
+
const minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;
|
|
38
44
|
return {
|
|
39
45
|
choices,
|
|
40
46
|
shuffle,
|
|
41
47
|
maxChoices,
|
|
48
|
+
minChoices,
|
|
42
49
|
prompt,
|
|
50
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
51
|
+
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
52
|
+
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
43
53
|
};
|
|
44
54
|
},
|
|
45
55
|
validate(data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendedTextExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/extendedTextExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,gBAAgB,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"extendedTextExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/extendedTextExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,gBAAgB,CAAC,gBAAgB,CAkE5E,CAAC"}
|
|
@@ -25,11 +25,17 @@ export const standardExtendedTextExtractor = {
|
|
|
25
25
|
const expectedLength = utils.getNumberAttribute(element, 'expectedLength', 200);
|
|
26
26
|
const placeholderText = utils.getAttribute(element, 'placeholderText', '');
|
|
27
27
|
const format = utils.getAttribute(element, 'format', 'plain');
|
|
28
|
+
const patternMask = utils.getAttribute(element, 'patternMask', '') || null;
|
|
29
|
+
const patternMaskMessage = utils.getAttribute(element, 'patternMaskMessage', '') || null;
|
|
30
|
+
const interactionClasses = utils.getClasses(element);
|
|
28
31
|
return {
|
|
29
32
|
expectedLines,
|
|
30
33
|
expectedLength,
|
|
31
34
|
placeholderText,
|
|
32
35
|
format,
|
|
36
|
+
...(patternMask ? { patternMask } : {}),
|
|
37
|
+
...(patternMaskMessage ? { patternMaskMessage } : {}),
|
|
38
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
33
39
|
};
|
|
34
40
|
},
|
|
35
41
|
validate(data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gapMatchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/gapMatchExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,KAAK,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,gBAAgB,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"gapMatchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/gapMatchExtractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,KAAK,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,gBAAgB,CAAC,YAAY,CAkKpE,CAAC"}
|
|
@@ -25,11 +25,14 @@ export const standardGapMatchExtractor = {
|
|
|
25
25
|
const classes = utils.getClasses(gapText);
|
|
26
26
|
const matchMax = utils.getNumberAttribute(gapText, 'matchMax', 1);
|
|
27
27
|
const matchMin = utils.getNumberAttribute(gapText, 'matchMin', 0);
|
|
28
|
+
const matchGroupRaw = utils.getAttribute(gapText, 'matchGroup', '');
|
|
29
|
+
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
28
30
|
return {
|
|
29
31
|
identifier: utils.getAttribute(gapText, 'identifier', ''),
|
|
30
32
|
text: utils.getTextContent(gapText),
|
|
31
33
|
matchMax,
|
|
32
34
|
...(matchMin > 0 ? { matchMin } : {}),
|
|
35
|
+
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
33
36
|
...(classes.length > 0 ? { classes } : {}),
|
|
34
37
|
};
|
|
35
38
|
});
|
|
@@ -45,49 +48,59 @@ export const standardGapMatchExtractor = {
|
|
|
45
48
|
prompt = utils.getHtmlContent(promptElement);
|
|
46
49
|
// Get the raw HTML content and extract gaps
|
|
47
50
|
const promptHtml = promptElement.outerHTML || promptElement.toString();
|
|
48
|
-
// Extract gap elements from prompt
|
|
51
|
+
// Extract gap elements from prompt children
|
|
49
52
|
const gapElements = utils.getChildrenByTag(promptElement, 'gap');
|
|
50
53
|
for (const gap of gapElements) {
|
|
51
54
|
gaps.push(utils.getAttribute(gap, 'identifier', ''));
|
|
52
55
|
}
|
|
53
56
|
// Replace gap elements with placeholders in the text
|
|
54
57
|
promptText = promptHtml
|
|
55
|
-
.replace(/<prompt[^>]*>/, '')
|
|
56
|
-
.replace(/<\/prompt>/, '')
|
|
57
|
-
.replace(/<gap\s+identifier="([^"]+)"[^>]*>/g, '[GAP:$1]')
|
|
58
|
-
.replace(/<gap\s+identifier='([^']+)'[^>]*>/g, '[GAP:$1]')
|
|
59
|
-
.replace(/<\/gap>/g, '')
|
|
58
|
+
.replace(/<qti-prompt[^>]*>|<prompt[^>]*>/, '')
|
|
59
|
+
.replace(/<\/qti-prompt>|<\/prompt>/, '')
|
|
60
|
+
.replace(/<(?:qti-)?gap\s+identifier="([^"]+)"[^>]*>/g, '[GAP:$1]')
|
|
61
|
+
.replace(/<(?:qti-)?gap\s+identifier='([^']+)'[^>]*>/g, '[GAP:$1]')
|
|
62
|
+
.replace(/<\/(?:qti-)?gap>/g, '')
|
|
60
63
|
.trim();
|
|
61
64
|
}
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
// If gaps were not found inside a <prompt>, search the full interaction body.
|
|
66
|
+
// This handles items where <gap> elements appear in <p>/<blockquote> siblings of <prompt>.
|
|
67
|
+
if (gaps.length === 0) {
|
|
64
68
|
const interactionHtml = element.outerHTML || element.toString();
|
|
65
|
-
|
|
66
|
-
const gapIdMatches = Array.from(interactionHtml.matchAll(/<gap\s+identifier=(?:"([^"]+)"|'([^']+)')[^>]*\/?>/g));
|
|
69
|
+
const gapIdMatches = Array.from(interactionHtml.matchAll(/<(?:qti-)?gap\s+identifier=(?:"([^"]+)"|'([^']+)')[^>]*\/?>/gi));
|
|
67
70
|
for (const m of gapIdMatches) {
|
|
68
71
|
const id = (m[1] || m[2] || '').trim();
|
|
69
72
|
if (id)
|
|
70
73
|
gaps.push(id);
|
|
71
74
|
}
|
|
72
|
-
promptText
|
|
73
|
-
.
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
if (!promptText) {
|
|
76
|
+
// No prompt element either: build promptText from full interaction content.
|
|
77
|
+
const interactionHtml2 = element.outerHTML || element.toString();
|
|
78
|
+
promptText = interactionHtml2
|
|
79
|
+
.replace(/<(?:qti-)?gap-match-interaction[^>]*>|<gapMatchInteraction[^>]*>/, '')
|
|
80
|
+
.replace(/<\/(?:qti-)?gap-match-interaction>|<\/gapMatchInteraction>/, '')
|
|
81
|
+
.replace(/<(?:qti-)?gap-text[\s\S]*?<\/(?:qti-)?gap-text>|<gapText[\s\S]*?<\/gapText>/g, '')
|
|
82
|
+
.replace(/<(?:qti-)?gap\s+identifier="([^"]+)"[^>]*\/?>/g, '[GAP:$1]')
|
|
83
|
+
.replace(/<(?:qti-)?gap\s+identifier='([^']+)'[^>]*\/?>/g, '[GAP:$1]')
|
|
84
|
+
.replace(/<\/(?:qti-)?gap>/g, '')
|
|
85
|
+
.trim();
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
// Extract attributes
|
|
84
89
|
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
90
|
+
const interactionClasses = utils.getClasses(element);
|
|
91
|
+
const choicesContainerWidth = utils.getAttribute(element, 'data-choices-container-width', '') || null;
|
|
92
|
+
const maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;
|
|
93
|
+
const minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;
|
|
85
94
|
return {
|
|
86
95
|
gapTexts,
|
|
87
96
|
gaps,
|
|
88
97
|
shuffle,
|
|
89
98
|
prompt,
|
|
90
99
|
promptText,
|
|
100
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
101
|
+
...(choicesContainerWidth ? { choicesContainerWidth } : {}),
|
|
102
|
+
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
103
|
+
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
91
104
|
};
|
|
92
105
|
},
|
|
93
106
|
validate(data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicAssociateExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/graphicAssociateExtractor.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,oBAAoB;IACpC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,KAAK,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,gBAAgB,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"graphicAssociateExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/graphicAssociateExtractor.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,oBAAoB;IACpC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,KAAK,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,EAAE,gBAAgB,CAAC,oBAAoB,CAoJpF,CAAC"}
|
|
@@ -57,6 +57,8 @@ export const standardGraphicAssociateExtractor = {
|
|
|
57
57
|
const coords = utils.getAttribute(hotspot, 'coords', '0,0,50,50');
|
|
58
58
|
const matchMax = utils.getNumberAttribute(hotspot, 'matchMax', 1);
|
|
59
59
|
const matchMin = utils.getNumberAttribute(hotspot, 'matchMin', 0);
|
|
60
|
+
const matchGroupRaw = utils.getAttribute(hotspot, 'matchGroup', '');
|
|
61
|
+
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
60
62
|
// Get text content as label, use identifier as fallback
|
|
61
63
|
const textContent = utils.getTextContent(hotspot).trim();
|
|
62
64
|
const label = textContent || identifier;
|
|
@@ -67,6 +69,7 @@ export const standardGraphicAssociateExtractor = {
|
|
|
67
69
|
coords,
|
|
68
70
|
matchMax,
|
|
69
71
|
...(matchMin > 0 ? { matchMin } : {}),
|
|
72
|
+
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
70
73
|
...(classes.length > 0 ? { classes } : {}),
|
|
71
74
|
};
|
|
72
75
|
});
|
|
@@ -19,13 +19,24 @@ export interface ImageData {
|
|
|
19
19
|
*/
|
|
20
20
|
export interface GraphicGapMatchData {
|
|
21
21
|
imageData: ImageData | null;
|
|
22
|
+
maxAssociations: number;
|
|
22
23
|
gapTexts: Array<{
|
|
23
24
|
identifier: string;
|
|
24
25
|
text: string;
|
|
25
26
|
matchMax: number;
|
|
26
27
|
matchMin?: number;
|
|
28
|
+
matchGroup?: string[];
|
|
27
29
|
classes?: string[];
|
|
28
30
|
}>;
|
|
31
|
+
gapImages: Array<{
|
|
32
|
+
identifier: string;
|
|
33
|
+
src: string;
|
|
34
|
+
alt: string;
|
|
35
|
+
matchMax: number;
|
|
36
|
+
matchGroup?: string[];
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
}>;
|
|
29
40
|
hotspots: Array<{
|
|
30
41
|
identifier: string;
|
|
31
42
|
shape: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicGapMatchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/graphicGapMatchExtractor.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,mBAAmB;IACnC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,QAAQ,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,gBAAgB,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"graphicGapMatchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/graphicGapMatchExtractor.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,mBAAmB;IACnC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,SAAS,EAAE,KAAK,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IACH,QAAQ,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzF,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,gBAAgB,CAAC,mBAAmB,CA8MlF,CAAC"}
|
|
@@ -29,14 +29,28 @@ export const standardGraphicGapMatchExtractor = {
|
|
|
29
29
|
const width = utils.getNumberAttribute(objectElement, 'width', 0);
|
|
30
30
|
const height = utils.getNumberAttribute(objectElement, 'height', 0);
|
|
31
31
|
if (type.startsWith('image/svg')) {
|
|
32
|
-
//
|
|
32
|
+
// Inline SVG: <object type="image/svg+xml"><svg>...</svg></object>
|
|
33
|
+
// External SVG: <object type="image/svg+xml" data="path/to/file.svg"/>
|
|
34
|
+
// The <object> may contain alt text (not SVG markup) — only treat as inline if content has <svg.
|
|
33
35
|
const content = utils.getHtmlContent(objectElement);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const hasSvgMarkup = /<svg[\s>]/i.test(content);
|
|
37
|
+
if (hasSvgMarkup) {
|
|
38
|
+
imageData = {
|
|
39
|
+
type: 'svg',
|
|
40
|
+
content,
|
|
41
|
+
...(width > 0 ? { width } : {}),
|
|
42
|
+
...(height > 0 ? { height } : {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// External SVG file reference — render via <img src>
|
|
47
|
+
imageData = {
|
|
48
|
+
type: 'image',
|
|
49
|
+
src: data,
|
|
50
|
+
...(width > 0 ? { width } : {}),
|
|
51
|
+
...(height > 0 ? { height } : {}),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
40
54
|
}
|
|
41
55
|
else {
|
|
42
56
|
// External image reference
|
|
@@ -48,21 +62,58 @@ export const standardGraphicGapMatchExtractor = {
|
|
|
48
62
|
};
|
|
49
63
|
}
|
|
50
64
|
}
|
|
65
|
+
// Extract interaction-level attributes
|
|
66
|
+
const maxAssociations = utils.getNumberAttribute(element, 'maxAssociations', 0);
|
|
51
67
|
// Extract gapText children (draggable text labels)
|
|
52
68
|
const gapTextElements = utils.getChildrenByTag(element, 'gapText');
|
|
53
69
|
const gapTexts = gapTextElements.map((gapText) => {
|
|
54
70
|
const classes = utils.getClasses(gapText);
|
|
55
71
|
const matchMax = utils.getNumberAttribute(gapText, 'matchMax', 1);
|
|
56
72
|
const matchMin = utils.getNumberAttribute(gapText, 'matchMin', 0);
|
|
73
|
+
const matchGroupRaw = utils.getAttribute(gapText, 'matchGroup', '');
|
|
74
|
+
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
57
75
|
const text = utils.getHtmlContent(gapText);
|
|
58
76
|
return {
|
|
59
77
|
identifier: utils.getAttribute(gapText, 'identifier', ''),
|
|
60
78
|
text,
|
|
61
79
|
matchMax,
|
|
62
80
|
...(matchMin > 0 ? { matchMin } : {}),
|
|
81
|
+
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
63
82
|
...(classes.length > 0 ? { classes } : {}),
|
|
64
83
|
};
|
|
65
84
|
});
|
|
85
|
+
// Extract gapImg children (draggable image labels)
|
|
86
|
+
const gapImgElements = utils.getChildrenByTag(element, 'gapImg');
|
|
87
|
+
const gapImages = gapImgElements.map((gapImg) => {
|
|
88
|
+
const matchMax = utils.getNumberAttribute(gapImg, 'matchMax', 1);
|
|
89
|
+
const matchGroupRaw = utils.getAttribute(gapImg, 'matchGroup', '');
|
|
90
|
+
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
91
|
+
const objectChildren = utils.getChildrenByTag(gapImg, 'object');
|
|
92
|
+
let src = '';
|
|
93
|
+
let alt = '';
|
|
94
|
+
let width;
|
|
95
|
+
let height;
|
|
96
|
+
if (objectChildren.length > 0) {
|
|
97
|
+
const obj = objectChildren[0];
|
|
98
|
+
src = utils.getAttribute(obj, 'data', '');
|
|
99
|
+
alt = utils.getTextContent(obj);
|
|
100
|
+
const w = utils.getNumberAttribute(obj, 'width', 0);
|
|
101
|
+
const h = utils.getNumberAttribute(obj, 'height', 0);
|
|
102
|
+
if (w > 0)
|
|
103
|
+
width = w;
|
|
104
|
+
if (h > 0)
|
|
105
|
+
height = h;
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
identifier: utils.getAttribute(gapImg, 'identifier', ''),
|
|
109
|
+
src,
|
|
110
|
+
alt,
|
|
111
|
+
matchMax,
|
|
112
|
+
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
113
|
+
...(width !== undefined ? { width } : {}),
|
|
114
|
+
...(height !== undefined ? { height } : {}),
|
|
115
|
+
};
|
|
116
|
+
});
|
|
66
117
|
// Extract associableHotspot elements (gap targets)
|
|
67
118
|
const hotspotElements = utils.getChildrenByTag(element, 'associableHotspot');
|
|
68
119
|
const hotspots = hotspotElements.map((hotspot) => ({
|
|
@@ -74,11 +125,21 @@ export const standardGraphicGapMatchExtractor = {
|
|
|
74
125
|
// Extract prompt (optional)
|
|
75
126
|
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
76
127
|
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
128
|
+
const interactionClasses = utils.getClasses(element);
|
|
129
|
+
const choicesContainerWidth = utils.getAttribute(element, 'data-choices-container-width', '') || null;
|
|
130
|
+
const maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;
|
|
131
|
+
const minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;
|
|
77
132
|
return {
|
|
78
133
|
imageData,
|
|
134
|
+
maxAssociations,
|
|
79
135
|
gapTexts,
|
|
136
|
+
gapImages,
|
|
80
137
|
hotspots,
|
|
81
138
|
prompt,
|
|
139
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
140
|
+
...(choicesContainerWidth ? { choicesContainerWidth } : {}),
|
|
141
|
+
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
142
|
+
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
82
143
|
};
|
|
83
144
|
},
|
|
84
145
|
validate(data) {
|
|
@@ -94,9 +155,9 @@ export const standardGraphicGapMatchExtractor = {
|
|
|
94
155
|
else if (data.imageData.type === 'svg' && !data.imageData.content) {
|
|
95
156
|
errors.push('graphicGapMatchInteraction must have SVG content');
|
|
96
157
|
}
|
|
97
|
-
// Validate
|
|
98
|
-
if (!data.gapTexts || data.gapTexts.length === 0) {
|
|
99
|
-
errors.push('graphicGapMatchInteraction must have at least one gapText');
|
|
158
|
+
// Validate that at least one draggable choice type is present
|
|
159
|
+
if ((!data.gapTexts || data.gapTexts.length === 0) && (!data.gapImages || data.gapImages.length === 0)) {
|
|
160
|
+
errors.push('graphicGapMatchInteraction must have at least one gapText or gapImg');
|
|
100
161
|
}
|
|
101
162
|
// Validate hotspots exist
|
|
102
163
|
if (!data.hotspots || data.hotspots.length === 0) {
|
|
@@ -1 +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,
|
|
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,CAuKlE,CAAC"}
|
|
@@ -29,15 +29,28 @@ export const standardHotspotExtractor = {
|
|
|
29
29
|
const width = utils.getAttribute(objectElement, 'width', 'auto');
|
|
30
30
|
const height = utils.getAttribute(objectElement, 'height', 'auto');
|
|
31
31
|
if (type.startsWith('image/svg')) {
|
|
32
|
-
//
|
|
33
|
-
//
|
|
32
|
+
// Inline SVG: <object type="image/svg+xml"><svg>...</svg></object>
|
|
33
|
+
// External SVG: <object type="image/svg+xml" data="path/to/file.svg"/>
|
|
34
|
+
// The <object> may contain alt text (not SVG markup) — only treat as inline if content has <svg.
|
|
34
35
|
const content = utils.getHtmlContent(objectElement);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
const hasSvgMarkup = /<svg[\s>]/i.test(content);
|
|
37
|
+
if (hasSvgMarkup) {
|
|
38
|
+
imageData = {
|
|
39
|
+
type: 'svg',
|
|
40
|
+
content,
|
|
41
|
+
width,
|
|
42
|
+
height,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// External SVG file reference — render via <img src> (SVG renders in img tags)
|
|
47
|
+
imageData = {
|
|
48
|
+
type: 'image',
|
|
49
|
+
src: data,
|
|
50
|
+
width,
|
|
51
|
+
height,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
41
54
|
}
|
|
42
55
|
else {
|
|
43
56
|
// External image reference
|
|
@@ -67,6 +80,9 @@ export const standardHotspotExtractor = {
|
|
|
67
80
|
// Extract attributes
|
|
68
81
|
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
69
82
|
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
83
|
+
const interactionClasses = utils.getClasses(element);
|
|
84
|
+
const maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;
|
|
85
|
+
const minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;
|
|
70
86
|
// Extract prompt (optional)
|
|
71
87
|
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
72
88
|
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
@@ -76,6 +92,9 @@ export const standardHotspotExtractor = {
|
|
|
76
92
|
maxChoices,
|
|
77
93
|
...(minChoices > 0 ? { minChoices } : {}),
|
|
78
94
|
prompt,
|
|
95
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
96
|
+
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
97
|
+
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
79
98
|
};
|
|
80
99
|
},
|
|
81
100
|
validate(data) {
|
|
@@ -1 +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,
|
|
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,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,WAAW,CAyIlE,CAAC"}
|
|
@@ -16,14 +16,14 @@ export const standardHottextExtractor = {
|
|
|
16
16
|
description: 'Extracts standard QTI hottextInteraction (select text spans)',
|
|
17
17
|
canHandle(element, _context) {
|
|
18
18
|
// All hottextInteraction elements are standard
|
|
19
|
-
return element.rawTagName === 'hottextInteraction';
|
|
19
|
+
return element.rawTagName === 'hottextInteraction' || element.rawTagName === 'qti-hottext-interaction';
|
|
20
20
|
},
|
|
21
21
|
extract(element, context) {
|
|
22
22
|
const { utils } = context;
|
|
23
23
|
// Extract hottext children (selectable text spans) - recursively search entire tree
|
|
24
24
|
const findHottextElements = (el) => {
|
|
25
25
|
const results = [];
|
|
26
|
-
if (el.rawTagName === 'hottext') {
|
|
26
|
+
if (el.rawTagName === 'hottext' || el.rawTagName === 'qti-hottext') {
|
|
27
27
|
results.push(el);
|
|
28
28
|
}
|
|
29
29
|
if (el.childNodes) {
|
|
@@ -47,6 +47,9 @@ export const standardHottextExtractor = {
|
|
|
47
47
|
// Extract attributes
|
|
48
48
|
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
49
49
|
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
50
|
+
const interactionClasses = utils.getClasses(element);
|
|
51
|
+
const maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;
|
|
52
|
+
const minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;
|
|
50
53
|
// Extract prompt (optional)
|
|
51
54
|
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
52
55
|
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
@@ -54,7 +57,9 @@ export const standardHottextExtractor = {
|
|
|
54
57
|
let contentHtml = '';
|
|
55
58
|
for (const child of element.childNodes) {
|
|
56
59
|
// Skip prompt elements
|
|
57
|
-
if (typeof child !== 'string' &&
|
|
60
|
+
if (typeof child !== 'string' &&
|
|
61
|
+
child.rawTagName !== 'prompt' &&
|
|
62
|
+
child.rawTagName !== 'qti-prompt') {
|
|
58
63
|
contentHtml += child.outerHTML || child.toString();
|
|
59
64
|
}
|
|
60
65
|
else if (typeof child === 'string') {
|
|
@@ -67,8 +72,11 @@ export const standardHottextExtractor = {
|
|
|
67
72
|
hottextChoices,
|
|
68
73
|
contentHtml,
|
|
69
74
|
maxChoices,
|
|
70
|
-
|
|
75
|
+
minChoices,
|
|
71
76
|
prompt,
|
|
77
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
78
|
+
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
79
|
+
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
72
80
|
};
|
|
73
81
|
},
|
|
74
82
|
validate(data) {
|
|
@@ -10,6 +10,7 @@ export type { ChoiceData } from './choiceExtractor.js';
|
|
|
10
10
|
export { standardChoiceExtractor } from './choiceExtractor.js';
|
|
11
11
|
export type { CustomData } from './customExtractor.js';
|
|
12
12
|
export { standardCustomExtractor } from './customExtractor.js';
|
|
13
|
+
export { portableCustomExtractor } from './portableCustomExtractor.js';
|
|
13
14
|
export type { DrawingData } from './drawingExtractor.js';
|
|
14
15
|
export { standardDrawingExtractor } from './drawingExtractor.js';
|
|
15
16
|
export type { EndAttemptData } from './endAttemptExtractor.js';
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { standardAssociateExtractor } from './associateExtractor.js';
|
|
8
8
|
import { standardChoiceExtractor } from './choiceExtractor.js';
|
|
9
9
|
import { standardCustomExtractor } from './customExtractor.js';
|
|
10
|
+
import { portableCustomExtractor } from './portableCustomExtractor.js';
|
|
10
11
|
import { standardDrawingExtractor } from './drawingExtractor.js';
|
|
11
12
|
import { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
12
13
|
import { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
@@ -28,6 +29,7 @@ import { standardUploadExtractor } from './uploadExtractor.js';
|
|
|
28
29
|
export { standardAssociateExtractor } from './associateExtractor.js';
|
|
29
30
|
export { standardChoiceExtractor } from './choiceExtractor.js';
|
|
30
31
|
export { standardCustomExtractor } from './customExtractor.js';
|
|
32
|
+
export { portableCustomExtractor } from './portableCustomExtractor.js';
|
|
31
33
|
export { standardDrawingExtractor } from './drawingExtractor.js';
|
|
32
34
|
export { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
33
35
|
export { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
@@ -59,6 +61,8 @@ export { standardUploadExtractor } from './uploadExtractor.js';
|
|
|
59
61
|
* }
|
|
60
62
|
*/
|
|
61
63
|
export const ALL_STANDARD_EXTRACTORS = [
|
|
64
|
+
// PCI extractor has higher priority (20) than standardCustomExtractor (10)
|
|
65
|
+
portableCustomExtractor,
|
|
62
66
|
// All 21 standard QTI 2.2 interaction extractors (Phase 2 - Complete)
|
|
63
67
|
standardChoiceExtractor,
|
|
64
68
|
standardTextEntryExtractor,
|