@citolab/qti-components 10.0.0-next.6 → 10.0.0-next.7

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 (58) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1750 -198
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-GZVLORVJ.js → chunk-3TUGZHKB.js} +2 -2
  6. package/dist/{chunk-7IRGNPCV.js → chunk-6PCCBSPB.js} +3 -3
  7. package/dist/{chunk-Z545U7O3.js → chunk-DJHH5D3E.js} +2 -2
  8. package/dist/{chunk-R7ZCUQU2.js → chunk-LCGPLQLE.js} +40 -4
  9. package/dist/chunk-LCGPLQLE.js.map +1 -0
  10. package/dist/{chunk-CXTHPEUN.js → chunk-M7X6TWSX.js} +2 -2
  11. package/dist/{chunk-W4NUIWRO.js → chunk-Q3C7XFVS.js} +2 -2
  12. package/dist/{chunk-KXYSYDIM.js → chunk-RN3MD444.js} +2 -2
  13. package/dist/{chunk-VY2DM47N.js → chunk-RSSEBILM.js} +215 -124
  14. package/dist/chunk-RSSEBILM.js.map +1 -0
  15. package/dist/{chunk-O5HGNYB2.js → chunk-RWMY7KRT.js} +2 -2
  16. package/dist/{chunk-JZZMY3FA.js → chunk-T7YSBBAA.js} +37 -1
  17. package/dist/chunk-T7YSBBAA.js.map +1 -0
  18. package/dist/{chunk-WAHTXGBK.js → chunk-VG5YI2OB.js} +6 -6
  19. package/dist/{chunk-QU23PPEZ.js → chunk-YOCOLMGB.js} +40 -5
  20. package/dist/{chunk-QU23PPEZ.js.map → chunk-YOCOLMGB.js.map} +1 -1
  21. package/dist/{computed.types.d-DvxBgnze.d.ts → computed.types.d-IXACuBr7.d.ts} +1 -1
  22. package/dist/corrections.d.ts +9 -9
  23. package/dist/corrections.js +7 -7
  24. package/dist/elements.d.ts +2 -2
  25. package/dist/elements.js +3 -3
  26. package/dist/index.d.ts +10 -10
  27. package/dist/index.js +22 -12
  28. package/dist/interactions.d.ts +4 -4
  29. package/dist/interactions.js +7 -3
  30. package/dist/item.d.ts +4 -4
  31. package/dist/item.js +3 -3
  32. package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
  33. package/dist/loader.d.ts +2 -2
  34. package/dist/processing.d.ts +10 -3
  35. package/dist/processing.js +3 -3
  36. package/dist/qti-components-jsx.d.ts +20 -26
  37. package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
  38. package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
  39. package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
  40. package/dist/{qti-item.d-klsgIEKQ.d.ts → qti-item.d-B1gffYCL.d.ts} +1 -1
  41. package/dist/{qti-test.d-Cra3sS-2.d.ts → qti-test.d-CHIATIDg.d.ts} +4 -4
  42. package/dist/{qti-text-entry-interaction.d-828kFi2A.d.ts → qti-text-entry-interaction.d-utFyp1DH.d.ts} +14 -18
  43. package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
  44. package/dist/{session.context.d-DYAdqSer.d.ts → session.context.d-DW09Lrie.d.ts} +1 -1
  45. package/dist/test.d.ts +7 -7
  46. package/dist/test.js +4 -4
  47. package/package.json +9 -9
  48. package/dist/chunk-JZZMY3FA.js.map +0 -1
  49. package/dist/chunk-R7ZCUQU2.js.map +0 -1
  50. package/dist/chunk-VY2DM47N.js.map +0 -1
  51. /package/dist/{chunk-GZVLORVJ.js.map → chunk-3TUGZHKB.js.map} +0 -0
  52. /package/dist/{chunk-7IRGNPCV.js.map → chunk-6PCCBSPB.js.map} +0 -0
  53. /package/dist/{chunk-Z545U7O3.js.map → chunk-DJHH5D3E.js.map} +0 -0
  54. /package/dist/{chunk-CXTHPEUN.js.map → chunk-M7X6TWSX.js.map} +0 -0
  55. /package/dist/{chunk-W4NUIWRO.js.map → chunk-Q3C7XFVS.js.map} +0 -0
  56. /package/dist/{chunk-KXYSYDIM.js.map → chunk-RN3MD444.js.map} +0 -0
  57. /package/dist/{chunk-O5HGNYB2.js.map → chunk-RWMY7KRT.js.map} +0 -0
  58. /package/dist/{chunk-WAHTXGBK.js.map → chunk-VG5YI2OB.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiTestElements
3
- } from "./chunk-7IRGNPCV.js";
3
+ } from "./chunk-6PCCBSPB.js";
4
4
 
5
5
  // ../qti-test/dist/register.js
6
6
  for (const { tag, ctor } of qtiTestElements) {
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiTestElements) {
8
8
  customElements.define(tag, ctor);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=chunk-KXYSYDIM.js.map
11
+ //# sourceMappingURL=chunk-RN3MD444.js.map
@@ -6,15 +6,18 @@ import {
6
6
  boxSizing,
7
7
  configContext,
8
8
  dropRegion,
9
+ inferRecordFieldBaseType,
9
10
  interactionContext,
11
+ isRecordValue,
10
12
  itemContext,
11
13
  parseResponseAttribute,
12
14
  qtiContext,
15
+ readRecordFieldValues,
13
16
  removeDoubleSlashes,
14
17
  responseAttributeConverter,
15
18
  serializeResponseAttribute,
16
19
  validationMessage
17
- } from "./chunk-JZZMY3FA.js";
20
+ } from "./chunk-T7YSBBAA.js";
18
21
 
19
22
  // ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.js
20
23
  import { LitElement, html } from "lit";
@@ -8572,6 +8575,9 @@ import { css as css27, html as html26 } from "lit";
8572
8575
  import { property as property23, state as state13 } from "lit/decorators.js";
8573
8576
  import { consume as consume6 } from "@lit/context";
8574
8577
 
8578
+ // ../qti-theme/dist/native-css.js
8579
+ var native_css_default = "@layer qti-base {\n/* https://www.imsglobal.org/sites/default/files/spec/qti/v3/guide/img/qti3p0.css */\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n}\n\n@layer qti-base {\n\n.qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n}\n\n.qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n}\n\n.qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there\u2019s padding or borders */\n}\n\n.qti-layout-col1 {\n width: 6.3829787234%;\n}\n\n.qti-layout-col2 {\n width: 14.8936170213%;\n}\n\n.qti-layout-col3 {\n width: 23.4042553191%;\n}\n\n.qti-layout-col4 {\n width: 31.914893617%;\n}\n\n.qti-layout-col5 {\n width: 40.4255319149%;\n}\n\n.qti-layout-col6 {\n width: 48.9361702128%;\n}\n\n.qti-layout-col7 {\n width: 57.4468085106%;\n}\n\n.qti-layout-col8 {\n width: 65.9574468085%;\n}\n\n.qti-layout-col9 {\n width: 74.4680851064%;\n}\n\n.qti-layout-col10 {\n width: 82.9787234043%;\n}\n\n.qti-layout-col11 {\n width: 91.4893617021%;\n}\n\n.qti-layout-col12 {\n width: 100%;\n}\n\n.qti-layout-offset1 {\n margin-left: 8.5106382979%;\n}\n\n.qti-layout-offset2 {\n margin-left: 17.0212765957%;\n}\n\n.qti-layout-offset3 {\n margin-left: 25.5319148936%;\n}\n\n.qti-layout-offset4 {\n margin-left: 34.0425531915%;\n}\n\n.qti-layout-offset5 {\n margin-left: 42.5531914894%;\n}\n\n.qti-layout-offset6 {\n margin-left: 51.0638297872%;\n}\n\n.qti-layout-offset7 {\n margin-left: 59.5744680851%;\n}\n\n.qti-layout-offset8 {\n margin-left: 68.085106383%;\n}\n\n.qti-layout-offset9 {\n margin-left: 76.5957446809%;\n}\n\n.qti-layout-offset10 {\n margin-left: 85.1063829787%;\n}\n\n.qti-layout-offset11 {\n margin-left: 93.6170212766%;\n}\n\n@media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n}\n}\n";
8580
+
8575
8581
  // ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.styles.js
8576
8582
  import { css as css26 } from "lit";
8577
8583
  var qti_portable_custom_interaction_styles_default = [
@@ -8589,6 +8595,161 @@ var qti_portable_custom_interaction_styles_default = [
8589
8595
  `
8590
8596
  ];
8591
8597
 
8598
+ // ../interactions/portable-custom-interaction/dist/record-response.js
8599
+ var PAIR_BASE_TYPES = /* @__PURE__ */ new Set(["point", "pair", "directedPair"]);
8600
+ var coerceBaseValue = (value, baseType) => {
8601
+ if (value === null || value === void 0)
8602
+ return value;
8603
+ switch (baseType) {
8604
+ case "integer": {
8605
+ if (typeof value === "number")
8606
+ return value;
8607
+ const parsed = parseInt(String(value), 10);
8608
+ return Number.isNaN(parsed) ? value : parsed;
8609
+ }
8610
+ case "float":
8611
+ case "duration": {
8612
+ if (typeof value === "number")
8613
+ return value;
8614
+ const parsed = parseFloat(String(value));
8615
+ return Number.isNaN(parsed) ? value : parsed;
8616
+ }
8617
+ case "boolean": {
8618
+ if (typeof value === "boolean")
8619
+ return value;
8620
+ if (typeof value === "string") {
8621
+ const lowered = value.toLowerCase();
8622
+ if (lowered === "true")
8623
+ return true;
8624
+ if (lowered === "false")
8625
+ return false;
8626
+ }
8627
+ return value;
8628
+ }
8629
+ case "point": {
8630
+ const parts = Array.isArray(value) ? value : String(value).trim().split(/[\s,]+/);
8631
+ const numbers = parts.map((part) => typeof part === "number" ? part : parseFloat(String(part)));
8632
+ return numbers.length === 2 && numbers.every(Number.isFinite) ? numbers : value;
8633
+ }
8634
+ case "pair":
8635
+ case "directedPair": {
8636
+ const parts = Array.isArray(value) ? value : String(value).trim().split(/\s+/);
8637
+ return parts.length === 2 ? parts.map(String) : value;
8638
+ }
8639
+ case "string":
8640
+ case "identifier":
8641
+ default:
8642
+ return String(value);
8643
+ }
8644
+ };
8645
+ var recordEntryFromValue = (name, entryValue, baseType) => {
8646
+ if (baseType) {
8647
+ if (Array.isArray(entryValue) && !PAIR_BASE_TYPES.has(baseType)) {
8648
+ return { name, list: { [baseType]: entryValue.map((v) => coerceBaseValue(v, baseType)) } };
8649
+ }
8650
+ if (entryValue === null || entryValue === void 0) {
8651
+ return { name, base: null };
8652
+ }
8653
+ return { name, base: { [baseType]: coerceBaseValue(entryValue, baseType) } };
8654
+ }
8655
+ if (Array.isArray(entryValue)) {
8656
+ const filtered = entryValue.filter((v) => v !== null && v !== void 0);
8657
+ if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
8658
+ return { name, list: { boolean: filtered } };
8659
+ }
8660
+ if (filtered.length && filtered.every((v) => typeof v === "number")) {
8661
+ const numbers = filtered;
8662
+ const isIntegers = numbers.every((n) => Number.isInteger(n));
8663
+ return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
8664
+ }
8665
+ return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
8666
+ }
8667
+ if (typeof entryValue === "boolean") {
8668
+ return { name, base: { boolean: entryValue } };
8669
+ }
8670
+ if (typeof entryValue === "number") {
8671
+ if (Number.isInteger(entryValue))
8672
+ return { name, base: { integer: entryValue } };
8673
+ return { name, base: { float: entryValue } };
8674
+ }
8675
+ if (entryValue === null || entryValue === void 0) {
8676
+ return { name, base: { string: "" } };
8677
+ }
8678
+ if (typeof entryValue === "object") {
8679
+ try {
8680
+ return { name, base: { string: JSON.stringify(entryValue) } };
8681
+ } catch {
8682
+ return { name, base: { string: String(entryValue) } };
8683
+ }
8684
+ }
8685
+ return { name, base: { string: String(entryValue) } };
8686
+ };
8687
+ var recordToQtiVariableJSON = (value, fieldBaseTypes = {}) => {
8688
+ if (!isRecordValue(value)) {
8689
+ return { record: [] };
8690
+ }
8691
+ const recordEntries = [];
8692
+ for (const [name, entryValue] of Object.entries(value)) {
8693
+ recordEntries.push(recordEntryFromValue(name, entryValue, fieldBaseTypes[name]));
8694
+ }
8695
+ return { record: recordEntries };
8696
+ };
8697
+ var recordFieldBaseTypes = (value, declared = {}) => {
8698
+ if (!isRecordValue(value))
8699
+ return { ...declared };
8700
+ const baseTypes = {};
8701
+ for (const [name, entryValue] of Object.entries(value)) {
8702
+ baseTypes[name] = declared[name] ?? inferRecordFieldBaseType(Array.isArray(entryValue) ? entryValue[0] : entryValue);
8703
+ }
8704
+ return baseTypes;
8705
+ };
8706
+ var recordResponseToQtiVariableJSON = (value, declared = {}) => recordToQtiVariableJSON(value, recordFieldBaseTypes(value, declared));
8707
+ var toQtiLiteral = (value) => {
8708
+ if (value === null || value === void 0)
8709
+ return null;
8710
+ if (Array.isArray(value))
8711
+ return value.map(String).join(" ");
8712
+ if (typeof value === "object") {
8713
+ try {
8714
+ return JSON.stringify(value);
8715
+ } catch {
8716
+ return String(value);
8717
+ }
8718
+ }
8719
+ return String(value);
8720
+ };
8721
+ var firstTypedValue = (typed) => {
8722
+ if (!typed)
8723
+ return void 0;
8724
+ for (const key of Object.keys(typed)) {
8725
+ const value = typed[key];
8726
+ if (value !== void 0 && value !== null)
8727
+ return value;
8728
+ }
8729
+ return void 0;
8730
+ };
8731
+ var recordFromQtiVariableJSON = (record) => {
8732
+ const value = {};
8733
+ for (const entry of record) {
8734
+ if (!entry || typeof entry.name !== "string" || !entry.name)
8735
+ continue;
8736
+ if (entry.list) {
8737
+ const items = firstTypedValue(entry.list);
8738
+ value[entry.name] = Array.isArray(items) ? items.map(toQtiLiteral).filter((v) => v !== null) : [];
8739
+ } else {
8740
+ value[entry.name] = toQtiLiteral(firstTypedValue(entry.base));
8741
+ }
8742
+ }
8743
+ return value;
8744
+ };
8745
+
8746
+ // ../interactions/portable-custom-interaction/dist/vendor/require-js.js
8747
+ var require_js_default = `/** vim: et:ts=4:sw=4:sts=4
8748
+ * @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.
8749
+ * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
8750
+ */var requirejs,require,define;(function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.8",commentRegExp=/\\/\\*[\\s\\S]*?\\*\\/|([^:"'=]|^)\\/\\/.*$/mg,cjsRequireRegExp=/[^.]\\s*require\\s*\\(\\s*["']([^'"\\s]+)["']\\s*\\)/g,jsSuffixRegExp=/\\.js$/,currDirRegExp=/^\\.\\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!!(typeof window<"u"&&typeof navigator<"u"&&window.document),isWebWorker=!isBrowser&&typeof importScripts<"u",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera<"u"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(r,a){return a||""}function isFunction(r){return ostring.call(r)==="[object Function]"}function isArray(r){return ostring.call(r)==="[object Array]"}function each(r,a){if(r){var c;for(c=0;c<r.length&&!(r[c]&&a(r[c],c,r));c+=1);}}function eachReverse(r,a){if(r){var c;for(c=r.length-1;c>-1&&!(r[c]&&a(r[c],c,r));c-=1);}}function hasProp(r,a){return hasOwn.call(r,a)}function getOwn(r,a){return hasProp(r,a)&&r[a]}function eachProp(r,a){var c;for(c in r)if(hasProp(r,c)&&c!=="__proto__"&&c!=="constructor"&&a(r[c],c))break}function mixin(r,a,c,u){return a&&eachProp(a,function(h,q){(c||!hasProp(r,q))&&(u&&typeof h=="object"&&h&&!isArray(h)&&!isFunction(h)&&!(h instanceof RegExp)?(r[q]||(r[q]={}),mixin(r[q],h,c,u)):r[q]=h)}),r}function bind(r,a){return function(){return a.apply(r,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(r){throw r}function getGlobal(r){if(!r)return r;var a=global;return each(r.split("."),function(c){a=a[c]}),a}function makeError(r,a,c,u){var h=new Error(a+\`
8751
+ https://requirejs.org/docs/errors.html#\`+r);return h.requireType=r,h.requireModules=u,c&&(h.originalError=c),h}if(typeof define<"u")return;if(typeof requirejs<"u"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}typeof require<"u"&&!isFunction(require)&&(cfg=require,require=void 0);function newContext(r){var a,c,u,h,q,g={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},v={},B={},I={},M=[],w={},D={},L={},H=1,K=1;function X(e){var i,n;for(i=0;i<e.length;i++)if(n=e[i],n===".")e.splice(i,1),i-=1;else if(n===".."){if(i===0||i===1&&e[2]===".."||e[i-1]==="..")continue;i>0&&(e.splice(i-1,2),i-=2)}}function P(e,i,n){var o,t,f,d,l,p,b,E,m,x,R,A,O=i&&i.split("/"),k=g.map,j=k&&k["*"];if(e&&(e=e.split("/"),b=e.length-1,g.nodeIdCompat&&jsSuffixRegExp.test(e[b])&&(e[b]=e[b].replace(jsSuffixRegExp,"")),e[0].charAt(0)==="."&&O&&(A=O.slice(0,O.length-1),e=A.concat(e)),X(e),e=e.join("/")),n&&k&&(O||j)){f=e.split("/");e:for(d=f.length;d>0;d-=1){if(p=f.slice(0,d).join("/"),O){for(l=O.length;l>0;l-=1)if(t=getOwn(k,O.slice(0,l).join("/")),t&&(t=getOwn(t,p),t)){E=t,m=d;break e}}!x&&j&&getOwn(j,p)&&(x=getOwn(j,p),R=d)}!E&&x&&(E=x,m=R),E&&(f.splice(0,m,E),e=f.join("/"))}return o=getOwn(g.pkgs,e),o||e}function W(e){isBrowser&&each(scripts(),function(i){if(i.getAttribute("data-requiremodule")===e&&i.getAttribute("data-requirecontext")===u.contextName)return i.parentNode.removeChild(i),!0})}function Q(e){var i=getOwn(g.paths,e);if(i&&isArray(i)&&i.length>1)return i.shift(),u.require.undef(e),u.makeRequire(null,{skipMap:!0})([e]),!0}function G(e){var i,n=e?e.indexOf("!"):-1;return n>-1&&(i=e.substring(0,n),e=e.substring(n+1,e.length)),[i,e]}function S(e,i,n,o){var t,f,d,l,p=null,b=i?i.name:null,E=e,m=!0,x="";return e||(m=!1,e="_@r"+(H+=1)),l=G(e),p=l[0],e=l[1],p&&(p=P(p,b,o),f=getOwn(w,p)),e&&(p?n?x=e:f&&f.normalize?x=f.normalize(e,function(R){return P(R,b,o)}):x=e.indexOf("!")===-1?P(e,b,o):e:(x=P(e,b,o),l=G(x),p=l[0],x=l[1],n=!0,t=u.nameToUrl(x))),d=p&&!f&&!n?"_unnormalized"+(K+=1):"",{prefix:p,name:x,parentMap:i,unnormalized:!!d,url:t,originalName:E,isDefine:m,id:(p?p+"!"+x:x)+d}}function T(e){var i=e.id,n=getOwn(v,i);return n||(n=v[i]=new u.Module(e)),n}function C(e,i,n){var o=e.id,t=getOwn(v,o);hasProp(w,o)&&(!t||t.defineEmitComplete)?i==="defined"&&n(w[o]):(t=T(e),t.error&&i==="error"?n(t.error):t.on(i,n))}function y(e,i){var n=e.requireModules,o=!1;i?i(e):(each(n,function(t){var f=getOwn(v,t);f&&(f.error=e,f.events.error&&(o=!0,f.emit("error",e)))}),o||req.onError(e))}function F(){globalDefQueue.length&&(each(globalDefQueue,function(e){var i=e[0];typeof i=="string"&&(u.defQueueMap[i]=!0),M.push(e)}),globalDefQueue=[])}h={require:function(e){return e.require?e.require:e.require=u.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?w[e.map.id]=e.exports:e.exports=w[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(g.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}};function U(e){delete v[e],delete B[e]}function $(e,i,n){var o=e.map.id;e.error?e.emit("error",e.error):(i[o]=!0,each(e.depMaps,function(t,f){var d=t.id,l=getOwn(v,d);l&&!e.depMatched[f]&&!n[d]&&(getOwn(i,d)?(e.defineDep(f,w[d]),e.check()):$(l,i,n))}),n[o]=!0)}function z(){var e,i,n=g.waitSeconds*1e3,o=n&&u.startTime+n<new Date().getTime(),t=[],f=[],d=!1,l=!0;if(!a){if(a=!0,eachProp(B,function(p){var b=p.map,E=b.id;if(p.enabled&&(b.isDefine||f.push(p),!p.error)){if(!p.inited&&o)Q(E)?(i=!0,d=!0):(t.push(E),W(E));else if(!p.inited&&p.fetched&&b.isDefine&&(d=!0,!b.prefix))return l=!1}}),o&&t.length)return e=makeError("timeout","Load timeout for modules: "+t,null,t),e.contextName=u.contextName,y(e);l&&each(f,function(p){$(p,{},{})}),(!o||i)&&d&&(isBrowser||isWebWorker)&&!q&&(q=setTimeout(function(){q=0,z()},50)),a=!1}}c=function(e){this.events=getOwn(I,e.id)||{},this.map=e,this.shim=getOwn(g.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},c.prototype={init:function(e,i,n,o){o=o||{},!this.inited&&(this.factory=i,n?this.on("error",n):this.events.error&&(n=bind(this,function(t){this.emit("error",t)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=o.ignore,o.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,i){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=i)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=new Date().getTime();var e=this.map;if(this.shim)u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}));else return e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,u.load(this.map.id,e))},check:function(){if(!(!this.enabled||this.enabling)){var e,i,n=this.map.id,o=this.depExports,t=this.exports,f=this.factory;if(!this.inited)hasProp(u.defQueueMap,n)||this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{t=u.execCb(n,f,o,t)}catch(l){e=l}else t=u.execCb(n,f,o,t);if(this.map.isDefine&&t===void 0&&(i=this.module,i?t=i.exports:this.usingExports&&(t=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",y(this.error=e)}else t=f;if(this.exports=t,this.map.isDefine&&!this.ignore&&(w[n]=t,req.onResourceLoad)){var d=[];each(this.depMaps,function(l){d.push(l.normalizedMap||l)}),req.onResourceLoad(u,this.map,d)}U(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var e=this.map,i=e.id,n=S(e.prefix);this.depMaps.push(n),C(n,"defined",bind(this,function(o){var t,f,d,l=getOwn(L,this.map.id),p=this.map.name,b=this.map.parentMap?this.map.parentMap.name:null,E=u.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){o.normalize&&(p=o.normalize(p,function(m){return P(m,b,!0)})||""),f=S(e.prefix+"!"+p,this.map.parentMap,!0),C(f,"defined",bind(this,function(m){this.map.normalizedMap=f,this.init([],function(){return m},null,{enabled:!0,ignore:!0})})),d=getOwn(v,f.id),d&&(this.depMaps.push(f),this.events.error&&d.on("error",bind(this,function(m){this.emit("error",m)})),d.enable());return}if(l){this.map.url=u.nameToUrl(l),this.load();return}t=bind(this,function(m){this.init([],function(){return m},null,{enabled:!0})}),t.error=bind(this,function(m){this.inited=!0,this.error=m,m.requireModules=[i],eachProp(v,function(x){x.map.id.indexOf(i+"_unnormalized")===0&&U(x.map.id)}),y(m)}),t.fromText=bind(this,function(m,x){var R=e.name,A=S(R),O=useInteractive;x&&(m=x),O&&(useInteractive=!1),T(A),hasProp(g.config,i)&&(g.config[R]=g.config[i]);try{req.exec(m)}catch(k){return y(makeError("fromtexteval","fromText eval for "+i+" failed: "+k,k,[i]))}O&&(useInteractive=!0),this.depMaps.push(A),u.completeLoad(R),E([R],t)}),o.load(e.name,E,t,g)})),u.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){B[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,i){var n,o,t;if(typeof e=="string"){if(e=S(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=e,t=getOwn(h,e.id),t){this.depExports[i]=t(this);return}this.depCount+=1,C(e,"defined",bind(this,function(f){this.undefed||(this.defineDep(i,f),this.check())})),this.errback?C(e,"error",bind(this,this.errback)):this.events.error&&C(e,"error",bind(this,function(f){this.emit("error",f)}))}n=e.id,o=v[n],!hasProp(h,n)&&o&&!o.enabled&&u.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var i=getOwn(v,e.id);i&&!i.enabled&&u.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,i){var n=this.events[e];n||(n=this.events[e]=[]),n.push(i)},emit:function(e,i){each(this.events[e],function(n){n(i)}),e==="error"&&delete this.events[e]}};function _(e){hasProp(w,e[0])||T(S(e[0],null,!0)).init(e[1],e[2])}function J(e,i,n,o){e.detachEvent&&!isOpera?o&&e.detachEvent(o,i):e.removeEventListener(n,i,!1)}function V(e){var i=e.currentTarget||e.srcElement;return J(i,u.onScriptLoad,"load","onreadystatechange"),J(i,u.onScriptError,"error"),{node:i,id:i&&i.getAttribute("data-requiremodule")}}function Y(){var e;for(F();M.length;){if(e=M.shift(),e[0]===null)return y(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));_(e)}u.defQueueMap={}}return u={config:g,contextName:r,registry:v,defined:w,urlFetched:D,defQueue:M,defQueueMap:{},Module:c,makeModuleMap:S,nextTick:req.nextTick,onError:y,configure:function(e){if(e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/"),typeof e.urlArgs=="string"){var i=e.urlArgs;e.urlArgs=function(t,f){return(f.indexOf("?")===-1?"?":"&")+i}}var n=g.shim,o={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(t,f){o[f]?(g[f]||(g[f]={}),mixin(g[f],t,!0,!0)):g[f]=t}),e.bundles&&eachProp(e.bundles,function(t,f){each(t,function(d){d!==f&&(L[d]=f)})}),e.shim&&(eachProp(e.shim,function(t,f){isArray(t)&&(t={deps:t}),(t.exports||t.init)&&!t.exportsFn&&(t.exportsFn=u.makeShimExports(t)),n[f]=t}),g.shim=n),e.packages&&each(e.packages,function(t){var f,d;t=typeof t=="string"?{name:t}:t,d=t.name,f=t.location,f&&(g.paths[d]=t.location),g.pkgs[d]=t.name+"/"+(t.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(v,function(t,f){!t.inited&&!t.map.unnormalized&&(t.map=S(f,null,!0))}),(e.deps||e.callback)&&u.require(e.deps||[],e.callback)},makeShimExports:function(e){function i(){var n;return e.init&&(n=e.init.apply(global,arguments)),n||e.exports&&getGlobal(e.exports)}return i},makeRequire:function(e,i){i=i||{};function n(o,t,f){var d,l,p;return i.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),typeof o=="string"?isFunction(t)?y(makeError("requireargs","Invalid require call"),f):e&&hasProp(h,o)?h[o](v[e.id]):req.get?req.get(u,o,e,n):(l=S(o,e,!1,!0),d=l.id,hasProp(w,d)?w[d]:y(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+r+(e?"":". Use require([])")))):(Y(),u.nextTick(function(){Y(),p=T(S(null,e)),p.skipMap=i.skipMap,p.init(o,t,f,{enabled:!0}),z()}),n)}return mixin(n,{isBrowser,toUrl:function(o){var t,f=o.lastIndexOf("."),d=o.split("/")[0],l=d==="."||d==="..";return f!==-1&&(!l||f>1)&&(t=o.substring(f,o.length),o=o.substring(0,f)),u.nameToUrl(P(o,e&&e.id,!0),t,!0)},defined:function(o){return hasProp(w,S(o,e,!1,!0).id)},specified:function(o){return o=S(o,e,!1,!0).id,hasProp(w,o)||hasProp(v,o)}}),e||(n.undef=function(o){F();var t=S(o,e,!0),f=getOwn(v,o);f.undefed=!0,W(o),delete w[o],delete D[t.url],delete I[o],eachReverse(M,function(d,l){d[0]===o&&M.splice(l,1)}),delete u.defQueueMap[o],f&&(f.events.defined&&(I[o]=f.events),U(o))}),n},enable:function(e){var i=getOwn(v,e.id);i&&T(e).enable()},completeLoad:function(e){var i,n,o,t=getOwn(g.shim,e)||{},f=t.exports;for(F();M.length;){if(n=M.shift(),n[0]===null){if(n[0]=e,i)break;i=!0}else n[0]===e&&(i=!0);_(n)}if(u.defQueueMap={},o=getOwn(v,e),!i&&!hasProp(w,e)&&o&&!o.inited){if(g.enforceDefine&&(!f||!getGlobal(f)))return Q(e)?void 0:y(makeError("nodefine","No define call for "+e,null,[e]));_([e,t.deps||[],t.exportsFn])}z()},nameToUrl:function(e,i,n){var o,t,f,d,l,p,b,E=getOwn(g.pkgs,e);if(E&&(e=E),b=getOwn(L,e),b)return u.nameToUrl(b,i,n);if(req.jsExtRegExp.test(e))l=e+(i||"");else{for(o=g.paths,t=e.split("/"),f=t.length;f>0;f-=1)if(d=t.slice(0,f).join("/"),p=getOwn(o,d),p){isArray(p)&&(p=p[0]),t.splice(0,f,p);break}l=t.join("/"),l+=i||(/^data\\:|^blob\\:|\\?/.test(l)||n?"":".js"),l=(l.charAt(0)==="/"||l.match(/^[\\w\\+\\.\\-]+:/)?"":g.baseUrl)+l}return g.urlArgs&&!/^blob\\:/.test(l)?l+g.urlArgs(e,l):l},load:function(e,i){req.load(u,e,i)},execCb:function(e,i,n,o){return i.apply(o,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var i=V(e);u.completeLoad(i.id)}},onScriptError:function(e){var i=V(e);if(!Q(i.id)){var n=[];return eachProp(v,function(o,t){t.indexOf("_@r")!==0&&each(o.depMaps,function(f){if(f.id===i.id)return n.push(t),!0})}),y(makeError("scripterror",'Script error for "'+i.id+(n.length?'", needed by: '+n.join(", "):'"'),e,[i.id]))}}},u.require=u.makeRequire(),u}req=requirejs=function(r,a,c,u){var h,q,g=defContextName;return!isArray(r)&&typeof r!="string"&&(q=r,isArray(a)?(r=a,a=c,c=u):r=[]),q&&q.context&&(g=q.context),h=getOwn(contexts,g),h||(h=contexts[g]=req.s.newContext(g)),q&&h.configure(q),h.require(r,a,c)},req.config=function(r){return req(r)},req.nextTick=typeof setTimeout<"u"?function(r){setTimeout(r,4)}:function(r){r()},require||(require=req),req.version=version,req.jsExtRegExp=/^\\/|:|\\?|\\.js$/,req.isBrowser=isBrowser,s=req.s={contexts,newContext},req({}),each(["toUrl","undef","defined","specified"],function(r){req[r]=function(){var a=contexts[defContextName];return a.require[r].apply(a,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(r,a,c){var u=r.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return u.type=r.scriptType||"text/javascript",u.charset="utf-8",u.async=!0,u},req.load=function(r,a,c){var u=r&&r.config||{},h;if(isBrowser)return h=req.createNode(u,a,c),h.setAttribute("data-requirecontext",r.contextName),h.setAttribute("data-requiremodule",a),h.attachEvent&&!(h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,h.attachEvent("onreadystatechange",r.onScriptLoad)):(h.addEventListener("load",r.onScriptLoad,!1),h.addEventListener("error",r.onScriptError,!1)),h.src=c,u.onNodeCreated&&u.onNodeCreated(h,u,a,c),currentlyAddingScript=h,baseElement?head.insertBefore(h,baseElement):head.appendChild(h),currentlyAddingScript=null,h;if(isWebWorker)try{setTimeout(function(){},0),importScripts(c),r.completeLoad(a)}catch(q){r.onError(makeError("importscripts","importScripts failed for "+a+" at "+c,q,[a]))}};function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"||eachReverse(scripts(),function(r){if(r.readyState==="interactive")return interactiveScript=r}),interactiveScript}isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(r){if(head||(head=r.parentNode),dataMain=r.getAttribute("data-main"),dataMain)return mainScript=dataMain,!cfg.baseUrl&&mainScript.indexOf("!")===-1&&(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(r,a,c){var u,h;typeof r!="string"&&(c=a,a=r,r=null),isArray(a)||(c=a,a=null),!a&&isFunction(c)&&(a=[],c.length&&(c.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(q,g){a.push(g)}),a=(c.length===1?["require"]:["require","exports","module"]).concat(a))),useInteractive&&(u=currentlyAddingScript||getInteractiveScript(),u&&(r||(r=u.getAttribute("data-requiremodule")),h=contexts[u.getAttribute("data-requirecontext")])),h?(h.defQueue.push([r,a,c]),h.defQueueMap[r]=!0):globalDefQueue.push([r,a,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this,typeof setTimeout>"u"?void 0:setTimeout);`;
8752
+
8592
8753
  // ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
8593
8754
  var __decorate25 = function(decorators, target, key, desc) {
8594
8755
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -8596,11 +8757,17 @@ var __decorate25 = function(decorators, target, key, desc) {
8596
8757
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8597
8758
  return c > 3 && r && Object.defineProperty(target, key, r), r;
8598
8759
  };
8760
+ var inlineScriptText = (text) => text.replace(/<\/(script)/gi, "<\\/$1");
8761
+ var inlineStyleText = (text) => text.replace(/<\/(style)/gi, "<\\/$1");
8599
8762
  var STATUSES_SHOWING_CORRECT_RESPONSE = ["solution", "review"];
8600
8763
  function hasCorrectResponseValue(value) {
8601
8764
  if (value === null || value === void 0)
8602
8765
  return false;
8603
- return Array.isArray(value) ? value.length > 0 : value !== "";
8766
+ if (Array.isArray(value))
8767
+ return value.length > 0;
8768
+ if (isRecordValue(value))
8769
+ return Object.keys(value).length > 0;
8770
+ return value !== "";
8604
8771
  }
8605
8772
  var QtiPortableCustomInteraction = class extends Interaction {
8606
8773
  constructor() {
@@ -8611,7 +8778,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
8611
8778
  this._iframeMessageOrigin = null;
8612
8779
  this.requirePathsJson = "";
8613
8780
  this.requireShimJson = "";
8614
- this.requireJsUrl = "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js";
8781
+ this.requireJsUrl = "";
8615
8782
  this.baseUrl = "";
8616
8783
  this.useDefaultPaths = false;
8617
8784
  this.status = "interacting";
@@ -8692,15 +8859,17 @@ var QtiPortableCustomInteraction = class extends Interaction {
8692
8859
  }
8693
8860
  }
8694
8861
  if (converted === null) {
8695
- const emptyResponse = this.responseVariable?.cardinality === "single" ? "" : [];
8862
+ const cardinality = this.responseVariable?.cardinality;
8863
+ const emptyResponse = cardinality === "record" ? null : cardinality === "single" ? "" : [];
8696
8864
  this.response = emptyResponse;
8697
8865
  this.validate();
8698
8866
  this.saveResponse(emptyResponse, state15);
8699
8867
  break;
8700
8868
  }
8701
- this.response = converted;
8869
+ const response = converted;
8870
+ this.response = response;
8702
8871
  this.validate();
8703
- this.saveResponse(converted, state15);
8872
+ this.saveResponse(response, state15);
8704
8873
  break;
8705
8874
  }
8706
8875
  case "error":
@@ -8828,9 +8997,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
8828
8997
  return this.#getRequireShim();
8829
8998
  }
8830
8999
  /**
8831
- * Converts QtiVariableJSON to a string or string array
9000
+ * Converts QtiVariableJSON to a string, a string array, or for a record its field map
8832
9001
  */
8833
9002
  #convertQtiVariableJSON(input) {
9003
+ if (input && Array.isArray(input.record)) {
9004
+ const record = recordFromQtiVariableJSON(input.record);
9005
+ return Object.keys(record).length ? record : null;
9006
+ }
8834
9007
  for (const topLevelKey in input) {
8835
9008
  if (input.hasOwnProperty(topLevelKey)) {
8836
9009
  const nestedObject = input[topLevelKey];
@@ -8857,44 +9030,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
8857
9030
  const needle = tagName.toLowerCase();
8858
9031
  return Array.from(this.children).filter((child) => child.tagName.toLowerCase() === needle);
8859
9032
  }
8860
- /**
8861
- * Coerce a scalar value to the expected base-type when possible
8862
- */
8863
- coerceBaseValue(value, baseType) {
8864
- if (value === null || value === void 0)
8865
- return value;
8866
- switch (baseType) {
8867
- case "integer": {
8868
- if (typeof value === "number")
8869
- return value;
8870
- const parsed = parseInt(String(value), 10);
8871
- return Number.isNaN(parsed) ? value : parsed;
8872
- }
8873
- case "float":
8874
- case "duration": {
8875
- if (typeof value === "number")
8876
- return value;
8877
- const parsed = parseFloat(String(value));
8878
- return Number.isNaN(parsed) ? value : parsed;
8879
- }
8880
- case "boolean": {
8881
- if (typeof value === "boolean")
8882
- return value;
8883
- if (typeof value === "string") {
8884
- const lowered = value.toLowerCase();
8885
- if (lowered === "true")
8886
- return true;
8887
- if (lowered === "false")
8888
- return false;
8889
- }
8890
- return value;
8891
- }
8892
- case "string":
8893
- case "identifier":
8894
- default:
8895
- return String(value);
8896
- }
8897
- }
8898
9033
  /**
8899
9034
  * Normalize an input into a list form
8900
9035
  */
@@ -8908,62 +9043,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
8908
9043
  */
8909
9044
  variableToQtiVariableJSON(value, cardinality, baseType) {
8910
9045
  if (cardinality === "record" || baseType === "record") {
8911
- return this.recordToQtiVariableJSON(value);
9046
+ return recordToQtiVariableJSON(value);
8912
9047
  }
8913
9048
  if (cardinality !== "single") {
8914
- const listValues = this.normalizeListValue(value).map((v) => this.coerceBaseValue(v, baseType));
9049
+ const listValues = this.normalizeListValue(value).map((v) => coerceBaseValue(v, baseType));
8915
9050
  return { list: { [baseType]: listValues } };
8916
9051
  }
8917
- return { base: { [baseType]: this.coerceBaseValue(value, baseType) } };
8918
- }
8919
- /**
8920
- * Convert a record object into QtiVariableJSON
8921
- */
8922
- recordToQtiVariableJSON(value) {
8923
- if (!value || typeof value !== "object") {
8924
- return { record: [] };
8925
- }
8926
- const recordEntries = [];
8927
- for (const [name, entryValue] of Object.entries(value)) {
8928
- recordEntries.push(this.recordEntryFromValue(name, entryValue));
8929
- }
8930
- return { record: recordEntries };
8931
- }
8932
- /**
8933
- * Build a record entry from an arbitrary value
8934
- */
8935
- recordEntryFromValue(name, entryValue) {
8936
- if (Array.isArray(entryValue)) {
8937
- const filtered = entryValue.filter((v) => v !== null && v !== void 0);
8938
- if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
8939
- return { name, list: { boolean: filtered } };
8940
- }
8941
- if (filtered.length && filtered.every((v) => typeof v === "number")) {
8942
- const numbers = filtered;
8943
- const isIntegers = numbers.every((n) => Number.isInteger(n));
8944
- return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
8945
- }
8946
- return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
8947
- }
8948
- if (typeof entryValue === "boolean") {
8949
- return { name, base: { boolean: entryValue } };
8950
- }
8951
- if (typeof entryValue === "number") {
8952
- if (Number.isInteger(entryValue))
8953
- return { name, base: { integer: entryValue } };
8954
- return { name, base: { float: entryValue } };
8955
- }
8956
- if (entryValue === null || entryValue === void 0) {
8957
- return { name, base: { string: "" } };
8958
- }
8959
- if (typeof entryValue === "object") {
8960
- try {
8961
- return { name, base: { string: JSON.stringify(entryValue) } };
8962
- } catch {
8963
- return { name, base: { string: String(entryValue) } };
8964
- }
8965
- }
8966
- return { name, base: { string: String(entryValue) } };
9052
+ return { base: { [baseType]: coerceBaseValue(value, baseType) } };
8967
9053
  }
8968
9054
  /**
8969
9055
  * Extract default QTI_CONTEXT values from qti-context-declaration elements
@@ -8978,15 +9064,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
8978
9064
  const defaultValueElement = declaration.querySelector("qti-default-value");
8979
9065
  if (!defaultValueElement)
8980
9066
  return;
8981
- const valueElements = defaultValueElement.querySelectorAll("qti-value[field-identifier]");
8982
- valueElements.forEach((valueElement) => {
8983
- const fieldIdentifier = valueElement.getAttribute("field-identifier");
8984
- if (!fieldIdentifier)
8985
- return;
8986
- const baseType = valueElement.getAttribute("base-type") || "string";
8987
- const textContent = valueElement.textContent?.trim() || "";
8988
- defaults[fieldIdentifier] = this.coerceBaseValue(textContent, baseType);
8989
- });
9067
+ const { value, baseTypes } = readRecordFieldValues(defaultValueElement.querySelectorAll("qti-value"));
9068
+ for (const [fieldIdentifier, textContent] of Object.entries(value)) {
9069
+ defaults[fieldIdentifier] = coerceBaseValue(textContent, baseTypes[fieldIdentifier] ?? "string");
9070
+ }
8990
9071
  });
8991
9072
  return defaults;
8992
9073
  }
@@ -9005,7 +9086,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
9005
9086
  environmentIdentifier: merged.environmentIdentifier ?? "",
9006
9087
  ...merged
9007
9088
  };
9008
- return this.recordToQtiVariableJSON(normalized);
9089
+ return recordToQtiVariableJSON(normalized);
9009
9090
  }
9010
9091
  /**
9011
9092
  * Collect template variables referenced by qti-template-variable children
@@ -9098,7 +9179,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
9098
9179
  /**
9099
9180
  * Converts response variables to QtiVariableJSON
9100
9181
  */
9101
- responseVariablesToQtiVariableJSON(input, cardinality, baseType) {
9182
+ responseVariablesToQtiVariableJSON(input, cardinality, baseType, fieldBaseTypes) {
9183
+ if (cardinality === "record") {
9184
+ return recordResponseToQtiVariableJSON(input, fieldBaseTypes);
9185
+ }
9102
9186
  if (cardinality !== "single") {
9103
9187
  const list = { list: {} };
9104
9188
  list.list[baseType] = input;
@@ -9112,6 +9196,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
9112
9196
  #hasNonEmptyResponse() {
9113
9197
  if (this.response === null || this.response === void 0)
9114
9198
  return false;
9199
+ if (isRecordValue(this.response)) {
9200
+ return Object.values(this.response).some((v) => v !== "" && v !== null && v !== void 0);
9201
+ }
9115
9202
  if (Array.isArray(this.response)) {
9116
9203
  if (this.response.length === 0)
9117
9204
  return false;
@@ -9139,6 +9226,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
9139
9226
  get value() {
9140
9227
  if (this.#value === null || this.#value === void 0)
9141
9228
  return null;
9229
+ if (isRecordValue(this.#value))
9230
+ return JSON.stringify(this.#value);
9142
9231
  return Array.isArray(this.#value) ? this.#value.join(",") : String(this.#value);
9143
9232
  }
9144
9233
  set boundTo(newValue) {
@@ -9153,10 +9242,11 @@ var QtiPortableCustomInteraction = class extends Interaction {
9153
9242
  const responseVariable = {};
9154
9243
  const variable = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier);
9155
9244
  if (variable) {
9156
- const cardinality = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier)?.cardinality || "single";
9157
- const baseType = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier)?.baseType || "string";
9158
- const value = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier)?.value || null;
9159
- const responseVal = this.responseVariablesToQtiVariableJSON(value, cardinality, baseType);
9245
+ const cardinality = variable.cardinality || "single";
9246
+ const baseType = variable.baseType || "string";
9247
+ const value = variable.value || null;
9248
+ const fieldBaseTypes = variable.fieldBaseTypes;
9249
+ const responseVal = this.responseVariablesToQtiVariableJSON(value, cardinality, baseType, fieldBaseTypes);
9160
9250
  responseVariable[this.responseIdentifier] = responseVal;
9161
9251
  }
9162
9252
  return responseVariable;
@@ -9326,11 +9416,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
9326
9416
  const iframeBaseUrl = this.dataset.baseUrl ? this.dataset.baseUrl.startsWith("/") ? `${window.location.origin}${this.dataset.baseUrl}` : this.dataset.baseUrl : "";
9327
9417
  const iframeBaseHref = iframeBaseUrl ? iframeBaseUrl.endsWith("/") ? iframeBaseUrl : `${iframeBaseUrl}/` : `${window.location.origin}/`;
9328
9418
  const forwardConsole = this.dataset.forwardConsole === "true";
9329
- const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1";
9330
- const defaultComponentsCdnUrl = isLocalhost ? `${window.location.origin}/cdn/index.js` : "https://unpkg.com/@citolab/qti-components/cdn";
9331
- const defaultComponentsCssUrl = isLocalhost ? `${window.location.origin}/dist/item.css` : "https://unpkg.com/@citolab/qti-components@latest/dist/item.css";
9332
- const componentsCdnUrl = this.dataset.componentsCdnUrl || defaultComponentsCdnUrl;
9333
- const componentsCssUrl = this.dataset.componentsCssUrl || defaultComponentsCssUrl;
9419
+ const componentsCdnUrl = this.dataset.componentsCdnUrl;
9420
+ const componentsCssUrl = this.dataset.componentsCssUrl;
9421
+ const requireJsTag = this.requireJsUrl ? `<script src="${this.requireJsUrl}"></script>` : `<script>${inlineScriptText(require_js_default)}</script>`;
9334
9422
  const fontStyles = `
9335
9423
  font-family: ${parentStyles.getPropertyValue("font-family")};
9336
9424
  font-size: ${parentStyles.getPropertyValue("font-size")};
@@ -9338,17 +9426,18 @@ var QtiPortableCustomInteraction = class extends Interaction {
9338
9426
  font-weight: ${parentStyles.getPropertyValue("font-weight")};
9339
9427
  color: ${parentStyles.getPropertyValue("color")};
9340
9428
  `;
9429
+ const langHost = this.closest("[lang], [xml\\:lang]");
9430
+ const iframeLang = [langHost?.getAttribute("lang"), langHost?.getAttribute("xml:lang"), document.documentElement.lang].map((l) => (l ?? "").trim()).find((l) => /^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$/.test(l)) ?? "en";
9341
9431
  return (
9342
9432
  /* html */
9343
9433
  `<!DOCTYPE html>
9344
- <html lang="en">
9434
+ <html lang="${iframeLang}">
9345
9435
  <head>
9346
9436
  <meta charset="utf-8" />
9347
9437
  <title>QTI PCI Container</title>
9348
9438
  <base href="${iframeBaseHref}" />
9349
- <script type="module">
9350
- import '${componentsCdnUrl}';
9351
- </script>
9439
+ ${componentsCdnUrl ? `<script type="module">import '${componentsCdnUrl}';</script>` : ""}
9440
+ <style>${inlineStyleText(native_css_default)}</style>
9352
9441
  <style>
9353
9442
  body, html {
9354
9443
  margin: 0;
@@ -9372,8 +9461,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
9372
9461
  min-height: 50px;
9373
9462
  }
9374
9463
  </style>
9375
- <link href="${componentsCssUrl}" rel="stylesheet" />
9376
- <script src="${this.requireJsUrl}"></script>
9464
+ ${componentsCssUrl ? `<link href="${componentsCssUrl}" rel="stylesheet" />` : ""}
9465
+ ${requireJsTag}
9377
9466
  <script>
9378
9467
  const forwardConsole = ${forwardConsole ? "true" : "false"};
9379
9468
  if (forwardConsole) {
@@ -11873,6 +11962,8 @@ export {
11873
11962
  elements24 as elements14,
11874
11963
  QtiOrderInteraction,
11875
11964
  elements25 as elements15,
11965
+ inlineScriptText,
11966
+ inlineStyleText,
11876
11967
  QtiPortableCustomInteraction,
11877
11968
  elements26 as elements16,
11878
11969
  QtiPositionObjectInteraction,
@@ -11888,4 +11979,4 @@ export {
11888
11979
  elements31 as elements21,
11889
11980
  qtiInteractionElements
11890
11981
  };
11891
- //# sourceMappingURL=chunk-VY2DM47N.js.map
11982
+ //# sourceMappingURL=chunk-RSSEBILM.js.map