@citolab/qti-components 8.0.0 → 8.0.1

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.
Files changed (53) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +591 -217
  3. package/dist/base.d.ts +135 -9
  4. package/dist/{chunk-MJVPNN7W.js → chunk-3AJOQCDU.js} +2 -2
  5. package/dist/chunk-7HC5SMCU.js +102 -0
  6. package/dist/chunk-7HC5SMCU.js.map +1 -0
  7. package/dist/{chunk-MGF5F3S2.js → chunk-CAO4JRLY.js} +2 -2
  8. package/dist/{chunk-5SJS36BI.js → chunk-F4BNJWYN.js} +1 -1
  9. package/dist/{chunk-5SJS36BI.js.map → chunk-F4BNJWYN.js.map} +1 -1
  10. package/dist/{chunk-5QYII4OZ.js → chunk-LVBIQDPM.js} +2 -2
  11. package/dist/{chunk-W4QZPCNC.js → chunk-QECOPVPO.js} +2 -2
  12. package/dist/{chunk-LZJHHZQ2.js → chunk-RXGDQDOV.js} +177 -173
  13. package/dist/chunk-RXGDQDOV.js.map +1 -0
  14. package/dist/{chunk-KYEZRYO6.js → chunk-XU7HNT4F.js} +4 -4
  15. package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
  16. package/dist/computed.types.d-rKLSPvVG.d.ts +42 -0
  17. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  18. package/dist/corrections.d.ts +432 -1
  19. package/dist/corrections.js +5 -5
  20. package/dist/elements.d.ts +393 -1
  21. package/dist/index.d.ts +58 -9
  22. package/dist/index.js +16 -8
  23. package/dist/interaction.d-D4MstYRz.d.ts +115 -0
  24. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  25. package/dist/interactions.d.ts +1569 -1
  26. package/dist/interactions.js +2 -2
  27. package/dist/item.css +588 -214
  28. package/dist/item.d.ts +92 -1
  29. package/dist/item.js +3 -3
  30. package/dist/item.types.d-QU7LljEK.d.ts +82 -0
  31. package/dist/loader.d.ts +22 -1
  32. package/dist/processing.d.ts +730 -1
  33. package/dist/qti-components-jsx.d.ts +221 -231
  34. package/dist/qti-components-jsx.js +1 -0
  35. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  36. package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
  37. package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
  38. package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
  39. package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
  40. package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
  41. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  42. package/dist/test.d.ts +699 -1
  43. package/dist/test.js +11 -3
  44. package/dist/transformers.d.ts +18 -1
  45. package/package.json +11 -8
  46. package/dist/chunk-LZJHHZQ2.js.map +0 -1
  47. package/dist/chunk-WCQ26LV7.js +0 -102
  48. package/dist/chunk-WCQ26LV7.js.map +0 -1
  49. /package/dist/{chunk-MJVPNN7W.js.map → chunk-3AJOQCDU.js.map} +0 -0
  50. /package/dist/{chunk-MGF5F3S2.js.map → chunk-CAO4JRLY.js.map} +0 -0
  51. /package/dist/{chunk-5QYII4OZ.js.map → chunk-LVBIQDPM.js.map} +0 -0
  52. /package/dist/{chunk-W4QZPCNC.js.map → chunk-QECOPVPO.js.map} +0 -0
  53. /package/dist/{chunk-KYEZRYO6.js.map → chunk-XU7HNT4F.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  item_default,
6
6
  m
7
- } from "./chunk-WCQ26LV7.js";
7
+ } from "./chunk-7HC5SMCU.js";
8
8
  import {
9
9
  watch
10
10
  } from "./chunk-64XSIBGO.js";
@@ -189,6 +189,34 @@ __decorate3([
189
189
  c({ context: testContext, subscribe: true })
190
190
  ], QtiAssessmentTest.prototype, "_testContext", void 0);
191
191
 
192
+ // ../qti-test/dist/components/qti-outcome-processing/qti-outcome-processing.js
193
+ var QtiOutcomeProcessing = class extends i2 {
194
+ static {
195
+ this.styles = [
196
+ i`
197
+ :host {
198
+ display: none;
199
+ }
200
+ `
201
+ ];
202
+ }
203
+ render() {
204
+ return T`<slot></slot>`;
205
+ }
206
+ process() {
207
+ const logic = new QtiOutcomeProcessingProcessor();
208
+ const rules = [...this.children];
209
+ logic.process(rules);
210
+ }
211
+ };
212
+ var QtiOutcomeProcessingProcessor = class {
213
+ process(rules) {
214
+ for (const rule of rules) {
215
+ rule.process();
216
+ }
217
+ }
218
+ };
219
+
192
220
  // ../qti-test/dist/components/qti-test-feedback/qti-test-feedback.js
193
221
  var QtiTestFeedback = class extends QtiModalFeedback {
194
222
  static {
@@ -253,13 +281,85 @@ __decorate4([
253
281
  n2({ type: String, attribute: "submission-mode" })
254
282
  ], QtiTestPart.prototype, "submissionMode", void 0);
255
283
 
256
- // ../qti-test/dist/mixins/test-navigation.mixin.js
284
+ // ../qti-test/dist/components/qti-test-variables/qti-test-variables.js
257
285
  var __decorate5 = function(decorators, target, key, desc) {
258
286
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
259
287
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
260
288
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
261
289
  return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
262
290
  };
291
+ var QtiTestVariables = class extends QtiExpression {
292
+ #testElement;
293
+ constructor() {
294
+ super();
295
+ this.addEventListener("qti-assessment-test-connected", (e2) => this.#testElement = e2.detail);
296
+ }
297
+ getResult() {
298
+ const includedCategories = this.getAttribute("include-category")?.split(" ") ?? [];
299
+ const excludedCategories = this.getAttribute("exclude-category")?.split(" ") ?? [];
300
+ const weightIdentifier = this.getAttribute("weight-identifier") ?? "";
301
+ const itemVariable = this.getAttribute("variable-identifier");
302
+ const itemRefEls = Array.from(this.#testElement.querySelectorAll(`qti-asssessment-test qti-assessment-item-ref`));
303
+ const includedItems = itemRefEls.filter((itemRef) => {
304
+ let include = true;
305
+ if (includedCategories.length > 0) {
306
+ include = includedCategories.includes(itemRef.category);
307
+ }
308
+ if (excludedCategories.length > 0) {
309
+ include = !excludedCategories.includes(itemRef.category);
310
+ }
311
+ return include;
312
+ }).map((itemRef) => {
313
+ let weight = 1;
314
+ if (weightIdentifier) {
315
+ const weightVariable = itemRef.weigths.get(weightIdentifier);
316
+ if (weightVariable !== null && weightVariable !== void 0) {
317
+ weight = weightVariable;
318
+ }
319
+ }
320
+ return { item: itemRef.identifier, weight };
321
+ });
322
+ const logic = new QtiTestVariablesExpression(this._testContext, itemVariable, includedItems);
323
+ const value = logic.calculate();
324
+ return value;
325
+ }
326
+ calculate() {
327
+ return this.getResult();
328
+ }
329
+ };
330
+ __decorate5([
331
+ c({ context: testContext, subscribe: true })
332
+ ], QtiTestVariables.prototype, "_testContext", void 0);
333
+ var QtiTestVariablesExpression = class {
334
+ constructor(testContext2, itemVariable, includedItems) {
335
+ this.testContext = testContext2;
336
+ this.itemVariable = itemVariable;
337
+ this.includedItems = includedItems;
338
+ }
339
+ calculate() {
340
+ const { items } = this.testContext;
341
+ let total = 0;
342
+ const uniqueItems = [...new Set(this.includedItems.map((item) => item.item))];
343
+ items.forEach((item) => {
344
+ if (uniqueItems.includes(item.identifier)) {
345
+ const variable = item.variables.find((vr) => vr.identifier === this.itemVariable);
346
+ const weight = this.includedItems.find((i4) => i4.item === item.identifier)?.weight ?? 1;
347
+ if (variable) {
348
+ total += Number(variable.value) * weight;
349
+ }
350
+ }
351
+ });
352
+ return total;
353
+ }
354
+ };
355
+
356
+ // ../qti-test/dist/mixins/test-navigation.mixin.js
357
+ var __decorate6 = function(decorators, target, key, desc) {
358
+ var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
359
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
360
+ else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
361
+ return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
362
+ };
263
363
  var TestNavigationMixin = (superClass) => {
264
364
  class TestNavigationClass extends superClass {
265
365
  constructor(...args) {
@@ -704,16 +804,16 @@ var TestNavigationMixin = (superClass) => {
704
804
  });
705
805
  }
706
806
  }
707
- __decorate5([
807
+ __decorate6([
708
808
  n2({ type: String })
709
809
  ], TestNavigationClass.prototype, "navigate", void 0);
710
- __decorate5([
810
+ __decorate6([
711
811
  n2({ type: Number })
712
812
  ], TestNavigationClass.prototype, "requestTimeout", void 0);
713
- __decorate5([
813
+ __decorate6([
714
814
  n2({ attribute: false })
715
815
  ], TestNavigationClass.prototype, "postLoadTransformCallback", void 0);
716
- __decorate5([
816
+ __decorate6([
717
817
  n2({ attribute: false })
718
818
  ], TestNavigationClass.prototype, "postLoadTestTransformCallback", void 0);
719
819
  return TestNavigationClass;
@@ -768,7 +868,7 @@ var TestViewMixin = (superClass) => {
768
868
  };
769
869
 
770
870
  // ../qti-test/dist/mixins/test-base.js
771
- var __decorate6 = function(decorators, target, key, desc) {
871
+ var __decorate7 = function(decorators, target, key, desc) {
772
872
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
773
873
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
774
874
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -876,11 +976,11 @@ var TestBaseMixin = (superClass) => {
876
976
  this.dispatchEvent(new CustomEvent("qti-test-context-updated", { detail: this.testContext, bubbles: false, composed: false }));
877
977
  }
878
978
  }
879
- __decorate6([
979
+ __decorate7([
880
980
  n2({ attribute: false, type: Object }),
881
981
  e({ context: testContext })
882
982
  ], TestBaseClass.prototype, "testContext", void 0);
883
- __decorate6([
983
+ __decorate7([
884
984
  n2({ attribute: false, type: Object }),
885
985
  e({ context: sessionContext })
886
986
  ], TestBaseClass.prototype, "sessionContext", void 0);
@@ -945,7 +1045,7 @@ var TestProcessingMixin = (superClass) => {
945
1045
  };
946
1046
 
947
1047
  // ../qti-test/dist/components/qti-test/qti-test.js
948
- var __decorate7 = function(decorators, target, key, desc) {
1048
+ var __decorate8 = function(decorators, target, key, desc) {
949
1049
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
950
1050
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
951
1051
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -969,7 +1069,7 @@ var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixi
969
1069
  return T`<slot></slot>`;
970
1070
  }
971
1071
  };
972
- __decorate7([
1072
+ __decorate8([
973
1073
  r(),
974
1074
  e({ context: configContext })
975
1075
  ], QtiTest.prototype, "configContext", void 0);
@@ -1026,7 +1126,7 @@ var TestCheckItem = class extends i2 {
1026
1126
  };
1027
1127
 
1028
1128
  // ../qti-test/dist/components/test-container/test-container.js
1029
- var __decorate8 = function(decorators, target, key, desc) {
1129
+ var __decorate9 = function(decorators, target, key, desc) {
1030
1130
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1031
1131
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1032
1132
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -1115,26 +1215,26 @@ var TestContainer = class extends i2 {
1115
1215
  `;
1116
1216
  }
1117
1217
  };
1118
- __decorate8([
1218
+ __decorate9([
1119
1219
  n2({ attribute: false })
1120
1220
  ], TestContainer.prototype, "customElementRegistry", void 0);
1121
- __decorate8([
1221
+ __decorate9([
1122
1222
  n2({ type: String, attribute: "test-url" })
1123
1223
  ], TestContainer.prototype, "testURL", void 0);
1124
- __decorate8([
1224
+ __decorate9([
1125
1225
  r()
1126
1226
  ], TestContainer.prototype, "testDoc", void 0);
1127
- __decorate8([
1227
+ __decorate9([
1128
1228
  r()
1129
1229
  ], TestContainer.prototype, "testXML", void 0);
1130
- __decorate8([
1230
+ __decorate9([
1131
1231
  r(),
1132
1232
  c({ context: qtiContext, subscribe: true })
1133
1233
  ], TestContainer.prototype, "qtiContext", void 0);
1134
- __decorate8([
1234
+ __decorate9([
1135
1235
  watch("testURL", { waitUntilFirstUpdate: true })
1136
1236
  ], TestContainer.prototype, "handleTestURLChange", null);
1137
- __decorate8([
1237
+ __decorate9([
1138
1238
  watch("testXML", { waitUntilFirstUpdate: true })
1139
1239
  ], TestContainer.prototype, "handleTestXMLChange", null);
1140
1240
 
@@ -1160,7 +1260,7 @@ var TestEndAttempt = class extends i2 {
1160
1260
  };
1161
1261
 
1162
1262
  // ../qti-test/dist/components/test-item-link/test-item-link.js
1163
- var __decorate9 = function(decorators, target, key, desc) {
1263
+ var __decorate10 = function(decorators, target, key, desc) {
1164
1264
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1165
1265
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1166
1266
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -1196,12 +1296,12 @@ var TestItemLink = class extends i2 {
1196
1296
  return T` <slot></slot> `;
1197
1297
  }
1198
1298
  };
1199
- __decorate9([
1299
+ __decorate10([
1200
1300
  n2({ type: String, attribute: "item-id" })
1201
1301
  ], TestItemLink.prototype, "itemId", void 0);
1202
1302
 
1203
1303
  // ../qti-test/dist/components/test-item-to-speech/test-item-to-speech.js
1204
- var __decorate10 = function(decorators, target, key, desc) {
1304
+ var __decorate11 = function(decorators, target, key, desc) {
1205
1305
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1206
1306
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1207
1307
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -1245,7 +1345,7 @@ var TtsButtonBase = class extends i2 {
1245
1345
  }
1246
1346
  }
1247
1347
  };
1248
- __decorate10([
1348
+ __decorate11([
1249
1349
  c({ context: ttsContext, subscribe: true })
1250
1350
  ], TtsButtonBase.prototype, "_tts", void 0);
1251
1351
  var TestItemToSpeech = class extends i2 {
@@ -1544,13 +1644,13 @@ var TestItemToSpeech = class extends i2 {
1544
1644
  }
1545
1645
  }
1546
1646
  };
1547
- __decorate10([
1647
+ __decorate11([
1548
1648
  n2({ type: String })
1549
1649
  ], TestItemToSpeech.prototype, "language", void 0);
1550
- __decorate10([
1650
+ __decorate11([
1551
1651
  c({ context: sessionContext, subscribe: true })
1552
1652
  ], TestItemToSpeech.prototype, "_sessionContext", void 0);
1553
- __decorate10([
1653
+ __decorate11([
1554
1654
  r(),
1555
1655
  e({ context: ttsContext })
1556
1656
  ], TestItemToSpeech.prototype, "_ttsContext", void 0);
@@ -1625,7 +1725,7 @@ var TestTtsNext = class extends TtsButtonBase {
1625
1725
  };
1626
1726
 
1627
1727
  // ../qti-test/dist/components/test-navigation/test-navigation.js
1628
- var __decorate11 = function(decorators, target, key, desc) {
1728
+ var __decorate12 = function(decorators, target, key, desc) {
1629
1729
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1630
1730
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1631
1731
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -1892,38 +1992,38 @@ var TestNavigation = class extends i2 {
1892
1992
  }));
1893
1993
  }
1894
1994
  };
1895
- __decorate11([
1995
+ __decorate12([
1896
1996
  n2({ type: String })
1897
1997
  ], TestNavigation.prototype, "identifier", void 0);
1898
- __decorate11([
1998
+ __decorate12([
1899
1999
  r()
1900
2000
  ], TestNavigation.prototype, "initContext", void 0);
1901
- __decorate11([
2001
+ __decorate12([
1902
2002
  r(),
1903
2003
  e({ context: qtiContext })
1904
2004
  ], TestNavigation.prototype, "qtiContext", void 0);
1905
- __decorate11([
2005
+ __decorate12([
1906
2006
  r(),
1907
2007
  c({ context: configContext, subscribe: true })
1908
2008
  ], TestNavigation.prototype, "configContext", void 0);
1909
- __decorate11([
2009
+ __decorate12([
1910
2010
  r(),
1911
2011
  c({ context: testContext, subscribe: true })
1912
2012
  ], TestNavigation.prototype, "_testContext", void 0);
1913
- __decorate11([
2013
+ __decorate12([
1914
2014
  r(),
1915
2015
  c({ context: sessionContext, subscribe: true })
1916
2016
  ], TestNavigation.prototype, "_sessionContext", void 0);
1917
- __decorate11([
2017
+ __decorate12([
1918
2018
  r(),
1919
2019
  e({ context: computedContext })
1920
2020
  ], TestNavigation.prototype, "computedContext", void 0);
1921
- __decorate11([
2021
+ __decorate12([
1922
2022
  n2({ type: Boolean, attribute: "auto-score-items" })
1923
2023
  ], TestNavigation.prototype, "autoScoreItems", void 0);
1924
2024
 
1925
2025
  // ../qti-test/dist/components/test-next/test-next.js
1926
- var __decorate12 = function(decorators, target, key, desc) {
2026
+ var __decorate13 = function(decorators, target, key, desc) {
1927
2027
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1928
2028
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1929
2029
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -1989,13 +2089,13 @@ var TestNext = class extends i2 {
1989
2089
  return T`<slot></slot>`;
1990
2090
  }
1991
2091
  };
1992
- __decorate12([
2092
+ __decorate13([
1993
2093
  n2({ type: Boolean, reflect: true, attribute: "disabled" })
1994
2094
  ], TestNext.prototype, "_internalDisabled", void 0);
1995
- __decorate12([
2095
+ __decorate13([
1996
2096
  c({ context: computedContext, subscribe: true })
1997
2097
  ], TestNext.prototype, "computedContext", void 0);
1998
- __decorate12([
2098
+ __decorate13([
1999
2099
  watch("computedContext")
2000
2100
  ], TestNext.prototype, "_handleTestElementChange", null);
2001
2101
 
@@ -3083,7 +3183,7 @@ var makeLitTemplate = (template) => {
3083
3183
  };
3084
3184
 
3085
3185
  // ../qti-test/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js
3086
- var __decorate13 = function(decorators, target, key, desc) {
3186
+ var __decorate14 = function(decorators, target, key, desc) {
3087
3187
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3088
3188
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3089
3189
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3111,12 +3211,12 @@ var TestPagingButtonsStamp = class extends i2 {
3111
3211
  return T` ${items.map((item) => this.myTemplate({ item, view: this.computedContext.view }))} `;
3112
3212
  }
3113
3213
  };
3114
- __decorate13([
3214
+ __decorate14([
3115
3215
  c({ context: computedContext, subscribe: true })
3116
3216
  ], TestPagingButtonsStamp.prototype, "computedContext", void 0);
3117
3217
 
3118
3218
  // ../qti-test/dist/components/test-prev/test-prev.js
3119
- var __decorate14 = function(decorators, target, key, desc) {
3219
+ var __decorate15 = function(decorators, target, key, desc) {
3120
3220
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3121
3221
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3122
3222
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3174,18 +3274,18 @@ var TestPrev = class extends i2 {
3174
3274
  return T`<slot></slot>`;
3175
3275
  }
3176
3276
  };
3177
- __decorate14([
3277
+ __decorate15([
3178
3278
  n2({ type: Boolean, reflect: true, attribute: "disabled" })
3179
3279
  ], TestPrev.prototype, "_internalDisabled", void 0);
3180
- __decorate14([
3280
+ __decorate15([
3181
3281
  c({ context: computedContext, subscribe: true })
3182
3282
  ], TestPrev.prototype, "computedContext", void 0);
3183
- __decorate14([
3283
+ __decorate15([
3184
3284
  watch("computedContext")
3185
3285
  ], TestPrev.prototype, "_handleTestElementChange", null);
3186
3286
 
3187
3287
  // ../qti-test/dist/components/test-print-context/test-print-context.js
3188
- var __decorate15 = function(decorators, target, key, desc) {
3288
+ var __decorate16 = function(decorators, target, key, desc) {
3189
3289
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3190
3290
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3191
3291
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3196,13 +3296,13 @@ var TestPrintContext = class extends i2 {
3196
3296
  return T` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
3197
3297
  }
3198
3298
  };
3199
- __decorate15([
3299
+ __decorate16([
3200
3300
  r(),
3201
3301
  c({ context: computedContext, subscribe: true })
3202
3302
  ], TestPrintContext.prototype, "computedContext", void 0);
3203
3303
 
3204
3304
  // ../qti-test/dist/components/test-print-item-variables/test-print-item-variables.js
3205
- var __decorate16 = function(decorators, target, key, desc) {
3305
+ var __decorate17 = function(decorators, target, key, desc) {
3206
3306
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3207
3307
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3208
3308
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3274,12 +3374,12 @@ var TestPrintVariables = class extends i2 {
3274
3374
  `;
3275
3375
  }
3276
3376
  };
3277
- __decorate16([
3377
+ __decorate17([
3278
3378
  c({ context: computedContext, subscribe: true })
3279
3379
  ], TestPrintVariables.prototype, "computedContext", void 0);
3280
3380
 
3281
3381
  // ../qti-test/dist/components/test-scoring-buttons/test-scoring-buttons.js
3282
- var __decorate17 = function(decorators, target, key, desc) {
3382
+ var __decorate18 = function(decorators, target, key, desc) {
3283
3383
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3284
3384
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3285
3385
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3338,18 +3438,18 @@ var TestScoringButtons = class extends i2 {
3338
3438
  });
3339
3439
  }
3340
3440
  };
3341
- __decorate17([
3441
+ __decorate18([
3342
3442
  n2({ type: String, attribute: "view" })
3343
3443
  ], TestScoringButtons.prototype, "view", void 0);
3344
- __decorate17([
3444
+ __decorate18([
3345
3445
  n2({ type: Boolean })
3346
3446
  ], TestScoringButtons.prototype, "disabled", void 0);
3347
- __decorate17([
3447
+ __decorate18([
3348
3448
  c({ context: computedContext, subscribe: true })
3349
3449
  ], TestScoringButtons.prototype, "computedContext", void 0);
3350
3450
 
3351
3451
  // ../qti-test/dist/components/test-scoring-feedback/test-scoring-feedback.js
3352
- var __decorate18 = function(decorators, target, key, desc) {
3452
+ var __decorate19 = function(decorators, target, key, desc) {
3353
3453
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3354
3454
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3355
3455
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3388,15 +3488,15 @@ var TestScoringFeedback = class extends i2 {
3388
3488
  return T`<div>${feedbackText()}</div>`;
3389
3489
  }
3390
3490
  };
3391
- __decorate18([
3491
+ __decorate19([
3392
3492
  c({ context: computedContext, subscribe: true })
3393
3493
  ], TestScoringFeedback.prototype, "computedContext", void 0);
3394
- __decorate18([
3494
+ __decorate19([
3395
3495
  n2({ type: String, attribute: "view" })
3396
3496
  ], TestScoringFeedback.prototype, "view", void 0);
3397
3497
 
3398
3498
  // ../qti-test/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js
3399
- var __decorate19 = function(decorators, target, key, desc) {
3499
+ var __decorate20 = function(decorators, target, key, desc) {
3400
3500
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3401
3501
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3402
3502
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3424,12 +3524,12 @@ var TestSectionButtonsStamp = class extends i2 {
3424
3524
  return T` ${sections.map((item) => this.myTemplate({ item }))} `;
3425
3525
  }
3426
3526
  };
3427
- __decorate19([
3527
+ __decorate20([
3428
3528
  c({ context: computedContext, subscribe: true })
3429
3529
  ], TestSectionButtonsStamp.prototype, "computedContext", void 0);
3430
3530
 
3431
3531
  // ../qti-test/dist/components/test-section-link/test-section-link.js
3432
- var __decorate20 = function(decorators, target, key, desc) {
3532
+ var __decorate21 = function(decorators, target, key, desc) {
3433
3533
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3434
3534
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3435
3535
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3465,12 +3565,12 @@ var TestSectionLink = class extends i2 {
3465
3565
  return T` <slot></slot> `;
3466
3566
  }
3467
3567
  };
3468
- __decorate20([
3568
+ __decorate21([
3469
3569
  n2({ type: String, attribute: "section-id" })
3470
3570
  ], TestSectionLink.prototype, "sectionId", void 0);
3471
3571
 
3472
3572
  // ../qti-test/dist/components/test-stamp/test-stamp.js
3473
- var __decorate21 = function(decorators, target, key, desc) {
3573
+ var __decorate22 = function(decorators, target, key, desc) {
3474
3574
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3475
3575
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3476
3576
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3543,19 +3643,19 @@ var TestStamp = class extends i2 {
3543
3643
  ${this.myTemplate ? this.myTemplate(this.stampContext) : A}`;
3544
3644
  }
3545
3645
  };
3546
- __decorate21([
3646
+ __decorate22([
3547
3647
  n2({ type: Boolean, reflect: true })
3548
3648
  ], TestStamp.prototype, "debug", void 0);
3549
- __decorate21([
3649
+ __decorate22([
3550
3650
  r(),
3551
3651
  c({ context: computedContext, subscribe: true })
3552
3652
  ], TestStamp.prototype, "computedContext", void 0);
3553
- __decorate21([
3653
+ __decorate22([
3554
3654
  r()
3555
3655
  ], TestStamp.prototype, "stampContext", void 0);
3556
3656
 
3557
3657
  // ../qti-test/dist/components/test-view-toggle/test-view.js
3558
- var __decorate22 = function(decorators, target, key, desc) {
3658
+ var __decorate23 = function(decorators, target, key, desc) {
3559
3659
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3560
3660
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3561
3661
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3610,24 +3710,24 @@ var TestView = class extends i2 {
3610
3710
  }
3611
3711
  };
3612
3712
  _a = TestView;
3613
- __decorate22([
3713
+ __decorate23([
3614
3714
  c({ context: sessionContext, subscribe: true })
3615
3715
  ], TestView.prototype, "sessionContext", void 0);
3616
- __decorate22([
3716
+ __decorate23([
3617
3717
  n2({ type: String })
3618
3718
  ], TestView.prototype, "label", void 0);
3619
- __decorate22([
3719
+ __decorate23([
3620
3720
  n2({ type: String, attribute: "view-options" })
3621
3721
  ], TestView.prototype, "viewOptions", void 0);
3622
- __decorate22([
3722
+ __decorate23([
3623
3723
  watch("viewOptions", { waitUntilFirstUpdate: true })
3624
3724
  ], TestView.prototype, "_handleViewOptionsChange", void 0);
3625
- __decorate22([
3725
+ __decorate23([
3626
3726
  r()
3627
3727
  ], TestView.prototype, "_viewOptions", void 0);
3628
3728
 
3629
3729
  // ../qti-test/dist/components/test-view-toggle/test-view-toggle.js
3630
- var __decorate23 = function(decorators, target, key, desc) {
3730
+ var __decorate24 = function(decorators, target, key, desc) {
3631
3731
  var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3632
3732
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3633
3733
  else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
@@ -3668,110 +3768,10 @@ var TestViewToggle = class extends i2 {
3668
3768
  }) : A}`;
3669
3769
  }
3670
3770
  };
3671
- __decorate23([
3771
+ __decorate24([
3672
3772
  c({ context: sessionContext, subscribe: true })
3673
3773
  ], TestViewToggle.prototype, "sessionContext", void 0);
3674
3774
 
3675
- // ../qti-test/dist/components/qti-outcome-processing/qti-outcome-processing.js
3676
- var QtiOutcomeProcessing = class extends i2 {
3677
- static {
3678
- this.styles = [
3679
- i`
3680
- :host {
3681
- display: none;
3682
- }
3683
- `
3684
- ];
3685
- }
3686
- render() {
3687
- return T`<slot></slot>`;
3688
- }
3689
- process() {
3690
- const logic = new QtiOutcomeProcessingProcessor();
3691
- const rules = [...this.children];
3692
- logic.process(rules);
3693
- }
3694
- };
3695
- var QtiOutcomeProcessingProcessor = class {
3696
- process(rules) {
3697
- for (const rule of rules) {
3698
- rule.process();
3699
- }
3700
- }
3701
- };
3702
-
3703
- // ../qti-test/dist/components/qti-test-variables/qti-test-variables.js
3704
- var __decorate24 = function(decorators, target, key, desc) {
3705
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3706
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3707
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3708
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3709
- };
3710
- var QtiTestVariables = class extends QtiExpression {
3711
- #testElement;
3712
- constructor() {
3713
- super();
3714
- this.addEventListener("qti-assessment-test-connected", (e2) => this.#testElement = e2.detail);
3715
- }
3716
- getResult() {
3717
- const includedCategories = this.getAttribute("include-category")?.split(" ") ?? [];
3718
- const excludedCategories = this.getAttribute("exclude-category")?.split(" ") ?? [];
3719
- const weightIdentifier = this.getAttribute("weight-identifier") ?? "";
3720
- const itemVariable = this.getAttribute("variable-identifier");
3721
- const itemRefEls = Array.from(this.#testElement.querySelectorAll(`qti-asssessment-test qti-assessment-item-ref`));
3722
- const includedItems = itemRefEls.filter((itemRef) => {
3723
- let include = true;
3724
- if (includedCategories.length > 0) {
3725
- include = includedCategories.includes(itemRef.category);
3726
- }
3727
- if (excludedCategories.length > 0) {
3728
- include = !excludedCategories.includes(itemRef.category);
3729
- }
3730
- return include;
3731
- }).map((itemRef) => {
3732
- let weight = 1;
3733
- if (weightIdentifier) {
3734
- const weightVariable = itemRef.weigths.get(weightIdentifier);
3735
- if (weightVariable !== null && weightVariable !== void 0) {
3736
- weight = weightVariable;
3737
- }
3738
- }
3739
- return { item: itemRef.identifier, weight };
3740
- });
3741
- const logic = new QtiTestVariablesExpression(this._testContext, itemVariable, includedItems);
3742
- const value = logic.calculate();
3743
- return value;
3744
- }
3745
- calculate() {
3746
- return this.getResult();
3747
- }
3748
- };
3749
- __decorate24([
3750
- c({ context: testContext, subscribe: true })
3751
- ], QtiTestVariables.prototype, "_testContext", void 0);
3752
- var QtiTestVariablesExpression = class {
3753
- constructor(testContext2, itemVariable, includedItems) {
3754
- this.testContext = testContext2;
3755
- this.itemVariable = itemVariable;
3756
- this.includedItems = includedItems;
3757
- }
3758
- calculate() {
3759
- const { items } = this.testContext;
3760
- let total = 0;
3761
- const uniqueItems = [...new Set(this.includedItems.map((item) => item.item))];
3762
- items.forEach((item) => {
3763
- if (uniqueItems.includes(item.identifier)) {
3764
- const variable = item.variables.find((vr) => vr.identifier === this.itemVariable);
3765
- const weight = this.includedItems.find((i4) => i4.item === item.identifier)?.weight ?? 1;
3766
- if (variable) {
3767
- total += Number(variable.value) * weight;
3768
- }
3769
- }
3770
- });
3771
- return total;
3772
- }
3773
- };
3774
-
3775
3775
  // ../qti-test/dist/elements.js
3776
3776
  var qtiTestElements = [
3777
3777
  { tag: "qti-assessment-item-ref", ctor: QtiAssessmentItemRef },
@@ -3812,8 +3812,12 @@ export {
3812
3812
  QtiAssessmentItemRef,
3813
3813
  QtiAssessmentSection,
3814
3814
  QtiAssessmentTest,
3815
+ QtiOutcomeProcessing,
3816
+ QtiOutcomeProcessingProcessor,
3815
3817
  QtiTestFeedback,
3816
3818
  QtiTestPart,
3819
+ QtiTestVariables,
3820
+ QtiTestVariablesExpression,
3817
3821
  QtiTest,
3818
3822
  TestCheckItem,
3819
3823
  TestContainer,
@@ -3861,4 +3865,4 @@ lit-html/node/private-ssr-support.js:
3861
3865
  * SPDX-License-Identifier: BSD-3-Clause
3862
3866
  *)
3863
3867
  */
3864
- //# sourceMappingURL=chunk-LZJHHZQ2.js.map
3868
+ //# sourceMappingURL=chunk-RXGDQDOV.js.map