@citolab/tspci 2.9.13 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.10.0](/compare/v2.9.13...v2.10.0) (2026-08-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * **types:** carry the response declaration in the getInstance configuration 9e92da8, closes 1EdTech/qti-project-management#210
12
+ * update dependencies and add settings for npm-check-updates 1b65ffe
13
+
14
+
15
+
16
+
17
+
6
18
  ## [2.9.13](/compare/v2.9.12...v2.9.13) (2026-03-18)
7
19
 
8
20
  **Note:** Version bump only for package @citolab/tspci
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citolab/tspci",
3
- "version": "2.9.13",
3
+ "version": "2.10.0",
4
4
  "description": "an opiniated typescript ims-pci builder with tao integration",
5
5
  "author": "patrick <patrick.deklein@cito.nl>",
6
6
  "repository": "@citolab/tspci",
@@ -43,7 +43,8 @@
43
43
  "rollup": "^4.59.0",
44
44
  "rollup-plugin-livereload": "^2.0.5",
45
45
  "tailwindcss": "^4.1.18",
46
- "tslib": "^2.8.1"
46
+ "tslib": "^2.8.1",
47
+ "typescript": "^5.9.3"
47
48
  },
48
49
  "devDependencies": {
49
50
  "@types/node": "^25.1.0",
@@ -54,5 +55,5 @@
54
55
  "access": "public",
55
56
  "registry": "https://registry.npmjs.org/"
56
57
  },
57
- "gitHead": "81bf2cf80de144c2ea6cd1c256fc59e5b637c962"
58
+ "gitHead": "7dbead5cfa41583d47bb503d40970df2d3444a1e"
58
59
  }
package/types/index.d.ts CHANGED
@@ -6,6 +6,32 @@ export interface QtiInteractionChangedDetail {
6
6
  value?: QtiVariableJSON; // Optional value returned by getResponse()
7
7
  }
8
8
 
9
+ /**
10
+ * Correct response of a response declaration, mirroring qti-correct-response.
11
+ *
12
+ * `value` holds the authored qti-value content: a single value for `single`
13
+ * cardinality, an array of values for every other cardinality.
14
+ */
15
+ export interface CorrectResponse {
16
+ value: ResponseType | ResponseType[];
17
+ }
18
+
19
+ /**
20
+ * Response declaration passed into the getInstance configuration, so a PCI can
21
+ * render the correct response itself when it is constructed with status "solution".
22
+ *
23
+ * Mirrors qti-response-declaration with camelCased names. Every field is optional,
24
+ * a delivery engine passes as much or as little as it has, and correctResponse is
25
+ * absent when the response variable has none.
26
+ *
27
+ * See https://github.com/1EdTech/qti-project-management/issues/210
28
+ */
29
+ export interface ResponseDeclaration {
30
+ baseType?: BaseType;
31
+ cardinality?: Cardinality;
32
+ correctResponse?: CorrectResponse;
33
+ }
34
+
9
35
  // Define the ConfigProperties interface
10
36
  export interface ConfigProperties<T> {
11
37
  properties: T; // Follows dataset conversion rules (camelCased keys)
@@ -13,6 +39,7 @@ export interface ConfigProperties<T> {
13
39
  contextVariables: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
14
40
  boundTo: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
15
41
  responseIdentifier: string; // Unique within interaction scope
42
+ responseDeclaration?: ResponseDeclaration; // Optional, carries the correct response when the item declares one
16
43
 
17
44
  onready: (interaction: IMSpci<T>, state?: string) => void; // Callback when PCI is fully constructed and ready
18
45
  ondone?: (