@qti-components/test 1.10.0-next.0 → 1.10.0-next.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACZ,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAC1G,OAAO,EAAE,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BAAmB,EAAE;IAC3D,EAAE,GAAG,EAAE,4BAA4B,EAAE,IAAI,EAAE,uBAAuB,EAAE;IACpE,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE;IACnD,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;IACtC,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE;IAC7C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,aAAa,EAAE;IAC/C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;CACzC,CAAC","sourcesContent":["import { QtiAssessmentItemRef } from './components/qti-assessment-item-ref/qti-assessment-item-ref';\nimport { QtiAssessmentSection } from './components/qti-assessment-section/qti-assessment-section';\nimport { QtiAssessmentTest } from './components/qti-assessment-test/qti-assessment-test';\nimport { QtiItemSessionControl } from './components/qti-item-session-control/qti-item-session-control';\nimport { QtiNumberSelected } from './components/qti-number-selected/qti-number-selected';\nimport { QtiOutcomeProcessing } from './components/qti-outcome-processing/qti-outcome-processing';\nimport { QtiTestFeedback } from './components/qti-test-feedback/qti-test-feedback';\nimport { QtiTestPart } from './components/qti-test-part/qti-test-part';\nimport { QtiTestVariables } from './components/qti-test-variables/qti-test-variables';\nimport { QtiTest } from './components/qti-test/qti-test';\nimport { TestCheckItem } from './components/test-check-item/test-check-item';\nimport { TestContainer } from './components/test-container/test-container';\nimport { TestEndAttempt } from './components/test-end-attempt/test-end-attempt';\nimport { TestItemLink } from './components/test-item-link/test-item-link';\nimport {\n TestItemToSpeech,\n TestTtsNext,\n TestTtsPause,\n TestTtsPick,\n TestTtsPlay,\n TestTtsPrev,\n TestTtsResume,\n TestTtsStop\n} from './components/test-item-to-speech/test-item-to-speech';\nimport { TestNavigation } from './components/test-navigation/test-navigation';\nimport { TestNext } from './components/test-next/test-next';\nimport { TestPagingButtonsStamp } from './components/test-paging-buttons-stamp/test-paging-buttons-stamp';\nimport { TestPrev } from './components/test-prev/test-prev';\nimport { TestPrintContext } from './components/test-print-context/test-print-context';\nimport { TestPrintVariables } from './components/test-print-item-variables/test-print-item-variables';\nimport { TestScoringButtons } from './components/test-scoring-buttons/test-scoring-buttons';\nimport { TestScoringFeedback } from './components/test-scoring-feedback/test-scoring-feedback';\nimport { TestSectionButtonsStamp } from './components/test-section-buttons-stamp/test-section-buttons-stamp';\nimport { TestSectionLink } from './components/test-section-link/test-section-link';\nimport { TestStamp } from './components/test-stamp/test-stamp';\nimport { TestView } from './components/test-view-toggle/test-view';\nimport { TestViewToggle } from './components/test-view-toggle/test-view-toggle';\n\nexport {\n QtiAssessmentItemRef,\n QtiAssessmentSection,\n QtiAssessmentTest,\n QtiItemSessionControl,\n QtiNumberSelected,\n QtiOutcomeProcessing,\n QtiTest,\n QtiTestFeedback,\n QtiTestPart,\n QtiTestVariables,\n TestCheckItem,\n TestContainer,\n TestEndAttempt,\n TestItemLink,\n TestItemToSpeech,\n TestNavigation,\n TestNext,\n TestPagingButtonsStamp,\n TestPrev,\n TestPrintContext,\n TestPrintVariables,\n TestScoringButtons,\n TestScoringFeedback,\n TestSectionButtonsStamp,\n TestSectionLink,\n TestStamp,\n TestTtsNext,\n TestTtsPause,\n TestTtsPick,\n TestTtsPlay,\n TestTtsPrev,\n TestTtsResume,\n TestTtsStop,\n TestView,\n TestViewToggle\n};\n\nexport const qtiTestElements = [\n { tag: 'qti-assessment-item-ref', ctor: QtiAssessmentItemRef },\n { tag: 'qti-assessment-section', ctor: QtiAssessmentSection },\n { tag: 'qti-assessment-test', ctor: QtiAssessmentTest },\n { tag: 'qti-item-session-control', ctor: QtiItemSessionControl },\n { tag: 'qti-number-selected', ctor: QtiNumberSelected },\n { tag: 'qti-outcome-processing', ctor: QtiOutcomeProcessing },\n { tag: 'qti-test', ctor: QtiTest },\n { tag: 'qti-test-feedback', ctor: QtiTestFeedback },\n { tag: 'qti-test-part', ctor: QtiTestPart },\n { tag: 'qti-test-variables', ctor: QtiTestVariables },\n { tag: 'test-check-item', ctor: TestCheckItem },\n { tag: 'test-container', ctor: TestContainer },\n { tag: 'test-end-attempt', ctor: TestEndAttempt },\n { tag: 'test-item-link', ctor: TestItemLink },\n { tag: 'test-item-to-speech', ctor: TestItemToSpeech },\n { tag: 'test-navigation', ctor: TestNavigation },\n { tag: 'test-next', ctor: TestNext },\n { tag: 'test-paging-buttons-stamp', ctor: TestPagingButtonsStamp },\n { tag: 'test-prev', ctor: TestPrev },\n { tag: 'test-print-context', ctor: TestPrintContext },\n { tag: 'test-print-item-variables', ctor: TestPrintVariables },\n { tag: 'test-scoring-buttons', ctor: TestScoringButtons },\n { tag: 'test-scoring-feedback', ctor: TestScoringFeedback },\n { tag: 'test-section-buttons-stamp', ctor: TestSectionButtonsStamp },\n { tag: 'test-section-link', ctor: TestSectionLink },\n { tag: 'test-stamp', ctor: TestStamp },\n { tag: 'test-tts-next', ctor: TestTtsNext },\n { tag: 'test-tts-pause', ctor: TestTtsPause },\n { tag: 'test-tts-pick', ctor: TestTtsPick },\n { tag: 'test-tts-play', ctor: TestTtsPlay },\n { tag: 'test-tts-prev', ctor: TestTtsPrev },\n { tag: 'test-tts-resume', ctor: TestTtsResume },\n { tag: 'test-tts-stop', ctor: TestTtsStop },\n { tag: 'test-view', ctor: TestView },\n { tag: 'test-view-toggle', ctor: TestViewToggle }\n] as const;\n"]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E;IAC9D,EAAE,GAAG,EAAE,sBAAsB,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACzD,EAAE,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAE,mBAAmB,EAAE;IAC3D,EAAE,GAAG,EAAE,4BAA4B,EAAE,IAAI,EAAE,uBAAuB,EAAE;IACpE,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE;IACnD,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;IACtC,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE;IAC7C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,aAAa,EAAE;IAC/C,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;CACzC,CAAC","sourcesContent":["import { QtiAssessmentItemRef } from './components/qti-assessment-item-ref/qti-assessment-item-ref';\nimport { QtiAssessmentSection } from './components/qti-assessment-section/qti-assessment-section';\nimport { QtiAssessmentTest } from './components/qti-assessment-test/qti-assessment-test';\nimport { QtiBranchRule } from './components/qti-branch-rule/qti-branch-rule';\nimport { QtiItemSessionControl } from './components/qti-item-session-control/qti-item-session-control';\nimport { QtiNumberSelected } from './components/qti-number-selected/qti-number-selected';\nimport { QtiPreCondition } from './components/qti-pre-condition/qti-pre-condition';\nimport { QtiOutcomeProcessing } from './components/qti-outcome-processing/qti-outcome-processing';\nimport { QtiTestFeedback } from './components/qti-test-feedback/qti-test-feedback';\nimport { QtiTestPart } from './components/qti-test-part/qti-test-part';\nimport { QtiTestVariables } from './components/qti-test-variables/qti-test-variables';\nimport { QtiTest } from './components/qti-test/qti-test';\nimport { TestCheckItem } from './components/test-check-item/test-check-item';\nimport { TestContainer } from './components/test-container/test-container';\nimport { TestEndAttempt } from './components/test-end-attempt/test-end-attempt';\nimport { TestItemLink } from './components/test-item-link/test-item-link';\nimport {\n TestItemToSpeech,\n TestTtsNext,\n TestTtsPause,\n TestTtsPick,\n TestTtsPlay,\n TestTtsPrev,\n TestTtsResume,\n TestTtsStop\n} from './components/test-item-to-speech/test-item-to-speech';\nimport { TestNavigation } from './components/test-navigation/test-navigation';\nimport { TestNext } from './components/test-next/test-next';\nimport { TestPagingButtonsStamp } from './components/test-paging-buttons-stamp/test-paging-buttons-stamp';\nimport { TestPrev } from './components/test-prev/test-prev';\nimport { TestPrintContext } from './components/test-print-context/test-print-context';\nimport { TestPrintVariables } from './components/test-print-item-variables/test-print-item-variables';\nimport { TestScoringButtons } from './components/test-scoring-buttons/test-scoring-buttons';\nimport { TestScoringFeedback } from './components/test-scoring-feedback/test-scoring-feedback';\nimport { TestSectionButtonsStamp } from './components/test-section-buttons-stamp/test-section-buttons-stamp';\nimport { TestSectionLink } from './components/test-section-link/test-section-link';\nimport { TestStamp } from './components/test-stamp/test-stamp';\nimport { TestView } from './components/test-view-toggle/test-view';\nimport { TestViewToggle } from './components/test-view-toggle/test-view-toggle';\n\nexport {\n QtiAssessmentItemRef,\n QtiAssessmentSection,\n QtiAssessmentTest,\n QtiBranchRule,\n QtiItemSessionControl,\n QtiNumberSelected,\n QtiOutcomeProcessing,\n QtiPreCondition,\n QtiTest,\n QtiTestFeedback,\n QtiTestPart,\n QtiTestVariables,\n TestCheckItem,\n TestContainer,\n TestEndAttempt,\n TestItemLink,\n TestItemToSpeech,\n TestNavigation,\n TestNext,\n TestPagingButtonsStamp,\n TestPrev,\n TestPrintContext,\n TestPrintVariables,\n TestScoringButtons,\n TestScoringFeedback,\n TestSectionButtonsStamp,\n TestSectionLink,\n TestStamp,\n TestTtsNext,\n TestTtsPause,\n TestTtsPick,\n TestTtsPlay,\n TestTtsPrev,\n TestTtsResume,\n TestTtsStop,\n TestView,\n TestViewToggle\n};\n\nexport const qtiTestElements = [\n { tag: 'qti-assessment-item-ref', ctor: QtiAssessmentItemRef },\n { tag: 'qti-assessment-section', ctor: QtiAssessmentSection },\n { tag: 'qti-assessment-test', ctor: QtiAssessmentTest },\n { tag: 'qti-branch-rule', ctor: QtiBranchRule },\n { tag: 'qti-item-session-control', ctor: QtiItemSessionControl },\n { tag: 'qti-number-selected', ctor: QtiNumberSelected },\n { tag: 'qti-outcome-processing', ctor: QtiOutcomeProcessing },\n { tag: 'qti-pre-condition', ctor: QtiPreCondition },\n { tag: 'qti-test', ctor: QtiTest },\n { tag: 'qti-test-feedback', ctor: QtiTestFeedback },\n { tag: 'qti-test-part', ctor: QtiTestPart },\n { tag: 'qti-test-variables', ctor: QtiTestVariables },\n { tag: 'test-check-item', ctor: TestCheckItem },\n { tag: 'test-container', ctor: TestContainer },\n { tag: 'test-end-attempt', ctor: TestEndAttempt },\n { tag: 'test-item-link', ctor: TestItemLink },\n { tag: 'test-item-to-speech', ctor: TestItemToSpeech },\n { tag: 'test-navigation', ctor: TestNavigation },\n { tag: 'test-next', ctor: TestNext },\n { tag: 'test-paging-buttons-stamp', ctor: TestPagingButtonsStamp },\n { tag: 'test-prev', ctor: TestPrev },\n { tag: 'test-print-context', ctor: TestPrintContext },\n { tag: 'test-print-item-variables', ctor: TestPrintVariables },\n { tag: 'test-scoring-buttons', ctor: TestScoringButtons },\n { tag: 'test-scoring-feedback', ctor: TestScoringFeedback },\n { tag: 'test-section-buttons-stamp', ctor: TestSectionButtonsStamp },\n { tag: 'test-section-link', ctor: TestSectionLink },\n { tag: 'test-stamp', ctor: TestStamp },\n { tag: 'test-tts-next', ctor: TestTtsNext },\n { tag: 'test-tts-pause', ctor: TestTtsPause },\n { tag: 'test-tts-pick', ctor: TestTtsPick },\n { tag: 'test-tts-play', ctor: TestTtsPlay },\n { tag: 'test-tts-prev', ctor: TestTtsPrev },\n { tag: 'test-tts-resume', ctor: TestTtsResume },\n { tag: 'test-tts-stop', ctor: TestTtsStop },\n { tag: 'test-view', ctor: TestView },\n { tag: 'test-view-toggle', ctor: TestViewToggle }\n] as const;\n"]}
@@ -0,0 +1,13 @@
1
+ /** An element that evaluates to a boolean: a `qti-pre-condition` or `qti-branch-rule`. */
2
+ export interface Condition extends Element {
3
+ evaluate(): boolean;
4
+ }
5
+ /**
6
+ * Evaluate the single expression child of a pre-condition or branch rule. NULL counts as false (a
7
+ * variable that does not resolve gives NULL, so a misspelled `ITEMREF.VAR` is false, not an error).
8
+ *
9
+ * `onError` is what an expression that throws (or has no expression child) means: a pre-condition fails open (`true`,
10
+ * the item is shown) so a malformed package never hides content silently; a branch rule does not
11
+ * branch (`false`).
12
+ */
13
+ export declare function evaluateBooleanChild(element: Element, onError: boolean): boolean;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Evaluate the single expression child of a pre-condition or branch rule. NULL counts as false (a
3
+ * variable that does not resolve gives NULL, so a misspelled `ITEMREF.VAR` is false, not an error).
4
+ *
5
+ * `onError` is what an expression that throws (or has no expression child) means: a pre-condition fails open (`true`,
6
+ * the item is shown) so a malformed package never hides content silently; a branch rule does not
7
+ * branch (`false`).
8
+ */
9
+ export function evaluateBooleanChild(element, onError) {
10
+ const expression = element.firstElementChild;
11
+ if (!expression || typeof expression.calculate !== 'function') {
12
+ console.warn(`<${element.localName}> has no evaluable expression child`, element);
13
+ return onError;
14
+ }
15
+ try {
16
+ const result = expression.calculate();
17
+ return result === true || result === 'true';
18
+ }
19
+ catch (error) {
20
+ console.warn(`<${element.localName}> could not evaluate its expression`, error);
21
+ return onError;
22
+ }
23
+ }
24
+ //# sourceMappingURL=evaluate-condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate-condition.js","sourceRoot":"","sources":["../../src/internal/evaluate-condition.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgB,EAAE,OAAgB;IACrE,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAsC,CAAC;IAClE,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,SAAS,qCAAqC,EAAE,OAAO,CAAC,CAAC;QAClF,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;QACtC,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,MAAM,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,SAAS,qCAAqC,EAAE,KAAK,CAAC,CAAC;QAChF,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["/** An element that evaluates to a boolean: a `qti-pre-condition` or `qti-branch-rule`. */\nexport interface Condition extends Element {\n evaluate(): boolean;\n}\n\n/** The expression a condition wraps: any QtiExpression, which answers with `calculate()`. */\ninterface Calculable extends Element {\n calculate(): unknown;\n}\n\n/**\n * Evaluate the single expression child of a pre-condition or branch rule. NULL counts as false (a\n * variable that does not resolve gives NULL, so a misspelled `ITEMREF.VAR` is false, not an error).\n *\n * `onError` is what an expression that throws (or has no expression child) means: a pre-condition fails open (`true`,\n * the item is shown) so a malformed package never hides content silently; a branch rule does not\n * branch (`false`).\n */\nexport function evaluateBooleanChild(element: Element, onError: boolean): boolean {\n const expression = element.firstElementChild as Calculable | null;\n if (!expression || typeof expression.calculate !== 'function') {\n console.warn(`<${element.localName}> has no evaluable expression child`, element);\n return onError;\n }\n try {\n const result = expression.calculate();\n return result === true || result === 'true';\n } catch (error) {\n console.warn(`<${element.localName}> could not evaluate its expression`, error);\n return onError;\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /** The item-ref identifier, also before the element is upgraded. */
2
+ export declare const idOf: (ref: Element) => string;
3
+ export interface NextItem {
4
+ /** The item ref to present next, or `null` when the test (part) ends. */
5
+ id: string | null;
6
+ /** The item refs passed over on the way, in document order. */
7
+ skipped: string[];
8
+ }
9
+ /**
10
+ * The item to present after `refs[current]`, applying branch rules and then pre-conditions.
11
+ *
12
+ * Branch rules: those of the item ref first, then those of each section / test part it was the
13
+ * last item of; the first one that is true wins. A target that is not ahead of the current item
14
+ * is ignored. Pre-conditions: those of the candidate item ref and of every section / test part it
15
+ * would enter. Items skipped this way are not presented.
16
+ *
17
+ * @param refs every item ref of the test, in document order
18
+ * @param current index in `refs` of the item that was just presented
19
+ */
20
+ export declare function resolveNextItem(refs: Element[], current: number): NextItem;
21
+ /**
22
+ * The first item to present when a linear test starts: the first item ref whose pre-conditions
23
+ * (and those of every section / test part it enters) pass. `null` when none is eligible.
24
+ */
25
+ export declare function resolveFirstItem(refs: Element[]): NextItem;
@@ -0,0 +1,107 @@
1
+ import { QtiBranchRule } from '../components/qti-branch-rule/qti-branch-rule';
2
+ const SECTION = 'qti-assessment-section';
3
+ const TEST_PART = 'qti-test-part';
4
+ /** The item-ref identifier, also before the element is upgraded. */
5
+ export const idOf = (ref) => ref.identifier || ref.getAttribute('identifier') || '';
6
+ /**
7
+ * The item to present after `refs[current]`, applying branch rules and then pre-conditions.
8
+ *
9
+ * Branch rules: those of the item ref first, then those of each section / test part it was the
10
+ * last item of; the first one that is true wins. A target that is not ahead of the current item
11
+ * is ignored. Pre-conditions: those of the candidate item ref and of every section / test part it
12
+ * would enter. Items skipped this way are not presented.
13
+ *
14
+ * @param refs every item ref of the test, in document order
15
+ * @param current index in `refs` of the item that was just presented
16
+ */
17
+ export function resolveNextItem(refs, current) {
18
+ const from = refs[current];
19
+ let start = current + 1;
20
+ const rule = firstFiringBranchRule(from, refs, current);
21
+ if (rule) {
22
+ const target = branchTargetIndex(rule, refs, current);
23
+ if (target === null)
24
+ return { id: null, skipped: refs.slice(current + 1).map(idOf) };
25
+ if (target > current)
26
+ start = target;
27
+ else
28
+ console.warn(`qti-branch-rule target "${rule.target}" is not ahead of "${idOf(from)}", ignored`);
29
+ }
30
+ const skipped = refs.slice(current + 1, start).map(idOf);
31
+ for (let i = start; i < refs.length; i++) {
32
+ if (preConditionsPass(refs[i], from))
33
+ return { id: idOf(refs[i]), skipped };
34
+ skipped.push(idOf(refs[i]));
35
+ }
36
+ return { id: null, skipped };
37
+ }
38
+ /**
39
+ * The first item to present when a linear test starts: the first item ref whose pre-conditions
40
+ * (and those of every section / test part it enters) pass. `null` when none is eligible.
41
+ */
42
+ export function resolveFirstItem(refs) {
43
+ const skipped = [];
44
+ for (const ref of refs) {
45
+ if (preConditionsPass(ref, null))
46
+ return { id: idOf(ref), skipped };
47
+ skipped.push(idOf(ref));
48
+ }
49
+ return { id: null, skipped };
50
+ }
51
+ function firstFiringBranchRule(itemRef, refs, current) {
52
+ const owners = [itemRef];
53
+ for (let el = itemRef.parentElement; el && (el.localName === SECTION || el.localName === TEST_PART); el = el.parentElement) {
54
+ if (el.contains(refs[current + 1] ?? null))
55
+ break; // not the last item of this container
56
+ owners.push(el);
57
+ }
58
+ for (const owner of owners) {
59
+ for (const rule of owner.querySelectorAll(':scope > qti-branch-rule')) {
60
+ if (rule.evaluate?.())
61
+ return rule;
62
+ }
63
+ }
64
+ return null;
65
+ }
66
+ /** Index of the first item ref to consider after a branch, or null for EXIT_TEST / leaving the last part. */
67
+ function branchTargetIndex(rule, refs, current) {
68
+ const owner = rule.parentElement;
69
+ const firstAfter = (container) => {
70
+ if (!container)
71
+ return null;
72
+ const last = refs.findLastIndex(ref => container.contains(ref));
73
+ return last + 1 < refs.length ? last + 1 : null;
74
+ };
75
+ switch (rule.target) {
76
+ case QtiBranchRule.EXIT_TEST:
77
+ return null;
78
+ case QtiBranchRule.EXIT_TESTPART:
79
+ return firstAfter(owner.closest(TEST_PART));
80
+ case QtiBranchRule.EXIT_SECTION: {
81
+ const section = owner.localName === SECTION ? owner : owner.closest(SECTION);
82
+ return firstAfter(section ?? owner);
83
+ }
84
+ default: {
85
+ const byRef = refs.findIndex(ref => idOf(ref) === rule.target);
86
+ if (byRef >= 0)
87
+ return byRef;
88
+ const container = [
89
+ ...(owner.closest('qti-assessment-test')?.querySelectorAll(`${SECTION}, ${TEST_PART}`) ?? [])
90
+ ].find(el => el.getAttribute('identifier') === rule.target);
91
+ const inside = container ? refs.findIndex(ref => container.contains(ref)) : -1;
92
+ if (inside >= 0)
93
+ return inside;
94
+ console.warn(`qti-branch-rule target "${rule.target}" not found`);
95
+ return current + 1;
96
+ }
97
+ }
98
+ }
99
+ function preConditionsPass(itemRef, from) {
100
+ const owners = [itemRef];
101
+ for (let el = itemRef.parentElement; el && (el.localName === SECTION || el.localName === TEST_PART); el = el.parentElement) {
102
+ if (!from || !el.contains(from))
103
+ owners.push(el);
104
+ }
105
+ return owners.every(owner => [...owner.querySelectorAll(':scope > qti-pre-condition')].every(condition => condition.evaluate?.() ?? true));
106
+ }
107
+ //# sourceMappingURL=item-sequencing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-sequencing.js","sourceRoot":"","sources":["../../src/internal/item-sequencing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAI9E,MAAM,OAAO,GAAG,wBAAwB,CAAC;AACzC,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,oEAAoE;AACpE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,GAAY,EAAU,EAAE,CAC1C,GAAyC,CAAC,UAAU,IAAI,GAAG,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;AAShG;;;;;;;;;;GAUG;AACH,MAAM,UA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from './evaluate-condition';\n\nconst SECTION = 'qti-assessment-section';\nconst TEST_PART = 'qti-test-part';\n\n/** The item-ref identifier, also before the element is upgraded. */\nexport const idOf = (ref: Element): string =>\n (ref as Element & { identifier?: string }).identifier || ref.getAttribute('identifier') || '';\n\nexport interface NextItem {\n /** The item ref to present next, or `null` when the test (part) ends. */\n id: string | null;\n /** The item refs passed over on the way, in document order. */\n skipped: string[];\n}\n\n/**\n * The item to present after `refs[current]`, applying branch rules and then pre-conditions.\n *\n * Branch rules: those of the item ref first, then those of each section / test part it was the\n * last item of; the first one that is true wins. A target that is not ahead of the current item\n * is ignored. Pre-conditions: those of the candidate item ref and of every section / test part it\n * would enter. Items skipped this way are not presented.\n *\n * @param refs every item ref of the test, in document order\n * @param current index in `refs` of the item that was just presented\n */\nexport function resolveNextItem(refs: Element[], current: number): NextItem {\n const from = refs[current];\n let start = current + 1;\n\n const rule = firstFiringBranchRule(from, refs, current);\n if (rule) {\n const target = branchTargetIndex(rule, refs, current);\n if (target === null) return { id: null, skipped: refs.slice(current + 1).map(idOf) };\n if (target > current) start = target;\n else console.warn(`qti-branch-rule target \"${rule.target}\" is not ahead of \"${idOf(from)}\", ignored`);\n }\n\n const skipped = refs.slice(current + 1, start).map(idOf);\n for (let i = start; i < refs.length; i++) {\n if (preConditionsPass(refs[i], from)) return { id: idOf(refs[i]), skipped };\n skipped.push(idOf(refs[i]));\n }\n return { id: null, skipped };\n}\n\n/**\n * The first item to present when a linear test starts: the first item ref whose pre-conditions\n * (and those of every section / test part it enters) pass. `null` when none is eligible.\n */\nexport function resolveFirstItem(refs: Element[]): NextItem {\n const skipped: string[] = [];\n for (const ref of refs) {\n if (preConditionsPass(ref, null)) return { id: idOf(ref), skipped };\n skipped.push(idOf(ref));\n }\n return { id: null, skipped };\n}\n\nfunction firstFiringBranchRule(itemRef: Element, refs: Element[], current: number): QtiBranchRule | null {\n const owners: Element[] = [itemRef];\n for (\n let el = itemRef.parentElement;\n el && (el.localName === SECTION || el.localName === TEST_PART);\n el = el.parentElement\n ) {\n if (el.contains(refs[current + 1] ?? null)) break; // not the last item of this container\n owners.push(el);\n }\n for (const owner of owners) {\n for (const rule of owner.querySelectorAll<QtiBranchRule>(':scope > qti-branch-rule')) {\n if (rule.evaluate?.()) return rule;\n }\n }\n return null;\n}\n\n/** Index of the first item ref to consider after a branch, or null for EXIT_TEST / leaving the last part. */\nfunction branchTargetIndex(rule: QtiBranchRule, refs: Element[], current: number): number | null {\n const owner = rule.parentElement as Element;\n const firstAfter = (container: Element | null): number | null => {\n if (!container) return null;\n const last = refs.findLastIndex(ref => container.contains(ref));\n return last + 1 < refs.length ? last + 1 : null;\n };\n\n switch (rule.target) {\n case QtiBranchRule.EXIT_TEST:\n return null;\n case QtiBranchRule.EXIT_TESTPART:\n return firstAfter(owner.closest(TEST_PART));\n case QtiBranchRule.EXIT_SECTION: {\n const section = owner.localName === SECTION ? owner : owner.closest(SECTION);\n return firstAfter(section ?? owner);\n }\n default: {\n const byRef = refs.findIndex(ref => idOf(ref) === rule.target);\n if (byRef >= 0) return byRef;\n const container = [\n ...(owner.closest('qti-assessment-test')?.querySelectorAll(`${SECTION}, ${TEST_PART}`) ?? [])\n ].find(el => el.getAttribute('identifier') === rule.target);\n const inside = container ? refs.findIndex(ref => container.contains(ref)) : -1;\n if (inside >= 0) return inside;\n console.warn(`qti-branch-rule target \"${rule.target}\" not found`);\n return current + 1;\n }\n }\n}\n\nfunction preConditionsPass(itemRef: Element, from: Element | null): boolean {\n const owners: Element[] = [itemRef];\n for (\n let el = itemRef.parentElement;\n el && (el.localName === SECTION || el.localName === TEST_PART);\n el = el.parentElement\n ) {\n if (!from || !el.contains(from)) owners.push(el);\n }\n return owners.every(owner =>\n [...owner.querySelectorAll<Condition>(':scope > qti-pre-condition')].every(\n condition => condition.evaluate?.() ?? true\n )\n );\n}\n"]}
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { property } from 'lit/decorators.js';
8
8
  import { qtiTransformItem } from '@qti-components/transformers';
9
+ import { idOf, resolveFirstItem, resolveNextItem } from '../internal/item-sequencing';
9
10
  import { dispatchPublic, listenPublic } from '../public-events';
10
11
  /**
11
12
  * Navigation mixin for QTI test components
@@ -141,7 +142,21 @@ export const TestNavigationMixin = (superClass) => {
141
142
  _initializeNavigation() {
142
143
  if (!this.navigate)
143
144
  return;
144
- const id = this._getDefaultNavigationId(this.navigate);
145
+ let id = this._getDefaultNavigationId(this.navigate);
146
+ if (this.navigate === 'item' && this._testElement && !this.sessionContext?.navItemRefId) {
147
+ // a fresh start: the first item of a linear part may itself have a false pre-condition
148
+ const refs = [...this._testElement.querySelectorAll('qti-assessment-item-ref')];
149
+ if (refs[0]?.closest('qti-test-part')?.getAttribute('navigation-mode') === 'linear') {
150
+ const first = resolveFirstItem(refs);
151
+ if (first.skipped.length)
152
+ dispatchPublic(this, 'cito-test-items-skipped', { ids: first.skipped });
153
+ if (first.id === null) {
154
+ dispatchPublic(this, 'cito-test-end-reached', {});
155
+ return;
156
+ }
157
+ id = first.id;
158
+ }
159
+ }
145
160
  if (id) {
146
161
  this.navigateTo(this.navigate, id);
147
162
  }
@@ -177,13 +192,44 @@ export const TestNavigationMixin = (superClass) => {
177
192
  // Sections are generally restricted in linear mode unless we are moving to the next one
178
193
  return true;
179
194
  }
195
+ /**
196
+ * A "next" step in a linear test part (a request for item i+1 while item i is active) goes
197
+ * through the branch rules and pre-conditions. Deep links, item links and nonlinear parts are
198
+ * left alone: the spec ignores both in nonlinear mode.
199
+ *
200
+ * @returns the item to present instead, `null` when the test has no eligible item left, or
201
+ * `undefined` when the request is not a "next" step.
202
+ */
203
+ _resolveLinearNext(type, id) {
204
+ if (type !== 'item' || !this._testElement)
205
+ return undefined;
206
+ const refs = [...this._testElement.querySelectorAll('qti-assessment-item-ref')];
207
+ const current = refs.findIndex(ref => idOf(ref) === this.sessionContext?.navItemRefId);
208
+ if (current < 0 || !refs[current + 1] || idOf(refs[current + 1]) !== id)
209
+ return undefined;
210
+ if (refs[current].closest('qti-test-part')?.getAttribute('navigation-mode') !== 'linear')
211
+ return undefined;
212
+ const next = resolveNextItem(refs, current);
213
+ if (next.id === id)
214
+ return undefined;
215
+ return next;
216
+ }
180
217
  /**
181
218
  * Main navigation request handler with proper lifecycle management
182
219
  */
183
220
  async _handleNavigationRequest({ detail }) {
184
221
  if (!detail?.id)
185
222
  return;
186
- if (this._isLinearNavigationRestricted(detail.type, detail.id)) {
223
+ const resolved = this._resolveLinearNext(detail.type, detail.id);
224
+ if (resolved?.id === null) {
225
+ if (resolved.skipped.length)
226
+ dispatchPublic(this, 'cito-test-items-skipped', { ids: resolved.skipped });
227
+ dispatchPublic(this, 'cito-test-end-reached', {});
228
+ return;
229
+ }
230
+ const target = resolved?.id ?? detail.id;
231
+ // a resolved jump is not a free choice by the candidate, so the linear restriction does not apply to it
232
+ if (!resolved && this._isLinearNavigationRestricted(detail.type, target)) {
187
233
  this._handleNavigationError(new Error('Navigation restricted in linear mode'), detail.type, detail.id);
188
234
  return;
189
235
  }
@@ -191,18 +237,22 @@ export const TestNavigationMixin = (superClass) => {
191
237
  const navigationId = ++this._navigationId;
192
238
  const controller = new AbortController();
193
239
  try {
194
- this._dispatchLoadingStarted(detail.type, detail.id);
240
+ this._dispatchLoadingStarted(detail.type, target);
195
241
  this._activeController = controller;
196
- await this._executeNavigation(detail.type, detail.id, navigationId, controller);
242
+ await this._executeNavigation(detail.type, target, navigationId, controller);
243
+ // only tell hosts about skipped items once the jump went through
244
+ if (resolved?.skipped.length && navigationId === this._navigationId && !controller.signal.aborted) {
245
+ dispatchPublic(this, 'cito-test-items-skipped', { ids: resolved.skipped });
246
+ }
197
247
  }
198
248
  catch (error) {
199
- this._handleNavigationError(error, detail.type, detail.id);
249
+ this._handleNavigationError(error, detail.type, target);
200
250
  }
201
251
  finally {
202
252
  if (this._activeController === controller) {
203
253
  this._activeController = null;
204
254
  }
205
- this._dispatchLoadingEnded(detail.type, detail.id);
255
+ this._dispatchLoadingEnded(detail.type, target);
206
256
  }
207
257
  }
208
258
  _handleNavigationError(error, type, id) {
@@ -1 +1 @@
1
- {"version":3,"file":"test-navigation.mixin.js","sourceRoot":"","sources":["../../src/mixins/test-navigation.mixin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA2DhE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAA2C,UAAa,EAAE,EAAE;IAC7F,MAAe,mBAAoB,SAAQ,UAAU;QA0BnD,YAAY,GAAG,IAAW;YACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YA1BW,aAAQ,GAA8B,IAAI,CAAC;YAC3C,mBAAc,GAAW,KAAK,CAAC;YAC3B,8BAAyB,GAAqC,IAAI,CAAC;YACnE,kCAA6B,GAAyC,IAAI,CAAC;YAI3G,4BAA4B;YACpB,sBAAiB,GAA2B,IAAI,CAAC;YACjD,iBAAY,GAAU,EAAE,CAAC;YACzB,kBAAa,GAAG,CAAC,CAAC;YAE1B,mCAAmC;YAC3B,kBAAa,GAAG;gBACtB,aAAa,EAAE,CAAC;gBAChB,cAAc,EAAE,CAAC;gBACjB,gBAAgB,EAAE,CAAC;gBACnB,cAAc,EAAE,CAAC;gBACjB,UAAU,EAAE,KAAK;aAClB,CAAC;YAEF,4DAA4D;YACpD,yBAAoB,GAAG,IAAI,GAAG,EAAU,CAAC;YACzC,0BAAqB,GAAG,IAAI,GAAG,EAAU,CAAC;YAIhD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC;QAED,8CAA8C;QAC9C,aAAa;QACb,8CAA8C;QAE9C;;;;WAIG;QACI,UAAU,CAAC,IAAwB,EAAE,EAAW;YACrD,MAAM,QAAQ,GAA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E,KAAK,EAAE,CAAC;8EAA4E;IAimB7G,OAAO,mBAA4D,CAAC;AACtE,CAAC,CAAC","sourcesContent":["import { property } from 'lit/decorators.js';\n\nimport { qtiTransformItem } from '@qti-components/transformers';\n\nimport { dispatchPublic, listenPublic } from '../public-events';\n\nimport type { QtiAssessmentStimulusRefConnectedEvent } from '@qti-components/elements';\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { transformItemApi, transformTestApi } from '@qti-components/transformers';\nimport type { QtiAssessmentItemRef } from '../components/qti-assessment-item-ref/qti-assessment-item-ref';\nimport type { QtiAssessmentSection } from '../components/qti-assessment-section/qti-assessment-section';\nimport type { QtiTestPart } from '../components/qti-test-part/qti-test-part';\nimport type { QtiAssessmentTest } from '../components/qti-assessment-test/qti-assessment-test';\nimport type { TestContainer } from '../components/test-container/test-container';\nimport type { PostLoadTestTransformCallback } from '../internal/test-host.context';\nimport type { TestBaseInterface } from './test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport type PostLoadTransformCallback = (\n transformer: transformItemApi,\n itemRef: QtiAssessmentItemRef\n) => transformItemApi | Promise<transformItemApi>;\n\nexport type { PostLoadTestTransformCallback };\n\nexport interface NavigationError {\n message: string;\n details?: any;\n itemId?: string;\n sectionId?: string;\n}\n\n/**\n * Exactly what this mixin adds. `IQtiTest` composes it (see ../types/iqti-test, which\n * re-exports it), and `TestNavigationClass` below `implements` it, so the interface and the\n * class cannot drift apart.\n *\n * This was `declare class TestNavigationInterface {}` — EMPTY — so the returned\n * `Constructor<TestNavigationInterface> & T` added nothing and every member the mixin\n * contributes was erased from the public type. `QtiTest` looked as though it had no\n * `navigate` or `postLoadTransformCallback`, and consumers had to intersect the class with\n * `IQtiTest` by hand to describe one element.\n *\n * `showLoadingIndicators` and `retryNavigation` used to be listed on the `IQtiTest` side with\n * no implementation anywhere in the repo, so calling `retryNavigation()` would have thrown.\n * They are gone rather than stubbed: there was no behaviour to preserve.\n */\nexport interface ITestNavigationMixin {\n navigate: 'item' | 'section' | null;\n requestTimeout: number;\n postLoadTransformCallback: PostLoadTransformCallback | null;\n postLoadTestTransformCallback: PostLoadTestTransformCallback | null;\n navigateTo(type: 'item' | 'section', id?: string): void;\n getLoadingProgress(): {\n expectedItems: number;\n connectedItems: number;\n expectedStimulus: number;\n loadedStimulus: number;\n isComplete: boolean;\n };\n}\n\n/**\n * Navigation mixin for QTI test components\n *\n * Provides comprehensive navigation functionality with:\n * - Efficient item/section loading with AbortController support\n * - Stimulus reference coordination and duplicate prevention\n * - Proper event timing and state management\n * - Error handling and edge case coverage\n */\nexport const TestNavigationMixin = <T extends Constructor<TestBaseInterface>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass implements ITestNavigationMixin {\n @property({ type: String }) navigate: 'item' | 'section' | null = null;\n @property({ type: Number }) requestTimeout: number = 30000;\n @property({ attribute: false }) postLoadTransformCallback: PostLoadTransformCallback | null = null;\n @property({ attribute: false }) postLoadTestTransformCallback: PostLoadTestTransformCallback | null = null;\n\n public _testElement: QtiAssessmentTest;\n\n // Navigation state tracking\n private _activeController: AbortController | null = null;\n private _loadResults: any[] = [];\n private _navigationId = 0;\n\n // Simple loading progress tracking\n private _loadingState = {\n expectedItems: 0,\n connectedItems: 0,\n expectedStimulus: 0,\n loadedStimulus: 0,\n isComplete: false\n };\n\n // Track loaded/loading stimulus hrefs to prevent duplicates\n private _loadedStimulusHrefs = new Set<string>();\n private _loadingStimulusHrefs = new Set<string>();\n\n constructor(...args: any[]) {\n super(...args);\n this._bindEventHandlers();\n }\n\n // ===========================================\n // PUBLIC API\n // ===========================================\n\n /**\n * Navigate to a specific item or section\n * @param type - Navigation type ('item' or 'section')\n * @param id - Target identifier (optional, falls back to the current position, or the first one before there is any)\n */\n public navigateTo(type: 'item' | 'section', id?: string): void {\n const targetId = id || this._getDefaultNavigationId(type);\n\n if (targetId) {\n dispatchPublic(this, 'cito-test-navigate', { type, id: targetId });\n }\n }\n\n // ===========================================\n // EVENT HANDLER SETUP\n // ===========================================\n\n private _bindEventHandlers(): void {\n listenPublic(this, 'cito-test-navigate', this._handleNavigationRequest.bind(this));\n listenPublic(this, 'cito-test-loaded', this._handleTestConnected.bind(this));\n this.addEventListener('qti-assessment-item-connected', this._handleItemConnected.bind(this));\n this.addEventListener('qti-assessment-stimulus-ref-connected', this._handleStimulusRefConnected.bind(this));\n }\n\n private _handleTestConnected(e: CustomEvent<QtiAssessmentTest>): void {\n this._testElement = e.detail;\n this._initializeNavigation();\n }\n\n /**\n * Handle item connection events - track connected items and discover stimulus references\n */\n private _handleItemConnected(e: CustomEvent<QtiAssessmentItemRef>): void {\n const itemRef = e.detail;\n\n // Increment connected items count\n this._loadingState.connectedItems++;\n\n // Count stimulus references in this item and add to expected\n const stimulusRefs = itemRef.querySelectorAll('qti-assessment-stimulus-ref');\n this._loadingState.expectedStimulus += stimulusRefs.length;\n\n this._checkLoadingComplete();\n }\n\n /**\n * Handle stimulus reference connection events with duplicate prevention\n */\n private async _handleStimulusRefConnected(e: QtiAssessmentStimulusRefConnectedEvent): Promise<void> {\n e.preventDefault();\n\n const { element, item } = e;\n console.info('Stimulus ref connected:', {\n identifier: element.identifier,\n href: element.href,\n item: item.identifier\n });\n\n // Check if this stimulus href is already loaded or currently loading\n if (this._loadedStimulusHrefs.has(element.href)) {\n console.info('Stimulus already loaded, skipping:', element.href);\n this._loadingState.loadedStimulus++;\n this._checkLoadingComplete();\n return;\n }\n\n if (this._loadingStimulusHrefs.has(element.href)) {\n console.info('Stimulus already loading, skipping duplicate:', element.href);\n this._loadingState.loadedStimulus++;\n this._checkLoadingComplete();\n return;\n }\n\n // Mark as currently loading\n this._loadingStimulusHrefs.add(element.href);\n console.info('Starting stimulus load:', element.href);\n\n try {\n await this._loadStimulusRef(element, item);\n this._loadedStimulusHrefs.add(element.href);\n this._loadingState.loadedStimulus++;\n console.info('Stimulus loaded successfully:', element.href);\n this._checkLoadingComplete();\n } catch (error) {\n if (error.name !== 'AbortError') {\n console.warn(`Failed to load stimulus ${element.identifier}:`, error);\n }\n // Still count as \"processed\" even if failed to avoid hanging\n this._loadingState.loadedStimulus++;\n this._checkLoadingComplete();\n } finally {\n // Remove from loading set regardless of outcome\n this._loadingStimulusHrefs.delete(element.href);\n }\n }\n\n // ===========================================\n // NAVIGATION FLOW\n // ===========================================\n\n private _getDefaultNavigationId(type: 'item' | 'section'): string | undefined {\n if (type === 'section') {\n return (\n this.sessionContext?.navSectionId ??\n this._testElement?.querySelector<QtiAssessmentSection>('qti-assessment-section')?.identifier\n );\n }\n return (\n this.sessionContext?.navItemRefId ??\n this._testElement?.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref')?.identifier\n );\n }\n\n private _initializeNavigation(): void {\n if (!this.navigate) return;\n\n const id = this._getDefaultNavigationId(this.navigate);\n if (id) {\n this.navigateTo(this.navigate, id);\n }\n }\n\n private _isLinearNavigationRestricted(type: 'item' | 'section', targetId: string): boolean {\n const currentItemId = this.sessionContext?.navItemRefId;\n if (!currentItemId) return false;\n\n // Never restrict navigating to the same item\n if (type === 'item' && targetId === currentItemId) return false;\n\n const currentItemRef = this._testElement?.querySelector(`qti-assessment-item-ref[identifier=\"${currentItemId}\"]`);\n if (!currentItemRef) return false;\n\n const section = currentItemRef.closest('qti-assessment-section') as QtiAssessmentSection;\n const testPart = currentItemRef.closest('qti-test-part') as QtiTestPart;\n\n const navigationMode = (section?.navigationMode ||\n section?.getAttribute('navigation-mode') ||\n testPart?.navigationMode ||\n testPart?.getAttribute('navigation-mode') ||\n 'nonlinear') as string;\n\n if (navigationMode !== 'linear') return false;\n\n const allItemRefs = Array.from(\n this._testElement?.querySelectorAll('qti-assessment-item-ref') || []\n ) as QtiAssessmentItemRef[];\n const currentIndex = allItemRefs.findIndex(ref => ref.identifier === currentItemId);\n\n if (type === 'item') {\n const targetIndex = allItemRefs.findIndex(ref => ref.identifier === targetId);\n if (targetIndex === -1 || currentIndex === -1) return false;\n\n // Only allow moving to the next item in linear mode\n return targetIndex !== currentIndex + 1;\n }\n\n // Sections are generally restricted in linear mode unless we are moving to the next one\n return true;\n }\n\n /**\n * Main navigation request handler with proper lifecycle management\n */\n private async _handleNavigationRequest({ detail }: CustomEvent<{ type: 'item' | 'section'; id: string }>) {\n if (!detail?.id) return;\n\n if (this._isLinearNavigationRestricted(detail.type, detail.id)) {\n this._handleNavigationError(new Error('Navigation restricted in linear mode'), detail.type, detail.id);\n return;\n }\n\n this._cancelPreviousNavigation();\n const navigationId = ++this._navigationId;\n const controller = new AbortController();\n\n try {\n this._dispatchLoadingStarted(detail.type, detail.id);\n this._activeController = controller;\n\n await this._executeNavigation(detail.type, detail.id, navigationId, controller);\n } catch (error) {\n this._handleNavigationError(error, detail.type, detail.id);\n } finally {\n if (this._activeController === controller) {\n this._activeController = null;\n }\n this._dispatchLoadingEnded(detail.type, detail.id);\n }\n }\n\n private _handleNavigationError(error: any, type: string, id: string): void {\n if (error.name !== 'AbortError') {\n this._dispatchError(this._createNavigationError(error, type, id));\n }\n }\n\n private async _executeNavigation(\n type: 'item' | 'section',\n id: string,\n navigationId: number,\n controller: AbortController\n ): Promise<void> {\n if (type === 'item') {\n await this._navigateToItem(id, navigationId, controller);\n } else {\n await this._navigateToSection(id, navigationId, controller);\n }\n }\n\n /**\n * Navigate to specific item with simple state tracking\n */\n private async _navigateToItem(itemId: string, navigationId: number, controller: AbortController): Promise<void> {\n const itemRef = this._findItemRef(itemId);\n this._updateSessionContext(itemRef, itemId);\n\n this._resetLoadingState();\n this._loadingState.expectedItems = 1;\n\n await this._loadItems([itemId], navigationId, controller);\n await this._waitForLoadingComplete(navigationId, controller);\n if (this._isStaleNavigation(navigationId, controller)) return;\n\n this._dispatchTestLoaded(this._loadResults, 'item', itemId);\n }\n\n /**\n * Navigate to section with simple state tracking\n */\n private async _navigateToSection(\n sectionId: string,\n navigationId: number,\n controller: AbortController\n ): Promise<void> {\n const sectionEl = this._findSection(sectionId);\n const navPartId = sectionEl?.closest('qti-test-part')?.identifier;\n\n this.sessionContext = {\n ...this.sessionContext,\n navPartId,\n navSectionId: sectionId,\n navItemRefId: null\n };\n\n const itemIds = this._getSectionItemIds(sectionId);\n\n this._resetLoadingState();\n this._loadingState.expectedItems = itemIds.length;\n\n await this._loadItems(itemIds, navigationId, controller);\n await this._waitForLoadingComplete(navigationId, controller);\n if (this._isStaleNavigation(navigationId, controller)) return;\n\n this._dispatchTestLoaded(this._loadResults, 'section', sectionId);\n }\n\n // ===========================================\n // LOADING STATE MANAGEMENT\n // ===========================================\n\n /**\n * Reset loading state for new navigation\n */\n private _resetLoadingState(): void {\n this._loadingState = {\n expectedItems: 0,\n connectedItems: 0,\n expectedStimulus: 0,\n loadedStimulus: 0,\n isComplete: false\n };\n\n // Clear stimulus tracking - start fresh for new navigation\n this._loadedStimulusHrefs.clear();\n this._loadingStimulusHrefs.clear();\n }\n\n /**\n * Check if loading is complete and dispatch events accordingly\n */\n private _checkLoadingComplete(): void {\n const allItemsConnected = this._loadingState.connectedItems >= this._loadingState.expectedItems;\n const allStimulusLoaded = this._loadingState.loadedStimulus >= this._loadingState.expectedStimulus;\n\n if (allItemsConnected && allStimulusLoaded && !this._loadingState.isComplete) {\n this._loadingState.isComplete = true;\n }\n }\n\n /**\n * Wait for loading to complete with simple polling\n */\n private async _waitForLoadingComplete(navigationId: number, controller: AbortController): Promise<void> {\n while (!this._loadingState.isComplete) {\n if (this._isStaleNavigation(navigationId, controller)) return;\n await new Promise(resolve => setTimeout(resolve, 10));\n }\n }\n\n /**\n * Get current loading progress for external consumption\n */\n public getLoadingProgress() {\n return { ...this._loadingState };\n }\n\n /**\n * Load stimulus reference with simple tracking\n */\n private async _loadStimulusRef(\n element: { identifier: string; href: string },\n item: QtiAssessmentItem\n ): Promise<void> {\n console.info('Loading stimulus:', element.href);\n const stimulus = await this._loadStimulus(element.href);\n console.info('Stimulus loaded, applying content:', stimulus ? 'has content' : 'no content');\n this._applyStimulusContent(stimulus, element, item);\n }\n\n private _applyStimulusContent(\n stimulus: DocumentFragment | null,\n element: { identifier: string },\n item: QtiAssessmentItem\n ): void {\n if (!stimulus) {\n console.warn('No stimulus content to apply');\n return;\n }\n\n // Place the whole qti-assessment-stimulus, not just its body: its `lang` is what the stimulus\n // content inherits its language from.\n const root = stimulus.querySelector('qti-assessment-stimulus');\n\n if (!root) {\n console.warn('No qti-assessment-stimulus element found in stimulus');\n return;\n }\n\n // Try multiple target selection strategies\n let targets: Element[] = [];\n\n // Strategy 1: Search inside the actual item element first.\n // This keeps stimulus placement working when items are rendered in a shadow root.\n const specificTarget = item.querySelector(`[data-stimulus-idref=\"${element.identifier}\"]`);\n\n if (specificTarget) {\n targets.push(specificTarget);\n console.info('Found specific target:', specificTarget);\n } else {\n // Strategy 2: Any element with matching stimulus idref\n const allTargetsWithId = Array.from(this.querySelectorAll(`[data-stimulus-idref=\"${element.identifier}\"]`));\n\n if (allTargetsWithId.length > 0) {\n targets = allTargetsWithId;\n console.info('Found targets by identifier:', allTargetsWithId.length);\n } else {\n // Strategy 3: Any stimulus idref target (fallback)\n const allStimulusTargets = Array.from(this.querySelectorAll('[data-stimulus-idref]'));\n targets = allStimulusTargets;\n console.info('Using fallback targets:', allStimulusTargets.length);\n }\n }\n\n if (targets.length === 0) {\n console.warn('No targets found for stimulus content');\n return;\n }\n\n // Apply content to all targets\n targets.forEach((target, index) => {\n target.innerHTML = '';\n target.append(root.cloneNode(true));\n console.info(`Applied stimulus content to target ${index + 1}/${targets.length}`);\n });\n } // ===========================================\n // LOADING INFRASTRUCTURE\n // ===========================================\n\n /**\n * Cancel previous navigation and clean up all state\n */\n private _cancelPreviousNavigation(): void {\n if (this._activeController) {\n this._activeController.abort();\n console.info('Previous navigation request cancelled');\n }\n\n this._clearNavigationState();\n }\n\n private _clearNavigationState(): void {\n this._clearLoadedItems();\n this._resetLoadingState();\n this._loadResults = [];\n }\n\n /**\n * Load items with simple tracking\n */\n private async _loadItems(itemIds: string[], navigationId: number, controller: AbortController): Promise<void> {\n if (!this._testElement || itemIds.length === 0) return;\n\n const itemRefs = itemIds.map(id => this._findItemRef(id));\n this._clearLoadedItems();\n this._clearStimulusRef();\n\n const results = await Promise.all(itemRefs.map(ref => this._loadSingleItem(ref, navigationId, controller)));\n const validResults = results.filter(Boolean);\n\n if (this._isStaleNavigation(navigationId, controller)) return;\n\n validResults.forEach(({ itemRef, doc }) => {\n if (itemRef && doc) itemRef.xmlDoc = doc;\n });\n\n // Restore per-item state as early as possible (before iframe-based interactions initialize).\n // Some PCIs (including IMS conformance examples) only support restoration via getInstance(state),\n // so the state needs to be present on the provided itemContext at initial render time.\n validResults.forEach(({ itemRef }) => {\n const itemId = itemRef?.identifier;\n if (!itemRef || !itemId) return;\n\n const savedState = this.testContext.items.find(i => i.identifier === itemId)?.state;\n if (savedState === undefined) return;\n\n itemRef.updateComplete.then(() => {\n const assessmentItem = itemRef.assessmentItem as QtiAssessmentItem | null;\n if (!assessmentItem) return;\n assessmentItem.state = savedState;\n });\n });\n\n this._loadResults = validResults;\n }\n\n private async _loadSingleItem(itemRef: QtiAssessmentItemRef, navigationId: number, controller: AbortController) {\n try {\n // The same seed `test-container` shuffled the item order with.\n const seed = this.qtiContext?.QTI_CONTEXT?.seed;\n let transformer = (await qtiTransformItem().load(itemRef.href, controller.signal)).shuffleInteractions(seed);\n\n if (this.postLoadTransformCallback) {\n transformer = await this.postLoadTransformCallback(transformer, itemRef);\n }\n\n if (this._isStaleNavigation(navigationId, controller)) {\n return null;\n }\n\n return { itemRef, doc: transformer.htmlDoc(this._customElementRegistry()) };\n } catch (error) {\n if (error.name === 'AbortError') {\n console.info(`Item load for ${itemRef.identifier} was aborted`);\n throw error;\n }\n console.warn(`Failed to load item ${itemRef.identifier}:`, error);\n return null;\n }\n }\n\n private async _loadStimulus(href: string): Promise<DocumentFragment | null> {\n const transformer = await qtiTransformItem().load(href, this._activeController?.signal);\n return transformer.htmlDoc(this._customElementRegistry());\n }\n\n private _customElementRegistry(): CustomElementRegistry | undefined {\n const container = this.querySelector<TestContainer>('test-container');\n if (!container) return undefined;\n return container.customElementRegistry ?? undefined;\n }\n\n // ===========================================\n // UTILITIES\n // ===========================================\n\n private _findItemRef(itemId: string): QtiAssessmentItemRef {\n const itemRef = this._testElement?.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${itemId}\"]`\n );\n\n if (!itemRef) {\n throw new Error(`Item with identifier \"${itemId}\" not found`);\n }\n\n return itemRef;\n }\n\n private _findSection(sectionId: string): QtiAssessmentSection | null {\n return (\n this._testElement?.querySelector<QtiAssessmentSection>(`qti-assessment-section[identifier=\"${sectionId}\"]`) ||\n null\n );\n }\n\n private _updateSessionContext(itemRef: QtiAssessmentItemRef, itemId: string): void {\n const navPartId = itemRef.closest('qti-test-part')?.identifier;\n const navSectionId = itemRef.closest('qti-assessment-section')?.identifier;\n\n this.sessionContext = {\n ...this.sessionContext,\n navPartId,\n navSectionId,\n navItemRefId: itemId\n };\n }\n\n private _getSectionItemIds(sectionId: string): string[] {\n return Array.from(\n this._testElement.querySelectorAll<QtiAssessmentItemRef>(\n `qti-assessment-section[identifier=\"${sectionId}\"] > qti-assessment-item-ref`\n )\n )\n .map(ref => ref.identifier)\n .filter(Boolean);\n }\n\n private _clearLoadedItems(): void {\n const itemRefs = this._testElement?.querySelectorAll<QtiAssessmentItemRef>('qti-assessment-item-ref');\n Array.from(itemRefs || []).forEach(element => {\n element.xmlDoc = null;\n });\n }\n\n private _clearStimulusRef(): void {\n this.querySelectorAll('[data-stimulus-idref]').forEach(el => (el.innerHTML = ''));\n }\n\n private _isStaleNavigation(navigationId: number, controller: AbortController): boolean {\n return controller.signal.aborted || navigationId !== this._navigationId;\n }\n\n private _createNavigationError(error: any, type: string, id: string): NavigationError {\n return {\n message: error.message || `Failed to load ${type}: ${id}`,\n details: error,\n itemId: type === 'item' ? id : undefined,\n sectionId: type === 'section' ? id : undefined\n };\n }\n\n // ===========================================\n // EVENT DISPATCHING\n // ===========================================\n\n private _dispatchLoadingStarted(type: string, id: string): void {\n dispatchPublic(this, 'cito-test-navigation-started', { type: type as 'item' | 'section', id });\n }\n\n private _dispatchLoadingEnded(type: string, id: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-navigation-loading-ended', {\n detail: { type, id },\n bubbles: true,\n composed: true\n })\n );\n }\n\n private _dispatchError(error: NavigationError): void {\n dispatchPublic(this, 'cito-test-navigation-failed', error);\n }\n\n /** The items are in the DOM: tell hosts the new position rendered (`cito-test-navigated`) and which items it holds. */\n private _dispatchTestLoaded(results: any[], type: 'item' | 'section', id: string): void {\n requestAnimationFrame(() => {\n dispatchPublic(\n this,\n 'cito-test-rendered',\n results.map(({ itemRef }) => ({\n identifier: itemRef?.identifier,\n element: itemRef\n }))\n );\n dispatchPublic(this, 'cito-test-navigated', { type, id });\n });\n }\n }\n\n return TestNavigationClass as Constructor<ITestNavigationMixin> & T;\n};\n"]}
1
+ {"version":3,"file":"test-navigation.mixin.js","sourceRoot":"","sources":["../../src/mixins/test-navigation.mixin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA2DhE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAA2C,UAAa,EAAE,EAAE;IAC7F,MAAe,mBAAoB,SAAQ,UAAU;QA0BnD,YAAY,GAAG,IAAW;YACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YA1BW,aAAQ,GAA8B,IAAI,CAAC;YAC3C,mBAAc,GAAW,KAAK,CAAC;YAC3B,8BAAyB,GAAqC,IAAI,CAAC;YACnE,kCAA6B,GAAyC,IAAI,CAAC;YAI3G,4BAA4B;YACpB,sBAAiB,GAA2B,IAAI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C,CAAC,CACJ,CAAC;gBACF,cAAc,CAAC,IAAI,EAAE,qBAAqB,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;QACL,CAAC;KACF;IAppB6B;QAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAA4C;IAC3C;QAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAAgC;IAC3B;QAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;0EAAoE;IACnE;QAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8EAA4E;IAmpB7G,OAAO,mBAA4D,CAAC;AACtE,CAAC,CAAC","sourcesContent":["import { property } from 'lit/decorators.js';\n\nimport { qtiTransformItem } from '@qti-components/transformers';\n\nimport { idOf, resolveFirstItem, resolveNextItem } from '../internal/item-sequencing';\nimport { dispatchPublic, listenPublic } from '../public-events';\n\nimport type { QtiAssessmentStimulusRefConnectedEvent } from '@qti-components/elements';\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { transformItemApi, transformTestApi } from '@qti-components/transformers';\nimport type { QtiAssessmentItemRef } from '../components/qti-assessment-item-ref/qti-assessment-item-ref';\nimport type { QtiAssessmentSection } from '../components/qti-assessment-section/qti-assessment-section';\nimport type { QtiTestPart } from '../components/qti-test-part/qti-test-part';\nimport type { QtiAssessmentTest } from '../components/qti-assessment-test/qti-assessment-test';\nimport type { TestContainer } from '../components/test-container/test-container';\nimport type { PostLoadTestTransformCallback } from '../internal/test-host.context';\nimport type { TestBaseInterface } from './test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\nexport type PostLoadTransformCallback = (\n transformer: transformItemApi,\n itemRef: QtiAssessmentItemRef\n) => transformItemApi | Promise<transformItemApi>;\n\nexport type { PostLoadTestTransformCallback };\n\nexport interface NavigationError {\n message: string;\n details?: any;\n itemId?: string;\n sectionId?: string;\n}\n\n/**\n * Exactly what this mixin adds. `IQtiTest` composes it (see ../types/iqti-test, which\n * re-exports it), and `TestNavigationClass` below `implements` it, so the interface and the\n * class cannot drift apart.\n *\n * This was `declare class TestNavigationInterface {}` — EMPTY — so the returned\n * `Constructor<TestNavigationInterface> & T` added nothing and every member the mixin\n * contributes was erased from the public type. `QtiTest` looked as though it had no\n * `navigate` or `postLoadTransformCallback`, and consumers had to intersect the class with\n * `IQtiTest` by hand to describe one element.\n *\n * `showLoadingIndicators` and `retryNavigation` used to be listed on the `IQtiTest` side with\n * no implementation anywhere in the repo, so calling `retryNavigation()` would have thrown.\n * They are gone rather than stubbed: there was no behaviour to preserve.\n */\nexport interface ITestNavigationMixin {\n navigate: 'item' | 'section' | null;\n requestTimeout: number;\n postLoadTransformCallback: PostLoadTransformCallback | null;\n postLoadTestTransformCallback: PostLoadTestTransformCallback | null;\n navigateTo(type: 'item' | 'section', id?: string): void;\n getLoadingProgress(): {\n expectedItems: number;\n connectedItems: number;\n expectedStimulus: number;\n loadedStimulus: number;\n isComplete: boolean;\n };\n}\n\n/**\n * Navigation mixin for QTI test components\n *\n * Provides comprehensive navigation functionality with:\n * - Efficient item/section loading with AbortController support\n * - Stimulus reference coordination and duplicate prevention\n * - Proper event timing and state management\n * - Error handling and edge case coverage\n */\nexport const TestNavigationMixin = <T extends Constructor<TestBaseInterface>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass implements ITestNavigationMixin {\n @property({ type: String }) navigate: 'item' | 'section' | null = null;\n @property({ type: Number }) requestTimeout: number = 30000;\n @property({ attribute: false }) postLoadTransformCallback: PostLoadTransformCallback | null = null;\n @property({ attribute: false }) postLoadTestTransformCallback: PostLoadTestTransformCallback | null = null;\n\n public _testElement: QtiAssessmentTest;\n\n // Navigation state tracking\n private _activeController: AbortController | null = null;\n private _loadResults: any[] = [];\n private _navigationId = 0;\n\n // Simple loading progress tracking\n private _loadingState = {\n expectedItems: 0,\n connectedItems: 0,\n expectedStimulus: 0,\n loadedStimulus: 0,\n isComplete: false\n };\n\n // Track loaded/loading stimulus hrefs to prevent duplicates\n private _loadedStimulusHrefs = new Set<string>();\n private _loadingStimulusHrefs = new Set<string>();\n\n constructor(...args: any[]) {\n super(...args);\n this._bindEventHandlers();\n }\n\n // ===========================================\n // PUBLIC API\n // ===========================================\n\n /**\n * Navigate to a specific item or section\n * @param type - Navigation type ('item' or 'section')\n * @param id - Target identifier (optional, falls back to the current position, or the first one before there is any)\n */\n public navigateTo(type: 'item' | 'section', id?: string): void {\n const targetId = id || this._getDefaultNavigationId(type);\n\n if (targetId) {\n dispatchPublic(this, 'cito-test-navigate', { type, id: targetId });\n }\n }\n\n // ===========================================\n // EVENT HANDLER SETUP\n // ===========================================\n\n private _bindEventHandlers(): void {\n listenPublic(this, 'cito-test-navigate', this._handleNavigationRequest.bind(this));\n listenPublic(this, 'cito-test-loaded', this._handleTestConnected.bind(this));\n this.addEventListener('qti-assessment-item-connected', this._handleItemConnected.bind(this));\n this.addEventListener('qti-assessment-stimulus-ref-connected', this._handleStimulusRefConnected.bind(this));\n }\n\n private _handleTestConnected(e: CustomEvent<QtiAssessmentTest>): void {\n this._testElement = e.detail;\n this._initializeNavigation();\n }\n\n /**\n * Handle item connection events - track connected items and discover stimulus references\n */\n private _handleItemConnected(e: CustomEvent<QtiAssessmentItemRef>): void {\n const itemRef = e.detail;\n\n // Increment connected items count\n this._loadingState.connectedItems++;\n\n // Count stimulus references in this item and add to expected\n const stimulusRefs = itemRef.querySelectorAll('qti-assessment-stimulus-ref');\n this._loadingState.expectedStimulus += stimulusRefs.length;\n\n this._checkLoadingComplete();\n }\n\n /**\n * Handle stimulus reference connection events with duplicate prevention\n */\n private async _handleStimulusRefConnected(e: QtiAssessmentStimulusRefConnectedEvent): Promise<void> {\n e.preventDefault();\n\n const { element, item } = e;\n console.info('Stimulus ref connected:', {\n identifier: element.identifier,\n href: element.href,\n item: item.identifier\n });\n\n // Check if this stimulus href is already loaded or currently loading\n if (this._loadedStimulusHrefs.has(element.href)) {\n console.info('Stimulus already loaded, skipping:', element.href);\n this._loadingState.loadedStimulus++;\n this._checkLoadingComplete();\n return;\n }\n\n if (this._loadingStimulusHrefs.has(element.href)) {\n console.info('Stimulus already loading, skipping duplicate:', element.href);\n this._loadingState.loadedStimulus++;\n this._checkLoadingComplete();\n return;\n }\n\n // Mark as currently loading\n this._loadingStimulusHrefs.add(element.href);\n console.info('Starting stimulus load:', element.href);\n\n try {\n await this._loadStimulusRef(element, item);\n this._loadedStimulusHrefs.add(element.href);\n this._loadingState.loadedStimulus++;\n console.info('Stimulus loaded successfully:', element.href);\n this._checkLoadingComplete();\n } catch (error) {\n if (error.name !== 'AbortError') {\n console.warn(`Failed to load stimulus ${element.identifier}:`, error);\n }\n // Still count as \"processed\" even if failed to avoid hanging\n this._loadingState.loadedStimulus++;\n this._checkLoadingComplete();\n } finally {\n // Remove from loading set regardless of outcome\n this._loadingStimulusHrefs.delete(element.href);\n }\n }\n\n // ===========================================\n // NAVIGATION FLOW\n // ===========================================\n\n private _getDefaultNavigationId(type: 'item' | 'section'): string | undefined {\n if (type === 'section') {\n return (\n this.sessionContext?.navSectionId ??\n this._testElement?.querySelector<QtiAssessmentSection>('qti-assessment-section')?.identifier\n );\n }\n return (\n this.sessionContext?.navItemRefId ??\n this._testElement?.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref')?.identifier\n );\n }\n\n private _initializeNavigation(): void {\n if (!this.navigate) return;\n\n let id = this._getDefaultNavigationId(this.navigate);\n if (this.navigate === 'item' && this._testElement && !this.sessionContext?.navItemRefId) {\n // a fresh start: the first item of a linear part may itself have a false pre-condition\n const refs = [...this._testElement.querySelectorAll('qti-assessment-item-ref')];\n if (refs[0]?.closest('qti-test-part')?.getAttribute('navigation-mode') === 'linear') {\n const first = resolveFirstItem(refs);\n if (first.skipped.length) dispatchPublic(this, 'cito-test-items-skipped', { ids: first.skipped });\n if (first.id === null) {\n dispatchPublic(this, 'cito-test-end-reached', {});\n return;\n }\n id = first.id;\n }\n }\n if (id) {\n this.navigateTo(this.navigate, id);\n }\n }\n\n private _isLinearNavigationRestricted(type: 'item' | 'section', targetId: string): boolean {\n const currentItemId = this.sessionContext?.navItemRefId;\n if (!currentItemId) return false;\n\n // Never restrict navigating to the same item\n if (type === 'item' && targetId === currentItemId) return false;\n\n const currentItemRef = this._testElement?.querySelector(`qti-assessment-item-ref[identifier=\"${currentItemId}\"]`);\n if (!currentItemRef) return false;\n\n const section = currentItemRef.closest('qti-assessment-section') as QtiAssessmentSection;\n const testPart = currentItemRef.closest('qti-test-part') as QtiTestPart;\n\n const navigationMode = (section?.navigationMode ||\n section?.getAttribute('navigation-mode') ||\n testPart?.navigationMode ||\n testPart?.getAttribute('navigation-mode') ||\n 'nonlinear') as string;\n\n if (navigationMode !== 'linear') return false;\n\n const allItemRefs = Array.from(\n this._testElement?.querySelectorAll('qti-assessment-item-ref') || []\n ) as QtiAssessmentItemRef[];\n const currentIndex = allItemRefs.findIndex(ref => ref.identifier === currentItemId);\n\n if (type === 'item') {\n const targetIndex = allItemRefs.findIndex(ref => ref.identifier === targetId);\n if (targetIndex === -1 || currentIndex === -1) return false;\n\n // Only allow moving to the next item in linear mode\n return targetIndex !== currentIndex + 1;\n }\n\n // Sections are generally restricted in linear mode unless we are moving to the next one\n return true;\n }\n\n /**\n * A \"next\" step in a linear test part (a request for item i+1 while item i is active) goes\n * through the branch rules and pre-conditions. Deep links, item links and nonlinear parts are\n * left alone: the spec ignores both in nonlinear mode.\n *\n * @returns the item to present instead, `null` when the test has no eligible item left, or\n * `undefined` when the request is not a \"next\" step.\n */\n private _resolveLinearNext(\n type: 'item' | 'section',\n id: string\n ): { id: string | null; skipped: string[] } | undefined {\n if (type !== 'item' || !this._testElement) return undefined;\n\n const refs = [...this._testElement.querySelectorAll('qti-assessment-item-ref')];\n const current = refs.findIndex(ref => idOf(ref) === this.sessionContext?.navItemRefId);\n if (current < 0 || !refs[current + 1] || idOf(refs[current + 1]) !== id) return undefined;\n if (refs[current].closest('qti-test-part')?.getAttribute('navigation-mode') !== 'linear') return undefined;\n\n const next = resolveNextItem(refs, current);\n if (next.id === id) return undefined;\n\n return next;\n }\n\n /**\n * Main navigation request handler with proper lifecycle management\n */\n private async _handleNavigationRequest({ detail }: CustomEvent<{ type: 'item' | 'section'; id: string }>) {\n if (!detail?.id) return;\n\n const resolved = this._resolveLinearNext(detail.type, detail.id);\n if (resolved?.id === null) {\n if (resolved.skipped.length) dispatchPublic(this, 'cito-test-items-skipped', { ids: resolved.skipped });\n dispatchPublic(this, 'cito-test-end-reached', {});\n return;\n }\n const target = resolved?.id ?? detail.id;\n // a resolved jump is not a free choice by the candidate, so the linear restriction does not apply to it\n if (!resolved && this._isLinearNavigationRestricted(detail.type, target)) {\n this._handleNavigationError(new Error('Navigation restricted in linear mode'), detail.type, detail.id);\n return;\n }\n\n this._cancelPreviousNavigation();\n const navigationId = ++this._navigationId;\n const controller = new AbortController();\n\n try {\n this._dispatchLoadingStarted(detail.type, target);\n this._activeController = controller;\n\n await this._executeNavigation(detail.type, target, navigationId, controller);\n // only tell hosts about skipped items once the jump went through\n if (resolved?.skipped.length && navigationId === this._navigationId && !controller.signal.aborted) {\n dispatchPublic(this, 'cito-test-items-skipped', { ids: resolved.skipped });\n }\n } catch (error) {\n this._handleNavigationError(error, detail.type, target);\n } finally {\n if (this._activeController === controller) {\n this._activeController = null;\n }\n this._dispatchLoadingEnded(detail.type, target);\n }\n }\n\n private _handleNavigationError(error: any, type: string, id: string): void {\n if (error.name !== 'AbortError') {\n this._dispatchError(this._createNavigationError(error, type, id));\n }\n }\n\n private async _executeNavigation(\n type: 'item' | 'section',\n id: string,\n navigationId: number,\n controller: AbortController\n ): Promise<void> {\n if (type === 'item') {\n await this._navigateToItem(id, navigationId, controller);\n } else {\n await this._navigateToSection(id, navigationId, controller);\n }\n }\n\n /**\n * Navigate to specific item with simple state tracking\n */\n private async _navigateToItem(itemId: string, navigationId: number, controller: AbortController): Promise<void> {\n const itemRef = this._findItemRef(itemId);\n this._updateSessionContext(itemRef, itemId);\n\n this._resetLoadingState();\n this._loadingState.expectedItems = 1;\n\n await this._loadItems([itemId], navigationId, controller);\n await this._waitForLoadingComplete(navigationId, controller);\n if (this._isStaleNavigation(navigationId, controller)) return;\n\n this._dispatchTestLoaded(this._loadResults, 'item', itemId);\n }\n\n /**\n * Navigate to section with simple state tracking\n */\n private async _navigateToSection(\n sectionId: string,\n navigationId: number,\n controller: AbortController\n ): Promise<void> {\n const sectionEl = this._findSection(sectionId);\n const navPartId = sectionEl?.closest('qti-test-part')?.identifier;\n\n this.sessionContext = {\n ...this.sessionContext,\n navPartId,\n navSectionId: sectionId,\n navItemRefId: null\n };\n\n const itemIds = this._getSectionItemIds(sectionId);\n\n this._resetLoadingState();\n this._loadingState.expectedItems = itemIds.length;\n\n await this._loadItems(itemIds, navigationId, controller);\n await this._waitForLoadingComplete(navigationId, controller);\n if (this._isStaleNavigation(navigationId, controller)) return;\n\n this._dispatchTestLoaded(this._loadResults, 'section', sectionId);\n }\n\n // ===========================================\n // LOADING STATE MANAGEMENT\n // ===========================================\n\n /**\n * Reset loading state for new navigation\n */\n private _resetLoadingState(): void {\n this._loadingState = {\n expectedItems: 0,\n connectedItems: 0,\n expectedStimulus: 0,\n loadedStimulus: 0,\n isComplete: false\n };\n\n // Clear stimulus tracking - start fresh for new navigation\n this._loadedStimulusHrefs.clear();\n this._loadingStimulusHrefs.clear();\n }\n\n /**\n * Check if loading is complete and dispatch events accordingly\n */\n private _checkLoadingComplete(): void {\n const allItemsConnected = this._loadingState.connectedItems >= this._loadingState.expectedItems;\n const allStimulusLoaded = this._loadingState.loadedStimulus >= this._loadingState.expectedStimulus;\n\n if (allItemsConnected && allStimulusLoaded && !this._loadingState.isComplete) {\n this._loadingState.isComplete = true;\n }\n }\n\n /**\n * Wait for loading to complete with simple polling\n */\n private async _waitForLoadingComplete(navigationId: number, controller: AbortController): Promise<void> {\n while (!this._loadingState.isComplete) {\n if (this._isStaleNavigation(navigationId, controller)) return;\n await new Promise(resolve => setTimeout(resolve, 10));\n }\n }\n\n /**\n * Get current loading progress for external consumption\n */\n public getLoadingProgress() {\n return { ...this._loadingState };\n }\n\n /**\n * Load stimulus reference with simple tracking\n */\n private async _loadStimulusRef(\n element: { identifier: string; href: string },\n item: QtiAssessmentItem\n ): Promise<void> {\n console.info('Loading stimulus:', element.href);\n const stimulus = await this._loadStimulus(element.href);\n console.info('Stimulus loaded, applying content:', stimulus ? 'has content' : 'no content');\n this._applyStimulusContent(stimulus, element, item);\n }\n\n private _applyStimulusContent(\n stimulus: DocumentFragment | null,\n element: { identifier: string },\n item: QtiAssessmentItem\n ): void {\n if (!stimulus) {\n console.warn('No stimulus content to apply');\n return;\n }\n\n // Place the whole qti-assessment-stimulus, not just its body: its `lang` is what the stimulus\n // content inherits its language from.\n const root = stimulus.querySelector('qti-assessment-stimulus');\n\n if (!root) {\n console.warn('No qti-assessment-stimulus element found in stimulus');\n return;\n }\n\n // Try multiple target selection strategies\n let targets: Element[] = [];\n\n // Strategy 1: Search inside the actual item element first.\n // This keeps stimulus placement working when items are rendered in a shadow root.\n const specificTarget = item.querySelector(`[data-stimulus-idref=\"${element.identifier}\"]`);\n\n if (specificTarget) {\n targets.push(specificTarget);\n console.info('Found specific target:', specificTarget);\n } else {\n // Strategy 2: Any element with matching stimulus idref\n const allTargetsWithId = Array.from(this.querySelectorAll(`[data-stimulus-idref=\"${element.identifier}\"]`));\n\n if (allTargetsWithId.length > 0) {\n targets = allTargetsWithId;\n console.info('Found targets by identifier:', allTargetsWithId.length);\n } else {\n // Strategy 3: Any stimulus idref target (fallback)\n const allStimulusTargets = Array.from(this.querySelectorAll('[data-stimulus-idref]'));\n targets = allStimulusTargets;\n console.info('Using fallback targets:', allStimulusTargets.length);\n }\n }\n\n if (targets.length === 0) {\n console.warn('No targets found for stimulus content');\n return;\n }\n\n // Apply content to all targets\n targets.forEach((target, index) => {\n target.innerHTML = '';\n target.append(root.cloneNode(true));\n console.info(`Applied stimulus content to target ${index + 1}/${targets.length}`);\n });\n } // ===========================================\n // LOADING INFRASTRUCTURE\n // ===========================================\n\n /**\n * Cancel previous navigation and clean up all state\n */\n private _cancelPreviousNavigation(): void {\n if (this._activeController) {\n this._activeController.abort();\n console.info('Previous navigation request cancelled');\n }\n\n this._clearNavigationState();\n }\n\n private _clearNavigationState(): void {\n this._clearLoadedItems();\n this._resetLoadingState();\n this._loadResults = [];\n }\n\n /**\n * Load items with simple tracking\n */\n private async _loadItems(itemIds: string[], navigationId: number, controller: AbortController): Promise<void> {\n if (!this._testElement || itemIds.length === 0) return;\n\n const itemRefs = itemIds.map(id => this._findItemRef(id));\n this._clearLoadedItems();\n this._clearStimulusRef();\n\n const results = await Promise.all(itemRefs.map(ref => this._loadSingleItem(ref, navigationId, controller)));\n const validResults = results.filter(Boolean);\n\n if (this._isStaleNavigation(navigationId, controller)) return;\n\n validResults.forEach(({ itemRef, doc }) => {\n if (itemRef && doc) itemRef.xmlDoc = doc;\n });\n\n // Restore per-item state as early as possible (before iframe-based interactions initialize).\n // Some PCIs (including IMS conformance examples) only support restoration via getInstance(state),\n // so the state needs to be present on the provided itemContext at initial render time.\n validResults.forEach(({ itemRef }) => {\n const itemId = itemRef?.identifier;\n if (!itemRef || !itemId) return;\n\n const savedState = this.testContext.items.find(i => i.identifier === itemId)?.state;\n if (savedState === undefined) return;\n\n itemRef.updateComplete.then(() => {\n const assessmentItem = itemRef.assessmentItem as QtiAssessmentItem | null;\n if (!assessmentItem) return;\n assessmentItem.state = savedState;\n });\n });\n\n this._loadResults = validResults;\n }\n\n private async _loadSingleItem(itemRef: QtiAssessmentItemRef, navigationId: number, controller: AbortController) {\n try {\n // The same seed `test-container` shuffled the item order with.\n const seed = this.qtiContext?.QTI_CONTEXT?.seed;\n let transformer = (await qtiTransformItem().load(itemRef.href, controller.signal)).shuffleInteractions(seed);\n\n if (this.postLoadTransformCallback) {\n transformer = await this.postLoadTransformCallback(transformer, itemRef);\n }\n\n if (this._isStaleNavigation(navigationId, controller)) {\n return null;\n }\n\n return { itemRef, doc: transformer.htmlDoc(this._customElementRegistry()) };\n } catch (error) {\n if (error.name === 'AbortError') {\n console.info(`Item load for ${itemRef.identifier} was aborted`);\n throw error;\n }\n console.warn(`Failed to load item ${itemRef.identifier}:`, error);\n return null;\n }\n }\n\n private async _loadStimulus(href: string): Promise<DocumentFragment | null> {\n const transformer = await qtiTransformItem().load(href, this._activeController?.signal);\n return transformer.htmlDoc(this._customElementRegistry());\n }\n\n private _customElementRegistry(): CustomElementRegistry | undefined {\n const container = this.querySelector<TestContainer>('test-container');\n if (!container) return undefined;\n return container.customElementRegistry ?? undefined;\n }\n\n // ===========================================\n // UTILITIES\n // ===========================================\n\n private _findItemRef(itemId: string): QtiAssessmentItemRef {\n const itemRef = this._testElement?.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${itemId}\"]`\n );\n\n if (!itemRef) {\n throw new Error(`Item with identifier \"${itemId}\" not found`);\n }\n\n return itemRef;\n }\n\n private _findSection(sectionId: string): QtiAssessmentSection | null {\n return (\n this._testElement?.querySelector<QtiAssessmentSection>(`qti-assessment-section[identifier=\"${sectionId}\"]`) ||\n null\n );\n }\n\n private _updateSessionContext(itemRef: QtiAssessmentItemRef, itemId: string): void {\n const navPartId = itemRef.closest('qti-test-part')?.identifier;\n const navSectionId = itemRef.closest('qti-assessment-section')?.identifier;\n\n this.sessionContext = {\n ...this.sessionContext,\n navPartId,\n navSectionId,\n navItemRefId: itemId\n };\n }\n\n private _getSectionItemIds(sectionId: string): string[] {\n return Array.from(\n this._testElement.querySelectorAll<QtiAssessmentItemRef>(\n `qti-assessment-section[identifier=\"${sectionId}\"] > qti-assessment-item-ref`\n )\n )\n .map(ref => ref.identifier)\n .filter(Boolean);\n }\n\n private _clearLoadedItems(): void {\n const itemRefs = this._testElement?.querySelectorAll<QtiAssessmentItemRef>('qti-assessment-item-ref');\n Array.from(itemRefs || []).forEach(element => {\n element.xmlDoc = null;\n });\n }\n\n private _clearStimulusRef(): void {\n this.querySelectorAll('[data-stimulus-idref]').forEach(el => (el.innerHTML = ''));\n }\n\n private _isStaleNavigation(navigationId: number, controller: AbortController): boolean {\n return controller.signal.aborted || navigationId !== this._navigationId;\n }\n\n private _createNavigationError(error: any, type: string, id: string): NavigationError {\n return {\n message: error.message || `Failed to load ${type}: ${id}`,\n details: error,\n itemId: type === 'item' ? id : undefined,\n sectionId: type === 'section' ? id : undefined\n };\n }\n\n // ===========================================\n // EVENT DISPATCHING\n // ===========================================\n\n private _dispatchLoadingStarted(type: string, id: string): void {\n dispatchPublic(this, 'cito-test-navigation-started', { type: type as 'item' | 'section', id });\n }\n\n private _dispatchLoadingEnded(type: string, id: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-navigation-loading-ended', {\n detail: { type, id },\n bubbles: true,\n composed: true\n })\n );\n }\n\n private _dispatchError(error: NavigationError): void {\n dispatchPublic(this, 'cito-test-navigation-failed', error);\n }\n\n /** The items are in the DOM: tell hosts the new position rendered (`cito-test-navigated`) and which items it holds. */\n private _dispatchTestLoaded(results: any[], type: 'item' | 'section', id: string): void {\n requestAnimationFrame(() => {\n dispatchPublic(\n this,\n 'cito-test-rendered',\n results.map(({ itemRef }) => ({\n identifier: itemRef?.identifier,\n element: itemRef\n }))\n );\n dispatchPublic(this, 'cito-test-navigated', { type, id });\n });\n }\n }\n\n return TestNavigationClass as Constructor<ITestNavigationMixin> & T;\n};\n"]}
@@ -38,6 +38,10 @@ export interface PublicEventMap {
38
38
  element: Element;
39
39
  }[]>;
40
40
  'cito-test-state-changed': CustomEvent<QtiTestState>;
41
+ 'cito-test-items-skipped': CustomEvent<{
42
+ ids: string[];
43
+ }>;
44
+ 'cito-test-end-reached': CustomEvent<Record<string, never>>;
41
45
  'cito-item-ref-connected': CustomEvent<{
42
46
  identifier: string;
43
47
  href: string;
@@ -14,6 +14,8 @@ export const PUBLIC_EVENTS = {
14
14
  'cito-test-rendered': { kind: 'notification', scope: 'test', deprecated: 'qti-test-loaded' },
15
15
  'cito-test-loaded': { kind: 'notification', scope: 'test', deprecated: 'qti-assessment-test-connected' },
16
16
  'cito-test-state-changed': { kind: 'notification', scope: 'test', deprecated: 'qti-state-changed' },
17
+ 'cito-test-items-skipped': { kind: 'notification', scope: 'test' },
18
+ 'cito-test-end-reached': { kind: 'notification', scope: 'test' },
17
19
  'cito-item-ref-connected': { kind: 'notification', scope: 'item', deprecated: 'qti-assessment-item-ref-connected' }
18
20
  };
19
21
  /**