@pie-element/extended-text-entry 6.6.4 → 6.7.0-annotations.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/CHANGELOG.md +6 -22
- package/configure/CHANGELOG.md +6 -9
- package/configure/package.json +3 -3
- package/controller/CHANGELOG.md +8 -0
- package/controller/lib/defaults.js +66 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +25 -15
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/pie-schema.json +65 -0
- package/docs/pie-schema.json.md +47 -1
- package/lib/annotation/annotation-editor.js +704 -0
- package/lib/annotation/annotation-editor.js.map +1 -0
- package/lib/annotation/annotation-menu.js +205 -0
- package/lib/annotation/annotation-menu.js.map +1 -0
- package/lib/annotation/annotation-utils.js +249 -0
- package/lib/annotation/annotation-utils.js.map +1 -0
- package/lib/annotation/freeform-editor.js +265 -0
- package/lib/annotation/freeform-editor.js.map +1 -0
- package/lib/index.js +27 -4
- package/lib/index.js.map +1 -1
- package/lib/main.js +49 -23
- package/lib/main.js.map +1 -1
- package/lib/print.js +2 -1
- package/lib/print.js.map +1 -1
- package/package.json +5 -5
- package/LICENSE.md +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,38 +3,22 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [6.6.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.6.2...@pie-element/extended-text-entry@6.6.3) (2021-10-04)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## [6.6.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.6.1...@pie-element/extended-text-entry@6.6.2) (2021-09-20)
|
|
6
|
+
# [6.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.5.3...@pie-element/extended-text-entry@6.7.0) (2021-11-11)
|
|
23
7
|
|
|
24
8
|
|
|
25
9
|
### Bug Fixes
|
|
26
10
|
|
|
11
|
+
* **multiple-choice-print, ecr-print:** fix toggle issue, change options.mode to options.role ([0b3f534](https://github.com/pie-framework/pie-elements/commit/0b3f534bb4d2f969e21528e74516345e84f18d72))
|
|
27
12
|
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
28
13
|
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
29
14
|
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
15
|
+
* **extended-text-entry:** Removed main content padding PD-384 ([e3f0bb3](https://github.com/pie-framework/pie-elements/commit/e3f0bb33ef66fe7fdd2de80d470eaecc4864dbbb))
|
|
30
16
|
|
|
31
17
|
|
|
18
|
+
### Features
|
|
32
19
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## [6.6.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@6.6.0...@pie-element/extended-text-entry@6.6.1) (2021-09-01)
|
|
36
|
-
|
|
37
|
-
**Note:** Version bump only for package @pie-element/extended-text-entry
|
|
20
|
+
* **extended-text-entry:** added option to set toolbar editor position ([3fefb22](https://github.com/pie-framework/pie-elements/commit/3fefb222a7b8ffe01304d7b23385f53b4709eeb8))
|
|
21
|
+
* **extended-text-entry:** implement print PD-1283 ([7e4f7d8](https://github.com/pie-framework/pie-elements/commit/7e4f7d8203f54d905f542369d444232b54261582))
|
|
38
22
|
|
|
39
23
|
|
|
40
24
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,15 +3,7 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @pie-element/extended-text-entry-configure
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [5.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.3.0...@pie-element/extended-text-entry-configure@5.3.1) (2021-09-20)
|
|
6
|
+
# [5.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@5.2.9...@pie-element/extended-text-entry-configure@5.4.0) (2021-11-11)
|
|
15
7
|
|
|
16
8
|
|
|
17
9
|
### Bug Fixes
|
|
@@ -21,6 +13,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
21
13
|
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
22
14
|
|
|
23
15
|
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **extended-text-entry:** added option to set toolbar editor position ([3fefb22](https://github.com/pie-framework/pie-elements/commit/3fefb222a7b8ffe01304d7b23385f53b4709eeb8))
|
|
19
|
+
|
|
20
|
+
|
|
24
21
|
|
|
25
22
|
|
|
26
23
|
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.4.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@material-ui/core": "^3.9.2",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
13
|
-
"@pie-lib/config-ui": "^10.10.
|
|
14
|
-
"@pie-lib/editable-html": "^7.17.
|
|
13
|
+
"@pie-lib/config-ui": "^10.10.13",
|
|
14
|
+
"@pie-lib/editable-html": "^7.17.13",
|
|
15
15
|
"lodash": "^4.17.15",
|
|
16
16
|
"prop-types": "^15.6.2",
|
|
17
17
|
"react": "^16.8.1",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [4.1.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@4.1.13...@pie-element/extended-text-entry-controller@4.1.14) (2021-11-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/extended-text-entry-controller
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.1.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@4.1.11...@pie-element/extended-text-entry-controller@4.1.13) (2021-08-05)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -8,7 +8,72 @@ var _default = {
|
|
|
8
8
|
dimensions: {
|
|
9
9
|
height: 100,
|
|
10
10
|
width: 500
|
|
11
|
-
}
|
|
11
|
+
},
|
|
12
|
+
predefinedAnnotations: [{
|
|
13
|
+
label: 'good',
|
|
14
|
+
text: 'good',
|
|
15
|
+
type: 'positive'
|
|
16
|
+
}, {
|
|
17
|
+
label: '★',
|
|
18
|
+
text: '★',
|
|
19
|
+
type: 'positive'
|
|
20
|
+
}, {
|
|
21
|
+
label: ':-)',
|
|
22
|
+
text: ':-)',
|
|
23
|
+
type: 'positive'
|
|
24
|
+
}, {
|
|
25
|
+
label: 'creative',
|
|
26
|
+
text: 'creative',
|
|
27
|
+
type: 'positive'
|
|
28
|
+
}, {
|
|
29
|
+
label: 'run-on',
|
|
30
|
+
text: 'run-on',
|
|
31
|
+
type: 'negative'
|
|
32
|
+
}, {
|
|
33
|
+
label: 'frag',
|
|
34
|
+
text: 'fragment',
|
|
35
|
+
type: 'negative'
|
|
36
|
+
}, {
|
|
37
|
+
label: 'tran',
|
|
38
|
+
text: 'transition',
|
|
39
|
+
type: 'negative'
|
|
40
|
+
}, {
|
|
41
|
+
label: 'supp',
|
|
42
|
+
text: 'support needed',
|
|
43
|
+
type: 'negative'
|
|
44
|
+
}, {
|
|
45
|
+
label: 'punc',
|
|
46
|
+
text: 'punctuation',
|
|
47
|
+
type: 'negative'
|
|
48
|
+
}, {
|
|
49
|
+
label: 'agr',
|
|
50
|
+
text: 'agreement wrong',
|
|
51
|
+
type: 'negative'
|
|
52
|
+
}, {
|
|
53
|
+
label: 'unclear',
|
|
54
|
+
text: 'unclear',
|
|
55
|
+
type: 'negative'
|
|
56
|
+
}, {
|
|
57
|
+
label: 'cut',
|
|
58
|
+
text: 'cut',
|
|
59
|
+
type: 'negative'
|
|
60
|
+
}, {
|
|
61
|
+
label: 'sp',
|
|
62
|
+
text: 'spelling',
|
|
63
|
+
type: 'negative'
|
|
64
|
+
}, {
|
|
65
|
+
label: 'cap',
|
|
66
|
+
text: 'capitalization',
|
|
67
|
+
type: 'negative'
|
|
68
|
+
}, {
|
|
69
|
+
label: 'inf',
|
|
70
|
+
text: 'informal',
|
|
71
|
+
type: 'negative'
|
|
72
|
+
}, {
|
|
73
|
+
label: 'awk',
|
|
74
|
+
text: 'awkward',
|
|
75
|
+
type: 'negative'
|
|
76
|
+
}]
|
|
12
77
|
};
|
|
13
78
|
exports["default"] = _default;
|
|
14
79
|
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["dimensions","height","width"],"mappings":";;;;;;eAAe;AACbA,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE,GADE;AAEVC,IAAAA,KAAK,EAAE;AAFG;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["dimensions","height","width","predefinedAnnotations","label","text","type"],"mappings":";;;;;;eAAe;AACbA,EAAAA,UAAU,EAAE;AACVC,IAAAA,MAAM,EAAE,GADE;AAEVC,IAAAA,KAAK,EAAE;AAFG,GADC;AAKbC,EAAAA,qBAAqB,EAAE,CACrB;AACEC,IAAAA,KAAK,EAAE,MADT;AAEEC,IAAAA,IAAI,EAAE,MAFR;AAGEC,IAAAA,IAAI,EAAE;AAHR,GADqB,EAKlB;AACDF,IAAAA,KAAK,EAAE,GADN;AAEDC,IAAAA,IAAI,EAAE,GAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GALkB,EASlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,KAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GATkB,EAalB;AACDF,IAAAA,KAAK,EAAE,UADN;AAEDC,IAAAA,IAAI,EAAE,UAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAbkB,EAiBlB;AACDF,IAAAA,KAAK,EAAE,QADN;AAEDC,IAAAA,IAAI,EAAE,QAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAjBkB,EAqBlB;AACDF,IAAAA,KAAK,EAAE,MADN;AAEDC,IAAAA,IAAI,EAAE,UAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GArBkB,EAyBlB;AACDF,IAAAA,KAAK,EAAE,MADN;AAEDC,IAAAA,IAAI,EAAE,YAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAzBkB,EA6BlB;AACDF,IAAAA,KAAK,EAAE,MADN;AAEDC,IAAAA,IAAI,EAAE,gBAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GA7BkB,EAiClB;AACDF,IAAAA,KAAK,EAAE,MADN;AAEDC,IAAAA,IAAI,EAAE,aAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAjCkB,EAqClB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,iBAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GArCkB,EAyClB;AACDF,IAAAA,KAAK,EAAE,SADN;AAEDC,IAAAA,IAAI,EAAE,SAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAzCkB,EA6ClB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,KAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GA7CkB,EAiDlB;AACDF,IAAAA,KAAK,EAAE,IADN;AAEDC,IAAAA,IAAI,EAAE,UAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAjDkB,EAqDlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,gBAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GArDkB,EAyDlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,UAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GAzDkB,EA6DlB;AACDF,IAAAA,KAAK,EAAE,KADN;AAEDC,IAAAA,IAAI,EAAE,SAFL;AAGDC,IAAAA,IAAI,EAAE;AAHL,GA7DkB;AALV,C","sourcesContent":["export default {\n dimensions: {\n height: 100,\n width: 500,\n },\n predefinedAnnotations: [\n {\n label: 'good',\n text: 'good',\n type: 'positive'\n }, {\n label: '★',\n text: '★',\n type: 'positive'\n }, {\n label: ':-)',\n text: ':-)',\n type: 'positive'\n }, {\n label: 'creative',\n text: 'creative',\n type: 'positive'\n }, {\n label: 'run-on',\n text: 'run-on',\n type: 'negative'\n }, {\n label: 'frag',\n text: 'fragment',\n type: 'negative'\n }, {\n label: 'tran',\n text: 'transition',\n type: 'negative'\n }, {\n label: 'supp',\n text: 'support needed',\n type: 'negative'\n }, {\n label: 'punc',\n text: 'punctuation',\n type: 'negative'\n }, {\n label: 'agr',\n text: 'agreement wrong',\n type: 'negative'\n }, {\n label: 'unclear',\n text: 'unclear',\n type: 'negative'\n }, {\n label: 'cut',\n text: 'cut',\n type: 'negative'\n }, {\n label: 'sp',\n text: 'spelling',\n type: 'negative'\n }, {\n label: 'cap',\n text: 'capitalization',\n type: 'negative'\n }, {\n label: 'inf',\n text: 'informal',\n type: 'negative'\n }, {\n label: 'awk',\n text: 'awkward',\n type: 'negative'\n }\n ]\n};\n"],"file":"defaults.js"}
|
package/controller/lib/index.js
CHANGED
|
@@ -72,13 +72,17 @@ function model(_x, _x2, _x3) {
|
|
|
72
72
|
|
|
73
73
|
function _model() {
|
|
74
74
|
_model = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(question, session, env) {
|
|
75
|
-
var normalizedQuestion, fb, teacherInstructions, equationEditor;
|
|
75
|
+
var normalizedQuestion, fb, teacherInstructions, equationEditor, annotatorMode, disabledAnnotator;
|
|
76
76
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
77
77
|
while (1) {
|
|
78
78
|
switch (_context2.prev = _context2.next) {
|
|
79
79
|
case 0:
|
|
80
80
|
log('[question]', question);
|
|
81
|
+
console.log('session', session);
|
|
82
|
+
console.log('question', question);
|
|
83
|
+
console.log('env', env);
|
|
81
84
|
normalizedQuestion = normalize(question);
|
|
85
|
+
console.log('normalizedQuestion', normalizedQuestion);
|
|
82
86
|
fb = env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled ? (0, _feedback.getFeedback)(normalizedQuestion.feedback, 'Your answer has been submitted') : Promise.resolve(undefined);
|
|
83
87
|
teacherInstructions = null;
|
|
84
88
|
|
|
@@ -90,43 +94,49 @@ function _model() {
|
|
|
90
94
|
|
|
91
95
|
equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';
|
|
92
96
|
_context2.t0 = normalizedQuestion.equationEditor;
|
|
93
|
-
_context2.next = _context2.t0 === 'Grade 1 - 2' ?
|
|
97
|
+
_context2.next = _context2.t0 === 'Grade 1 - 2' ? 13 : _context2.t0 === 'Grade 3 - 5' ? 15 : _context2.t0 === 'Grade 6 - 7' ? 17 : _context2.t0 === 'Grade 8 - HS' ? 19 : 21;
|
|
94
98
|
break;
|
|
95
99
|
|
|
96
|
-
case
|
|
100
|
+
case 13:
|
|
97
101
|
equationEditor = 1;
|
|
98
|
-
return _context2.abrupt("break",
|
|
102
|
+
return _context2.abrupt("break", 22);
|
|
99
103
|
|
|
100
|
-
case
|
|
104
|
+
case 15:
|
|
101
105
|
equationEditor = 3;
|
|
102
|
-
return _context2.abrupt("break",
|
|
106
|
+
return _context2.abrupt("break", 22);
|
|
103
107
|
|
|
104
|
-
case
|
|
108
|
+
case 17:
|
|
105
109
|
equationEditor = 6;
|
|
106
|
-
return _context2.abrupt("break",
|
|
110
|
+
return _context2.abrupt("break", 22);
|
|
107
111
|
|
|
108
|
-
case
|
|
112
|
+
case 19:
|
|
109
113
|
equationEditor = 8;
|
|
110
|
-
return _context2.abrupt("break",
|
|
114
|
+
return _context2.abrupt("break", 22);
|
|
111
115
|
|
|
112
|
-
case
|
|
113
|
-
return _context2.abrupt("break",
|
|
116
|
+
case 21:
|
|
117
|
+
return _context2.abrupt("break", 22);
|
|
114
118
|
|
|
115
|
-
case
|
|
119
|
+
case 22:
|
|
120
|
+
annotatorMode = env.role === 'instructor' || env.mode === 'evaluate';
|
|
121
|
+
disabledAnnotator = env.role !== 'instructor';
|
|
116
122
|
return _context2.abrupt("return", fb.then(function (feedback) {
|
|
117
123
|
return {
|
|
118
124
|
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
119
125
|
dimensions: normalizedQuestion.dimensions,
|
|
120
126
|
customKeys: normalizedQuestion.customKeys || [],
|
|
127
|
+
id: normalizedQuestion.id,
|
|
121
128
|
disabled: env.mode !== 'gather',
|
|
122
129
|
feedback: feedback,
|
|
123
130
|
teacherInstructions: teacherInstructions,
|
|
124
131
|
mathInput: normalizedQuestion.mathInput,
|
|
125
|
-
equationEditor: equationEditor
|
|
132
|
+
equationEditor: equationEditor,
|
|
133
|
+
annotatorMode: annotatorMode,
|
|
134
|
+
disabledAnnotator: disabledAnnotator,
|
|
135
|
+
predefinedAnnotations: normalizedQuestion.predefinedAnnotations
|
|
126
136
|
};
|
|
127
137
|
}));
|
|
128
138
|
|
|
129
|
-
case
|
|
139
|
+
case 25:
|
|
130
140
|
case "end":
|
|
131
141
|
return _context2.stop();
|
|
132
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","createDefaultModel","model","defaults","normalize","question","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","session","env","normalizedQuestion","fb","mode","feedback","Promise","resolve","undefined","teacherInstructions","role","equationEditor","then","prompt","dimensions","customKeys","disabled","mathInput","outcome","score","completed","note"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAGA;;AAEA;;;;;;AAHA,IAAMA,GAAG,GAAG,uBAAM,6CAAN,CAAZ;;SAKsBC,kB;;;;;sGAAf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkCC,YAAAA,KAAlC,2DAA0C,EAA1C;AACLF,YAAAA,GAAG,CAAC,sBAAD,EAAyBE,KAAzB,CAAH;AADK,6EAIAC,oBAJA,GAKAD,KALA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;;;AASA,IAAME,SAAS,GAAG,SAAZA,SAAY,CAAAC,QAAQ;AAAA,yCAC5BF,oBAD4B;AAE/BG,IAAAA,eAAe,EAAE,IAFc;AAG/BC,IAAAA,gBAAgB,EAAE,IAHa;AAI/BC,IAAAA,aAAa,EAAE,IAJgB;AAK/BC,IAAAA,0BAA0B,EAAE,IALG;AAM/BC,IAAAA,0BAA0B,EAAE;AANG,KAO5BL,QAP4B;AAAA,CAA1B;;;;SAWeH,K;;;;;yFAAf,kBAAqBG,QAArB,EAA+BM,OAA/B,EAAwCC,GAAxC;AAAA;AAAA;AAAA;AAAA;AAAA;AACLZ,YAAAA,GAAG,CAAC,YAAD,EAAeK,QAAf,CAAH;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["log","createDefaultModel","model","defaults","normalize","question","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","session","env","console","normalizedQuestion","fb","mode","feedback","Promise","resolve","undefined","teacherInstructions","role","equationEditor","annotatorMode","disabledAnnotator","then","prompt","dimensions","customKeys","id","disabled","mathInput","predefinedAnnotations","outcome","score","completed","note"],"mappings":"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","sourcesContent":["import debug from 'debug';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\nimport { getFeedback } from '@pie-lib/feedback';\n\nimport defaults from './defaults';\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return {\n ...defaults,\n ...model,\n };\n}\n\nexport const normalize = question => ({\n ...defaults,\n feedbackEnabled: true,\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n ...question,\n});\n\n\nexport async function model(question, session, env) {\n log('[question]', question);\n console.log('session', session);\n console.log('question', question);\n console.log('env', env);\n const normalizedQuestion = normalize(question);\n console.log('normalizedQuestion', normalizedQuestion);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = env.role === 'instructor' || env.mode === 'evaluate';\n const disabledAnnotator = env.role !== 'instructor';\n\n return fb.then(feedback => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n mathInput: normalizedQuestion.mathInput,\n equationEditor,\n annotatorMode,\n disabledAnnotator,\n predefinedAnnotations: normalizedQuestion.predefinedAnnotations\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring'\n };\n}\n"],"file":"index.js"}
|
package/controller/package.json
CHANGED
package/docs/pie-schema.json
CHANGED
|
@@ -116,6 +116,41 @@
|
|
|
116
116
|
"type": "string",
|
|
117
117
|
"title": "toolbarEditorPosition"
|
|
118
118
|
},
|
|
119
|
+
"predefinedAnnotations": {
|
|
120
|
+
"description": "Indicates the predefined annotations for the annotation menu",
|
|
121
|
+
"type": "array",
|
|
122
|
+
"items": {
|
|
123
|
+
"title": "PredefinedAnnotation",
|
|
124
|
+
"type": "object",
|
|
125
|
+
"properties": {
|
|
126
|
+
"label": {
|
|
127
|
+
"description": "Indicates the value displayed in the annotation button",
|
|
128
|
+
"type": "string",
|
|
129
|
+
"title": "label"
|
|
130
|
+
},
|
|
131
|
+
"text": {
|
|
132
|
+
"description": "Indicates the annotation value",
|
|
133
|
+
"type": "string",
|
|
134
|
+
"title": "text"
|
|
135
|
+
},
|
|
136
|
+
"type": {
|
|
137
|
+
"description": "Indicates the type of the annotation",
|
|
138
|
+
"enum": [
|
|
139
|
+
"negative",
|
|
140
|
+
"positive"
|
|
141
|
+
],
|
|
142
|
+
"type": "string",
|
|
143
|
+
"title": "type"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"required": [
|
|
147
|
+
"label",
|
|
148
|
+
"text",
|
|
149
|
+
"type"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"title": "predefinedAnnotations"
|
|
153
|
+
},
|
|
119
154
|
"id": {
|
|
120
155
|
"description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
|
|
121
156
|
"type": "string",
|
|
@@ -212,6 +247,36 @@
|
|
|
212
247
|
"required": [
|
|
213
248
|
"type"
|
|
214
249
|
]
|
|
250
|
+
},
|
|
251
|
+
"PredefinedAnnotation": {
|
|
252
|
+
"title": "PredefinedAnnotation",
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"label": {
|
|
256
|
+
"description": "Indicates the value displayed in the annotation button",
|
|
257
|
+
"type": "string",
|
|
258
|
+
"title": "label"
|
|
259
|
+
},
|
|
260
|
+
"text": {
|
|
261
|
+
"description": "Indicates the annotation value",
|
|
262
|
+
"type": "string",
|
|
263
|
+
"title": "text"
|
|
264
|
+
},
|
|
265
|
+
"type": {
|
|
266
|
+
"description": "Indicates the type of the annotation",
|
|
267
|
+
"enum": [
|
|
268
|
+
"negative",
|
|
269
|
+
"positive"
|
|
270
|
+
],
|
|
271
|
+
"type": "string",
|
|
272
|
+
"title": "type"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
"required": [
|
|
276
|
+
"label",
|
|
277
|
+
"text",
|
|
278
|
+
"type"
|
|
279
|
+
]
|
|
215
280
|
}
|
|
216
281
|
},
|
|
217
282
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
package/docs/pie-schema.json.md
CHANGED
|
@@ -95,6 +95,31 @@ This element must be one of the following enum values:
|
|
|
95
95
|
* `bottom`
|
|
96
96
|
* `top`
|
|
97
97
|
|
|
98
|
+
# `predefinedAnnotations` (array)
|
|
99
|
+
|
|
100
|
+
Indicates the predefined annotations for the annotation menu
|
|
101
|
+
|
|
102
|
+
The object is an array with all elements of the type `object`.
|
|
103
|
+
|
|
104
|
+
The array object has the following properties:
|
|
105
|
+
|
|
106
|
+
## `label` (string, required)
|
|
107
|
+
|
|
108
|
+
Indicates the value displayed in the annotation button
|
|
109
|
+
|
|
110
|
+
## `text` (string, required)
|
|
111
|
+
|
|
112
|
+
Indicates the annotation value
|
|
113
|
+
|
|
114
|
+
## `type` (string, enum, required)
|
|
115
|
+
|
|
116
|
+
Indicates the type of the annotation
|
|
117
|
+
|
|
118
|
+
This element must be one of the following enum values:
|
|
119
|
+
|
|
120
|
+
* `negative`
|
|
121
|
+
* `positive`
|
|
122
|
+
|
|
98
123
|
# `id` (string, required)
|
|
99
124
|
|
|
100
125
|
Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
|
|
@@ -165,4 +190,25 @@ This element must be one of the following enum values:
|
|
|
165
190
|
|
|
166
191
|
### `default` (string)
|
|
167
192
|
|
|
168
|
-
Indicates the feedback value
|
|
193
|
+
Indicates the feedback value
|
|
194
|
+
|
|
195
|
+
## `PredefinedAnnotation` (object)
|
|
196
|
+
|
|
197
|
+
Properties of the `PredefinedAnnotation` object:
|
|
198
|
+
|
|
199
|
+
### `label` (string, required)
|
|
200
|
+
|
|
201
|
+
Indicates the value displayed in the annotation button
|
|
202
|
+
|
|
203
|
+
### `text` (string, required)
|
|
204
|
+
|
|
205
|
+
Indicates the annotation value
|
|
206
|
+
|
|
207
|
+
### `type` (string, enum, required)
|
|
208
|
+
|
|
209
|
+
Indicates the type of the annotation
|
|
210
|
+
|
|
211
|
+
This element must be one of the following enum values:
|
|
212
|
+
|
|
213
|
+
* `negative`
|
|
214
|
+
* `positive`
|