@citolab/qti-components 10.0.0-next.21 → 10.0.0-next.22

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/base.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as ComputedItemContext } from './session.context.d-9gRdGK4T.js';
2
2
  export { I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './session.context.d-9gRdGK4T.js';
3
- import { C as ComputedContext } from './computed.types.d-6Ht-HNRx.js';
4
- export { a as ComputedItem, S as SessionControl } from './computed.types.d-6Ht-HNRx.js';
3
+ import { C as ComputedContext } from './computed.types.d-6qQNFbu1.js';
4
+ export { a as ComputedItem, S as SessionControl } from './computed.types.d-6qQNFbu1.js';
5
5
  export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-Dm11aAuw.js';
6
6
  export { C as ChoiceRole, I as Interaction, a as InteractionContext, R as RecordFieldValues, b as RecordValue, V as ValidityKind, c as ValidityTrigger, i as inferRecordFieldBaseType, d as interactionContext, e as isRecordValue, r as readRecordFieldValues } from './record.d-N1Bq7e1f.js';
7
7
  import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
@@ -1303,12 +1303,6 @@ __decorate2([
1303
1303
  __decorate2([
1304
1304
  property2({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
1305
1305
  ], QtiAssessmentSection.prototype, "keepTogether", void 0);
1306
- __decorate2([
1307
- property2({ type: String, attribute: "navigation-mode" })
1308
- ], QtiAssessmentSection.prototype, "navigationMode", void 0);
1309
- __decorate2([
1310
- property2({ type: String, attribute: "submission-mode" })
1311
- ], QtiAssessmentSection.prototype, "submissionMode", void 0);
1312
1306
  __decorate2([
1313
1307
  consume2({ context: testContext, subscribe: true })
1314
1308
  ], QtiAssessmentSection.prototype, "_testContext", void 0);
@@ -2179,10 +2173,7 @@ var TestNavigationMixin = (superClass) => {
2179
2173
  const currentItemRef = this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${currentItemId}"]`);
2180
2174
  if (!currentItemRef)
2181
2175
  return false;
2182
- const section = currentItemRef.closest("qti-assessment-section");
2183
- const testPart = currentItemRef.closest("qti-test-part");
2184
- const navigationMode = section?.navigationMode || section?.getAttribute("navigation-mode") || testPart?.navigationMode || testPart?.getAttribute("navigation-mode") || "nonlinear";
2185
- if (navigationMode !== "linear")
2176
+ if (currentItemRef.closest("qti-test-part")?.getAttribute("navigation-mode") !== "linear")
2186
2177
  return false;
2187
2178
  const allItemRefs = Array.from(this._testElement?.querySelectorAll("qti-assessment-item-ref") || []);
2188
2179
  const currentIndex = allItemRefs.findIndex((ref) => ref.identifier === currentItemId);
@@ -3519,8 +3510,6 @@ var TestNavigation = class extends LitElement13 {
3519
3510
  active: false,
3520
3511
  identifier: section.identifier,
3521
3512
  title: section.title,
3522
- // QTI defines both modes on the test part only; the section attributes go in roadmap T1d.
3523
- ...this.#sectionModes(section.identifier),
3524
3513
  allowSkipping: section.sessionControl.allowSkipping,
3525
3514
  items: ownItemRefs(section).map((item) => ({
3526
3515
  ...this.initContext?.find((i) => i.identifier === item.identifier),
@@ -3550,14 +3539,6 @@ var TestNavigation = class extends LitElement13 {
3550
3539
  item.categories.includes(this.configContext?.infoItemCategory) ? null : index++
3551
3540
  ]));
3552
3541
  }
3553
- /** The non-QTI `navigation-mode` / `submission-mode` a section declares, as before; removed in T1d. */
3554
- #sectionModes(identifier) {
3555
- const section = this.#testElement.querySelector(`qti-assessment-section[identifier="${CSS.escape(identifier)}"]`);
3556
- return {
3557
- navigationMode: section?.getAttribute("navigation-mode") ?? void 0,
3558
- submissionMode: section?.getAttribute("submission-mode") ?? void 0
3559
- };
3560
- }
3561
3542
  /**
3562
3543
  * Extract default values from a qti-context-declaration element
3563
3544
  */
@@ -3729,7 +3710,7 @@ var TestNavigation = class extends LitElement13 {
3729
3710
  #lockUsedItems() {
3730
3711
  if (!this.#testElement || !this.computedContext)
3731
3712
  return;
3732
- const items = new Map(this.computedContext.testParts.flatMap((part) => part.sections.flatMap((section) => (section.submissionMode || part.submissionMode) === "simultaneous" ? [] : section.items.map((item) => [item.identifier, item]))));
3713
+ const items = new Map(this.computedContext.testParts.flatMap((part) => part.submissionMode === "simultaneous" ? [] : part.sections.flatMap((section) => section.items.map((item) => [item.identifier, item]))));
3733
3714
  for (const itemRef of this.#testElement.querySelectorAll("qti-assessment-item-ref")) {
3734
3715
  const element = itemRef.assessmentItem;
3735
3716
  if (!element)
@@ -3921,11 +3902,8 @@ var TestNext = class extends LitElement14 {
3921
3902
  const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
3922
3903
  if (!testPart)
3923
3904
  return;
3924
- const activeSection = testPart.sections.find((s) => s.active);
3925
- const navigationMode = activeSection?.navigationMode || testPart.navigationMode;
3926
- const submissionMode = activeSection?.submissionMode || testPart.submissionMode;
3927
3905
  const activeItem = this.sectionItems[this.itemIndex];
3928
- const isLinearIndividual = navigationMode === "linear" && submissionMode === "individual";
3906
+ const isLinearIndividual = testPart.navigationMode === "linear" && testPart.submissionMode === "individual";
3929
3907
  this._internalDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= (this.sectionItems?.length ?? 0) - 1 || isLinearIndividual && !activeItem?.done;
3930
3908
  }
3931
3909
  _requestItem(identifier) {
@@ -3985,8 +3963,7 @@ var TestPrev = class extends LitElement15 {
3985
3963
  }
3986
3964
  checkDisabled() {
3987
3965
  const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
3988
- const activeSection = testPart?.sections.find((s) => s.active);
3989
- const navigationMode = activeSection?.navigationMode || testPart?.navigationMode || "nonlinear";
3966
+ const navigationMode = testPart?.navigationMode ?? "nonlinear";
3990
3967
  this._internalDisabled = navigationMode === "linear" || !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
3991
3968
  }
3992
3969
  _requestItem(identifier) {
@@ -4085,4 +4062,4 @@ export {
4085
4062
  * Portions Copyright (c) 2013, the Dart project authors.
4086
4063
  *)
4087
4064
  */
4088
- //# sourceMappingURL=chunk-TB2OI3ED.js.map
4065
+ //# sourceMappingURL=chunk-373IRT4X.js.map