@qti-components/base 2.5.0-next.1 → 2.5.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from './lib/response';
23
23
  export * from './lib/expression-result';
24
24
  export * from './lib/interaction.interface';
25
25
  export * from './lib/variables';
26
+ export * from './lib/record';
26
27
  export * from './lib/qti-rule-base';
27
28
  export * from './lib/custom-operators';
28
29
  export * from './utils/custom-state-set';
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ export * from './lib/response';
23
23
  export * from './lib/expression-result';
24
24
  export * from './lib/interaction.interface';
25
25
  export * from './lib/variables';
26
+ export * from './lib/record';
26
27
  export * from './lib/qti-rule-base';
27
28
  export * from './lib/custom-operators';
28
29
  export * from './utils/custom-state-set';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,YAAY,CAAC;AAEpB,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AAEnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC","sourcesContent":["import './context/context-root';\nimport './register';\n\nexport * from './context/computed-item.context';\nexport * from './context/types/computed-item.types';\nexport * from './context/computed.context';\nexport * from './context/types/computed.types';\nexport * from './context/config.context';\nexport * from './context/interaction.context';\nexport * from './context/item.context';\nexport * from './context/types/item.types';\nexport * from './context/qti.context';\nexport * from './context/session.context';\nexport * from './context/test.context';\n\nexport * from './styles/box-sizing.styles';\nexport * from './styles/drop-region.styles';\nexport * from './styles/validation-message.styles';\n\nexport * from './abstract/interaction';\nexport * from './abstract/qti-variable-declaration';\nexport * from './abstract/qti-condition-expression';\nexport * from './abstract/qti-feedback';\nexport * from './abstract/qti-expression';\n\nexport * from './lib/response';\nexport * from './lib/expression-result';\nexport * from './lib/interaction.interface';\nexport * from './lib/variables';\nexport * from './lib/qti-rule-base';\nexport * from './lib/custom-operators';\n\nexport * from './utils/custom-state-set';\nexport * from './utils/scoring-helper';\nexport * from './utils/utils';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAChC,OAAO,YAAY,CAAC;AAEpB,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AAEnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC","sourcesContent":["import './context/context-root';\nimport './register';\n\nexport * from './context/computed-item.context';\nexport * from './context/types/computed-item.types';\nexport * from './context/computed.context';\nexport * from './context/types/computed.types';\nexport * from './context/config.context';\nexport * from './context/interaction.context';\nexport * from './context/item.context';\nexport * from './context/types/item.types';\nexport * from './context/qti.context';\nexport * from './context/session.context';\nexport * from './context/test.context';\n\nexport * from './styles/box-sizing.styles';\nexport * from './styles/drop-region.styles';\nexport * from './styles/validation-message.styles';\n\nexport * from './abstract/interaction';\nexport * from './abstract/qti-variable-declaration';\nexport * from './abstract/qti-condition-expression';\nexport * from './abstract/qti-feedback';\nexport * from './abstract/qti-expression';\n\nexport * from './lib/response';\nexport * from './lib/expression-result';\nexport * from './lib/interaction.interface';\nexport * from './lib/variables';\nexport * from './lib/record';\nexport * from './lib/qti-rule-base';\nexport * from './lib/custom-operators';\n\nexport * from './utils/custom-state-set';\nexport * from './utils/scoring-helper';\nexport * from './utils/utils';\n"]}
@@ -12,7 +12,7 @@ export interface Calculate {
12
12
  }
13
13
  export type float = number;
14
14
  export type integer = number;
15
- export type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair' | 'record';
15
+ export type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair' | 'point' | 'record';
16
16
  export type Multiple = string | string[][];
17
17
  export type Ordered = string | string[][];
18
18
  export type Cardinality = 'multiple' | 'ordered' | 'single' | 'record';
@@ -1 +1 @@
1
- {"version":3,"file":"expression-result.js","sourceRoot":"","sources":["../../src/lib/expression-result.ts"],"names":[],"mappings":"","sourcesContent":["export interface directedPair {\n destination: string;\n source: string;\n}\n\n// PK: EVENT: response from a INTERACTION_RESPONSE qti-interaction\nexport interface ResponseInteraction {\n responseIdentifier: string;\n response: string | string[];\n state?: string | null;\n}\n\nexport interface Calculate {\n calculate: () => string | string[];\n}\n\nexport type float = number;\nexport type integer = number;\n\n// export type string|string[] = string | string[];\n\nexport type BaseType =\n | 'boolean'\n | 'directedPair'\n | 'duration'\n | 'float'\n | 'integer'\n | 'string'\n | 'identifier'\n | 'pair'\n | 'record'; // record is a special type for QTI context variables\n\nexport type Multiple = string | string[][];\nexport type Ordered = string | string[][];\n\nexport type Cardinality = 'multiple' | 'ordered' | 'single' | 'record';\n"]}
1
+ {"version":3,"file":"expression-result.js","sourceRoot":"","sources":["../../src/lib/expression-result.ts"],"names":[],"mappings":"","sourcesContent":["export interface directedPair {\n destination: string;\n source: string;\n}\n\n// PK: EVENT: response from a INTERACTION_RESPONSE qti-interaction\nexport interface ResponseInteraction {\n responseIdentifier: string;\n response: string | string[];\n state?: string | null;\n}\n\nexport interface Calculate {\n calculate: () => string | string[];\n}\n\nexport type float = number;\nexport type integer = number;\n\n// export type string|string[] = string | string[];\n\nexport type BaseType =\n | 'boolean'\n | 'directedPair'\n | 'duration'\n | 'float'\n | 'integer'\n | 'string'\n | 'identifier'\n | 'pair'\n | 'point'\n | 'record'; // record is a special type for QTI context variables\n\nexport type Multiple = string | string[][];\nexport type Ordered = string | string[][];\n\nexport type Cardinality = 'multiple' | 'ordered' | 'single' | 'record';\n"]}
@@ -0,0 +1,32 @@
1
+ import type { BaseType } from './expression-result';
2
+ /**
3
+ * The value of a variable with `record` cardinality: its fields by field identifier.
4
+ *
5
+ * Field values are kept the way every other response value is kept, as QTI string literals — a
6
+ * float is `"4.12"`, a point is `"455 250"` — with a list-valued field as an array of them.
7
+ */
8
+ export type RecordValue = Record<string, string | string[] | null>;
9
+ /** A record's field values with the base type each `qti-value` declared for its field. */
10
+ export interface RecordFieldValues {
11
+ value: RecordValue;
12
+ baseTypes: Record<string, BaseType>;
13
+ }
14
+ /** Whether a variable value is a record: a plain object, not a list and not NULL. */
15
+ export declare const isRecordValue: (value: unknown) => value is RecordValue;
16
+ /**
17
+ * Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
18
+ * elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
19
+ *
20
+ * A value without a `field-identifier` is not a record field and is skipped. A field without a
21
+ * `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
22
+ */
23
+ export declare const readRecordFieldValues: (valueElements: Iterable<Element>) => RecordFieldValues;
24
+ /**
25
+ * A best guess at a record field's base type, for when the declaration does not say.
26
+ *
27
+ * A record field value carries no type of its own once it is stored, and a record response
28
+ * declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
29
+ * when given as a whole JS number), two numbers separated by whitespace are a point, and
30
+ * anything else is a string.
31
+ */
32
+ export declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
@@ -0,0 +1,48 @@
1
+ /** Whether a variable value is a record: a plain object, not a list and not NULL. */
2
+ export const isRecordValue = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
3
+ /**
4
+ * Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
5
+ * elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
6
+ *
7
+ * A value without a `field-identifier` is not a record field and is skipped. A field without a
8
+ * `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
9
+ */
10
+ export const readRecordFieldValues = (valueElements) => {
11
+ const value = {};
12
+ const baseTypes = {};
13
+ for (const element of valueElements) {
14
+ const fieldIdentifier = element.getAttribute('field-identifier');
15
+ if (!fieldIdentifier)
16
+ continue;
17
+ value[fieldIdentifier] = element.textContent?.trim() ?? '';
18
+ const baseType = element.getAttribute('base-type');
19
+ if (baseType)
20
+ baseTypes[fieldIdentifier] = baseType;
21
+ }
22
+ return { value, baseTypes };
23
+ };
24
+ const NUMBER = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;
25
+ /**
26
+ * A best guess at a record field's base type, for when the declaration does not say.
27
+ *
28
+ * A record field value carries no type of its own once it is stored, and a record response
29
+ * declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
30
+ * when given as a whole JS number), two numbers separated by whitespace are a point, and
31
+ * anything else is a string.
32
+ */
33
+ export const inferRecordFieldBaseType = (value) => {
34
+ if (typeof value === 'number')
35
+ return Number.isInteger(value) ? 'integer' : 'float';
36
+ if (typeof value === 'boolean')
37
+ return 'boolean';
38
+ if (typeof value !== 'string')
39
+ return 'string';
40
+ const text = value.trim();
41
+ if (NUMBER.test(text))
42
+ return 'float';
43
+ const parts = text.split(/\s+/);
44
+ if (parts.length === 2 && parts.every(part => NUMBER.test(part)))
45
+ return 'point';
46
+ return 'string';
47
+ };
48
+ //# sourceMappingURL=record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/lib/record.ts"],"names":[],"mappings":"AAgBA,qFAAqF;AACrF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAc,EAAwB,EAAE,CACpE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,aAAgC,EAAqB,EAAE;IAC3F,MAAM,KAAK,GAAgB,EAAE,CAAC;IAC9B,MAAM,SAAS,GAA6B,EAAE,CAAC;IAC/C,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;QACpC,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QACjE,IAAI,CAAC,eAAe;YAAE,SAAS;QAC/B,KAAK,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACnD,IAAI,QAAQ;YAAE,SAAS,CAAC,eAAe,CAAC,GAAG,QAAoB,CAAC;IAClE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,yCAAyC,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAc,EAAY,EAAE;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;IACpF,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,OAAO,CAAC;IACjF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC","sourcesContent":["import type { BaseType } from './expression-result';\n\n/**\n * The value of a variable with `record` cardinality: its fields by field identifier.\n *\n * Field values are kept the way every other response value is kept, as QTI string literals — a\n * float is `\"4.12\"`, a point is `\"455 250\"` — with a list-valued field as an array of them.\n */\nexport type RecordValue = Record<string, string | string[] | null>;\n\n/** A record's field values with the base type each `qti-value` declared for its field. */\nexport interface RecordFieldValues {\n value: RecordValue;\n baseTypes: Record<string, BaseType>;\n}\n\n/** Whether a variable value is a record: a plain object, not a list and not NULL. */\nexport const isRecordValue = (value: unknown): value is RecordValue =>\n value !== null && typeof value === 'object' && !Array.isArray(value);\n\n/**\n * Reads the field values of a record out of `qti-value field-identifier=\"…\" base-type=\"…\"`\n * elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.\n *\n * A value without a `field-identifier` is not a record field and is skipped. A field without a\n * `base-type` gets no entry in `baseTypes`, so a reader can tell \"declared string\" from \"unknown\".\n */\nexport const readRecordFieldValues = (valueElements: Iterable<Element>): RecordFieldValues => {\n const value: RecordValue = {};\n const baseTypes: Record<string, BaseType> = {};\n for (const element of valueElements) {\n const fieldIdentifier = element.getAttribute('field-identifier');\n if (!fieldIdentifier) continue;\n value[fieldIdentifier] = element.textContent?.trim() ?? '';\n const baseType = element.getAttribute('base-type');\n if (baseType) baseTypes[fieldIdentifier] = baseType as BaseType;\n }\n return { value, baseTypes };\n};\n\nconst NUMBER = /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/;\n\n/**\n * A best guess at a record field's base type, for when the declaration does not say.\n *\n * A record field value carries no type of its own once it is stored, and a record response\n * declaration has no `base-type`, so this is the fallback. A number is a float (or an integer\n * when given as a whole JS number), two numbers separated by whitespace are a point, and\n * anything else is a string.\n */\nexport const inferRecordFieldBaseType = (value: unknown): BaseType => {\n if (typeof value === 'number') return Number.isInteger(value) ? 'integer' : 'float';\n if (typeof value === 'boolean') return 'boolean';\n if (typeof value !== 'string') return 'string';\n const text = value.trim();\n if (NUMBER.test(text)) return 'float';\n const parts = text.split(/\\s+/);\n if (parts.length === 2 && parts.every(part => NUMBER.test(part))) return 'point';\n return 'string';\n};\n"]}
@@ -58,6 +58,12 @@ export interface ResponseVariable extends VariableDeclaration<string | string[]
58
58
  mapping?: QtiMapping;
59
59
  areaMapping?: QtiAreaMapping;
60
60
  correctResponse?: string | string[] | null;
61
+ /**
62
+ * For `record` cardinality: the base type of each field, by field identifier, as declared on the
63
+ * `qti-value` elements of the correct response. A record declaration has no `base-type` of its
64
+ * own, so this is the only place the field types are known once the value is stored.
65
+ */
66
+ fieldBaseTypes?: Record<string, BaseType>;
61
67
  }
62
68
  export interface TemplateVariable extends VariableDeclaration<string | string[] | number | boolean | null> {
63
69
  type: 'template';
@@ -1 +1 @@
1
- {"version":3,"file":"variables.js","sourceRoot":"","sources":["../../src/lib/variables.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseType, Cardinality } from './expression-result';\n\nexport type QtiAreaMapping = {\n defaultValue: number;\n lowerBound?: number;\n upperBound?: number;\n areaMapEntries: QtiAreaMapEntry[];\n};\n\nexport type QtiAreaMapEntry = {\n shape: areaShape;\n coords: string;\n mappedValue: number;\n defaultValue: number;\n};\n\nexport type QtiMapping = {\n defaultValue: number;\n lowerBound?: number;\n upperBound?: number;\n mapEntries: QtiMapEntry[];\n};\n\nexport type QtiMapEntry = { mapKey: string; mappedValue: number; caseSensitive: boolean };\n\nexport type areaShape = 'default' | 'circle' | 'rect' | 'ellipse' | 'poly';\nexport interface VariableValue<T> {\n identifier: string;\n value: Readonly<T>;\n defaultValue?: T | null;\n type: 'outcome' | 'response' | 'context' | 'template';\n}\n\nexport interface VariableDeclaration<T> extends VariableValue<T> {\n cardinality?: Cardinality;\n baseType?: BaseType;\n}\n\n/**\n * One `qti-interpolation-table-entry`. `sourceValue` is the *lower bound* of a\n * range rather than a value to match exactly, so the entries have to keep their\n * document order: the first whose bound the source value clears wins.\n */\nexport interface InterpolationTableEntry {\n sourceValue: number;\n targetValue: number;\n /** Whether `sourceValue` itself is in range. Defaults to true, per the spec. */\n includeBoundary: boolean;\n}\n\nexport interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {\n // specific to outcome variables\n interpolationTable?: InterpolationTableEntry[];\n /**\n * A qti-match-table's entries. Its targets are not necessarily numeric — a\n * match table may map onto identifiers or strings — so they stay as written.\n */\n matchTable?: Map<number, string>;\n externalScored?: 'human' | 'externalMachine' | null;\n}\n\nexport interface ResponseVariable extends VariableDeclaration<string | string[] | null> {\n // specific to response variables\n candidateResponse?: string | string[] | null;\n mapping?: QtiMapping;\n areaMapping?: QtiAreaMapping; // Optional property for area mappings\n correctResponse?: string | string[] | null;\n}\n\nexport interface TemplateVariable extends VariableDeclaration<string | string[] | number | boolean | null> {\n type: 'template';\n mathVariable?: boolean;\n paramVariable?: boolean;\n}\n"]}
1
+ {"version":3,"file":"variables.js","sourceRoot":"","sources":["../../src/lib/variables.ts"],"names":[],"mappings":"","sourcesContent":["import type { BaseType, Cardinality } from './expression-result';\n\nexport type QtiAreaMapping = {\n defaultValue: number;\n lowerBound?: number;\n upperBound?: number;\n areaMapEntries: QtiAreaMapEntry[];\n};\n\nexport type QtiAreaMapEntry = {\n shape: areaShape;\n coords: string;\n mappedValue: number;\n defaultValue: number;\n};\n\nexport type QtiMapping = {\n defaultValue: number;\n lowerBound?: number;\n upperBound?: number;\n mapEntries: QtiMapEntry[];\n};\n\nexport type QtiMapEntry = { mapKey: string; mappedValue: number; caseSensitive: boolean };\n\nexport type areaShape = 'default' | 'circle' | 'rect' | 'ellipse' | 'poly';\nexport interface VariableValue<T> {\n identifier: string;\n value: Readonly<T>;\n defaultValue?: T | null;\n type: 'outcome' | 'response' | 'context' | 'template';\n}\n\nexport interface VariableDeclaration<T> extends VariableValue<T> {\n cardinality?: Cardinality;\n baseType?: BaseType;\n}\n\n/**\n * One `qti-interpolation-table-entry`. `sourceValue` is the *lower bound* of a\n * range rather than a value to match exactly, so the entries have to keep their\n * document order: the first whose bound the source value clears wins.\n */\nexport interface InterpolationTableEntry {\n sourceValue: number;\n targetValue: number;\n /** Whether `sourceValue` itself is in range. Defaults to true, per the spec. */\n includeBoundary: boolean;\n}\n\nexport interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {\n // specific to outcome variables\n interpolationTable?: InterpolationTableEntry[];\n /**\n * A qti-match-table's entries. Its targets are not necessarily numeric — a\n * match table may map onto identifiers or strings — so they stay as written.\n */\n matchTable?: Map<number, string>;\n externalScored?: 'human' | 'externalMachine' | null;\n}\n\nexport interface ResponseVariable extends VariableDeclaration<string | string[] | null> {\n // specific to response variables\n candidateResponse?: string | string[] | null;\n mapping?: QtiMapping;\n areaMapping?: QtiAreaMapping; // Optional property for area mappings\n correctResponse?: string | string[] | null;\n /**\n * For `record` cardinality: the base type of each field, by field identifier, as declared on the\n * `qti-value` elements of the correct response. A record declaration has no `base-type` of its\n * own, so this is the only place the field types are known once the value is stored.\n */\n fieldBaseTypes?: Record<string, BaseType>;\n}\n\nexport interface TemplateVariable extends VariableDeclaration<string | string[] | number | boolean | null> {\n type: 'template';\n mathVariable?: boolean;\n paramVariable?: boolean;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qti-components/base",
3
3
  "description": "QTI shared utilities",
4
- "version": "2.5.0-next.1",
4
+ "version": "2.5.0-next.2",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "@qti-components/utilities": "^1.3.3"