@citolab/qti-components 8.0.2 → 8.1.0

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 +647 -815
  3. package/dist/base.d.ts +58 -1
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-NJQHUUTN.js → chunk-3IACYIU2.js} +2 -2
  6. package/dist/{chunk-TWPXES3S.js → chunk-4XR2JHCP.js} +6 -6
  7. package/dist/chunk-4XR2JHCP.js.map +1 -0
  8. package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
  9. package/dist/{chunk-ZII6M3SN.js → chunk-6V3A7NQP.js} +2 -2
  10. package/dist/{chunk-7AVWRQIS.js → chunk-6XJUP55A.js} +62 -76
  11. package/dist/{chunk-7AVWRQIS.js.map → chunk-6XJUP55A.js.map} +1 -1
  12. package/dist/{chunk-J5SQLKNP.js → chunk-CF3DXJWM.js} +6 -6
  13. package/dist/{chunk-HQESINXH.js → chunk-EKXZI26R.js} +84 -1
  14. package/dist/chunk-EKXZI26R.js.map +1 -0
  15. package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
  16. package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
  17. package/dist/{chunk-CK7AV2UJ.js → chunk-IXPDMYKH.js} +3 -3
  18. package/dist/chunk-IYC7LZV6.js +7 -0
  19. package/dist/chunk-IYC7LZV6.js.map +1 -0
  20. package/dist/{chunk-VAE6HBKR.js → chunk-MK2I3MQB.js} +86 -59
  21. package/dist/chunk-MK2I3MQB.js.map +1 -0
  22. package/dist/{chunk-BQFWCZFH.js → chunk-NZLW6EX7.js} +2 -2
  23. package/dist/{chunk-HBSWJC3B.js → chunk-Q52IJELT.js} +5 -5
  24. package/dist/{chunk-RSVRS5AK.js → chunk-TXIB3SKC.js} +4 -4
  25. package/dist/corrections.js +8 -8
  26. package/dist/elements.d.ts +0 -1
  27. package/dist/elements.js +4 -4
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +28 -14
  30. package/dist/interactions.js +3 -3
  31. package/dist/item.css +370 -532
  32. package/dist/item.js +5 -5
  33. package/dist/loader.js +2 -2
  34. package/dist/processing.d.ts +61 -11
  35. package/dist/processing.js +10 -2
  36. package/dist/qti-components-jsx.d.ts +756 -552
  37. package/dist/test.js +6 -6
  38. package/dist/transformers.d.ts +1 -1
  39. package/dist/transformers.js +1 -1
  40. package/package.json +8 -8
  41. package/dist/chunk-G6GFQDVN.js +0 -7
  42. package/dist/chunk-G6GFQDVN.js.map +0 -1
  43. package/dist/chunk-HQESINXH.js.map +0 -1
  44. package/dist/chunk-TWPXES3S.js.map +0 -1
  45. package/dist/chunk-VAE6HBKR.js.map +0 -1
  46. /package/dist/{chunk-NJQHUUTN.js.map → chunk-3IACYIU2.js.map} +0 -0
  47. /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
  48. /package/dist/{chunk-ZII6M3SN.js.map → chunk-6V3A7NQP.js.map} +0 -0
  49. /package/dist/{chunk-J5SQLKNP.js.map → chunk-CF3DXJWM.js.map} +0 -0
  50. /package/dist/{chunk-CK7AV2UJ.js.map → chunk-IXPDMYKH.js.map} +0 -0
  51. /package/dist/{chunk-BQFWCZFH.js.map → chunk-NZLW6EX7.js.map} +0 -0
  52. /package/dist/{chunk-HBSWJC3B.js.map → chunk-Q52IJELT.js.map} +0 -0
  53. /package/dist/{chunk-RSVRS5AK.js.map → chunk-TXIB3SKC.js.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  qtiTransformItem,
3
3
  qtiTransformManifest,
4
4
  qtiTransformTest
5
- } from "./chunk-IJD53WY6.js";
5
+ } from "./chunk-HDEG6BAZ.js";
6
6
 
7
7
  // ../qti-loader/dist/qti-loader.js
8
8
  var getManifestInfo = async (manifestURL) => {
@@ -28,4 +28,4 @@ export {
28
28
  getManifestInfo,
29
29
  getItemByUri
30
30
  };
31
- //# sourceMappingURL=chunk-7V4HJFHW.js.map
31
+ //# sourceMappingURL=chunk-6ITD55QE.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiItemElements
3
- } from "./chunk-RSVRS5AK.js";
3
+ } from "./chunk-TXIB3SKC.js";
4
4
 
5
5
  // ../qti-item/dist/register.js
6
6
  for (const { tag, ctor } of qtiItemElements) {
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiItemElements) {
8
8
  customElements.define(tag, ctor);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=chunk-ZII6M3SN.js.map
11
+ //# sourceMappingURL=chunk-6V3A7NQP.js.map
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-4DB4SC5K.js";
4
4
  import {
5
5
  qtiTransformItem
6
- } from "./chunk-IJD53WY6.js";
6
+ } from "./chunk-HDEG6BAZ.js";
7
7
  import {
8
8
  QtiFeedback,
9
9
  QtiVariableDeclaration,
10
10
  itemContext,
11
11
  itemContextVariables
12
- } from "./chunk-HQESINXH.js";
12
+ } from "./chunk-EKXZI26R.js";
13
13
 
14
14
  // ../qti-elements/dist/components/qti-assessment-item/qti-assessment-item.js
15
15
  import { provide } from "@lit/context";
@@ -1068,60 +1068,59 @@ __decorate7([
1068
1068
  import { css as css8, html as html11, LitElement as LitElement8 } from "lit";
1069
1069
 
1070
1070
  // ../qti-elements/dist/internal/template-strings.js
1071
- var matchCorrect = `<qti-response-processing>
1072
- <qti-response-condition>
1073
- <qti-response-if>
1074
- <qti-match>
1075
- <qti-variable identifier="RESPONSE"></qti-variable>
1076
- <qti-correct identifier="RESPONSE"></qti-correct>
1077
- </qti-match>
1078
- <qti-set-outcome-value identifier="SCORE">
1079
- <qti-base-value base-type="float">1</qti-base-value>
1080
- </qti-set-outcome-value>
1081
- </qti-response-if>
1082
- <qti-response-else>
1083
- <qti-set-outcome-value identifier="SCORE">
1084
- <qti-base-value base-type="float">0</qti-base-value>
1085
- </qti-set-outcome-value>
1086
- </qti-response-else>
1087
- </qti-response-condition>
1088
- </qti-response-processing>`;
1089
- var mapResponse = `<qti-response-processing>
1090
- <qti-response-condition>
1091
- <qti-response-if>
1092
- <qti-is-null>
1093
- <qti-variable identifier="RESPONSE"></qti-variable>
1094
- </qti-is-null>
1095
- <qti-set-outcome-value identifier="SCORE">
1096
- <qti-base-value base-type="float">0.0</qti-base-value>
1097
- </qti-set-outcome-value>
1098
- </qti-response-if>
1099
- <qti-response-else>
1100
- <qti-set-outcome-value identifier="SCORE">
1101
- <qti-map-response identifier="RESPONSE"> </qti-map-response>
1102
- </qti-set-outcome-value>
1103
- </qti-response-else>
1104
- </qti-response-condition>
1105
- </qti-response-processing>`;
1106
- var mapResponsePoint = `<qti-response-processing>
1107
- <qti-response-condition>
1108
- <qti-response-if>
1109
- <qti-is-null>
1110
- <qti-variable identifier="RESPONSE"></qti-variable>
1111
- </qti-is-null>
1112
- <qti-set-outcome-value identifier="SCORE">
1113
- <qti-base-value base-type="float">0</qti-base-value>
1114
- </qti-set-outcome-value>
1115
- </qti-response-if>
1116
- <qti-response-else>
1117
- <qti-set-outcome-value identifier="SCORE">
1118
- <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
1119
- </qti-set-outcome-value>
1120
- </qti-response-else>
1121
- </qti-response-condition>
1122
- </qti-response-processing>`;
1071
+ var matchCorrect = `<qti-response-condition>
1072
+ <qti-response-if>
1073
+ <qti-match>
1074
+ <qti-variable identifier="RESPONSE"></qti-variable>
1075
+ <qti-correct identifier="RESPONSE"></qti-correct>
1076
+ </qti-match>
1077
+ <qti-set-outcome-value identifier="SCORE">
1078
+ <qti-base-value base-type="float">1</qti-base-value>
1079
+ </qti-set-outcome-value>
1080
+ </qti-response-if>
1081
+ <qti-response-else>
1082
+ <qti-set-outcome-value identifier="SCORE">
1083
+ <qti-base-value base-type="float">0</qti-base-value>
1084
+ </qti-set-outcome-value>
1085
+ </qti-response-else>
1086
+ </qti-response-condition>`;
1087
+ var mapResponse = `<qti-response-condition>
1088
+ <qti-response-if>
1089
+ <qti-is-null>
1090
+ <qti-variable identifier="RESPONSE"></qti-variable>
1091
+ </qti-is-null>
1092
+ <qti-set-outcome-value identifier="SCORE">
1093
+ <qti-base-value base-type="float">0.0</qti-base-value>
1094
+ </qti-set-outcome-value>
1095
+ </qti-response-if>
1096
+ <qti-response-else>
1097
+ <qti-set-outcome-value identifier="SCORE">
1098
+ <qti-map-response identifier="RESPONSE"> </qti-map-response>
1099
+ </qti-set-outcome-value>
1100
+ </qti-response-else>
1101
+ </qti-response-condition>`;
1102
+ var mapResponsePoint = `<qti-response-condition>
1103
+ <qti-response-if>
1104
+ <qti-is-null>
1105
+ <qti-variable identifier="RESPONSE"></qti-variable>
1106
+ </qti-is-null>
1107
+ <qti-set-outcome-value identifier="SCORE">
1108
+ <qti-base-value base-type="float">0</qti-base-value>
1109
+ </qti-set-outcome-value>
1110
+ </qti-response-if>
1111
+ <qti-response-else>
1112
+ <qti-set-outcome-value identifier="SCORE">
1113
+ <qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
1114
+ </qti-set-outcome-value>
1115
+ </qti-response-else>
1116
+ </qti-response-condition>`;
1123
1117
 
1124
1118
  // ../qti-elements/dist/components/qti-response-processing/qti-response-processing.js
1119
+ var responseProcessingTemplates = {
1120
+ map_response: mapResponse,
1121
+ map_response_point: mapResponsePoint,
1122
+ match_correct: matchCorrect
1123
+ };
1125
1124
  var QtiResponseProcessing = class extends LitElement8 {
1126
1125
  static {
1127
1126
  this.styles = [
@@ -1145,27 +1144,14 @@ var QtiResponseProcessing = class extends LitElement8 {
1145
1144
  }
1146
1145
  }
1147
1146
  firstUpdated(_changedProperties) {
1148
- if (this.getAttribute("template")) {
1149
- const splittedTemplateName = this.getAttribute("template").split("/");
1150
- const templateName = splittedTemplateName[splittedTemplateName.length - 1].replace(".xml", "");
1151
- this.innerHTML = "";
1152
- switch (templateName) {
1153
- case "map_response": {
1154
- this.appendChild(this.#fragmentFromString(mapResponse).firstElementChild.firstElementChild);
1155
- break;
1156
- }
1157
- case "map_response_point": {
1158
- this.appendChild(this.#fragmentFromString(mapResponsePoint).firstElementChild.firstElementChild);
1159
- break;
1160
- }
1161
- case "match_correct":
1162
- this.appendChild(this.#fragmentFromString(matchCorrect).firstElementChild.firstElementChild);
1163
- break;
1164
- }
1165
- }
1166
- }
1167
- #fragmentFromString(strHTML) {
1168
- return document.createRange().createContextualFragment(strHTML);
1147
+ const template = this.getAttribute("template");
1148
+ if (!template)
1149
+ return;
1150
+ const templateName = template.split("/").pop().replace(".xml", "");
1151
+ const rules = responseProcessingTemplates[templateName];
1152
+ if (!rules)
1153
+ return;
1154
+ this.innerHTML = rules;
1169
1155
  }
1170
1156
  };
1171
1157
 
@@ -1555,4 +1541,4 @@ export {
1555
1541
  QtiTemplateProcessing,
1556
1542
  qtiContentElements
1557
1543
  };
1558
- //# sourceMappingURL=chunk-7AVWRQIS.js.map
1544
+ //# sourceMappingURL=chunk-6XJUP55A.js.map