@citolab/tspci 2.5.22 → 2.5.30-beta.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 +64 -0
- package/package.json +4 -4
- package/src/cli.js +1 -1
- package/types/index.d.ts +32 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,70 @@
|
|
|
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.5.30-beta.0](/compare/v2.5.29...v2.5.30-beta.0) (2025-02-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 2.5.29 (2025-02-03)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.5.28](/compare/v2.5.27...v2.5.28) (2025-02-03)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [2.5.27](/compare/v2.5.26...v2.5.27) (2025-02-03)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [2.5.26](/compare/v2.5.25...v2.5.26) (2025-02-03)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [2.5.25](/compare/v2.5.24...v2.5.25) (2025-02-03)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [2.5.24](/compare/v2.5.23...v2.5.24) (2025-02-03)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 2.5.23 (2024-10-16)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @citolab/tspci
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
6
70
|
## 2.5.22 (2024-10-16)
|
|
7
71
|
|
|
8
72
|
**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.5.
|
|
3
|
+
"version": "2.5.30-beta.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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"live-server": "^1.2.2",
|
|
38
38
|
"postcss": "^8.4.47",
|
|
39
39
|
"postcss-import": "^16.1.0",
|
|
40
|
-
"rollup": "^4.
|
|
40
|
+
"rollup": "^4.34.1",
|
|
41
41
|
"rollup-plugin-copy": "^3.5.0",
|
|
42
42
|
"rollup-plugin-live-server": "^2.0.0",
|
|
43
43
|
"rollup-plugin-livereload": "^2.0.5",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"rollup-plugin-node-globals": "^1.4.0",
|
|
46
46
|
"rollup-plugin-postcss": "^4.0.2",
|
|
47
47
|
"rollup-plugin-string": "^3.0.0",
|
|
48
|
-
"tailwindcss": "^
|
|
48
|
+
"tailwindcss": "^4.0.3"
|
|
49
49
|
},
|
|
50
50
|
"resolutions": {
|
|
51
51
|
"chokidar": "^4.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "604b6123a4e495717e4fdde55d1ad1c52cb81724"
|
|
54
54
|
}
|
package/src/cli.js
CHANGED
|
@@ -188,7 +188,7 @@ const run = async () => {
|
|
|
188
188
|
const t = args.indexOf("--target") !== -1 ? args.indexOf("--target") : args.indexOf("-t");
|
|
189
189
|
const tExt = args.indexOf("--targetExt") !== -1 ? args.indexOf("--targetExt") : args.indexOf("-tx");
|
|
190
190
|
const init = args.indexOf("init") >= 0;
|
|
191
|
-
const targetName = t !== -1 ? `@citolab/tspci-${args[t]}` : tExt !== -1 ? args[tExt] : null;
|
|
191
|
+
const targetName = t !== -1 ? `@citolab/tspci-${args[t + 1]}` : tExt !== -1 ? args[tExt + 1] : null;
|
|
192
192
|
|
|
193
193
|
if (help) {
|
|
194
194
|
console.log(`•\t${chalk.blueBright("--help -h")} list these commands`);
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
// Define the payload structure for the custom event
|
|
2
|
+
export interface QtiInteractionChangedDetail {
|
|
3
|
+
interaction: IMSpci<ConfigProperties>; // The PCI instance itself
|
|
4
|
+
responseIdentifier: string; // The response identifier provided in the getInstance call
|
|
5
|
+
valid?: boolean; // Optional boolean indicating if checkValidity() returns true
|
|
6
|
+
value?: QtiVariableJSON; // Optional value returned by getResponse()
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Define the ConfigProperties interface
|
|
10
|
+
export interface ConfigProperties {
|
|
11
|
+
properties: Record<string, string>; // Follows dataset conversion rules (camelCased keys)
|
|
12
|
+
templateVariables: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
|
|
13
|
+
contextVariables: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
|
|
14
|
+
boundTo: Record<string, QtiVariableJSON>; // Follows structure in Appendix C
|
|
15
|
+
responseIdentifier: string; // Unique within interaction scope
|
|
16
|
+
|
|
17
|
+
onready: (interaction: IMSpci<ConfigProperties>, state?: string) => void; // Callback when PCI is fully constructed and ready
|
|
18
|
+
ondone?: (
|
|
19
|
+
interaction: IMSpci<ConfigProperties>,
|
|
20
|
+
response: Record<string, QtiVariableJSON>,
|
|
21
|
+
state: string,
|
|
22
|
+
status?: "interacting" | "closed" | "solution" | "review"
|
|
23
|
+
) => void; // Optional callback when candidate finishes interaction
|
|
24
|
+
|
|
25
|
+
status?: "interacting" | "suspended" | "closed" | "solution" | "review"; // Optional, defaults to "interacting"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface IMSpci<CustomConfigProperties extends ConfigProperties> {
|
|
2
29
|
typeIdentifier: string;
|
|
3
30
|
|
|
4
31
|
/** @access public
|
|
@@ -10,13 +37,13 @@ export interface IMSpci<ConfigProperties> {
|
|
|
10
37
|
* This must have been obtained from a prior call to getState on an
|
|
11
38
|
* instance of this type (same typeIdentifier)
|
|
12
39
|
*/
|
|
13
|
-
getInstance: (dom: HTMLElement, configuration: Configuration<
|
|
40
|
+
getInstance: (dom: HTMLElement, configuration: Configuration<CustomConfigProperties>, state: string) => void;
|
|
14
41
|
|
|
15
42
|
/** @access public
|
|
16
43
|
* @method getResponse
|
|
17
44
|
* @return {Object} - the value to assign to the bound QTI response variable
|
|
18
45
|
*/
|
|
19
|
-
getResponse: () => QtiVariableJSON;
|
|
46
|
+
getResponse: () => QtiVariableJSON | undefined;
|
|
20
47
|
|
|
21
48
|
/** @access public
|
|
22
49
|
* @method getState
|
|
@@ -28,21 +55,9 @@ export interface IMSpci<ConfigProperties> {
|
|
|
28
55
|
destroy?: () => void; // Not used in IMS and not in TAO implementation, so not used here (optional)
|
|
29
56
|
}
|
|
30
57
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export declare type Configuration<T> = {
|
|
34
|
-
onready: (pci: IMSpci<T>, state?: string) => void;
|
|
58
|
+
export declare type Configuration<T extends ConfigProperties> = {
|
|
59
|
+
onready: () => void;
|
|
35
60
|
properties: T;
|
|
36
|
-
// PK: following this: https://www.imsglobal.org/spec/qti/v3p0/impl#h.1mc9puik2ft6
|
|
37
|
-
// All below are not used in the IMS Reference implementation, keeping for ref
|
|
38
|
-
/*
|
|
39
|
-
ondone: (pci: IMSPci<T>,response:any,state:string, status?: "interacting" | "closed" | "solution" | "review" ) => void;
|
|
40
|
-
status: string;
|
|
41
|
-
templateVariables: any;
|
|
42
|
-
boundTo: any;
|
|
43
|
-
contextVariables
|
|
44
|
-
responseIdentifier
|
|
45
|
-
*/
|
|
46
61
|
};
|
|
47
62
|
|
|
48
63
|
export interface directedPair {
|