@citolab/tspci-tao 2.0.7 → 2.0.9
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/LICENSE +674 -674
- package/package.json +2 -2
- package/readme.md +85 -85
- package/release-notes.md +9 -9
- package/src/createPackage.mjs +307 -307
- package/toa_pci_default/imsPciCreator.js +66 -66
- package/toa_pci_default/imsPciCreator.json +41 -41
- package/toa_pci_default/interaction/creator/img/icon.svg +8 -8
- package/toa_pci_default/interaction/creator/tpl/markup.tpl +18 -18
- package/toa_pci_default/interaction/creator/tpl/propertiesForm.tpl +7 -7
- package/toa_pci_default/interaction/creator/widget/Widget.js +14 -14
- package/toa_pci_default/interaction/creator/widget/states/Answer.js +26 -26
- package/toa_pci_default/interaction/creator/widget/states/Correct.js +44 -44
- package/toa_pci_default/interaction/creator/widget/states/Question.js +51 -51
- package/toa_pci_default/interaction/creator/widget/states/states.js +8 -8
- package/types/index.d.ts +17 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citolab/tspci-tao",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "create a zip file that can be imported into TAO",
|
|
5
5
|
"author": "patrick <patrick.deklein@cito.nl>, Marcel Hoekstra <marcel.hoekstra@cito.nl>",
|
|
6
6
|
"repository": "",
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
"archiver": "^5.3.0"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {},
|
|
13
|
-
"gitHead": "
|
|
13
|
+
"gitHead": "559a1a390389ca87f68e62efbe2d98c92cab7165"
|
|
14
14
|
}
|
package/readme.md
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# @citolab/tspci-tao
|
|
4
|
-
|
|
5
|
-
[release notes](https://github.com/Citolab/tspci/lib/tspci-tao/release-notes.md)
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
- building a package(.zip) to import in TAO
|
|
9
|
-
- configure PCI in TAO
|
|
10
|
-
- set correct response in TAO
|
|
11
|
-
|
|
12
|
-
This package allows the @citolab/tspci-bundler to create a package which can be imported in the TAO platform.
|
|
13
|
-
|
|
14
|
-
PCI's can be imported in TAO as a ZIP file. The ZIP generated contains the PCI itself and metadata enabling the PCI to be shown in the TAO creator platform.
|
|
15
|
-
Configuration of a PCI can be done by the author because this packager reads the config.json file in the src folder
|
|
16
|
-
|
|
17
|
-
If scoring can be done with a MATCH_CORRECT (single string comparison) the item author can provide the correct answer in TAO by interaction with the PCI.
|
|
18
|
-
This way one PCI can be re-used in different configurations supporting multiple items.
|
|
19
|
-
|
|
20
|
-
To be able to add an IMS-PCI to the TAO authoring system properties are added to the `package.json`
|
|
21
|
-
and implemented lifecycle events that should be implemented in the PCI.
|
|
22
|
-
|
|
23
|
-
To create this zip file run:
|
|
24
|
-
|
|
25
|
-
``` sh
|
|
26
|
-
tspci --target tao
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## life cycle methods
|
|
30
|
-
|
|
31
|
-
To be TAO compliant the TAOpci interface should be implemented:
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
class App implements IMSpci<PropTypes>, TAOpci {
|
|
35
|
-
// ============== OMMITED IMS IMPLEMENTATION =====================
|
|
36
|
-
|
|
37
|
-
// ============== HERE THE EXTRA TAO IMPLEMENTATION =====================
|
|
38
|
-
off = () => {}; // called when setting correct response in tao, if not implemented TAO gives an error
|
|
39
|
-
on = (val) => {};
|
|
40
|
-
|
|
41
|
-
// THIS IS USED TO RESTORE THE CORRECT ANSWER IN THE AUTHORING PART OF TAO.
|
|
42
|
-
setResponse = (response: any) => {
|
|
43
|
-
try {
|
|
44
|
-
// this is an example of how a string response can be restored.
|
|
45
|
-
if (response.base && response.base.string) {
|
|
46
|
-
// set the response to the pci
|
|
47
|
-
}
|
|
48
|
-
} catch {
|
|
49
|
-
// ignore
|
|
50
|
-
}
|
|
51
|
-
this.render();
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
resetResponse = () => {
|
|
55
|
-
// reset the pci to its initial state
|
|
56
|
-
this.render();
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// RERENDER THE PCI HERE, SO CHANGING CONFIG PROPERTIES IS DIRECTLY VISIBLE IN TAO.
|
|
60
|
-
trigger = (event: string, value: any) => {
|
|
61
|
-
this.config.properties[event] = value;
|
|
62
|
-
this.render();
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Configuration
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### package.json
|
|
71
|
-
- typeIdentifier: a field 'typeIdentifier' should be added. This should match the 'typeIdentifier' value in the PCI entry file (The one that implements IMSPci). Only (alpha)numeric values are allowed. This because a hyphen in the identifier causes an error in TAO. To be sure, only alphanumeric are allowed.
|
|
72
|
-
- label: used as label in TAO
|
|
73
|
-
- short: short name used in TAO to label the PCI where you can drag it in an item.
|
|
74
|
-
- score: Array of: "MATCH_CORRECT", "CUSTOM" or "NONE". Can contain one or all three values. The first provided value will be used as default.
|
|
75
|
-
- MATCH_CORRECT: If the item author should be able to set the correct response in TAO; MATCH_CORRECT is the only option. With the MATCH_CORRECT, the item author can interact with the PCI to provide the correct answer.
|
|
76
|
-
- CUSTOM: "CUSTOM" allows to add custom response processing in TAO. This is needed if a string comparison is not possible. The item author cannot interact with the PCI to provided the correct answer. The correct answer should in the response processing template.
|
|
77
|
-
- NONE: if the PCI is used as a tool and/or scoring is not needed the scoring method should be set to NONE.
|
|
78
|
-
|
|
79
|
-

|
|
80
|
-
|
|
81
|
-
## icon
|
|
82
|
-
|
|
83
|
-
Add a svg file with the name {typeIdentifier}.svg in the root of the PCI directory to have a custom icon for the PCI in TAO.
|
|
84
|
-
|
|
85
|
-

|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# @citolab/tspci-tao
|
|
4
|
+
|
|
5
|
+
[release notes](https://github.com/Citolab/tspci/blob/main/lib/tspci-tao/release-notes.md)
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
- building a package(.zip) to import in TAO
|
|
9
|
+
- configure PCI in TAO
|
|
10
|
+
- set correct response in TAO
|
|
11
|
+
|
|
12
|
+
This package allows the @citolab/tspci-bundler to create a package which can be imported in the TAO platform.
|
|
13
|
+
|
|
14
|
+
PCI's can be imported in TAO as a ZIP file. The ZIP generated contains the PCI itself and metadata enabling the PCI to be shown in the TAO creator platform.
|
|
15
|
+
Configuration of a PCI can be done by the author because this packager reads the config.json file in the src folder
|
|
16
|
+
|
|
17
|
+
If scoring can be done with a MATCH_CORRECT (single string comparison) the item author can provide the correct answer in TAO by interaction with the PCI.
|
|
18
|
+
This way one PCI can be re-used in different configurations supporting multiple items.
|
|
19
|
+
|
|
20
|
+
To be able to add an IMS-PCI to the TAO authoring system properties are added to the `package.json`
|
|
21
|
+
and implemented lifecycle events that should be implemented in the PCI.
|
|
22
|
+
|
|
23
|
+
To create this zip file run:
|
|
24
|
+
|
|
25
|
+
``` sh
|
|
26
|
+
tspci --target tao
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## life cycle methods
|
|
30
|
+
|
|
31
|
+
To be TAO compliant the TAOpci interface should be implemented:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
class App implements IMSpci<PropTypes>, TAOpci {
|
|
35
|
+
// ============== OMMITED IMS IMPLEMENTATION =====================
|
|
36
|
+
|
|
37
|
+
// ============== HERE THE EXTRA TAO IMPLEMENTATION =====================
|
|
38
|
+
off = () => {}; // called when setting correct response in tao, if not implemented TAO gives an error
|
|
39
|
+
on = (val) => {};
|
|
40
|
+
|
|
41
|
+
// THIS IS USED TO RESTORE THE CORRECT ANSWER IN THE AUTHORING PART OF TAO.
|
|
42
|
+
setResponse = (response: any) => {
|
|
43
|
+
try {
|
|
44
|
+
// this is an example of how a string response can be restored.
|
|
45
|
+
if (response.base && response.base.string) {
|
|
46
|
+
// set the response to the pci
|
|
47
|
+
}
|
|
48
|
+
} catch {
|
|
49
|
+
// ignore
|
|
50
|
+
}
|
|
51
|
+
this.render();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
resetResponse = () => {
|
|
55
|
+
// reset the pci to its initial state
|
|
56
|
+
this.render();
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// RERENDER THE PCI HERE, SO CHANGING CONFIG PROPERTIES IS DIRECTLY VISIBLE IN TAO.
|
|
60
|
+
trigger = (event: string, value: any) => {
|
|
61
|
+
this.config.properties[event] = value;
|
|
62
|
+
this.render();
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### package.json
|
|
71
|
+
- typeIdentifier: a field 'typeIdentifier' should be added. This should match the 'typeIdentifier' value in the PCI entry file (The one that implements IMSPci). Only (alpha)numeric values are allowed. This because a hyphen in the identifier causes an error in TAO. To be sure, only alphanumeric are allowed.
|
|
72
|
+
- label: used as label in TAO
|
|
73
|
+
- short: short name used in TAO to label the PCI where you can drag it in an item.
|
|
74
|
+
- score: Array of: "MATCH_CORRECT", "CUSTOM" or "NONE". Can contain one or all three values. The first provided value will be used as default.
|
|
75
|
+
- MATCH_CORRECT: If the item author should be able to set the correct response in TAO; MATCH_CORRECT is the only option. With the MATCH_CORRECT, the item author can interact with the PCI to provide the correct answer.
|
|
76
|
+
- CUSTOM: "CUSTOM" allows to add custom response processing in TAO. This is needed if a string comparison is not possible. The item author cannot interact with the PCI to provided the correct answer. The correct answer should in the response processing template.
|
|
77
|
+
- NONE: if the PCI is used as a tool and/or scoring is not needed the scoring method should be set to NONE.
|
|
78
|
+
|
|
79
|
+

|
|
80
|
+
|
|
81
|
+
## icon
|
|
82
|
+
|
|
83
|
+
Add a svg file with the name {typeIdentifier}.svg in the root of the PCI directory to have a custom icon for the PCI in TAO.
|
|
84
|
+
|
|
85
|
+

|
package/release-notes.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# 2.0.0
|
|
2
|
-
|
|
3
|
-
- synchronized versions across tspci libraries
|
|
4
|
-
# 1.0.2
|
|
5
|
-
|
|
6
|
-
- fixed error when trying to remove a folder that did not exist
|
|
7
|
-
|
|
8
|
-
# 1.0.1
|
|
9
|
-
|
|
1
|
+
# 2.0.0
|
|
2
|
+
|
|
3
|
+
- synchronized versions across tspci libraries
|
|
4
|
+
# 1.0.2
|
|
5
|
+
|
|
6
|
+
- fixed error when trying to remove a folder that did not exist
|
|
7
|
+
|
|
8
|
+
# 1.0.1
|
|
9
|
+
|
|
10
10
|
Initial version
|