@pie-element/extended-text-entry 10.12.4 → 10.13.1
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 +30 -0
- package/configure/CHANGELOG.md +19 -0
- package/configure/lib/defaults.js +6 -1
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +3 -0
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +2 -2
- package/controller/CHANGELOG.md +22 -0
- package/controller/lib/defaults.js +73 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +9 -11
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -2
- package/docs/config-schema.json +16 -0
- package/docs/config-schema.json.md +12 -0
- package/docs/demo/generate.js +1 -0
- package/docs/pie-schema.json +70 -0
- package/docs/pie-schema.json.md +51 -1
- package/lib/annotation/annotation-editor.js +703 -0
- package/lib/annotation/annotation-editor.js.map +1 -0
- package/lib/annotation/annotation-menu.js +206 -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 +266 -0
- package/lib/annotation/freeform-editor.js.map +1 -0
- package/lib/index.js +23 -6
- package/lib/index.js.map +1 -1
- package/lib/main.js +49 -19
- package/lib/main.js.map +1 -1
- package/module/configure.js +20 -14
- package/module/controller.js +33 -14
- package/module/demo.js +1 -0
- package/module/element.js +7601 -506
- package/module/index.html +1 -1
- package/module/manifest.json +2 -2
- package/module/print-demo.js +1 -0
- package/module/print.html +1 -1
- package/module/print.js +7585 -503
- package/package.json +3 -3
package/module/configure.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.10.4/module/index.js";
|
|
2
2
|
import {_dll_pie_lib__pie_toolbox_config_ui, _dll_pie_lib__pie_toolbox_editable_html} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
|
|
3
3
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
@@ -5840,7 +5840,7 @@ class Main extends React$1.Component {
|
|
|
5840
5840
|
}
|
|
5841
5841
|
render() {
|
|
5842
5842
|
const {model, classes, configuration, imageSupport, onConfigurationChanged, onModelChanged, uploadSoundSupport} = this.props;
|
|
5843
|
-
const {contentDimensions = {}, dimensions = {}, equationEditor = {}, feedback = {}, playerSpellCheck = {}, prompt = {}, settingsPanelDisabled, spanishInput = {}, specialInput = {}, spellCheck = {}, studentInstructions = {}, teacherInstructions = {}, mathInput = {}, maxImageWidth = {}, maxImageHeight = {}, multiple = {}, withRubric = {}, mathMlOptions = {}, baseInputConfiguration = {}} = configuration || ({});
|
|
5843
|
+
const {annotations = {}, contentDimensions = {}, dimensions = {}, equationEditor = {}, feedback = {}, playerSpellCheck = {}, prompt = {}, settingsPanelDisabled, spanishInput = {}, specialInput = {}, spellCheck = {}, studentInstructions = {}, teacherInstructions = {}, mathInput = {}, maxImageWidth = {}, maxImageHeight = {}, multiple = {}, withRubric = {}, mathMlOptions = {}, baseInputConfiguration = {}} = configuration || ({});
|
|
5844
5844
|
const {errors = {}, feedbackEnabled, promptEnabled, spellCheckEnabled, teacherInstructionsEnabled, toolbarEditorPosition} = model || ({});
|
|
5845
5845
|
const {prompt: promptError, teacherInstructions: teacherInstructionsError} = errors;
|
|
5846
5846
|
const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
@@ -5870,6 +5870,7 @@ class Main extends React$1.Component {
|
|
|
5870
5870
|
'multiple.enabled': multiple.settings && toggle(multiple.label, true),
|
|
5871
5871
|
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
5872
5872
|
feedbackEnabled: feedback.settings && toggle(feedback.label),
|
|
5873
|
+
annotationsEnabled: annotations.settings && toggle(annotations.label),
|
|
5873
5874
|
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
5874
5875
|
playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label)
|
|
5875
5876
|
};
|
|
@@ -5898,13 +5899,13 @@ class Main extends React$1.Component {
|
|
|
5898
5899
|
__self: this,
|
|
5899
5900
|
__source: {
|
|
5900
5901
|
fileName: _jsxFileName,
|
|
5901
|
-
lineNumber:
|
|
5902
|
+
lineNumber: 145
|
|
5902
5903
|
}
|
|
5903
5904
|
}),
|
|
5904
5905
|
__self: this,
|
|
5905
5906
|
__source: {
|
|
5906
5907
|
fileName: _jsxFileName,
|
|
5907
|
-
lineNumber:
|
|
5908
|
+
lineNumber: 141
|
|
5908
5909
|
}
|
|
5909
5910
|
}, teacherInstructionsEnabled && React$1.createElement(InputContainer, {
|
|
5910
5911
|
label: teacherInstructions.label,
|
|
@@ -5912,7 +5913,7 @@ class Main extends React$1.Component {
|
|
|
5912
5913
|
__self: this,
|
|
5913
5914
|
__source: {
|
|
5914
5915
|
fileName: _jsxFileName,
|
|
5915
|
-
lineNumber:
|
|
5916
|
+
lineNumber: 158
|
|
5916
5917
|
}
|
|
5917
5918
|
}, React$1.createElement(EditableHtml, {
|
|
5918
5919
|
className: classes.prompt,
|
|
@@ -5936,14 +5937,14 @@ class Main extends React$1.Component {
|
|
|
5936
5937
|
__self: this,
|
|
5937
5938
|
__source: {
|
|
5938
5939
|
fileName: _jsxFileName,
|
|
5939
|
-
lineNumber:
|
|
5940
|
+
lineNumber: 159
|
|
5940
5941
|
}
|
|
5941
5942
|
}), teacherInstructionsError && React$1.createElement('div', {
|
|
5942
5943
|
className: classes.errorText,
|
|
5943
5944
|
__self: this,
|
|
5944
5945
|
__source: {
|
|
5945
5946
|
fileName: _jsxFileName,
|
|
5946
|
-
lineNumber:
|
|
5947
|
+
lineNumber: 175
|
|
5947
5948
|
}
|
|
5948
5949
|
}, teacherInstructionsError)), promptEnabled && React$1.createElement(InputContainer, {
|
|
5949
5950
|
label: prompt.label,
|
|
@@ -5951,7 +5952,7 @@ class Main extends React$1.Component {
|
|
|
5951
5952
|
__self: this,
|
|
5952
5953
|
__source: {
|
|
5953
5954
|
fileName: _jsxFileName,
|
|
5954
|
-
lineNumber:
|
|
5955
|
+
lineNumber: 180
|
|
5955
5956
|
}
|
|
5956
5957
|
}, React$1.createElement(EditableHtml, {
|
|
5957
5958
|
activePlugins: ALL_PLUGINS,
|
|
@@ -5976,20 +5977,20 @@ class Main extends React$1.Component {
|
|
|
5976
5977
|
__self: this,
|
|
5977
5978
|
__source: {
|
|
5978
5979
|
fileName: _jsxFileName,
|
|
5979
|
-
lineNumber:
|
|
5980
|
+
lineNumber: 181
|
|
5980
5981
|
}
|
|
5981
5982
|
}), promptError && React$1.createElement('div', {
|
|
5982
5983
|
className: classes.errorText,
|
|
5983
5984
|
__self: this,
|
|
5984
5985
|
__source: {
|
|
5985
5986
|
fileName: _jsxFileName,
|
|
5986
|
-
lineNumber:
|
|
5987
|
+
lineNumber: 198
|
|
5987
5988
|
}
|
|
5988
5989
|
}, promptError)), feedbackEnabled && React$1.createElement(React$1.Fragment, {
|
|
5989
5990
|
__self: this,
|
|
5990
5991
|
__source: {
|
|
5991
5992
|
fileName: _jsxFileName,
|
|
5992
|
-
lineNumber:
|
|
5993
|
+
lineNumber: 203
|
|
5993
5994
|
}
|
|
5994
5995
|
}, React$1.createElement(Typography, {
|
|
5995
5996
|
className: classes.header,
|
|
@@ -5997,7 +5998,7 @@ class Main extends React$1.Component {
|
|
|
5997
5998
|
__self: this,
|
|
5998
5999
|
__source: {
|
|
5999
6000
|
fileName: _jsxFileName,
|
|
6000
|
-
lineNumber:
|
|
6001
|
+
lineNumber: 204
|
|
6001
6002
|
}
|
|
6002
6003
|
}, "Feedback"), React$1.createElement(FeedbackSelector, {
|
|
6003
6004
|
label: "When submitted, show",
|
|
@@ -6007,7 +6008,7 @@ class Main extends React$1.Component {
|
|
|
6007
6008
|
__self: this,
|
|
6008
6009
|
__source: {
|
|
6009
6010
|
fileName: _jsxFileName,
|
|
6010
|
-
lineNumber:
|
|
6011
|
+
lineNumber: 208
|
|
6011
6012
|
}
|
|
6012
6013
|
})));
|
|
6013
6014
|
}
|
|
@@ -6046,9 +6047,14 @@ var defaults = {
|
|
|
6046
6047
|
studentInstructionsEnabled: true,
|
|
6047
6048
|
spellCheckEnabled: true,
|
|
6048
6049
|
playerSpellCheckDisabled: true,
|
|
6049
|
-
toolbarEditorPosition: 'bottom'
|
|
6050
|
+
toolbarEditorPosition: 'bottom',
|
|
6051
|
+
annotationsEnabled: false
|
|
6050
6052
|
},
|
|
6051
6053
|
configuration: {
|
|
6054
|
+
annotations: {
|
|
6055
|
+
settings: false,
|
|
6056
|
+
label: 'Annotations'
|
|
6057
|
+
},
|
|
6052
6058
|
baseInputConfiguration: {
|
|
6053
6059
|
audio: {
|
|
6054
6060
|
disabled: false
|
package/module/controller.js
CHANGED
|
@@ -164,30 +164,43 @@ var _feedback = feedback;
|
|
|
164
164
|
}(feedback$1));
|
|
165
165
|
|
|
166
166
|
var defaults = {
|
|
167
|
+
annotationsEnabled: false,
|
|
167
168
|
dimensions: {
|
|
168
169
|
height: 100,
|
|
169
170
|
width: 500,
|
|
170
171
|
},
|
|
172
|
+
feedbackEnabled: false,
|
|
173
|
+
promptEnabled: true,
|
|
174
|
+
rationaleEnabled: true,
|
|
175
|
+
teacherInstructionsEnabled: true,
|
|
176
|
+
studentInstructionsEnabled: true,
|
|
177
|
+
playerSpellCheckDisabled: true,
|
|
178
|
+
predefinedAnnotations: [
|
|
179
|
+
{ label: 'good', text: 'good', type: 'positive' },
|
|
180
|
+
{ label: '★', text: '★', type: 'positive' },
|
|
181
|
+
{ label: ':-)', text: ':-)', type: 'positive' },
|
|
182
|
+
{ label: 'creative', text: 'creative', type: 'positive' },
|
|
183
|
+
{ label: 'run-on', text: 'run-on', type: 'negative' },
|
|
184
|
+
{ label: 'frag', text: 'fragment', type: 'negative' },
|
|
185
|
+
{ label: 'tran', text: 'transition', type: 'negative' },
|
|
186
|
+
{ label: 'supp', text: 'support needed', type: 'negative' },
|
|
187
|
+
{ label: 'punc', text: 'punctuation', type: 'negative' },
|
|
188
|
+
{ label: 'agr', text: 'agreement wrong', type: 'negative' },
|
|
189
|
+
{ label: 'unclear', text: 'unclear', type: 'negative' },
|
|
190
|
+
{ label: 'cut', text: 'cut', type: 'negative' },
|
|
191
|
+
{ label: 'sp', text: 'spelling', type: 'negative' },
|
|
192
|
+
{ label: 'cap', text: 'capitalization', type: 'negative' },
|
|
193
|
+
{ label: 'inf', text: 'informal', type: 'negative' },
|
|
194
|
+
{ label: 'awk', text: 'awkward', type: 'negative' },
|
|
195
|
+
],
|
|
171
196
|
};
|
|
172
197
|
|
|
173
198
|
async function createDefaultModel(model = {}) {
|
|
174
199
|
|
|
175
|
-
return {
|
|
176
|
-
...defaults,
|
|
177
|
-
...model,
|
|
178
|
-
};
|
|
200
|
+
return { ...defaults, ...model };
|
|
179
201
|
}
|
|
180
202
|
|
|
181
|
-
const normalize = (question) => ({
|
|
182
|
-
...defaults,
|
|
183
|
-
feedbackEnabled: false,
|
|
184
|
-
rationaleEnabled: true,
|
|
185
|
-
promptEnabled: true,
|
|
186
|
-
teacherInstructionsEnabled: true,
|
|
187
|
-
studentInstructionsEnabled: true,
|
|
188
|
-
playerSpellCheckDisabled: true,
|
|
189
|
-
...question,
|
|
190
|
-
});
|
|
203
|
+
const normalize = (question) => ({ ...defaults, ...question });
|
|
191
204
|
|
|
192
205
|
async function model(question, session, env) {
|
|
193
206
|
const normalizedQuestion = normalize(question);
|
|
@@ -221,10 +234,13 @@ async function model(question, session, env) {
|
|
|
221
234
|
break;
|
|
222
235
|
}
|
|
223
236
|
|
|
237
|
+
const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');
|
|
238
|
+
|
|
224
239
|
return fb.then((feedback) => ({
|
|
225
240
|
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
226
241
|
dimensions: normalizedQuestion.dimensions,
|
|
227
242
|
customKeys: normalizedQuestion.customKeys || [],
|
|
243
|
+
id: normalizedQuestion.id,
|
|
228
244
|
disabled: env.mode !== 'gather',
|
|
229
245
|
feedback,
|
|
230
246
|
teacherInstructions,
|
|
@@ -234,6 +250,9 @@ async function model(question, session, env) {
|
|
|
234
250
|
equationEditor,
|
|
235
251
|
spellCheckEnabled: !normalizedQuestion.playerSpellCheckDisabled,
|
|
236
252
|
playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',
|
|
253
|
+
annotatorMode,
|
|
254
|
+
disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,
|
|
255
|
+
predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],
|
|
237
256
|
}));
|
|
238
257
|
}
|
|
239
258
|
|