@qti-components/test 1.10.1 → 2.0.0-next.11
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/dist/components/index.d.ts +0 -11
- package/dist/components/index.js +0 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/qti-test/getting-started.fixtures.d.ts +7 -0
- package/dist/components/qti-test/getting-started.fixtures.js +8 -0
- package/dist/components/qti-test/getting-started.fixtures.js.map +1 -0
- package/dist/components/qti-test/qti-test.d.ts +1 -0
- package/dist/components/qti-test/showcase.fixtures.d.ts +6 -0
- package/dist/components/qti-test/showcase.fixtures.js +7 -0
- package/dist/components/qti-test/showcase.fixtures.js.map +1 -0
- package/dist/components/styles.d.ts +8 -1
- package/dist/components/styles.js +63 -14
- package/dist/components/styles.js.map +1 -1
- package/dist/components/test-bookmark/test-bookmark.d.ts +48 -0
- package/dist/components/test-bookmark/test-bookmark.js +149 -0
- package/dist/components/test-bookmark/test-bookmark.js.map +1 -0
- package/dist/components/test-check-item/test-check-item.d.ts +9 -2
- package/dist/components/test-check-item/test-check-item.js +19 -13
- package/dist/components/test-check-item/test-check-item.js.map +1 -1
- package/dist/components/test-end-attempt/test-end-attempt.js +7 -2
- package/dist/components/test-end-attempt/test-end-attempt.js.map +1 -1
- package/dist/components/test-item-link/test-item-link.js +7 -2
- package/dist/components/test-item-link/test-item-link.js.map +1 -1
- package/dist/components/test-navigation/test-navigation.js +8 -2
- package/dist/components/test-navigation/test-navigation.js.map +1 -1
- package/dist/components/test-next/test-next.js +8 -2
- package/dist/components/test-next/test-next.js.map +1 -1
- package/dist/components/test-prev/test-prev.js +7 -2
- package/dist/components/test-prev/test-prev.js.map +1 -1
- package/dist/components/test-print-state/test-print-state.d.ts +27 -0
- package/dist/components/test-print-state/test-print-state.js +87 -0
- package/dist/components/test-print-state/test-print-state.js.map +1 -0
- package/dist/components/test-section-link/test-section-link.js +7 -2
- package/dist/components/test-section-link/test-section-link.js.map +1 -1
- package/dist/components/test-stamp/test-stamp.d.ts +3 -2
- package/dist/components/test-stamp/test-stamp.js +9 -4
- package/dist/components/test-stamp/test-stamp.js.map +1 -1
- package/dist/components/test-submit/test-submit.d.ts +16 -0
- package/dist/components/test-submit/test-submit.js +37 -0
- package/dist/components/test-submit/test-submit.js.map +1 -0
- package/dist/elements.d.ts +37 -44
- package/dist/elements.js +4 -30
- package/dist/elements.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mixins/test-navigation.mixin.js +4 -2
- package/dist/mixins/test-navigation.mixin.js.map +1 -1
- package/dist/mixins/test-processing.mixin.d.ts +1 -0
- package/dist/mixins/test-processing.mixin.js +22 -1
- package/dist/mixins/test-processing.mixin.js.map +1 -1
- package/dist/mixins/test-state.mixin.js +25 -1
- package/dist/mixins/test-state.mixin.js.map +1 -1
- package/dist/plugin-state.d.ts +8 -0
- package/dist/plugin-state.js +7 -0
- package/dist/plugin-state.js.map +1 -0
- package/dist/plugins/elements.d.ts +79 -0
- package/dist/plugins/elements.js +37 -0
- package/dist/plugins/elements.js.map +1 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +3 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/public-events.d.ts +9 -0
- package/dist/public-events.js +3 -0
- package/dist/public-events.js.map +1 -1
- package/dist/tts/elements.d.ts +28 -0
- package/dist/tts/elements.js +14 -0
- package/dist/tts/elements.js.map +1 -0
- package/dist/{components/test-item-to-speech → tts}/test-item-to-speech.d.ts +9 -9
- package/dist/{components/test-item-to-speech → tts}/test-item-to-speech.js +81 -92
- package/dist/tts/test-item-to-speech.js.map +1 -0
- package/dist/types/qti-test-state.d.ts +12 -1
- package/dist/types/qti-test-state.js.map +1 -1
- package/package.json +11 -7
- package/dist/components/test-item-to-speech/test-item-to-speech.js.map +0 -1
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.d.ts +0 -19
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js +0 -39
- package/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js.map +0 -1
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.d.ts +0 -19
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js +0 -39
- package/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-section-link.js","sourceRoot":"","sources":["../../../src/components/test-section-link/test-section-link.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,OAAO,eAAgB,SAAQ,UAAU;aAC7B,WAAM,GAAG,GAAG,CAAA;;QAEtB,MAAM,CAAC,GAAG
|
|
1
|
+
{"version":3,"file":"test-section-link.js","sourceRoot":"","sources":["../../../src/components/test-section-link/test-section-link.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,OAAO,eAAgB,SAAQ,UAAU;aAC7B,WAAM,GAAG,GAAG,CAAA;;QAEtB,MAAM,CAAC,GAAG;;;;UAIR,MAAM,CAAC,cAAc;;;;QAIvB,MAAM,CAAC,SAAS;;;QAGhB,MAAM,CAAC,SAAS;;;QAGhB,MAAM,CAAC,GAAG;;GAEf,AAlBqB,CAkBpB;IAKF,YAAY,CAAC,UAAkB;QAC7B,cAAc,CAAC,IAAI,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QAPF,cAAS,GAAW,IAAI,CAAC;QAQ/B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1E,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,iBAAiB,CAAC;IAC/B,CAAC;;AAbO;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;kDACnB","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport * as styles from '../styles';\nimport { dispatchPublic } from '../../public-events';\n\nexport class TestSectionLink extends LitElement {\n static override styles = css`\n :host {\n ${styles.btn};\n }\n @media (hover: hover) and (pointer: fine) {\n :host(:hover:not([disabled])) {\n ${styles.btnInteractive};\n }\n }\n :host(:active:not([disabled])) {\n ${styles.btnActive};\n }\n :host(:focus-visible) {\n ${styles.focusRing};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: String, attribute: 'section-id' })\n private sectionId: string = null;\n\n #requestItem(identifier: string) {\n dispatchPublic(this, 'cito-test-navigate', { type: 'section', id: identifier });\n }\n\n constructor() {\n super();\n this.addEventListener('click', () => this.#requestItem(this.sectionId));\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-section-link': TestSectionLink;\n }\n}\n"]}
|
|
@@ -2,8 +2,9 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import type { PropertyValues } from 'lit';
|
|
3
3
|
import type { TemplateFunction } from '@heximal/templates';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* The stamp plugin: renders its `<template>` child with the state of the test (`test`,
|
|
6
|
+
* `activeTestpart`, `activeSection`, `activeItem`, `view`), again on every change, so a player
|
|
7
|
+
* can show progress or numbered navigation without writing a component.
|
|
7
8
|
* @customElement
|
|
8
9
|
* @extends {LitElement}
|
|
9
10
|
*/
|
|
@@ -10,8 +10,9 @@ import { prepareTemplate } from '@heximal/templates';
|
|
|
10
10
|
import { consume } from '@lit/context';
|
|
11
11
|
import { computedContext } from '@qti-components/base';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* The stamp plugin: renders its `<template>` child with the state of the test (`test`,
|
|
14
|
+
* `activeTestpart`, `activeSection`, `activeItem`, `view`), again on every change, so a player
|
|
15
|
+
* can show progress or numbered navigation without writing a component.
|
|
15
16
|
* @customElement
|
|
16
17
|
* @extends {LitElement}
|
|
17
18
|
*/
|
|
@@ -55,8 +56,9 @@ export class TestStamp extends LitElement {
|
|
|
55
56
|
const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);
|
|
56
57
|
const activeSection = activeTestPart?.sections.find(section => section.active);
|
|
57
58
|
const activeItem = activeSection?.items.find(item => item.active);
|
|
59
|
+
// In `navigate="section"` the test shows a section, not one item, so there may be no active item.
|
|
58
60
|
const { variables, ...augmentedItem } = activeItem || {};
|
|
59
|
-
if (!activeTestPart
|
|
61
|
+
if (!activeTestPart) {
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
64
|
const augmentedTestPart = {
|
|
@@ -67,7 +69,10 @@ export class TestStamp extends LitElement {
|
|
|
67
69
|
items: section.items.map(({ variables, ...rest }) => rest)
|
|
68
70
|
}))
|
|
69
71
|
};
|
|
70
|
-
const augmentedSection = {
|
|
72
|
+
const augmentedSection = {
|
|
73
|
+
...activeSection,
|
|
74
|
+
items: (activeSection?.items ?? []).map(({ variables, ...rest }) => rest)
|
|
75
|
+
};
|
|
71
76
|
const { testParts, ...activeTest } = this.computedContext;
|
|
72
77
|
this.stampContext = {
|
|
73
78
|
view: this.computedContext.view,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-stamp.js","sourceRoot":"","sources":["../../../src/components/test-stamp/test-stamp.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAOvD
|
|
1
|
+
{"version":3,"file":"test-stamp.js","sourceRoot":"","sources":["../../../src/components/test-stamp/test-stamp.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAOvD;;;;;;GAMG;AAEH,MAAM,OAAO,SAAU,SAAQ,UAAU;IAAzC;;QACE;;;WAGG;QAEI,UAAK,GAAG,KAAK,CAAC;QAOb,iBAAY,GAMhB;YACF,IAAI,EAAE,WAAW;YACjB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE;gBACb,KAAK,EAAE,EAAE;aACV;YACD,cAAc,EAAE;gBACd,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,EAAE;aACb;YACD,IAAI,EAAE,EAAE;SACT,CAAC;IAmEJ,CAAC;IA/DoB,gBAAgB;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,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E,IAAI,EAAE,CAAC;wCACtB;AAIb;IAFP,KAAK,EAAE;IACP,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;kDACd;AAGjC;IADP,KAAK,EAAE;+CAkBN","sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '@qti-components/base';\n\nimport type { View } from '@qti-components/base';\nimport type { PropertyValues } from 'lit';\nimport type { ComputedContext } from '@qti-components/base';\nimport type { TemplateFunction } from '@heximal/templates';\n\n/**\n * The stamp plugin: renders its `<template>` child with the state of the test (`test`,\n * `activeTestpart`, `activeSection`, `activeItem`, `view`), again on every change, so a player\n * can show progress or numbered navigation without writing a component.\n * @customElement\n * @extends {LitElement}\n */\n\nexport class TestStamp extends LitElement {\n /**\n * Indicates whether the component is in debug mode.\n * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.\n */\n @property({ type: Boolean, reflect: true })\n public debug = false;\n\n @state()\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n @state()\n private stampContext: {\n view?: View;\n test?: unknown;\n activeTestpart?: unknown;\n activeSection?: unknown;\n activeItem?: unknown;\n } = {\n view: 'candidate',\n activeItem: {},\n activeSection: {\n items: []\n },\n activeTestpart: {\n items: [],\n sections: []\n },\n test: {}\n };\n\n myTemplate: TemplateFunction;\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n protected override willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) {\n return;\n }\n const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n const activeSection = activeTestPart?.sections.find(section => section.active);\n const activeItem = activeSection?.items.find(item => item.active);\n // In `navigate=\"section\"` the test shows a section, not one item, so there may be no active item.\n const { variables, ...augmentedItem } = activeItem || {};\n\n if (!activeTestPart) {\n return;\n }\n\n const augmentedTestPart = {\n ...activeTestPart,\n items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n sections: activeTestPart.sections.map(section => ({\n ...section,\n items: section.items.map(({ variables, ...rest }) => rest)\n }))\n };\n\n const augmentedSection = {\n ...activeSection,\n items: (activeSection?.items ?? []).map(({ variables, ...rest }) => rest)\n };\n const { testParts, ...activeTest } = this.computedContext;\n\n this.stampContext = {\n view: this.computedContext.view,\n activeItem: augmentedItem,\n activeSection: augmentedSection,\n activeTestpart: augmentedTestPart,\n test: activeTest\n };\n this.dispatchEvent(\n new CustomEvent('qti-stamp-context-updated', {\n detail: this.stampContext,\n bubbles: true\n })\n );\n }\n\n override render() {\n // if (!this.stampContext) return nothing;\n return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}\n ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Scores the test: on click the test resets its outcomes to their declared defaults, runs its
|
|
4
|
+
* outcome processing and dispatches `cito-test-submitted`, after which the host reads the outcomes.
|
|
5
|
+
* The host decides where it sits, for example on the last item or in a review view.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TestSubmit extends LitElement {
|
|
8
|
+
static styles: import("lit").CSSResult;
|
|
9
|
+
constructor();
|
|
10
|
+
render(): import("lit").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'test-submit': TestSubmit;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { css, html, LitElement } from 'lit';
|
|
2
|
+
import * as styles from '../styles';
|
|
3
|
+
import { dispatchPublic } from '../../public-events';
|
|
4
|
+
/**
|
|
5
|
+
* Scores the test: on click the test resets its outcomes to their declared defaults, runs its
|
|
6
|
+
* outcome processing and dispatches `cito-test-submitted`, after which the host reads the outcomes.
|
|
7
|
+
* The host decides where it sits, for example on the last item or in a review view.
|
|
8
|
+
*/
|
|
9
|
+
export class TestSubmit extends LitElement {
|
|
10
|
+
static { this.styles = css `
|
|
11
|
+
:host {
|
|
12
|
+
${styles.btn};
|
|
13
|
+
}
|
|
14
|
+
@media (hover: hover) and (pointer: fine) {
|
|
15
|
+
:host(:hover:not([disabled])) {
|
|
16
|
+
${styles.btnInteractive};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
:host(:active:not([disabled])) {
|
|
20
|
+
${styles.btnActive};
|
|
21
|
+
}
|
|
22
|
+
:host(:focus-visible) {
|
|
23
|
+
${styles.focusRing};
|
|
24
|
+
}
|
|
25
|
+
:host([disabled]) {
|
|
26
|
+
${styles.dis};
|
|
27
|
+
}
|
|
28
|
+
`; }
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.addEventListener('click', () => dispatchPublic(this, 'cito-test-submit', {}));
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return html ` <slot></slot> `;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=test-submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-submit.js","sourceRoot":"","sources":["../../../src/components/test-submit/test-submit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;aACxB,WAAM,GAAG,GAAG,CAAA;;QAEtB,MAAM,CAAC,GAAG;;;;UAIR,MAAM,CAAC,cAAc;;;;QAIvB,MAAM,CAAC,SAAS;;;QAGhB,MAAM,CAAC,SAAS;;;QAGhB,MAAM,CAAC,GAAG;;GAEf,CAAC;IAEF;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,iBAAiB,CAAC;IAC/B,CAAC","sourcesContent":["import { css, html, LitElement } from 'lit';\n\nimport * as styles from '../styles';\nimport { dispatchPublic } from '../../public-events';\n\n/**\n * Scores the test: on click the test resets its outcomes to their declared defaults, runs its\n * outcome processing and dispatches `cito-test-submitted`, after which the host reads the outcomes.\n * The host decides where it sits, for example on the last item or in a review view.\n */\nexport class TestSubmit extends LitElement {\n static override styles = css`\n :host {\n ${styles.btn};\n }\n @media (hover: hover) and (pointer: fine) {\n :host(:hover:not([disabled])) {\n ${styles.btnInteractive};\n }\n }\n :host(:active:not([disabled])) {\n ${styles.btnActive};\n }\n :host(:focus-visible) {\n ${styles.focusRing};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this.addEventListener('click', () => dispatchPublic(this, 'cito-test-submit', {}));\n }\n\n override render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-submit': TestSubmit;\n }\n}\n"]}
|
package/dist/elements.d.ts
CHANGED
|
@@ -11,25 +11,15 @@ import { QtiTestFeedback } from './components/qti-test-feedback/qti-test-feedbac
|
|
|
11
11
|
import { QtiTestPart } from './components/qti-test-part/qti-test-part';
|
|
12
12
|
import { QtiTestVariables } from './components/qti-test-variables/qti-test-variables';
|
|
13
13
|
import { QtiTest } from './components/qti-test/qti-test';
|
|
14
|
-
import { TestCheckItem } from './components/test-check-item/test-check-item';
|
|
15
14
|
import { TestContainer } from './components/test-container/test-container';
|
|
16
15
|
import { TestEndAttempt } from './components/test-end-attempt/test-end-attempt';
|
|
17
16
|
import { TestItemLink } from './components/test-item-link/test-item-link';
|
|
18
|
-
import { TestItemToSpeech, TestTtsNext, TestTtsPause, TestTtsPick, TestTtsPlay, TestTtsPrev, TestTtsResume, TestTtsStop } from './components/test-item-to-speech/test-item-to-speech';
|
|
19
17
|
import { TestNavigation } from './components/test-navigation/test-navigation';
|
|
20
18
|
import { TestNext } from './components/test-next/test-next';
|
|
21
|
-
import { TestPagingButtonsStamp } from './components/test-paging-buttons-stamp/test-paging-buttons-stamp';
|
|
22
19
|
import { TestPrev } from './components/test-prev/test-prev';
|
|
23
|
-
import { TestPrintContext } from './components/test-print-context/test-print-context';
|
|
24
|
-
import { TestPrintVariables } from './components/test-print-item-variables/test-print-item-variables';
|
|
25
|
-
import { TestScoringButtons } from './components/test-scoring-buttons/test-scoring-buttons';
|
|
26
|
-
import { TestScoringFeedback } from './components/test-scoring-feedback/test-scoring-feedback';
|
|
27
|
-
import { TestSectionButtonsStamp } from './components/test-section-buttons-stamp/test-section-buttons-stamp';
|
|
28
20
|
import { TestSectionLink } from './components/test-section-link/test-section-link';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { TestViewToggle } from './components/test-view-toggle/test-view-toggle';
|
|
32
|
-
export { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiBranchRule, QtiItemSessionControl, QtiNumberPresented, QtiNumberSelected, QtiOutcomeProcessing, QtiPreCondition, QtiTest, QtiTestFeedback, QtiTestPart, QtiTestVariables, TestCheckItem, TestContainer, TestEndAttempt, TestItemLink, TestItemToSpeech, TestNavigation, TestNext, TestPagingButtonsStamp, TestPrev, TestPrintContext, TestPrintVariables, TestScoringButtons, TestScoringFeedback, TestSectionButtonsStamp, TestSectionLink, TestStamp, TestTtsNext, TestTtsPause, TestTtsPick, TestTtsPlay, TestTtsPrev, TestTtsResume, TestTtsStop, TestView, TestViewToggle };
|
|
21
|
+
export * from './plugins/elements';
|
|
22
|
+
export { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiBranchRule, QtiItemSessionControl, QtiNumberPresented, QtiNumberSelected, QtiOutcomeProcessing, QtiPreCondition, QtiTest, QtiTestFeedback, QtiTestPart, QtiTestVariables, TestContainer, TestEndAttempt, TestItemLink, TestNavigation, TestNext, TestPrev, TestSectionLink };
|
|
33
23
|
export declare const qtiTestElements: readonly [{
|
|
34
24
|
readonly tag: "qti-assessment-item-ref";
|
|
35
25
|
readonly ctor: typeof QtiAssessmentItemRef;
|
|
@@ -69,9 +59,6 @@ export declare const qtiTestElements: readonly [{
|
|
|
69
59
|
}, {
|
|
70
60
|
readonly tag: "qti-test-variables";
|
|
71
61
|
readonly ctor: typeof QtiTestVariables;
|
|
72
|
-
}, {
|
|
73
|
-
readonly tag: "test-check-item";
|
|
74
|
-
readonly ctor: typeof TestCheckItem;
|
|
75
62
|
}, {
|
|
76
63
|
readonly tag: "test-container";
|
|
77
64
|
readonly ctor: typeof TestContainer;
|
|
@@ -81,67 +68,73 @@ export declare const qtiTestElements: readonly [{
|
|
|
81
68
|
}, {
|
|
82
69
|
readonly tag: "test-item-link";
|
|
83
70
|
readonly ctor: typeof TestItemLink;
|
|
84
|
-
}, {
|
|
85
|
-
readonly tag: "test-item-to-speech";
|
|
86
|
-
readonly ctor: typeof TestItemToSpeech;
|
|
87
71
|
}, {
|
|
88
72
|
readonly tag: "test-navigation";
|
|
89
73
|
readonly ctor: typeof TestNavigation;
|
|
90
74
|
}, {
|
|
91
75
|
readonly tag: "test-next";
|
|
92
76
|
readonly ctor: typeof TestNext;
|
|
93
|
-
}, {
|
|
94
|
-
readonly tag: "test-paging-buttons-stamp";
|
|
95
|
-
readonly ctor: typeof TestPagingButtonsStamp;
|
|
96
77
|
}, {
|
|
97
78
|
readonly tag: "test-prev";
|
|
98
79
|
readonly ctor: typeof TestPrev;
|
|
80
|
+
}, {
|
|
81
|
+
readonly tag: "test-section-link";
|
|
82
|
+
readonly ctor: typeof TestSectionLink;
|
|
83
|
+
}, {
|
|
84
|
+
readonly tag: "test-check-item";
|
|
85
|
+
readonly ctor: typeof import("./elements").TestCheckItem;
|
|
86
|
+
}, {
|
|
87
|
+
readonly tag: "test-bookmark";
|
|
88
|
+
readonly ctor: typeof import("./elements").TestBookmark;
|
|
99
89
|
}, {
|
|
100
90
|
readonly tag: "test-print-context";
|
|
101
|
-
readonly ctor: typeof TestPrintContext;
|
|
91
|
+
readonly ctor: typeof import("./elements").TestPrintContext;
|
|
102
92
|
}, {
|
|
103
93
|
readonly tag: "test-print-item-variables";
|
|
104
|
-
readonly ctor: typeof TestPrintVariables;
|
|
94
|
+
readonly ctor: typeof import("./elements").TestPrintVariables;
|
|
95
|
+
}, {
|
|
96
|
+
readonly tag: "test-print-state";
|
|
97
|
+
readonly ctor: typeof import("./elements").TestPrintState;
|
|
105
98
|
}, {
|
|
106
99
|
readonly tag: "test-scoring-buttons";
|
|
107
|
-
readonly ctor: typeof TestScoringButtons;
|
|
100
|
+
readonly ctor: typeof import("./elements").TestScoringButtons;
|
|
108
101
|
}, {
|
|
109
102
|
readonly tag: "test-scoring-feedback";
|
|
110
|
-
readonly ctor: typeof TestScoringFeedback;
|
|
103
|
+
readonly ctor: typeof import("./elements").TestScoringFeedback;
|
|
111
104
|
}, {
|
|
112
|
-
readonly tag: "test-
|
|
113
|
-
readonly ctor: typeof
|
|
105
|
+
readonly tag: "test-stamp";
|
|
106
|
+
readonly ctor: typeof import("./elements").TestStamp;
|
|
114
107
|
}, {
|
|
115
|
-
readonly tag: "test-
|
|
116
|
-
readonly ctor: typeof
|
|
108
|
+
readonly tag: "test-submit";
|
|
109
|
+
readonly ctor: typeof import("./elements").TestSubmit;
|
|
117
110
|
}, {
|
|
118
|
-
readonly tag: "test-
|
|
119
|
-
readonly ctor: typeof
|
|
111
|
+
readonly tag: "test-view";
|
|
112
|
+
readonly ctor: typeof import("./elements").TestView;
|
|
113
|
+
}, {
|
|
114
|
+
readonly tag: "test-view-toggle";
|
|
115
|
+
readonly ctor: typeof import("./elements").TestViewToggle;
|
|
116
|
+
}, {
|
|
117
|
+
readonly tag: "test-item-to-speech";
|
|
118
|
+
readonly ctor: typeof import("./elements").TestItemToSpeech;
|
|
120
119
|
}, {
|
|
121
120
|
readonly tag: "test-tts-next";
|
|
122
|
-
readonly ctor: typeof TestTtsNext;
|
|
121
|
+
readonly ctor: typeof import("./elements").TestTtsNext;
|
|
123
122
|
}, {
|
|
124
123
|
readonly tag: "test-tts-pause";
|
|
125
|
-
readonly ctor: typeof TestTtsPause;
|
|
124
|
+
readonly ctor: typeof import("./elements").TestTtsPause;
|
|
126
125
|
}, {
|
|
127
126
|
readonly tag: "test-tts-pick";
|
|
128
|
-
readonly ctor: typeof TestTtsPick;
|
|
127
|
+
readonly ctor: typeof import("./elements").TestTtsPick;
|
|
129
128
|
}, {
|
|
130
129
|
readonly tag: "test-tts-play";
|
|
131
|
-
readonly ctor: typeof TestTtsPlay;
|
|
130
|
+
readonly ctor: typeof import("./elements").TestTtsPlay;
|
|
132
131
|
}, {
|
|
133
132
|
readonly tag: "test-tts-prev";
|
|
134
|
-
readonly ctor: typeof TestTtsPrev;
|
|
133
|
+
readonly ctor: typeof import("./elements").TestTtsPrev;
|
|
135
134
|
}, {
|
|
136
135
|
readonly tag: "test-tts-resume";
|
|
137
|
-
readonly ctor: typeof TestTtsResume;
|
|
136
|
+
readonly ctor: typeof import("./elements").TestTtsResume;
|
|
138
137
|
}, {
|
|
139
138
|
readonly tag: "test-tts-stop";
|
|
140
|
-
readonly ctor: typeof TestTtsStop;
|
|
141
|
-
}, {
|
|
142
|
-
readonly tag: "test-view";
|
|
143
|
-
readonly ctor: typeof TestView;
|
|
144
|
-
}, {
|
|
145
|
-
readonly tag: "test-view-toggle";
|
|
146
|
-
readonly ctor: typeof TestViewToggle;
|
|
139
|
+
readonly ctor: typeof import("./elements").TestTtsStop;
|
|
147
140
|
}];
|
package/dist/elements.js
CHANGED
|
@@ -11,25 +11,16 @@ import { QtiTestFeedback } from './components/qti-test-feedback/qti-test-feedbac
|
|
|
11
11
|
import { QtiTestPart } from './components/qti-test-part/qti-test-part';
|
|
12
12
|
import { QtiTestVariables } from './components/qti-test-variables/qti-test-variables';
|
|
13
13
|
import { QtiTest } from './components/qti-test/qti-test';
|
|
14
|
-
import { TestCheckItem } from './components/test-check-item/test-check-item';
|
|
15
14
|
import { TestContainer } from './components/test-container/test-container';
|
|
16
15
|
import { TestEndAttempt } from './components/test-end-attempt/test-end-attempt';
|
|
17
16
|
import { TestItemLink } from './components/test-item-link/test-item-link';
|
|
18
|
-
import { TestItemToSpeech, TestTtsNext, TestTtsPause, TestTtsPick, TestTtsPlay, TestTtsPrev, TestTtsResume, TestTtsStop } from './components/test-item-to-speech/test-item-to-speech';
|
|
19
17
|
import { TestNavigation } from './components/test-navigation/test-navigation';
|
|
20
18
|
import { TestNext } from './components/test-next/test-next';
|
|
21
|
-
import { TestPagingButtonsStamp } from './components/test-paging-buttons-stamp/test-paging-buttons-stamp';
|
|
22
19
|
import { TestPrev } from './components/test-prev/test-prev';
|
|
23
|
-
import { TestPrintContext } from './components/test-print-context/test-print-context';
|
|
24
|
-
import { TestPrintVariables } from './components/test-print-item-variables/test-print-item-variables';
|
|
25
|
-
import { TestScoringButtons } from './components/test-scoring-buttons/test-scoring-buttons';
|
|
26
|
-
import { TestScoringFeedback } from './components/test-scoring-feedback/test-scoring-feedback';
|
|
27
|
-
import { TestSectionButtonsStamp } from './components/test-section-buttons-stamp/test-section-buttons-stamp';
|
|
28
20
|
import { TestSectionLink } from './components/test-section-link/test-section-link';
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiBranchRule, QtiItemSessionControl, QtiNumberPresented, QtiNumberSelected, QtiOutcomeProcessing, QtiPreCondition, QtiTest, QtiTestFeedback, QtiTestPart, QtiTestVariables, TestCheckItem, TestContainer, TestEndAttempt, TestItemLink, TestItemToSpeech, TestNavigation, TestNext, TestPagingButtonsStamp, TestPrev, TestPrintContext, TestPrintVariables, TestScoringButtons, TestScoringFeedback, TestSectionButtonsStamp, TestSectionLink, TestStamp, TestTtsNext, TestTtsPause, TestTtsPick, TestTtsPlay, TestTtsPrev, TestTtsResume, TestTtsStop, TestView, TestViewToggle };
|
|
21
|
+
import { pluginElements } from './plugins/elements';
|
|
22
|
+
export * from './plugins/elements';
|
|
23
|
+
export { QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiBranchRule, QtiItemSessionControl, QtiNumberPresented, QtiNumberSelected, QtiOutcomeProcessing, QtiPreCondition, QtiTest, QtiTestFeedback, QtiTestPart, QtiTestVariables, TestContainer, TestEndAttempt, TestItemLink, TestNavigation, TestNext, TestPrev, TestSectionLink };
|
|
33
24
|
export const qtiTestElements = [
|
|
34
25
|
{ tag: 'qti-assessment-item-ref', ctor: QtiAssessmentItemRef },
|
|
35
26
|
{ tag: 'qti-assessment-section', ctor: QtiAssessmentSection },
|
|
@@ -44,30 +35,13 @@ export const qtiTestElements = [
|
|
|
44
35
|
{ tag: 'qti-test-feedback', ctor: QtiTestFeedback },
|
|
45
36
|
{ tag: 'qti-test-part', ctor: QtiTestPart },
|
|
46
37
|
{ tag: 'qti-test-variables', ctor: QtiTestVariables },
|
|
47
|
-
{ tag: 'test-check-item', ctor: TestCheckItem },
|
|
48
38
|
{ tag: 'test-container', ctor: TestContainer },
|
|
49
39
|
{ tag: 'test-end-attempt', ctor: TestEndAttempt },
|
|
50
40
|
{ tag: 'test-item-link', ctor: TestItemLink },
|
|
51
|
-
{ tag: 'test-item-to-speech', ctor: TestItemToSpeech },
|
|
52
41
|
{ tag: 'test-navigation', ctor: TestNavigation },
|
|
53
42
|
{ tag: 'test-next', ctor: TestNext },
|
|
54
|
-
{ tag: 'test-paging-buttons-stamp', ctor: TestPagingButtonsStamp },
|
|
55
43
|
{ tag: 'test-prev', ctor: TestPrev },
|
|
56
|
-
{ tag: 'test-print-context', ctor: TestPrintContext },
|
|
57
|
-
{ tag: 'test-print-item-variables', ctor: TestPrintVariables },
|
|
58
|
-
{ tag: 'test-scoring-buttons', ctor: TestScoringButtons },
|
|
59
|
-
{ tag: 'test-scoring-feedback', ctor: TestScoringFeedback },
|
|
60
|
-
{ tag: 'test-section-buttons-stamp', ctor: TestSectionButtonsStamp },
|
|
61
44
|
{ tag: 'test-section-link', ctor: TestSectionLink },
|
|
62
|
-
|
|
63
|
-
{ tag: 'test-tts-next', ctor: TestTtsNext },
|
|
64
|
-
{ tag: 'test-tts-pause', ctor: TestTtsPause },
|
|
65
|
-
{ tag: 'test-tts-pick', ctor: TestTtsPick },
|
|
66
|
-
{ tag: 'test-tts-play', ctor: TestTtsPlay },
|
|
67
|
-
{ tag: 'test-tts-prev', ctor: TestTtsPrev },
|
|
68
|
-
{ tag: 'test-tts-resume', ctor: TestTtsResume },
|
|
69
|
-
{ tag: 'test-tts-stop', ctor: TestTtsStop },
|
|
70
|
-
{ tag: 'test-view', ctor: TestView },
|
|
71
|
-
{ tag: 'test-view-toggle', ctor: TestViewToggle }
|
|
45
|
+
...pluginElements
|
|
72
46
|
];
|
|
73
47
|
//# sourceMappingURL=elements.js.map
|
package/dist/elements.js.map
CHANGED
|
@@ -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,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAA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,EAAE,wBAAwB,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC7D,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE;IACnD,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE;IAClC,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE;IACnD,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACrD,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE;IAC9C,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;IACjD,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE;IAC7C,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE;IAChD,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,eAAe,EAAE;IACnD,GAAG,cAAc;CACT,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 { QtiNumberPresented } from './components/qti-number-presented/qti-number-presented';\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 { 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 { TestNavigation } from './components/test-navigation/test-navigation';\nimport { TestNext } from './components/test-next/test-next';\nimport { TestPrev } from './components/test-prev/test-prev';\nimport { TestSectionLink } from './components/test-section-link/test-section-link';\nimport { pluginElements } from './plugins/elements';\n\nexport * from './plugins/elements';\n\nexport {\n QtiAssessmentItemRef,\n QtiAssessmentSection,\n QtiAssessmentTest,\n QtiBranchRule,\n QtiItemSessionControl,\n QtiNumberPresented,\n QtiNumberSelected,\n QtiOutcomeProcessing,\n QtiPreCondition,\n QtiTest,\n QtiTestFeedback,\n QtiTestPart,\n QtiTestVariables,\n TestContainer,\n TestEndAttempt,\n TestItemLink,\n TestNavigation,\n TestNext,\n TestPrev,\n TestSectionLink\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-presented', ctor: QtiNumberPresented },\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-container', ctor: TestContainer },\n { tag: 'test-end-attempt', ctor: TestEndAttempt },\n { tag: 'test-item-link', ctor: TestItemLink },\n { tag: 'test-navigation', ctor: TestNavigation },\n { tag: 'test-next', ctor: TestNext },\n { tag: 'test-prev', ctor: TestPrev },\n { tag: 'test-section-link', ctor: TestSectionLink },\n ...pluginElements\n] as const;\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC","sourcesContent":["import './register.js';\n\nexport * from './components/index.js';\nexport * from './types/iqti-test.js';\nexport * from './types/qti-test-state.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC","sourcesContent":["import './register.js';\n\nexport * from './components/index.js';\nexport * from './plugins/index.js';\nexport * from './plugin-state.js';\nexport * from './types/iqti-test.js';\nexport * from './types/qti-test-state.js';\n"]}
|
|
@@ -288,13 +288,15 @@ export const TestNavigationMixin = (superClass) => {
|
|
|
288
288
|
async _navigateToSection(sectionId, navigationId, controller) {
|
|
289
289
|
const sectionEl = this._findSection(sectionId);
|
|
290
290
|
const navPartId = sectionEl?.closest('qti-test-part')?.identifier;
|
|
291
|
+
const itemIds = this._getSectionItemIds(sectionId);
|
|
291
292
|
this.sessionContext = {
|
|
292
293
|
...this.sessionContext,
|
|
293
294
|
navPartId,
|
|
294
295
|
navSectionId: sectionId,
|
|
295
|
-
|
|
296
|
+
// with navigate="item", the section's first item is the current position, so test-next/test-prev
|
|
297
|
+
// and item highlights have an item to work from
|
|
298
|
+
navItemRefId: this.navigate === 'item' ? (itemIds[0] ?? null) : null
|
|
296
299
|
};
|
|
297
|
-
const itemIds = this._getSectionItemIds(sectionId);
|
|
298
300
|
this._resetLoadingState();
|
|
299
301
|
this._loadingState.expectedItems = itemIds.length;
|
|
300
302
|
await this._loadItems(itemIds, navigationId, controller);
|