@citolab/qti-components 9.5.0 → 9.6.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 (63) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1783 -226
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-GBZNFSFY.js → chunk-H72OXVRF.js} +2 -2
  6. package/dist/{chunk-RU6332MD.js → chunk-I7ACMH74.js} +3 -3
  7. package/dist/{chunk-DAFB2E5H.js → chunk-LOKULHVY.js} +386 -241
  8. package/dist/chunk-LOKULHVY.js.map +1 -0
  9. package/dist/{chunk-MI7774NV.js → chunk-QOFGUIYE.js} +2 -2
  10. package/dist/{chunk-TDWJ6WZA.js → chunk-QUTM5TT6.js} +37 -1
  11. package/dist/chunk-QUTM5TT6.js.map +1 -0
  12. package/dist/chunk-QVZLJY75.js +7 -0
  13. package/dist/chunk-QVZLJY75.js.map +1 -0
  14. package/dist/{chunk-SIE3E4FG.js → chunk-RGBQ65Y2.js} +18 -6
  15. package/dist/{chunk-SIE3E4FG.js.map → chunk-RGBQ65Y2.js.map} +1 -1
  16. package/dist/{chunk-SU63QGGD.js → chunk-RTS3JSEM.js} +6 -6
  17. package/dist/{chunk-FD4AB6TM.js → chunk-RV7ADJ33.js} +2 -2
  18. package/dist/{chunk-OQDBARD5.js → chunk-SUMSMTZJ.js} +2 -2
  19. package/dist/{chunk-6U3YPHXU.js → chunk-TFQAUWCM.js} +40 -5
  20. package/dist/{chunk-6U3YPHXU.js.map → chunk-TFQAUWCM.js.map} +1 -1
  21. package/dist/{chunk-6K3QWJHH.js → chunk-V3NKEAQY.js} +40 -4
  22. package/dist/chunk-V3NKEAQY.js.map +1 -0
  23. package/dist/{chunk-YZRODVYZ.js → chunk-YS6CBO45.js} +2 -2
  24. package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-SsTm3ieP.d.ts} +1 -1
  25. package/dist/corrections.d.ts +9 -9
  26. package/dist/corrections.js +8 -8
  27. package/dist/elements.d.ts +2 -2
  28. package/dist/elements.js +3 -3
  29. package/dist/index.d.ts +10 -10
  30. package/dist/index.js +25 -13
  31. package/dist/interactions.d.ts +4 -4
  32. package/dist/interactions.js +7 -3
  33. package/dist/item.css +2 -1
  34. package/dist/item.d.ts +4 -4
  35. package/dist/item.js +4 -4
  36. package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
  37. package/dist/loader.d.ts +2 -2
  38. package/dist/processing.d.ts +10 -3
  39. package/dist/processing.js +3 -3
  40. package/dist/qti-components-jsx.d.ts +47 -26
  41. package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
  42. package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
  43. package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
  44. package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-DjWvKbfL.d.ts} +1 -1
  45. package/dist/{qti-test.d-86TlaMlI.d.ts → qti-test.d-ClQtDdgx.d.ts} +10 -5
  46. package/dist/{qti-text-entry-interaction.d-C4eixT-D.d.ts → qti-text-entry-interaction.d-h5UZ8Qvp.d.ts} +28 -18
  47. package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
  48. package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-Cw8GcziG.d.ts} +1 -1
  49. package/dist/test.d.ts +7 -7
  50. package/dist/test.js +7 -5
  51. package/package.json +6 -6
  52. package/dist/chunk-6K3QWJHH.js.map +0 -1
  53. package/dist/chunk-DAFB2E5H.js.map +0 -1
  54. package/dist/chunk-TDWJ6WZA.js.map +0 -1
  55. package/dist/chunk-ZP6QQYSU.js +0 -7
  56. package/dist/chunk-ZP6QQYSU.js.map +0 -1
  57. /package/dist/{chunk-GBZNFSFY.js.map → chunk-H72OXVRF.js.map} +0 -0
  58. /package/dist/{chunk-RU6332MD.js.map → chunk-I7ACMH74.js.map} +0 -0
  59. /package/dist/{chunk-MI7774NV.js.map → chunk-QOFGUIYE.js.map} +0 -0
  60. /package/dist/{chunk-SU63QGGD.js.map → chunk-RTS3JSEM.js.map} +0 -0
  61. /package/dist/{chunk-FD4AB6TM.js.map → chunk-RV7ADJ33.js.map} +0 -0
  62. /package/dist/{chunk-OQDBARD5.js.map → chunk-SUMSMTZJ.js.map} +0 -0
  63. /package/dist/{chunk-YZRODVYZ.js.map → chunk-YS6CBO45.js.map} +0 -0
@@ -61,6 +61,8 @@ import type {
61
61
  QtiMediaInteraction,
62
62
  QtiOrderInteraction,
63
63
  QtiPortableCustomInteraction,
64
+ inlineScriptText,
65
+ inlineStyleText,
64
66
  QtiPortableCustomInteractionTest,
65
67
  QtiPositionObjectInteraction,
66
68
  QtiPositionObjectStage,
@@ -105,6 +107,7 @@ import type {
105
107
  TestPrev,
106
108
  TestPrintContext,
107
109
  TestPrintVariables,
110
+ formatVariableValue,
108
111
  TestScoringButtons,
109
112
  TestScoringFeedback,
110
113
  TestSectionButtonsStamp,
@@ -2165,6 +2168,14 @@ casts, rather than pretending at an encapsulation the type system was the only t
2165
2168
  };
2166
2169
 
2167
2170
  export type QtiGraphicGapMatchInteractionProps = {
2171
+ /** A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
2172
+ `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
2173
+ beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
2174
+ declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
2175
+ their hotspots through `--qti-graphic-scale` instead. */
2176
+ autoSizeDropzones?:
2177
+ | QtiGraphicGapMatchInteraction["autoSizeDropzones"]
2178
+ | undefined;
2168
2179
  /** */
2169
2180
  allowReorder?: QtiGraphicGapMatchInteraction["allowReorder"] | undefined;
2170
2181
  /** */
@@ -2178,6 +2189,14 @@ export type QtiGraphicGapMatchInteractionProps = {
2178
2189
  };
2179
2190
 
2180
2191
  export type QtiGraphicGapMatchInteractionSolidJsProps = {
2192
+ /** A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
2193
+ `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
2194
+ beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
2195
+ declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
2196
+ their hotspots through `--qti-graphic-scale` instead. */
2197
+ "prop:autoSizeDropzones"?:
2198
+ | QtiGraphicGapMatchInteraction["autoSizeDropzones"]
2199
+ | undefined;
2181
2200
  /** */
2182
2201
  "prop:allowReorder"?:
2183
2202
  | QtiGraphicGapMatchInteraction["allowReorder"]
@@ -3147,11 +3166,11 @@ export type QtiPortableCustomInteractionProps = {
3147
3166
  | undefined;
3148
3167
  /** */
3149
3168
  requireShimJson?: QtiPortableCustomInteraction["requireShimJson"] | undefined;
3150
- /** */
3169
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3151
3170
  "data-require-js-url"?:
3152
3171
  | QtiPortableCustomInteraction["requireJsUrl"]
3153
3172
  | undefined;
3154
- /** */
3173
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3155
3174
  requireJsUrl?: QtiPortableCustomInteraction["requireJsUrl"] | undefined;
3156
3175
  /** */
3157
3176
  "data-base-url"?: QtiPortableCustomInteraction["baseUrl"] | undefined;
@@ -3256,11 +3275,11 @@ export type QtiPortableCustomInteractionSolidJsProps = {
3256
3275
  "prop:requireShimJson"?:
3257
3276
  | QtiPortableCustomInteraction["requireShimJson"]
3258
3277
  | undefined;
3259
- /** */
3278
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3260
3279
  "attr:data-require-js-url"?:
3261
3280
  | QtiPortableCustomInteraction["requireJsUrl"]
3262
3281
  | undefined;
3263
- /** */
3282
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3264
3283
  "prop:requireJsUrl"?:
3265
3284
  | QtiPortableCustomInteraction["requireJsUrl"]
3266
3285
  | undefined;
@@ -3375,11 +3394,11 @@ export type QtiPortableCustomInteractionTestProps = {
3375
3394
  requireShimJson?:
3376
3395
  | QtiPortableCustomInteractionTest["requireShimJson"]
3377
3396
  | undefined;
3378
- /** */
3397
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3379
3398
  "data-require-js-url"?:
3380
3399
  | QtiPortableCustomInteractionTest["requireJsUrl"]
3381
3400
  | undefined;
3382
- /** */
3401
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3383
3402
  requireJsUrl?: QtiPortableCustomInteractionTest["requireJsUrl"] | undefined;
3384
3403
  /** */
3385
3404
  "data-base-url"?: QtiPortableCustomInteractionTest["baseUrl"] | undefined;
@@ -3486,11 +3505,11 @@ export type QtiPortableCustomInteractionTestSolidJsProps = {
3486
3505
  "prop:requireShimJson"?:
3487
3506
  | QtiPortableCustomInteractionTest["requireShimJson"]
3488
3507
  | undefined;
3489
- /** */
3508
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3490
3509
  "attr:data-require-js-url"?:
3491
3510
  | QtiPortableCustomInteractionTest["requireJsUrl"]
3492
3511
  | undefined;
3493
- /** */
3512
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
3494
3513
  "prop:requireJsUrl"?:
3495
3514
  | QtiPortableCustomInteractionTest["requireJsUrl"]
3496
3515
  | undefined;
@@ -7968,6 +7987,11 @@ export type CustomElements = {
7968
7987
  *
7969
7988
  * Component attributes and properties that can be applied to the element or by using JavaScript.
7970
7989
  *
7990
+ * - `autoSizeDropzones`: A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
7991
+ * `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
7992
+ * beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
7993
+ * declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
7994
+ * their hotspots through `--qti-graphic-scale` instead. (property only)
7971
7995
  * - `allowReorder`: undefined (property only)
7972
7996
  * - `sortablePlaceholderConfig`: undefined (property only)
7973
7997
  * - `sortableAnimationConfig`: undefined (property only)
@@ -8632,7 +8656,7 @@ export type CustomElements = {
8632
8656
  * - `custom-interaction-type-identifier`/`customInteractionTypeIdentifier`: undefined
8633
8657
  * - `data-require-paths`/`requirePathsJson`: undefined
8634
8658
  * - `data-require-shim`/`requireShimJson`: undefined
8635
- * - `data-require-js-url`/`requireJsUrl`: undefined
8659
+ * - `data-require-js-url`/`requireJsUrl`: A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts).
8636
8660
  * - `data-base-url`/`baseUrl`: undefined
8637
8661
  * - `data-use-default-paths`/`useDefaultPaths`: undefined
8638
8662
  * - `data-status`/`status`: Item lifecycle status handed to the PCI in its `getInstance` configuration.
@@ -8715,7 +8739,7 @@ export type CustomElements = {
8715
8739
  * - `custom-interaction-type-identifier`/`customInteractionTypeIdentifier`: undefined
8716
8740
  * - `data-require-paths`/`requirePathsJson`: undefined
8717
8741
  * - `data-require-shim`/`requireShimJson`: undefined
8718
- * - `data-require-js-url`/`requireJsUrl`: undefined
8742
+ * - `data-require-js-url`/`requireJsUrl`: A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts).
8719
8743
  * - `data-base-url`/`baseUrl`: undefined
8720
8744
  * - `data-use-default-paths`/`useDefaultPaths`: undefined
8721
8745
  * - `data-status`/`status`: Item lifecycle status handed to the PCI in its `getInstance` configuration.
@@ -10484,6 +10508,9 @@ export type CustomElements = {
10484
10508
  *
10485
10509
  * Component attributes and properties that can be applied to the element or by using JavaScript.
10486
10510
  *
10511
+ * - `resultBaseType`: The base type of the field last read: as declared on the record's correct response when it
10512
+ * is, otherwise read off the value. The value alone is a string like `"4.1"` or `"455 250"`, and
10513
+ * an operator reading it as text would refuse to compare it as a number or test it as a point. (property only) (readonly)
10487
10514
  * - `lastResult`: What the last `calculate()` produced, or undefined if it has not run.
10488
10515
  *
10489
10516
  * This is the supported way to inspect a scoring run: process the responses,
@@ -10491,13 +10518,6 @@ export type CustomElements = {
10491
10518
  * to visualise how a score came about gets the whole tree annotated with its
10492
10519
  * values, without the components having to re-render to show them. (property only) (readonly)
10493
10520
  * - `lastVariables`: undefined (property only) (readonly)
10494
- * - `resultBaseType`: The base type this operator always produces, when the QTI vocabulary fixes
10495
- * one regardless of its operands — `qti-divide` is a float even dividing two
10496
- * integers exactly, and `qti-round` is an integer whatever it rounds.
10497
- *
10498
- * Left undefined by operators whose result type follows their operands (a
10499
- * `qti-sum` of integers is an integer) and by those that return no number at
10500
- * all; the type is then read off the value. (property only) (readonly)
10501
10521
  * - `getVariables`: undefined (property only)
10502
10522
  *
10503
10523
  * ## Methods
@@ -13705,6 +13725,11 @@ export type CustomElementsSolidJs = {
13705
13725
  *
13706
13726
  * Component attributes and properties that can be applied to the element or by using JavaScript.
13707
13727
  *
13728
+ * - `autoSizeDropzones`: A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
13729
+ * `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
13730
+ * beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
13731
+ * declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
13732
+ * their hotspots through `--qti-graphic-scale` instead. (property only)
13708
13733
  * - `allowReorder`: undefined (property only)
13709
13734
  * - `sortablePlaceholderConfig`: undefined (property only)
13710
13735
  * - `sortableAnimationConfig`: undefined (property only)
@@ -14387,7 +14412,7 @@ export type CustomElementsSolidJs = {
14387
14412
  * - `custom-interaction-type-identifier`/`customInteractionTypeIdentifier`: undefined
14388
14413
  * - `data-require-paths`/`requirePathsJson`: undefined
14389
14414
  * - `data-require-shim`/`requireShimJson`: undefined
14390
- * - `data-require-js-url`/`requireJsUrl`: undefined
14415
+ * - `data-require-js-url`/`requireJsUrl`: A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts).
14391
14416
  * - `data-base-url`/`baseUrl`: undefined
14392
14417
  * - `data-use-default-paths`/`useDefaultPaths`: undefined
14393
14418
  * - `data-status`/`status`: Item lifecycle status handed to the PCI in its `getInstance` configuration.
@@ -14471,7 +14496,7 @@ export type CustomElementsSolidJs = {
14471
14496
  * - `custom-interaction-type-identifier`/`customInteractionTypeIdentifier`: undefined
14472
14497
  * - `data-require-paths`/`requirePathsJson`: undefined
14473
14498
  * - `data-require-shim`/`requireShimJson`: undefined
14474
- * - `data-require-js-url`/`requireJsUrl`: undefined
14499
+ * - `data-require-js-url`/`requireJsUrl`: A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts).
14475
14500
  * - `data-base-url`/`baseUrl`: undefined
14476
14501
  * - `data-use-default-paths`/`useDefaultPaths`: undefined
14477
14502
  * - `data-status`/`status`: Item lifecycle status handed to the PCI in its `getInstance` configuration.
@@ -16406,6 +16431,9 @@ export type CustomElementsSolidJs = {
16406
16431
  *
16407
16432
  * Component attributes and properties that can be applied to the element or by using JavaScript.
16408
16433
  *
16434
+ * - `resultBaseType`: The base type of the field last read: as declared on the record's correct response when it
16435
+ * is, otherwise read off the value. The value alone is a string like `"4.1"` or `"455 250"`, and
16436
+ * an operator reading it as text would refuse to compare it as a number or test it as a point. (property only) (readonly)
16409
16437
  * - `lastResult`: What the last `calculate()` produced, or undefined if it has not run.
16410
16438
  *
16411
16439
  * This is the supported way to inspect a scoring run: process the responses,
@@ -16413,13 +16441,6 @@ export type CustomElementsSolidJs = {
16413
16441
  * to visualise how a score came about gets the whole tree annotated with its
16414
16442
  * values, without the components having to re-render to show them. (property only) (readonly)
16415
16443
  * - `lastVariables`: undefined (property only) (readonly)
16416
- * - `resultBaseType`: The base type this operator always produces, when the QTI vocabulary fixes
16417
- * one regardless of its operands — `qti-divide` is a float even dividing two
16418
- * integers exactly, and `qti-round` is an integer whatever it rounds.
16419
- *
16420
- * Left undefined by operators whose result type follows their operands (a
16421
- * `qti-sum` of integers is an integer) and by those that return no number at
16422
- * all; the type is then read off the value. (property only) (readonly)
16423
16444
  * - `getVariables`: undefined (property only)
16424
16445
  *
16425
16446
  * ## Methods
@@ -1,4 +1,4 @@
1
- import { Q as QtiExpression } from './qti-expression.d-BPxEp8HU.js';
1
+ import { Q as QtiExpression } from './qti-expression.d-B-Cfbqlb.js';
2
2
 
3
3
  declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
4
4
  calculate(): Readonly<boolean>;
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
- import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-B55QkJ92.js';
3
+ import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
4
4
  import { a as QtiContextType, Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
5
5
 
6
6
  interface TestContext {
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
- import { a as Cardinality } from './item.types.d-B55QkJ92.js';
3
+ import { a as Cardinality } from './item.types.d-DuVR0ZVK.js';
4
4
 
5
5
  declare abstract class QtiVariableDeclaration extends LitElement {
6
6
  render(): lit.TemplateResult<1>;
@@ -1,7 +1,7 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
4
- import { C as ComputedItemContext, V as View } from './session.context.d-D5080LVx.js';
4
+ import { C as ComputedItemContext, V as View } from './session.context.d-Cw8GcziG.js';
5
5
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
6
6
  import { QtiAssessmentItem } from './elements.js';
7
7
 
@@ -1,13 +1,13 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues, nothing } from 'lit';
3
3
  import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-BL7GGFJj.js';
4
- import { C as ComputedContext, a as ComputedItem } from './computed.types.d-gJrBeUMG.js';
4
+ import { C as ComputedContext, a as ComputedItem } from './computed.types.d-SsTm3ieP.js';
5
5
  import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
6
6
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
7
- import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-BPxEp8HU.js';
7
+ import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-B-Cfbqlb.js';
8
8
  import { TemplateFunction } from '@heximal/templates';
9
- import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-B55QkJ92.js';
10
- import { S as SessionContext, V as View } from './session.context.d-D5080LVx.js';
9
+ import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
10
+ import { S as SessionContext, V as View } from './session.context.d-Cw8GcziG.js';
11
11
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
12
12
  import { b as QtiRuleBase } from './qti-rule-base.d-Bdzg8eGH.js';
13
13
 
@@ -655,6 +655,11 @@ declare global {
655
655
  }
656
656
  }
657
657
 
658
+ /**
659
+ * A variable value as text: a list as `a, b`, a record (e.g. the response of a PCI) as `time: 3.6, point: 455 250`.
660
+ * Without this a record printed as "[object Object]".
661
+ */
662
+ declare const formatVariableValue: (value: unknown) => string;
658
663
  declare class TestPrintVariables extends LitElement {
659
664
  computedContext?: ComputedContext;
660
665
  static styles: lit.CSSResult;
@@ -1123,4 +1128,4 @@ declare global {
1123
1128
  }
1124
1129
  }
1125
1130
 
1126
- export { TestScoringButtons as A, TestScoringFeedback as B, TestSectionButtonsStamp as C, TestSectionLink as D, TestStamp as E, TestTtsNext as F, TestTtsPause as G, TestTtsPick as H, type ITestNavigationMixin as I, TestTtsPlay as J, TestTtsPrev as K, TestTtsResume as L, TestTtsStop as M, TestView as N, TestViewToggle as O, type TtsContext as P, QtiAssessmentItemRef as Q, ttsContext as R, type SpeechState as S, TestCheckItem as T, type ItemVariableValue as U, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberPresented as g, QtiNumberSelected as h, QtiOutcomeProcessing as i, QtiOutcomeProcessingProcessor as j, QtiPreCondition as k, QtiTest as l, QtiTestFeedback as m, QtiTestPart as n, QtiTestVariables as o, QtiTestVariablesExpression as p, TestContainer as q, TestEndAttempt as r, TestItemLink as s, TestItemToSpeech as t, TestNavigation as u, TestNext as v, TestPagingButtonsStamp as w, TestPrev as x, TestPrintContext as y, TestPrintVariables as z };
1131
+ export { TestScoringButtons as A, TestScoringFeedback as B, TestSectionButtonsStamp as C, TestSectionLink as D, TestStamp as E, TestTtsNext as F, TestTtsPause as G, TestTtsPick as H, type ITestNavigationMixin as I, TestTtsPlay as J, TestTtsPrev as K, TestTtsResume as L, TestTtsStop as M, TestView as N, TestViewToggle as O, type TtsContext as P, QtiAssessmentItemRef as Q, formatVariableValue as R, type SpeechState as S, TestCheckItem as T, ttsContext as U, type ItemVariableValue as V, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberPresented as g, QtiNumberSelected as h, QtiOutcomeProcessing as i, QtiOutcomeProcessingProcessor as j, QtiPreCondition as k, QtiTest as l, QtiTestFeedback as m, QtiTestPart as n, QtiTestVariables as o, QtiTestVariablesExpression as p, TestContainer as q, TestEndAttempt as r, TestItemLink as s, TestItemToSpeech as t, TestNavigation as u, TestNext as v, TestPagingButtonsStamp as w, TestPrev as x, TestPrintContext as y, TestPrintVariables as z };
@@ -1,9 +1,9 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { I as Interaction } from './interaction.d-g6XG0T0Z.js';
3
+ import { I as Interaction, b as RecordValue } from './record.d-wB9uYs-j.js';
4
4
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
5
5
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
6
- import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-B55QkJ92.js';
6
+ import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-DuVR0ZVK.js';
7
7
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
8
8
  import * as lit_directives_ref_js from 'lit/directives/ref.js';
9
9
 
@@ -750,6 +750,20 @@ declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[])
750
750
  declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
751
751
  #private;
752
752
  static styles: CSSResultGroup;
753
+ /**
754
+ * A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
755
+ * `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
756
+ * beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
757
+ * declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
758
+ * their hotspots through `--qti-graphic-scale` instead.
759
+ */
760
+ autoSizeDropzones: boolean;
761
+ /**
762
+ * Rendered width of the graphic over its declared width: the factor the drop areas are scaled by.
763
+ * Published as `--qti-graphic-scale` on both slots, so it reaches a chip in the bank and one placed
764
+ * in a hotspot (qti-gap-img.styles.ts), without writing to the light-DOM host.
765
+ */
766
+ private _graphicScale;
753
767
  render(): lit.TemplateResult<1>;
754
768
  shouldReturnToInventoryOnInventoryDrop(): boolean;
755
769
  connectedCallback(): void;
@@ -1107,10 +1121,11 @@ type PciInteractionStatus = 'interacting' | 'suspended' | 'closed' | 'solution'
1107
1121
  * Correct response of a response declaration, mirroring `qti-correct-response`.
1108
1122
  *
1109
1123
  * `value` holds the authored `qti-value` content: a single value for `single`
1110
- * cardinality, an array of values for every other cardinality.
1124
+ * cardinality, a field map (`{ time: '4.0', point: '460 245' }`) for `record`
1125
+ * cardinality, and an array of values for every other cardinality.
1111
1126
  */
1112
1127
  interface PciCorrectResponse {
1113
- value: string | string[];
1128
+ value: string | string[] | Record<string, string | string[] | null>;
1114
1129
  }
1115
1130
  /**
1116
1131
  * Response declaration passed into the `getInstance` configuration so a PCI can
@@ -1203,6 +1218,12 @@ declare type QtiVariableJSON = {
1203
1218
  record?: QtiRecordItem[] | null;
1204
1219
  };
1205
1220
 
1221
+ /** Text for an inline `<script>`: a `</script` inside it would end the element early. */
1222
+ declare const inlineScriptText: (text: string) => string;
1223
+ /** Text for an inline `<style>`: a `</style` inside it would end the element early. */
1224
+ declare const inlineStyleText: (text: string) => string;
1225
+ /** A response value as this interaction holds it: a record response is its field map. */
1226
+ type PciResponseValue = string | string[] | RecordValue;
1206
1227
  declare class QtiPortableCustomInteraction extends Interaction {
1207
1228
  #private;
1208
1229
  protected _iframeLoaded: boolean;
@@ -1218,6 +1239,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
1218
1239
  customInteractionTypeIdentifier: string;
1219
1240
  requirePathsJson: string;
1220
1241
  requireShimJson: string;
1242
+ /** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
1221
1243
  requireJsUrl: string;
1222
1244
  baseUrl: string;
1223
1245
  useDefaultPaths: boolean;
@@ -1245,10 +1267,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
1245
1267
  * Get direct child elements by tag name
1246
1268
  */
1247
1269
  private getDirectChildrenByTag;
1248
- /**
1249
- * Coerce a scalar value to the expected base-type when possible
1250
- */
1251
- private coerceBaseValue;
1252
1270
  /**
1253
1271
  * Normalize an input into a list form
1254
1272
  */
@@ -1257,14 +1275,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
1257
1275
  * Convert a variable value to QtiVariableJSON
1258
1276
  */
1259
1277
  private variableToQtiVariableJSON;
1260
- /**
1261
- * Convert a record object into QtiVariableJSON
1262
- */
1263
- private recordToQtiVariableJSON;
1264
- /**
1265
- * Build a record entry from an arbitrary value
1266
- */
1267
- private recordEntryFromValue;
1268
1278
  /**
1269
1279
  * Extract default QTI_CONTEXT values from qti-context-declaration elements
1270
1280
  */
@@ -1284,7 +1294,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
1284
1294
  /**
1285
1295
  * Converts response variables to QtiVariableJSON
1286
1296
  */
1287
- protected responseVariablesToQtiVariableJSON(input: string | string[], cardinality: Cardinality, baseType: BaseType): QtiVariableJSON;
1297
+ protected responseVariablesToQtiVariableJSON(input: PciResponseValue, cardinality: Cardinality, baseType: BaseType, fieldBaseTypes?: Record<string, BaseType>): QtiVariableJSON;
1288
1298
  validate(): boolean;
1289
1299
  set value(v: string | null);
1290
1300
  get value(): string | null;
@@ -1570,4 +1580,4 @@ declare global {
1570
1580
  }
1571
1581
  }
1572
1582
 
1573
- export { type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y, QtiPortableCustomInteractionTest as z };
1583
+ export { inlineStyleText as A, QtiPortableCustomInteractionTest as B, type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y, inlineScriptText as z };
@@ -1,7 +1,7 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-BvU9r-Mg.js';
3
3
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
4
- import { g as ResponseVariable } from './item.types.d-B55QkJ92.js';
4
+ import { g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
5
5
 
6
6
  /**
7
7
  * What a choice element should render and behave as. The same element — `qti-simple-choice`,
@@ -123,4 +123,36 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
123
123
  protected firstUpdated(_changedProperties?: PropertyValues): void;
124
124
  }
125
125
 
126
- export { type ChoiceRole as C, Interaction as I, type InteractionContext as a, interactionContext as i };
126
+ /**
127
+ * The value of a variable with `record` cardinality: its fields by field identifier.
128
+ *
129
+ * Field values are kept the way every other response value is kept, as QTI string literals — a
130
+ * float is `"4.12"`, a point is `"455 250"` — with a list-valued field as an array of them.
131
+ */
132
+ type RecordValue = Record<string, string | string[] | null>;
133
+ /** A record's field values with the base type each `qti-value` declared for its field. */
134
+ interface RecordFieldValues {
135
+ value: RecordValue;
136
+ baseTypes: Record<string, BaseType>;
137
+ }
138
+ /** Whether a variable value is a record: a plain object, not a list and not NULL. */
139
+ declare const isRecordValue: (value: unknown) => value is RecordValue;
140
+ /**
141
+ * Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
142
+ * elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
143
+ *
144
+ * A value without a `field-identifier` is not a record field and is skipped. A field without a
145
+ * `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
146
+ */
147
+ declare const readRecordFieldValues: (valueElements: Iterable<Element>) => RecordFieldValues;
148
+ /**
149
+ * A best guess at a record field's base type, for when the declaration does not say.
150
+ *
151
+ * A record field value carries no type of its own once it is stored, and a record response
152
+ * declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
153
+ * when given as a whole JS number), two numbers separated by whitespace are a point, and
154
+ * anything else is a string.
155
+ */
156
+ declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
157
+
158
+ export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type InteractionContext as a, type RecordValue as b, interactionContext as c, isRecordValue as d, inferRecordFieldBaseType as i, readRecordFieldValues as r };
@@ -1,4 +1,4 @@
1
- import { V as VariableDeclaration } from './item.types.d-B55QkJ92.js';
1
+ import { V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
2
2
 
3
3
  type ComputedItemContext = {
4
4
  identifier: string;
package/dist/test.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { U as ItemVariableValue, I as ITestNavigationMixin, a as ITestStateMixin } from './qti-test.d-86TlaMlI.js';
2
- export { b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as QtiNumberPresented, h as QtiNumberSelected, i as QtiOutcomeProcessing, j as QtiOutcomeProcessingProcessor, k as QtiPreCondition, l as QtiTest, m as QtiTestFeedback, n as QtiTestPart, o as QtiTestVariables, p as QtiTestVariablesExpression, S as SpeechState, T as TestCheckItem, q as TestContainer, r as TestEndAttempt, s as TestItemLink, t as TestItemToSpeech, u as TestNavigation, v as TestNext, w as TestPagingButtonsStamp, x as TestPrev, y as TestPrintContext, z as TestPrintVariables, A as TestScoringButtons, B as TestScoringFeedback, C as TestSectionButtonsStamp, D as TestSectionLink, E as TestStamp, F as TestTtsNext, G as TestTtsPause, H as TestTtsPick, J as TestTtsPlay, K as TestTtsPrev, L as TestTtsResume, M as TestTtsStop, N as TestView, O as TestViewToggle, P as TtsContext, R as ttsContext } from './qti-test.d-86TlaMlI.js';
1
+ import { V as ItemVariableValue, I as ITestNavigationMixin, a as ITestStateMixin } from './qti-test.d-ClQtDdgx.js';
2
+ export { b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as QtiNumberPresented, h as QtiNumberSelected, i as QtiOutcomeProcessing, j as QtiOutcomeProcessingProcessor, k as QtiPreCondition, l as QtiTest, m as QtiTestFeedback, n as QtiTestPart, o as QtiTestVariables, p as QtiTestVariablesExpression, S as SpeechState, T as TestCheckItem, q as TestContainer, r as TestEndAttempt, s as TestItemLink, t as TestItemToSpeech, u as TestNavigation, v as TestNext, w as TestPagingButtonsStamp, x as TestPrev, y as TestPrintContext, z as TestPrintVariables, A as TestScoringButtons, B as TestScoringFeedback, C as TestSectionButtonsStamp, D as TestSectionLink, E as TestStamp, F as TestTtsNext, G as TestTtsPause, H as TestTtsPick, J as TestTtsPlay, K as TestTtsPrev, L as TestTtsResume, M as TestTtsStop, N as TestView, O as TestViewToggle, P as TtsContext, R as formatVariableValue, U as ttsContext } from './qti-test.d-ClQtDdgx.js';
3
3
  import { LitElement } from 'lit';
4
- import { b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-B55QkJ92.js';
5
- import { S as SessionContext } from './session.context.d-D5080LVx.js';
4
+ import { b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
5
+ import { S as SessionContext } from './session.context.d-Cw8GcziG.js';
6
6
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
7
- import { T as TestContext } from './qti-expression.d-BPxEp8HU.js';
7
+ import { T as TestContext } from './qti-expression.d-B-Cfbqlb.js';
8
8
  import './qti-transform-test.d-BL7GGFJj.js';
9
- import './computed.types.d-gJrBeUMG.js';
9
+ import './computed.types.d-SsTm3ieP.js';
10
10
  import './elements.js';
11
11
  import './interaction.interface.d-CvjHM2bi.js';
12
- import './qti-feedback.d-wMYNVkkj.js';
12
+ import './qti-feedback.d-DbzPSJuK.js';
13
13
  import './qti-rule-base.d-Bdzg8eGH.js';
14
14
  import './qti.context.d-CejJMlfZ.js';
15
15
  import '@heximal/templates';
package/dist/test.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-OQDBARD5.js";
1
+ import "./chunk-SUMSMTZJ.js";
2
2
  import {
3
3
  QTI_TEST_STATE_VERSION,
4
4
  QtiAssessmentItemRef,
@@ -41,13 +41,14 @@ import {
41
41
  TestTtsStop,
42
42
  TestView,
43
43
  TestViewToggle,
44
+ formatVariableValue,
44
45
  ttsContext
45
- } from "./chunk-SIE3E4FG.js";
46
- import "./chunk-6U3YPHXU.js";
47
- import "./chunk-ZP6QQYSU.js";
46
+ } from "./chunk-RGBQ65Y2.js";
47
+ import "./chunk-TFQAUWCM.js";
48
+ import "./chunk-QVZLJY75.js";
48
49
  import "./chunk-4DB4SC5K.js";
49
50
  import "./chunk-TLAVOBEM.js";
50
- import "./chunk-TDWJ6WZA.js";
51
+ import "./chunk-QUTM5TT6.js";
51
52
  export {
52
53
  QTI_TEST_STATE_VERSION,
53
54
  QtiAssessmentItemRef,
@@ -90,6 +91,7 @@ export {
90
91
  TestTtsStop,
91
92
  TestView,
92
93
  TestViewToggle,
94
+ formatVariableValue,
93
95
  ttsContext
94
96
  };
95
97
  //# sourceMappingURL=test.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@citolab/qti-components",
3
3
  "description": "QTI component utilities",
4
- "version": "9.5.0",
4
+ "version": "9.6.1",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "@heximal/templates": "^0.1.5",
@@ -10,15 +10,15 @@
10
10
  "lit-html": "^3.3.1"
11
11
  },
12
12
  "devDependencies": {
13
- "@qti-components/base": "^2.4.1",
13
+ "@qti-components/base": "^2.5.0",
14
14
  "@qti-components/corrections": "^0.4.0",
15
- "@qti-components/elements": "^1.10.0",
15
+ "@qti-components/elements": "^1.10.1",
16
16
  "@qti-components/interactions": "^1.10.4",
17
17
  "@qti-components/item": "^1.5.0",
18
18
  "@qti-components/loader": "^1.3.3",
19
- "@qti-components/processing": "^1.6.0",
20
- "@qti-components/test": "^1.10.0",
21
- "@qti-components/theme": "^2.2.2",
19
+ "@qti-components/processing": "^1.6.1",
20
+ "@qti-components/test": "^1.10.1",
21
+ "@qti-components/theme": "^2.3.0",
22
22
  "@qti-components/transformers": "^1.7.3"
23
23
  },
24
24
  "exports": {