@pie-qti/item-player 1.0.0-beta.3 → 1.0.0-beta.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 +33 -5
- package/dist/catalog/applyGlossaryTriggers.js +14 -2
- package/dist/catalog/applyGlossaryTriggers.js.map +1 -1
- package/dist/catalog/catalogExtractor.js +2 -4
- package/dist/catalog/catalogExtractor.js.map +1 -1
- package/dist/catalog/sessionCatalog.d.ts +46 -0
- package/dist/catalog/sessionCatalog.js +87 -0
- package/dist/catalog/sessionCatalog.js.map +1 -0
- package/dist/components/utils/endAttempt.d.ts +16 -0
- package/dist/components/utils/endAttempt.js +28 -0
- package/dist/components/utils/endAttempt.js.map +1 -0
- package/dist/components/utils/focus.d.ts +19 -0
- package/dist/components/utils/focus.js +67 -0
- package/dist/components/utils/focus.js.map +1 -0
- package/dist/components/utils/itemBodyRenderer.d.ts +44 -0
- package/dist/components/utils/itemBodyRenderer.js +177 -0
- package/dist/components/utils/itemBodyRenderer.js.map +1 -0
- package/dist/components/utils/sentenceContext.d.ts +6 -0
- package/dist/components/utils/sentenceContext.js +16 -0
- package/dist/components/utils/sentenceContext.js.map +1 -0
- package/dist/core/AssessmentItemDefinition.d.ts +20 -1
- package/dist/core/AssessmentItemDefinition.js +12 -31
- package/dist/core/AssessmentItemDefinition.js.map +1 -1
- package/dist/core/ComponentRegistry.d.ts +92 -0
- package/dist/core/ComponentRegistry.js +7 -1
- package/dist/core/ComponentRegistry.js.map +1 -1
- package/dist/core/ItemSession.d.ts +18 -1
- package/dist/core/ItemSession.js +79 -41
- package/dist/core/ItemSession.js.map +1 -1
- package/dist/core/Player.d.ts +118 -141
- package/dist/core/Player.js +387 -1233
- package/dist/core/Player.js.map +1 -1
- package/dist/core/compliance.d.ts +72 -0
- package/dist/core/compliance.js +147 -0
- package/dist/core/compliance.js.map +1 -0
- package/dist/core/declarations/declarationBuilder.d.ts +29 -0
- package/dist/core/declarations/declarationBuilder.js +284 -0
- package/dist/core/declarations/declarationBuilder.js.map +1 -0
- package/dist/core/declarations/declarationValues.d.ts +11 -0
- package/dist/core/declarations/declarationValues.js +168 -0
- package/dist/core/declarations/declarationValues.js.map +1 -0
- package/dist/core/matchGroups.d.ts +36 -0
- package/dist/core/matchGroups.js +100 -0
- package/dist/core/matchGroups.js.map +1 -0
- package/dist/core/nameMappers.d.ts +35 -0
- package/dist/core/nameMappers.js +47 -0
- package/dist/core/nameMappers.js.map +1 -0
- package/dist/core/parsingLimits.d.ts +4 -0
- package/dist/core/parsingLimits.js +5 -2
- package/dist/core/parsingLimits.js.map +1 -1
- package/dist/core/processing/responseProcessing.d.ts +88 -0
- package/dist/core/processing/responseProcessing.js +317 -0
- package/dist/core/processing/responseProcessing.js.map +1 -0
- package/dist/core/processing/responseValidation.d.ts +55 -0
- package/dist/core/processing/responseValidation.js +335 -0
- package/dist/core/processing/responseValidation.js.map +1 -0
- package/dist/core/rendering/contentPass.d.ts +31 -0
- package/dist/core/rendering/contentPass.js +152 -0
- package/dist/core/rendering/contentPass.js.map +1 -0
- package/dist/core/rendering/htmlRender.d.ts +21 -0
- package/dist/core/rendering/htmlRender.js +56 -0
- package/dist/core/rendering/htmlRender.js.map +1 -0
- package/dist/core/responseProcessingTemplates.d.ts +23 -0
- package/dist/core/responseProcessingTemplates.js +45 -0
- package/dist/core/responseProcessingTemplates.js.map +1 -0
- package/dist/core/rolePolicy.d.ts +5 -0
- package/dist/core/rolePolicy.js +21 -0
- package/dist/core/rolePolicy.js.map +1 -1
- package/dist/core/sanitizer.js +8 -14
- package/dist/core/sanitizer.js.map +1 -1
- package/dist/core/serialization/sessionState.d.ts +56 -0
- package/dist/core/serialization/sessionState.js +139 -0
- package/dist/core/serialization/sessionState.js.map +1 -0
- package/dist/core/serialization/valueForms.d.ts +32 -0
- package/dist/core/serialization/valueForms.js +112 -0
- package/dist/core/serialization/valueForms.js.map +1 -0
- package/dist/document/AssessmentItemDocument.d.ts +27 -1
- package/dist/document/AssessmentItemDocument.js +67 -31
- package/dist/document/AssessmentItemDocument.js.map +1 -1
- package/dist/element-class-BbF4Dj7F.js +3773 -0
- package/dist/element-class-BbF4Dj7F.js.map +1 -0
- package/dist/element-class.d.ts +34 -1
- package/dist/element-class.js +1 -1
- package/dist/element.js +1 -1
- package/dist/extraction/ExtractionRegistry.js +6 -12
- package/dist/extraction/ExtractionRegistry.js.map +1 -1
- package/dist/extraction/createContext.d.ts +2 -2
- package/dist/extraction/createContext.js.map +1 -1
- package/dist/extraction/index.d.ts +2 -2
- package/dist/extraction/index.js +1 -1
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/interactionCoverage.d.ts +31 -0
- package/dist/extraction/interactionCoverage.js +40 -0
- package/dist/extraction/interactionCoverage.js.map +1 -0
- package/dist/extraction/interactionExtractionPipeline.js +5 -10
- package/dist/extraction/interactionExtractionPipeline.js.map +1 -1
- package/dist/extraction/interactionSecurity.js +1 -28
- package/dist/extraction/interactionSecurity.js.map +1 -1
- package/dist/extraction/mergeDeliveryFields.d.ts +13 -0
- package/dist/extraction/mergeDeliveryFields.js +17 -0
- package/dist/extraction/mergeDeliveryFields.js.map +1 -0
- package/dist/extraction/responseIdentifier.d.ts +19 -0
- package/dist/extraction/responseIdentifier.js +29 -0
- package/dist/extraction/responseIdentifier.js.map +1 -0
- package/dist/extraction/types.d.ts +11 -18
- package/dist/extraction/types.js +0 -12
- package/dist/extraction/types.js.map +1 -1
- package/dist/extraction/utils.d.ts +14 -0
- package/dist/extraction/utils.js +35 -5
- package/dist/extraction/utils.js.map +1 -1
- package/dist/index.d.ts +16 -10
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/dist/interactions/associate/extractor.d.ts +1 -0
- package/dist/interactions/associate/extractor.js +10 -12
- package/dist/interactions/associate/extractor.js.map +1 -1
- package/dist/interactions/choice/extractor.js +6 -13
- package/dist/interactions/choice/extractor.js.map +1 -1
- package/dist/interactions/drawing/extractor.d.ts +6 -0
- package/dist/interactions/drawing/extractor.js +30 -9
- package/dist/interactions/drawing/extractor.js.map +1 -1
- package/dist/interactions/end-attempt/extractor.js +2 -1
- package/dist/interactions/end-attempt/extractor.js.map +1 -1
- package/dist/interactions/extended-text/extractor.d.ts +6 -1
- package/dist/interactions/extended-text/extractor.js +10 -5
- package/dist/interactions/extended-text/extractor.js.map +1 -1
- package/dist/interactions/extended-text/response.js +18 -18
- package/dist/interactions/extended-text/response.js.map +1 -1
- package/dist/interactions/gap-match/extractor.d.ts +40 -2
- package/dist/interactions/gap-match/extractor.js +197 -39
- package/dist/interactions/gap-match/extractor.js.map +1 -1
- package/dist/interactions/graphic-associate/extractor.d.ts +11 -0
- package/dist/interactions/graphic-associate/extractor.js +35 -24
- package/dist/interactions/graphic-associate/extractor.js.map +1 -1
- package/dist/interactions/graphic-gap-match/extractor.d.ts +21 -0
- package/dist/interactions/graphic-gap-match/extractor.js +79 -43
- package/dist/interactions/graphic-gap-match/extractor.js.map +1 -1
- package/dist/interactions/graphic-order/extractor.d.ts +15 -0
- package/dist/interactions/graphic-order/extractor.js +39 -24
- package/dist/interactions/graphic-order/extractor.js.map +1 -1
- package/dist/interactions/hotspot/extractor.d.ts +6 -0
- package/dist/interactions/hotspot/extractor.js +31 -16
- package/dist/interactions/hotspot/extractor.js.map +1 -1
- package/dist/interactions/hottext/extractor.js +2 -12
- package/dist/interactions/hottext/extractor.js.map +1 -1
- package/dist/interactions/inline/accessibleName.d.ts +29 -0
- package/dist/interactions/inline/accessibleName.js +35 -0
- package/dist/interactions/inline/accessibleName.js.map +1 -0
- package/dist/interactions/inline/render-plan.d.ts +5 -14
- package/dist/interactions/inline/render-plan.js +5 -56
- package/dist/interactions/inline/render-plan.js.map +1 -1
- package/dist/interactions/inline-choice/extractor.d.ts +4 -0
- package/dist/interactions/inline-choice/extractor.js +13 -12
- package/dist/interactions/inline-choice/extractor.js.map +1 -1
- package/dist/interactions/match/extractor.d.ts +2 -0
- package/dist/interactions/match/extractor.js +14 -28
- package/dist/interactions/match/extractor.js.map +1 -1
- package/dist/interactions/media/extractor.d.ts +5 -11
- package/dist/interactions/media/extractor.js +100 -36
- package/dist/interactions/media/extractor.js.map +1 -1
- package/dist/interactions/modules.js +8 -2
- package/dist/interactions/modules.js.map +1 -1
- package/dist/interactions/order/extractor.d.ts +2 -0
- package/dist/interactions/order/extractor.js +8 -12
- package/dist/interactions/order/extractor.js.map +1 -1
- package/dist/interactions/order/limits.d.ts +29 -0
- package/dist/interactions/order/limits.js +28 -0
- package/dist/interactions/order/limits.js.map +1 -0
- package/dist/interactions/portable-custom/extractor.js +4 -2
- package/dist/interactions/portable-custom/extractor.js.map +1 -1
- package/dist/interactions/position-object/extractor.d.ts +18 -1
- package/dist/interactions/position-object/extractor.js +81 -22
- package/dist/interactions/position-object/extractor.js.map +1 -1
- package/dist/interactions/select-point/extractor.d.ts +6 -0
- package/dist/interactions/select-point/extractor.js +31 -19
- package/dist/interactions/select-point/extractor.js.map +1 -1
- package/dist/interactions/shared/imageAlt.d.ts +54 -0
- package/dist/interactions/shared/imageAlt.js +84 -0
- package/dist/interactions/shared/imageAlt.js.map +1 -0
- package/dist/interactions/shared/interactionImage.d.ts +32 -0
- package/dist/interactions/shared/interactionImage.js +39 -0
- package/dist/interactions/shared/interactionImage.js.map +1 -0
- package/dist/interactions/shared/specDefaults.d.ts +20 -0
- package/dist/interactions/shared/specDefaults.js +25 -0
- package/dist/interactions/shared/specDefaults.js.map +1 -0
- package/dist/interactions/shared/types.d.ts +212 -40
- package/dist/interactions/shared/types.js.map +1 -1
- package/dist/interactions/text-entry/extractor.d.ts +9 -0
- package/dist/interactions/text-entry/extractor.js +9 -0
- package/dist/interactions/text-entry/extractor.js.map +1 -1
- package/dist/interactions/text-entry/inlineInputStyle.d.ts +10 -0
- package/dist/interactions/text-entry/inlineInputStyle.js +12 -0
- package/dist/interactions/text-entry/inlineInputStyle.js.map +1 -0
- package/dist/interactions/text-entry/inputMode.d.ts +35 -0
- package/dist/interactions/text-entry/inputMode.js +134 -0
- package/dist/interactions/text-entry/inputMode.js.map +1 -0
- package/dist/interactions/text-entry/response.d.ts +15 -0
- package/dist/interactions/text-entry/response.js +25 -0
- package/dist/interactions/text-entry/response.js.map +1 -0
- package/dist/interactions/upload/extractor.js +2 -2
- package/dist/interactions/upload/extractor.js.map +1 -1
- package/dist/pci/PciHost.d.ts +1 -1
- package/dist/pci/PciHost.js +11 -11
- package/dist/pci/PciHost.js.map +1 -1
- package/dist/pci/index.d.ts +1 -0
- package/dist/pci/index.js.map +1 -1
- package/dist/pci/modulePaths.d.ts +16 -0
- package/dist/pci/modulePaths.js +33 -0
- package/dist/pci/modulePaths.js.map +1 -0
- package/dist/pci/pageRealmSession.js +3 -15
- package/dist/pci/pageRealmSession.js.map +1 -1
- package/dist/pci/qtiVariableJson.d.ts +46 -3
- package/dist/pci/qtiVariableJson.js +247 -53
- package/dist/pci/qtiVariableJson.js.map +1 -1
- package/dist/pci/sandbox/SandboxedPciSession.d.ts +3 -0
- package/dist/pci/sandbox/SandboxedPciSession.js +15 -14
- package/dist/pci/sandbox/SandboxedPciSession.js.map +1 -1
- package/dist/pci/sandbox/iframeConnector.d.ts +18 -4
- package/dist/pci/sandbox/iframeConnector.js +35 -6
- package/dist/pci/sandbox/iframeConnector.js.map +1 -1
- package/dist/pci/sandbox/protocol.d.ts +14 -0
- package/dist/pci/sandbox/protocol.js.map +1 -1
- package/dist/pci/sessionHosts.d.ts +47 -0
- package/dist/pci/sessionHosts.js +66 -0
- package/dist/pci/sessionHosts.js.map +1 -0
- package/dist/pci/types.d.ts +7 -1
- package/dist/pci/types.js.map +1 -1
- package/dist/pnp/applyPnp.d.ts +20 -3
- package/dist/pnp/applyPnp.js +84 -9
- package/dist/pnp/applyPnp.js.map +1 -1
- package/dist/pnp/parsePnpXml.js +2 -0
- package/dist/pnp/parsePnpXml.js.map +1 -1
- package/dist/pnp/types.d.ts +16 -8
- package/dist/pnp/types.js.map +1 -1
- package/dist/presentation/feedbackAnnouncement.d.ts +56 -0
- package/dist/presentation/feedbackAnnouncement.js +150 -0
- package/dist/presentation/feedbackAnnouncement.js.map +1 -0
- package/dist/presentation/interactionSlots.d.ts +31 -0
- package/dist/presentation/interactionSlots.js +101 -0
- package/dist/presentation/interactionSlots.js.map +1 -0
- package/dist/presentation/itemPresentationPlan.d.ts +69 -6
- package/dist/presentation/itemPresentationPlan.js +93 -81
- package/dist/presentation/itemPresentationPlan.js.map +1 -1
- package/dist/{components/utils → presentation}/stimulusRender.js +3 -12
- package/dist/presentation/stimulusRender.js.map +1 -0
- package/dist/presentation/stylesheetRender.js.map +1 -0
- package/dist/security/escapeHtml.d.ts +15 -0
- package/dist/security/escapeHtml.js +22 -0
- package/dist/security/escapeHtml.js.map +1 -0
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.js +1 -0
- package/dist/security/index.js.map +1 -1
- package/dist/server.d.ts +8 -1
- package/dist/server.js.map +1 -1
- package/dist/session-inputs.d.ts +108 -0
- package/dist/session-inputs.js +130 -0
- package/dist/session-inputs.js.map +1 -0
- package/dist/types/index.d.ts +67 -35
- package/dist/types/index.js.map +1 -1
- package/dist/utils/cloneFreeze.d.ts +52 -0
- package/dist/utils/cloneFreeze.js +113 -0
- package/dist/utils/cloneFreeze.js.map +1 -0
- package/dist/utils/htmlAttributes.d.ts +13 -0
- package/dist/utils/htmlAttributes.js +22 -0
- package/dist/utils/htmlAttributes.js.map +1 -0
- package/dist/web-components/QTIInteractionElement.d.ts +0 -29
- package/dist/web-components/QTIInteractionElement.js +0 -32
- package/dist/web-components/QTIInteractionElement.js.map +1 -1
- package/dist/web-components/index.d.ts +1 -2
- package/dist/web-components/index.js +2 -3
- package/dist/web-components/index.js.map +1 -1
- package/package.json +15 -18
- package/dist/components/utils/feedbackUtils.d.ts +0 -77
- package/dist/components/utils/feedbackUtils.js +0 -138
- package/dist/components/utils/feedbackUtils.js.map +0 -1
- package/dist/components/utils/index.d.ts +0 -4
- package/dist/components/utils/index.js +0 -5
- package/dist/components/utils/index.js.map +0 -1
- package/dist/components/utils/stimulusRender.js.map +0 -1
- package/dist/components/utils/stylesheetRender.js.map +0 -1
- package/dist/core/constants.d.ts +0 -65
- package/dist/core/constants.js +0 -74
- package/dist/core/constants.js.map +0 -1
- package/dist/element-class-X2XXDa29.js +0 -9299
- package/dist/element-class-X2XXDa29.js.map +0 -1
- package/dist/extensions/MathLiveEditor.d.ts +0 -31
- package/dist/extensions/MathLiveEditor.js +0 -248
- package/dist/extensions/MathLiveEditor.js.map +0 -1
- package/dist/utils/PerformanceMonitor.d.ts +0 -169
- package/dist/utils/PerformanceMonitor.js +0 -243
- package/dist/utils/PerformanceMonitor.js.map +0 -1
- package/dist/utils/responseUtils.d.ts +0 -15
- package/dist/utils/responseUtils.js +0 -46
- package/dist/utils/responseUtils.js.map +0 -1
- package/dist/web-components/QTIInteractionBase.d.ts +0 -119
- package/dist/web-components/QTIInteractionBase.js +0 -244
- package/dist/web-components/QTIInteractionBase.js.map +0 -1
- /package/dist/{components/utils → presentation}/stimulusRender.d.ts +0 -0
- /package/dist/{components/utils → presentation}/stylesheetRender.d.ts +0 -0
- /package/dist/{components/utils → presentation}/stylesheetRender.js +0 -0
package/dist/core/Player.d.ts
CHANGED
|
@@ -1,46 +1,42 @@
|
|
|
1
1
|
import { type DeclarationMap } from '@pie-qti/qti-processing';
|
|
2
2
|
import type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';
|
|
3
|
-
import { type
|
|
4
|
-
import type { CompletionStatus, HtmlContent, ItemSessionActionCommand, ItemSessionActionResult,
|
|
3
|
+
import { type I18nProvider } from '@pie-qti/i18n';
|
|
4
|
+
import type { CompletionStatus, HtmlContent, ItemSessionActionCommand, ItemSessionActionResult, ItemSessionEngineConfig, PlayerSecurityConfig, RubricBlock, RubricBlockOptions, ScoringResult, SerializedItemSessionState } from '../types/index.js';
|
|
5
5
|
import type { BaseInteractionData } from '../interactions/shared/types.js';
|
|
6
6
|
import type { ResponseValidationResult } from '../types/responseValidation.js';
|
|
7
7
|
import type { ComponentRegistry } from './ComponentRegistry.js';
|
|
8
|
+
import { type QtiItemDiagnostic } from './compliance.js';
|
|
8
9
|
import type { PnpProfile } from '../pnp/types.js';
|
|
9
10
|
import { PciHost } from '../pci/PciHost.js';
|
|
10
11
|
import type { ExtractedPci } from '../pci/types.js';
|
|
11
12
|
export declare class Player {
|
|
12
|
-
private role;
|
|
13
|
-
private config;
|
|
14
13
|
private itemXml;
|
|
15
|
-
private itemDocument;
|
|
16
|
-
private decls;
|
|
17
|
-
private sourceDeclarations;
|
|
18
|
-
private ctx;
|
|
19
|
-
private rng;
|
|
20
|
-
private ops;
|
|
21
14
|
private extractionRegistry;
|
|
22
15
|
private interactionDataCache;
|
|
23
|
-
/** Template variables declared with `mathVariable`, substituted into MathML. */
|
|
24
|
-
private mathVariableIds;
|
|
25
16
|
private componentRegistry;
|
|
26
17
|
private i18nProvider;
|
|
27
|
-
|
|
28
|
-
private
|
|
29
|
-
private responseProcessingProgram;
|
|
30
|
-
private responseProcessing;
|
|
31
|
-
private templateProcessingProgram;
|
|
32
|
-
private outcomeProcessingProgram;
|
|
18
|
+
/** The item's detected QTI version ('unknown' when nothing identified it). */
|
|
19
|
+
private qtiVersion;
|
|
33
20
|
private _pnp;
|
|
34
21
|
private _rootEl;
|
|
35
22
|
private _catalogIndex;
|
|
36
23
|
private _stimulusCatalogIndexes;
|
|
37
|
-
private _pciHosts;
|
|
38
24
|
private _pnpChangeListeners;
|
|
39
|
-
private
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
private diagnostics;
|
|
26
|
+
/**
|
|
27
|
+
* Bumped at every change to the session's response values (candidate input, restore,
|
|
28
|
+
* template rules, PCI writes, attempt settlement) and wherever the interaction data
|
|
29
|
+
* regenerates; keys the response-validation memo.
|
|
30
|
+
*/
|
|
31
|
+
private responseRevision;
|
|
32
|
+
private interactionDataGeneration;
|
|
33
|
+
/** The base validation of the engine's current responses, memoized per revision. */
|
|
34
|
+
private engineValidationMemo;
|
|
35
|
+
/** The last base validation computed for an explicit responses record. */
|
|
36
|
+
private validationMemo;
|
|
43
37
|
constructor(config: ItemSessionEngineConfig);
|
|
38
|
+
/** The item's QTI compliance findings from compilation; empty when it compiled cleanly. */
|
|
39
|
+
getDiagnostics(): readonly QtiItemDiagnostic[];
|
|
44
40
|
/**
|
|
45
41
|
* Apply the PNP profile to a player root element.
|
|
46
42
|
* Call this once the root DOM element is available (e.g. after mounting).
|
|
@@ -68,14 +64,9 @@ export declare class Player {
|
|
|
68
64
|
getCatalogEntry(idref: string, usage: string, lang?: string, options?: {
|
|
69
65
|
stimulusIdentifier?: string;
|
|
70
66
|
}): HtmlContent | null;
|
|
71
|
-
/** Sanitize externally resolved item-adjacent HTML before it reaches a rendering sink. */
|
|
72
67
|
sanitizeHtmlContent(html: string): string;
|
|
73
|
-
/**
|
|
74
|
-
* Create a PciHost for an extracted PCI and register it for response tracking.
|
|
75
|
-
* The caller is responsible for calling host.load() and
|
|
76
|
-
* host.initialize(domNode) once the DOM element is available.
|
|
77
|
-
*/
|
|
78
68
|
createPciHost(data: ExtractedPci): PciHost;
|
|
69
|
+
private pciInteractionStatus;
|
|
79
70
|
/**
|
|
80
71
|
* Offer a response value to the PCI identified by responseIdentifier. A
|
|
81
72
|
* mounted module that has already reported a response keeps it.
|
|
@@ -86,18 +77,6 @@ export declare class Player {
|
|
|
86
77
|
* state. Session restore and reset-to-default use this.
|
|
87
78
|
*/
|
|
88
79
|
restorePciResponse(responseIdentifier: string, value: unknown): void;
|
|
89
|
-
/**
|
|
90
|
-
* Disable/enable all PCI hosts based on role.
|
|
91
|
-
* 'candidate' = enabled; any other role = disabled.
|
|
92
|
-
*/
|
|
93
|
-
syncPciDisabledState(): void;
|
|
94
|
-
/**
|
|
95
|
-
* The QTI 3.0 §6.1 interaction status a PCI instantiates with: 'solution' when
|
|
96
|
-
* correct responses are exposed, 'review' for non-candidate roles otherwise,
|
|
97
|
-
* 'closed' once the attempt finished, 'interacting' while the candidate works.
|
|
98
|
-
* Hosts that know better pass their own `status` to the PciHost options.
|
|
99
|
-
*/
|
|
100
|
-
private pciInteractionStatus;
|
|
101
80
|
/**
|
|
102
81
|
* Destroy all PCI hosts. Call on player teardown.
|
|
103
82
|
*/
|
|
@@ -119,6 +98,32 @@ export declare class Player {
|
|
|
119
98
|
*/
|
|
120
99
|
restoreResponses(responses: Record<string, unknown>): void;
|
|
121
100
|
private applyResponses;
|
|
101
|
+
/**
|
|
102
|
+
* QTI ASI §5.2.1 built-in `completionStatus` transitions, as the specification's table names
|
|
103
|
+
* them: `not_attempted` when the item session is registered, `unknown` once the attempt has
|
|
104
|
+
* begun, and `completed` when response processing completes the attempt (the submission of a
|
|
105
|
+
* non-adaptive item; an adaptive item reaches `completed` only through its own response
|
|
106
|
+
* processing rules). This engine begins the attempt when the candidate changes a response
|
|
107
|
+
* (every candidate write goes through setResponses, a mounted PCI reporting its own change
|
|
108
|
+
* included) and when a suspended handoff is activated for interaction; response processing
|
|
109
|
+
* completes it (responseProcessing.ts).
|
|
110
|
+
*
|
|
111
|
+
* Documented reading of an ambiguous edge: `openSession({ responses })` pre-seeds through
|
|
112
|
+
* setResponses, so it counts as the attempt having begun. `restoreResponses` deliberately
|
|
113
|
+
* does not begin an attempt — it replaces saved state ("the state as it stands"), and the
|
|
114
|
+
* restored completionStatus travels with that state.
|
|
115
|
+
*/
|
|
116
|
+
private beginAttempt;
|
|
117
|
+
/** Response values changed: the response snapshot and its memoized validation drop. */
|
|
118
|
+
private touchResponses;
|
|
119
|
+
/**
|
|
120
|
+
* textEntryInteraction@stringIdentifier (QTI ASI §5.122.3; `string-identifier` in QTI 3.0):
|
|
121
|
+
* writing the text entry's response also writes the response its stringIdentifier names, with
|
|
122
|
+
* the text as entered before the numeric response reads it — "3.50" where the float response
|
|
123
|
+
* is 3.5 — or NULL for an empty field, so response processing can score that lexical form. A
|
|
124
|
+
* stringIdentifier that repeats the response, or names no declared response, is ignored.
|
|
125
|
+
*/
|
|
126
|
+
private applyTextEntryStringResponse;
|
|
122
127
|
/**
|
|
123
128
|
* Destroy all resources owned by this player instance (PCI modules, etc.).
|
|
124
129
|
* Call when unmounting to prevent memory leaks.
|
|
@@ -127,12 +132,7 @@ export declare class Player {
|
|
|
127
132
|
processResponses(): ScoringResult;
|
|
128
133
|
saveItemSession(): SerializedItemSessionState;
|
|
129
134
|
restoreItemSession(state: SerializedItemSessionState): void;
|
|
130
|
-
|
|
131
|
-
endAttempt(options?: {
|
|
132
|
-
countAttempt?: boolean;
|
|
133
|
-
validateResponses?: boolean;
|
|
134
|
-
}): ItemSessionActionResult;
|
|
135
|
-
scoreAttempt(): ItemSessionActionResult;
|
|
135
|
+
/** Test seam (paramVariable delivery); sessions dispatch newTemplate through ItemSession. */
|
|
136
136
|
newTemplate(options?: {
|
|
137
137
|
resetResponses?: boolean;
|
|
138
138
|
}): ItemSessionActionResult;
|
|
@@ -144,54 +144,27 @@ export declare class Player {
|
|
|
144
144
|
private runSubmitAttemptAction;
|
|
145
145
|
private createItemSessionActionResult;
|
|
146
146
|
getSecurityConfig(): PlayerSecurityConfig | undefined;
|
|
147
|
-
getTrustedTypesPolicyName(): string | undefined;
|
|
148
147
|
/**
|
|
149
148
|
* Get the i18n provider instance
|
|
150
149
|
* @returns I18nProvider instance
|
|
151
150
|
*/
|
|
152
|
-
getI18nProvider():
|
|
153
|
-
/**
|
|
154
|
-
* Get attribute value with QTI version support.
|
|
155
|
-
* Tries the attribute mapper's native form first, then falls back to direct lookup.
|
|
156
|
-
* @param el - Element to get attribute from
|
|
157
|
-
* @param canonicalName - Canonical (lowercase) attribute name
|
|
158
|
-
* @returns Attribute value or null
|
|
159
|
-
*/
|
|
160
|
-
private getAttrMapped;
|
|
151
|
+
getI18nProvider(): I18nProvider;
|
|
161
152
|
/**
|
|
162
153
|
* The provider used when the host passes none: English, from the catalog
|
|
163
154
|
* `@pie-qti/i18n` bundles eagerly.
|
|
164
155
|
*/
|
|
165
156
|
private createDefaultI18nProvider;
|
|
166
157
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
* @returns QTI version string ('2.0', '2.1', '2.2') or 'unknown'
|
|
171
|
-
*/
|
|
172
|
-
private detectQTIVersion;
|
|
173
|
-
/**
|
|
174
|
-
* Validates strict QTI 2.2 compliance if enabled in configuration.
|
|
175
|
-
* Logs warnings or throws errors based on config settings.
|
|
158
|
+
* The item's QTI compliance findings (see `collectItemDiagnostics`): errors in strict mode,
|
|
159
|
+
* warnings otherwise. Strict mode with `rejectUnknownExtensions` throws a `QtiComplianceError`
|
|
160
|
+
* on any finding; otherwise they are logged unless `logDeviations` is false.
|
|
176
161
|
*/
|
|
177
|
-
private
|
|
162
|
+
private compileDiagnostics;
|
|
178
163
|
private resetOutcomesToDefault;
|
|
179
164
|
private resetResponsesToDefault;
|
|
180
165
|
private resetTemplatesToDefault;
|
|
181
|
-
|
|
182
|
-
* A MAXSCORE declared without a <defaultValue> is 0 per the numeric outcome rule, so an item
|
|
183
|
-
* that never assigns it scores against a maximum of zero. That is the spec-correct reading of
|
|
184
|
-
* under-specified content, and silently substituting 1 would make this engine disagree with a
|
|
185
|
-
* conformant one — so surface the authoring gap instead of masking it.
|
|
186
|
-
*/
|
|
187
|
-
private warnOnceOnImpliedZeroMaxScore;
|
|
166
|
+
private restoreDeclaredTemplateRuleTargets;
|
|
188
167
|
private runResponseProcessing;
|
|
189
|
-
/**
|
|
190
|
-
* QTI item correctness, as test-level `numberCorrect` reads it: every declared response matches
|
|
191
|
-
* its correct response. Undefined when the item has no response or one declares no correct
|
|
192
|
-
* response.
|
|
193
|
-
*/
|
|
194
|
-
private responsesMatchCorrect;
|
|
195
168
|
getItemBodyHtml(): HtmlContent;
|
|
196
169
|
/**
|
|
197
170
|
* Extract rubric blocks for the current role.
|
|
@@ -203,7 +176,6 @@ export declare class Player {
|
|
|
203
176
|
*/
|
|
204
177
|
getRubrics(options?: RubricBlockOptions): RubricBlock[];
|
|
205
178
|
getComponentRegistry(): ComponentRegistry;
|
|
206
|
-
getExtractionRegistry(): ExtractionRegistry;
|
|
207
179
|
/**
|
|
208
180
|
* Canonical interaction API (new): extracted, typed interaction data.
|
|
209
181
|
*/
|
|
@@ -224,28 +196,77 @@ export declare class Player {
|
|
|
224
196
|
* Used to detect hint-only submissions (e.g. Request Hint button).
|
|
225
197
|
*/
|
|
226
198
|
getHintEndAttemptIdentifiers(): string[];
|
|
199
|
+
private getEndAttemptResponseIdentifiers;
|
|
200
|
+
private isResponseTrue;
|
|
201
|
+
/**
|
|
202
|
+
* QTI endAttemptInteraction (QTI 3.0 §5.45): "If the candidate invokes response processing
|
|
203
|
+
* using an end-attempt interaction then the associated response variable is set to true. If
|
|
204
|
+
* response processing is invoked in any other way […] then the associated response variable
|
|
205
|
+
* is set to false. The default value of the response variable is always ignored." The
|
|
206
|
+
* interactions that invoke this attempt's processing are the ones the candidate turned true
|
|
207
|
+
* since the attempt last ended; a value restored with the session invokes nothing. Rescoring
|
|
208
|
+
* (scoreAttempt) replays the last submission and leaves these responses as they are.
|
|
209
|
+
*/
|
|
210
|
+
private settleEndAttemptResponses;
|
|
227
211
|
getResponseIdentifiers(): string[];
|
|
212
|
+
/**
|
|
213
|
+
* Response identifiers the item's content prints live: the `printedVariable` targets of the
|
|
214
|
+
* body and rubric content that are declared responses. Their values are substituted while
|
|
215
|
+
* `getItemBodyHtml()` serializes (the content pass reads the live context), so they are the
|
|
216
|
+
* part of the response state a presentation's markup actually renders — presentation
|
|
217
|
+
* consumers (ItemBody) can key caching on them. The declared response set is fixed per
|
|
218
|
+
* session, so the filtered set is computed once.
|
|
219
|
+
*/
|
|
220
|
+
getResponseIdentifiersPrintedInContent(): ReadonlySet<string>;
|
|
221
|
+
private printedResponseIdentifiers?;
|
|
222
|
+
/**
|
|
223
|
+
* Context identifiers the item's content prints live: the `printedVariable` targets of the
|
|
224
|
+
* body and rubric content the session reports as context state — the QTI built-ins
|
|
225
|
+
* (`duration`, `numAttempts`, `completionStatus`) and declared context variables. Their
|
|
226
|
+
* values are substituted while `getItemBodyHtml()` serializes (the content pass reads the
|
|
227
|
+
* live context), so they are the part of the context state a presentation's markup actually
|
|
228
|
+
* renders — presentation consumers (ItemBody) can key caching on them. The context
|
|
229
|
+
* declaration set is fixed per session, so the filtered set is computed once.
|
|
230
|
+
*/
|
|
231
|
+
getContextIdentifiersPrintedInContent(): ReadonlySet<string>;
|
|
232
|
+
private printedContextIdentifiers?;
|
|
228
233
|
isAdaptive(): boolean;
|
|
229
234
|
getNumAttempts(): number;
|
|
230
235
|
getCompletionStatus(): CompletionStatus;
|
|
231
236
|
isCompleted(): boolean;
|
|
232
237
|
private runAdaptiveSubmitAttempt;
|
|
233
238
|
getResponses(): Record<string, any>;
|
|
234
|
-
|
|
235
|
-
* Get correct response for a specific response identifier
|
|
236
|
-
* @param responseId - The response identifier
|
|
237
|
-
* @returns The correct response value, or undefined if not available
|
|
238
|
-
*/
|
|
239
|
-
getCorrectResponse(responseId: string): any | undefined;
|
|
239
|
+
private responseSnapshotState;
|
|
240
240
|
/**
|
|
241
241
|
* Get all correct responses as a map
|
|
242
242
|
* @returns Map of responseId to correct response value
|
|
243
243
|
*/
|
|
244
244
|
getCorrectResponses(): Record<string, any>;
|
|
245
|
-
getTemplateVariables(): Record<string, any>;
|
|
246
245
|
setTemplateVariables(vars: Record<string, any>): void;
|
|
247
|
-
getSessionState(): ItemSessionState;
|
|
248
246
|
validateResponses(responses: Record<string, any>): ResponseValidationResult;
|
|
247
|
+
/**
|
|
248
|
+
* The base validation of the engine's current responses, memoized per response revision
|
|
249
|
+
* and interaction-data generation: serialization and the suspend path read it repeatedly
|
|
250
|
+
* at unchanged state. The end-attempt gate (validateAttemptResponses) stays a separate
|
|
251
|
+
* derivation, so its `incomplete` issues never reach the memoized base result.
|
|
252
|
+
*/
|
|
253
|
+
private currentResponsesValidation;
|
|
254
|
+
/**
|
|
255
|
+
* The validation `dispatch({ action: 'endAttempt', validateResponses: true })` gates on
|
|
256
|
+
* (QTI ASI §4
|
|
257
|
+
* itemSessionControl validateResponses). An invalid response "does not satisfy the
|
|
258
|
+
* constraints imposed by the interaction": beyond a malformed value or a matchGroup
|
|
259
|
+
* pairing (`validateResponses`), an interaction that requires input — minChoices,
|
|
260
|
+
* minAssociations, minStrings, minPlays, matchMin — rejects an incomplete one. Those
|
|
261
|
+
* entries turn invalid with an `incomplete` issue, so the result reads invalid through
|
|
262
|
+
* the same channel as every other rejection.
|
|
263
|
+
*
|
|
264
|
+
* An item with no response at all is a skip, which allowSkipping governs ("delivery
|
|
265
|
+
* engines must ensure that the candidate can choose to submit no response" when it is
|
|
266
|
+
* true). The item cannot see allowSkipping, so completeness applies only once the
|
|
267
|
+
* candidate has responded and a skip is the caller's decision.
|
|
268
|
+
*/
|
|
269
|
+
private validateAttemptResponses;
|
|
249
270
|
getProgress(responses: Record<string, any>): {
|
|
250
271
|
total: number;
|
|
251
272
|
answered: number;
|
|
@@ -257,67 +278,23 @@ export declare class Player {
|
|
|
257
278
|
* Used by assessment/session controllers to track "answered" state.
|
|
258
279
|
*/
|
|
259
280
|
isAttempted(responses: Record<string, any>): boolean;
|
|
260
|
-
/**
|
|
261
|
-
|
|
281
|
+
/**
|
|
282
|
+
* Template processing re-extracts the item's interactions, so the interaction cache
|
|
283
|
+
* drops before the program runs. Template rules can also change response values
|
|
284
|
+
* (setDefaultValue), so the response revision moves with it.
|
|
285
|
+
*/
|
|
262
286
|
private execTemplateProcessing;
|
|
263
|
-
private
|
|
264
|
-
private execOutcomeProcessingProgram;
|
|
265
|
-
private execResponseProcessingTemplate;
|
|
266
|
-
private buildDeclarations;
|
|
287
|
+
private invalidateInteractionData;
|
|
267
288
|
/** Host-supplied context values, e.g. `QTI_CONTEXT`; identifiers that are not context variables are ignored. */
|
|
268
289
|
private applyContextVariables;
|
|
269
290
|
/** Test-supplied template defaults; identifiers that are not template variables are ignored. */
|
|
270
291
|
private applyTemplateDefaults;
|
|
271
|
-
private parseMatchTable;
|
|
272
|
-
private parseInterpolationTable;
|
|
273
|
-
private ensureBuiltinDeclarations;
|
|
274
|
-
private applySessionState;
|
|
275
292
|
private applySerializedVariables;
|
|
276
293
|
private serializeItemSession;
|
|
277
|
-
private serializeVariable;
|
|
278
|
-
private qtiValueToSerializable;
|
|
279
|
-
private qtiValueToPublic;
|
|
280
|
-
private updateDuration;
|
|
281
294
|
private freezeDuration;
|
|
295
|
+
/** Time on task in whole milliseconds, as the host-facing session fields report it. */
|
|
282
296
|
private getDuration;
|
|
283
|
-
/**
|
|
284
|
-
* QTI 2.1 §5.2, carried into 2.2 and 3.0: an outcome variable with no declared default is
|
|
285
|
-
* initialized to NULL unless it is of a numeric type, in which case it is initialized to 0.
|
|
286
|
-
* Response and template variables keep NULL — an unanswered numeric response must stay
|
|
287
|
-
* distinguishable from an answered zero.
|
|
288
|
-
*/
|
|
289
|
-
private hasImpliedNumericDefault;
|
|
290
|
-
private impliedDefaultValue;
|
|
291
|
-
/** Returns undefined when the declaration carries no <defaultValue> at all. */
|
|
292
|
-
private parseDefaultValue;
|
|
293
|
-
private parseCorrectResponse;
|
|
294
|
-
private parseDeclarationValues;
|
|
295
|
-
private parseMapping;
|
|
296
|
-
private parseAreaMapping;
|
|
297
|
+
/** Raw values read as a declaration's QTI base type and cardinality; see declarations/declarationValues. */
|
|
297
298
|
private coerceToDeclarationValue;
|
|
298
|
-
private getExtendedTextBase;
|
|
299
|
-
private coerceRecordValue;
|
|
300
|
-
private collectOutcomes;
|
|
301
|
-
/**
|
|
302
|
-
* The item content pass's handlers, reading the session's current variable values. QTI 3 wraps
|
|
303
|
-
* rubric content in `qti-content-body`, which is unwrapped so a rubric renders as in QTI 2.2.
|
|
304
|
-
* Feedback resolves here for rubric and modal feedback content; item body and choice feedback
|
|
305
|
-
* resolve in presentation, which takes the outcome values to present as input.
|
|
306
|
-
*/
|
|
307
299
|
private contentHandlers;
|
|
308
|
-
/**
|
|
309
|
-
* Whether `element` shows: the variable named by its `variableAttribute` against `identifier`,
|
|
310
|
-
* by the shared visibility rule. A missing variable or identifier hides it.
|
|
311
|
-
*/
|
|
312
|
-
private isShownByVariable;
|
|
313
|
-
private mathVariables;
|
|
314
|
-
/**
|
|
315
|
-
* A MathML `mi` or `ci` naming a math variable, with the variable's single value in its place:
|
|
316
|
-
* a number as `mn` or `cn` (`numberName`), any other value as the element's text. NULL and
|
|
317
|
-
* container values leave the element as authored.
|
|
318
|
-
*/
|
|
319
|
-
private mathVariableNodes;
|
|
320
|
-
private printedVariableNodes;
|
|
321
|
-
private renderHtmlContent;
|
|
322
|
-
private getModalFeedback;
|
|
323
300
|
}
|