@pie-element/placement-ordering 14.1.2-next.5 → 14.1.3
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.json +1312 -0
- package/CHANGELOG.md +2444 -0
- package/LICENSE.md +5 -0
- package/README.md +57 -0
- package/configure/CHANGELOG.json +952 -0
- package/configure/CHANGELOG.md +2139 -0
- package/configure/lib/choice-editor.js +252 -0
- package/configure/lib/choice-editor.js.map +1 -0
- package/configure/lib/choice-tile.js +205 -0
- package/configure/lib/choice-tile.js.map +1 -0
- package/configure/lib/defaults.js +211 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/design.js +427 -0
- package/configure/lib/design.js.map +1 -0
- package/configure/lib/help.js +14 -0
- package/configure/lib/help.js.map +1 -0
- package/configure/lib/index.js +155 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +108 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +26 -0
- package/controller/CHANGELOG.json +517 -0
- package/controller/CHANGELOG.md +1518 -0
- package/controller/lib/defaults.js +29 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +285 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/scoring.js +109 -0
- package/controller/lib/scoring.js.map +1 -0
- package/controller/package.json +15 -0
- package/docs/config-schema.json +2964 -0
- package/docs/config-schema.json.md +2190 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +50 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +7 -0
- package/docs/pie-schema.json +1613 -0
- package/docs/pie-schema.json.md +973 -0
- package/icon.png +0 -0
- package/lib/index.js +122 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +32 -0
- package/lib/main.js.map +1 -0
- package/lib/ordering.js +165 -0
- package/lib/ordering.js.map +1 -0
- package/lib/placement-ordering.js +419 -0
- package/lib/placement-ordering.js.map +1 -0
- package/lib/tile.js +259 -0
- package/lib/tile.js.map +1 -0
- package/lib/tiler.js +165 -0
- package/lib/tiler.js.map +1 -0
- package/lib/utils.js +18 -0
- package/lib/utils.js.map +1 -0
- package/package.json +21 -88
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/choice-editor.d.ts +0 -39
- package/dist/author/choice-editor.js +0 -156
- package/dist/author/choice-tile.d.ts +0 -40
- package/dist/author/choice-tile.js +0 -132
- package/dist/author/defaults.d.ts +0 -213
- package/dist/author/defaults.js +0 -159
- package/dist/author/design.d.ts +0 -21
- package/dist/author/design.js +0 -273
- package/dist/author/help.d.ts +0 -11
- package/dist/author/index.d.ts +0 -45
- package/dist/author/index.js +0 -85
- package/dist/author/utils.d.ts +0 -15
- package/dist/author/utils.js +0 -62
- package/dist/browser/author/index.js +0 -46600
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/browser-DHPggtaA.js +0 -376
- package/dist/browser/browser-DHPggtaA.js.map +0 -1
- package/dist/browser/controller/index.js +0 -242
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -1035
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-D9ARZhQk.js +0 -1426
- package/dist/browser/dist-D9ARZhQk.js.map +0 -1
- package/dist/browser/drag-provider-C1slTlsc.js +0 -10555
- package/dist/browser/drag-provider-C1slTlsc.js.map +0 -1
- package/dist/browser/placement-ordering.css +0 -2
- package/dist/controller/defaults.d.ts +0 -31
- package/dist/controller/defaults.js +0 -25
- package/dist/controller/index.d.ts +0 -29
- package/dist/controller/index.js +0 -123
- package/dist/controller/scoring.d.ts +0 -27
- package/dist/controller/scoring.js +0 -30
- package/dist/delivery/index.d.ts +0 -26
- package/dist/delivery/index.js +0 -70
- package/dist/delivery/main.d.ts +0 -19
- package/dist/delivery/main.js +0 -22
- package/dist/delivery/ordering.d.ts +0 -18
- package/dist/delivery/ordering.js +0 -93
- package/dist/delivery/placement-ordering.d.ts +0 -28
- package/dist/delivery/placement-ordering.js +0 -213
- package/dist/delivery/tile.d.ts +0 -28
- package/dist/delivery/tile.js +0 -165
- package/dist/delivery/tiler.d.ts +0 -42
- package/dist/delivery/tiler.js +0 -89
- package/dist/delivery/utils.d.ts +0 -9
- package/dist/delivery/utils.js +0 -8
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -152
- package/dist/index.js +0 -2
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
|
|
8
|
+
* functionalities are not defined yet - the value for those can belong to
|
|
9
|
+
* model or to configuration
|
|
10
|
+
*/
|
|
11
|
+
var _default = exports.default = {
|
|
12
|
+
model: {
|
|
13
|
+
choiceLabel: '',
|
|
14
|
+
choiceLabelEnabled: true,
|
|
15
|
+
choices: [],
|
|
16
|
+
correctResponse: [],
|
|
17
|
+
feedbackEnabled: false,
|
|
18
|
+
numberedGuides: false,
|
|
19
|
+
orientation: 'vertical',
|
|
20
|
+
partialScoring: true,
|
|
21
|
+
placementArea: false,
|
|
22
|
+
prompt: '',
|
|
23
|
+
promptEnabled: true,
|
|
24
|
+
rationale: '',
|
|
25
|
+
rationaleEnabled: true,
|
|
26
|
+
removeTilesAfterPlacing: true,
|
|
27
|
+
scoringType: 'auto',
|
|
28
|
+
studentInstructionsEnabled: true,
|
|
29
|
+
targetLabel: '',
|
|
30
|
+
teacherInstructions: '',
|
|
31
|
+
teacherInstructionsEnabled: true,
|
|
32
|
+
toolbarEditorPosition: 'bottom'
|
|
33
|
+
},
|
|
34
|
+
configuration: {
|
|
35
|
+
baseInputConfiguration: {
|
|
36
|
+
h3: {
|
|
37
|
+
disabled: true
|
|
38
|
+
},
|
|
39
|
+
audio: {
|
|
40
|
+
disabled: false
|
|
41
|
+
},
|
|
42
|
+
video: {
|
|
43
|
+
disabled: false
|
|
44
|
+
},
|
|
45
|
+
image: {
|
|
46
|
+
disabled: false
|
|
47
|
+
},
|
|
48
|
+
textAlign: {
|
|
49
|
+
disabled: true
|
|
50
|
+
},
|
|
51
|
+
showParagraphs: {
|
|
52
|
+
disabled: false
|
|
53
|
+
},
|
|
54
|
+
separateParagraphs: {
|
|
55
|
+
disabled: true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
choiceLabel: {
|
|
59
|
+
settings: true,
|
|
60
|
+
label: 'Choice label',
|
|
61
|
+
inputConfiguration: {
|
|
62
|
+
audio: {
|
|
63
|
+
disabled: false
|
|
64
|
+
},
|
|
65
|
+
video: {
|
|
66
|
+
disabled: false
|
|
67
|
+
},
|
|
68
|
+
image: {
|
|
69
|
+
disabled: false
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
choices: {
|
|
74
|
+
settings: true,
|
|
75
|
+
label: 'Choices',
|
|
76
|
+
inputConfiguration: {
|
|
77
|
+
audio: {
|
|
78
|
+
disabled: true
|
|
79
|
+
},
|
|
80
|
+
video: {
|
|
81
|
+
disabled: true
|
|
82
|
+
},
|
|
83
|
+
image: {
|
|
84
|
+
disabled: true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
feedback: {
|
|
89
|
+
settings: true,
|
|
90
|
+
label: 'Feedback',
|
|
91
|
+
enabled: true
|
|
92
|
+
},
|
|
93
|
+
prompt: {
|
|
94
|
+
settings: true,
|
|
95
|
+
label: 'Item Stem',
|
|
96
|
+
required: false,
|
|
97
|
+
inputConfiguration: {
|
|
98
|
+
audio: {
|
|
99
|
+
disabled: false
|
|
100
|
+
},
|
|
101
|
+
video: {
|
|
102
|
+
disabled: false
|
|
103
|
+
},
|
|
104
|
+
image: {
|
|
105
|
+
disabled: false
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
numberedGuides: {
|
|
110
|
+
settings: true,
|
|
111
|
+
label: 'Numbered guides'
|
|
112
|
+
},
|
|
113
|
+
orientation: {
|
|
114
|
+
settings: true,
|
|
115
|
+
label: 'Orientation'
|
|
116
|
+
},
|
|
117
|
+
partialScoring: {
|
|
118
|
+
settings: false,
|
|
119
|
+
label: 'Allow Partial Scoring'
|
|
120
|
+
},
|
|
121
|
+
placementArea: {
|
|
122
|
+
settings: true,
|
|
123
|
+
label: 'Placement Area'
|
|
124
|
+
},
|
|
125
|
+
rationale: {
|
|
126
|
+
settings: true,
|
|
127
|
+
label: 'Rationale',
|
|
128
|
+
required: false,
|
|
129
|
+
inputConfiguration: {
|
|
130
|
+
audio: {
|
|
131
|
+
disabled: false
|
|
132
|
+
},
|
|
133
|
+
video: {
|
|
134
|
+
disabled: false
|
|
135
|
+
},
|
|
136
|
+
image: {
|
|
137
|
+
disabled: false
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
removeTilesAfterPlacing: {
|
|
142
|
+
settings: false,
|
|
143
|
+
label: 'Remove Tiles after placing'
|
|
144
|
+
},
|
|
145
|
+
settingsPanelDisabled: false,
|
|
146
|
+
scoringType: {
|
|
147
|
+
settings: false,
|
|
148
|
+
label: 'Scoring Type'
|
|
149
|
+
},
|
|
150
|
+
studentInstructions: {
|
|
151
|
+
settings: false,
|
|
152
|
+
label: 'Student Instructions'
|
|
153
|
+
},
|
|
154
|
+
targetLabel: {
|
|
155
|
+
settings: true,
|
|
156
|
+
label: 'Target label'
|
|
157
|
+
},
|
|
158
|
+
spellCheck: {
|
|
159
|
+
label: 'Spellcheck',
|
|
160
|
+
settings: false,
|
|
161
|
+
enabled: true
|
|
162
|
+
},
|
|
163
|
+
teacherInstructions: {
|
|
164
|
+
settings: true,
|
|
165
|
+
label: 'Teacher Instructions',
|
|
166
|
+
required: false,
|
|
167
|
+
inputConfiguration: {
|
|
168
|
+
audio: {
|
|
169
|
+
disabled: false
|
|
170
|
+
},
|
|
171
|
+
video: {
|
|
172
|
+
disabled: false
|
|
173
|
+
},
|
|
174
|
+
image: {
|
|
175
|
+
disabled: false
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
maxImageWidth: {
|
|
180
|
+
teacherInstructions: 300,
|
|
181
|
+
prompt: 300,
|
|
182
|
+
rationale: 300,
|
|
183
|
+
choicesWithPlacementArea: 240,
|
|
184
|
+
choicesWithoutPlacementArea: 300
|
|
185
|
+
},
|
|
186
|
+
maxImageHeight: {
|
|
187
|
+
teacherInstructions: 300,
|
|
188
|
+
prompt: 300,
|
|
189
|
+
rationale: 300,
|
|
190
|
+
choices: 150
|
|
191
|
+
},
|
|
192
|
+
withRubric: {
|
|
193
|
+
settings: false,
|
|
194
|
+
label: 'Add Rubric'
|
|
195
|
+
},
|
|
196
|
+
mathMlOptions: {
|
|
197
|
+
mmlOutput: false,
|
|
198
|
+
mmlEditing: false
|
|
199
|
+
},
|
|
200
|
+
language: {
|
|
201
|
+
settings: false,
|
|
202
|
+
label: 'Specify Language',
|
|
203
|
+
enabled: false
|
|
204
|
+
},
|
|
205
|
+
languageChoices: {
|
|
206
|
+
label: 'Language Choices',
|
|
207
|
+
options: []
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["_default","exports","default","model","choiceLabel","choiceLabelEnabled","choices","correctResponse","feedbackEnabled","numberedGuides","orientation","partialScoring","placementArea","prompt","promptEnabled","rationale","rationaleEnabled","removeTilesAfterPlacing","scoringType","studentInstructionsEnabled","targetLabel","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition","configuration","baseInputConfiguration","h3","disabled","audio","video","image","textAlign","showParagraphs","separateParagraphs","settings","label","inputConfiguration","feedback","enabled","required","settingsPanelDisabled","studentInstructions","spellCheck","maxImageWidth","choicesWithPlacementArea","choicesWithoutPlacementArea","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options"],"sources":["../src/defaults.js"],"sourcesContent":["/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType\n * functionalities are not defined yet - the value for those can belong to\n * model or to configuration\n */\n\nexport default {\n model: {\n choiceLabel: '',\n choiceLabelEnabled: true,\n choices: [],\n correctResponse: [],\n feedbackEnabled: false,\n numberedGuides: false,\n orientation: 'vertical',\n partialScoring: true,\n placementArea: false,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n removeTilesAfterPlacing: true,\n scoringType: 'auto',\n studentInstructionsEnabled: true,\n targetLabel: '',\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n baseInputConfiguration: {\n h3: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\n },\n choiceLabel: {\n settings: true,\n label: 'Choice label',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n choices: {\n settings: true,\n label: 'Choices',\n inputConfiguration: {\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: true },\n },\n },\n feedback: {\n settings: true,\n label: 'Feedback',\n enabled: true,\n },\n prompt: {\n settings: true,\n label: 'Item Stem',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n numberedGuides: {\n settings: true,\n label: 'Numbered guides',\n },\n orientation: {\n settings: true,\n label: 'Orientation',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n placementArea: {\n settings: true,\n label: 'Placement Area',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n removeTilesAfterPlacing: {\n settings: false,\n label: 'Remove Tiles after placing',\n },\n settingsPanelDisabled: false,\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n targetLabel: {\n settings: true,\n label: 'Target label',\n },\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n choicesWithPlacementArea: 240,\n choicesWithoutPlacementArea: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n choices: 150,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n language: {\n settings: false,\n label: 'Specify Language',\n enabled: false,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n },\n },\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.Design = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
13
|
+
var _lodashEs = require("lodash-es");
|
|
14
|
+
var _nestedProperty = require("nested-property");
|
|
15
|
+
var _pluralize = _interopRequireDefault(require("pluralize"));
|
|
16
|
+
var _styles = require("@mui/material/styles");
|
|
17
|
+
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
18
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
19
|
+
var _configUi = require("@pie-lib/config-ui");
|
|
20
|
+
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
21
|
+
var _drag = require("@pie-lib/drag");
|
|
22
|
+
var _choiceEditor = _interopRequireDefault(require("./choice-editor"));
|
|
23
|
+
var _utils = require("./utils");
|
|
24
|
+
const log = (0, _debug.default)('@pie-element:placement-ordering:design');
|
|
25
|
+
const {
|
|
26
|
+
Panel,
|
|
27
|
+
toggle,
|
|
28
|
+
radio,
|
|
29
|
+
dropdown
|
|
30
|
+
} = _configUi.settings;
|
|
31
|
+
const getSingularAndPlural = label => !_pluralize.default.isPlural(label) ? {
|
|
32
|
+
singularLabel: label,
|
|
33
|
+
pluralLabel: (0, _pluralize.default)(label)
|
|
34
|
+
} : {
|
|
35
|
+
singularLabel: _pluralize.default.singular(label),
|
|
36
|
+
pluralLabel: label
|
|
37
|
+
};
|
|
38
|
+
const StyledInputContainer = (0, _styles.styled)(_configUi.InputContainer)(({
|
|
39
|
+
theme
|
|
40
|
+
}) => ({
|
|
41
|
+
width: '100%',
|
|
42
|
+
paddingTop: theme.spacing(2),
|
|
43
|
+
marginBottom: theme.spacing(2)
|
|
44
|
+
}));
|
|
45
|
+
const StyledRow = (0, _styles.styled)('div')({
|
|
46
|
+
display: 'grid',
|
|
47
|
+
gridAutoFlow: 'column',
|
|
48
|
+
gridAutoColumns: '1fr',
|
|
49
|
+
gridGap: '8px'
|
|
50
|
+
});
|
|
51
|
+
const StyledChoicesWrapper = (0, _styles.styled)(_configUi.FormSection)(({
|
|
52
|
+
theme
|
|
53
|
+
}) => ({
|
|
54
|
+
marginTop: 0,
|
|
55
|
+
marginBottom: theme.spacing(2.5)
|
|
56
|
+
}));
|
|
57
|
+
const InlineFlexContainer = (0, _styles.styled)('div')({
|
|
58
|
+
display: 'inline-flex',
|
|
59
|
+
position: 'absolute'
|
|
60
|
+
});
|
|
61
|
+
const ErrorText = (0, _styles.styled)('div')(({
|
|
62
|
+
theme
|
|
63
|
+
}) => ({
|
|
64
|
+
fontSize: theme.typography.fontSize - 2,
|
|
65
|
+
color: theme.palette.error.main,
|
|
66
|
+
paddingTop: theme.spacing(1)
|
|
67
|
+
}));
|
|
68
|
+
class Design extends _react.default.Component {
|
|
69
|
+
constructor(props) {
|
|
70
|
+
super(props);
|
|
71
|
+
(0, _defineProperty2.default)(this, "onDragEnd", (event, ordering) => {
|
|
72
|
+
const {
|
|
73
|
+
active,
|
|
74
|
+
over
|
|
75
|
+
} = event;
|
|
76
|
+
if (!over || !active) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const target = over.data.current;
|
|
80
|
+
const source = active.data.current;
|
|
81
|
+
const rawFrom = ordering.tiles.find(t => t.id === source.id && t.type === source.type);
|
|
82
|
+
const rawTo = target;
|
|
83
|
+
const from = {
|
|
84
|
+
...rawFrom,
|
|
85
|
+
index: (0, _utils.normalizeIndex)(rawFrom, ordering)
|
|
86
|
+
};
|
|
87
|
+
const to = {
|
|
88
|
+
...rawTo,
|
|
89
|
+
index: (0, _utils.normalizeIndex)(rawTo, ordering)
|
|
90
|
+
};
|
|
91
|
+
const {
|
|
92
|
+
response,
|
|
93
|
+
choices: updatedChoices
|
|
94
|
+
} = (0, _utils.updateResponseOrChoices)(ordering.response, ordering.choices, from, to);
|
|
95
|
+
this.onChoiceEditorChange(updatedChoices, response);
|
|
96
|
+
});
|
|
97
|
+
this.applyUpdate = modelFn => {
|
|
98
|
+
const {
|
|
99
|
+
model,
|
|
100
|
+
onModelChanged
|
|
101
|
+
} = this.props;
|
|
102
|
+
const update = modelFn((0, _lodashEs.cloneDeep)(model));
|
|
103
|
+
onModelChanged(update);
|
|
104
|
+
};
|
|
105
|
+
this.changeHandler = (modelPath, valuePath) => {
|
|
106
|
+
return value => {
|
|
107
|
+
log('[changeHandler] value: ', value);
|
|
108
|
+
const v = valuePath ? (0, _nestedProperty.get)(value, valuePath) : value;
|
|
109
|
+
this.applyUpdate(model => {
|
|
110
|
+
(0, _nestedProperty.set)(model, modelPath, v);
|
|
111
|
+
return model;
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
this.onPromptChange = this.changeHandler('prompt');
|
|
116
|
+
this.onTeacherInstructionsChange = this.changeHandler('teacherInstructions');
|
|
117
|
+
this.onRationaleChange = this.changeHandler('rationale');
|
|
118
|
+
this.onChoiceAreaLabelChange = this.changeHandler('choiceLabel', 'target.value');
|
|
119
|
+
this.onAnswerAreaLabelChange = this.changeHandler('targetLabel', 'target.value');
|
|
120
|
+
this.onFeedbackChange = this.changeHandler('feedback');
|
|
121
|
+
this.onChoiceEditorChange = (choices, correctResponse) => {
|
|
122
|
+
const {
|
|
123
|
+
model,
|
|
124
|
+
onModelChanged
|
|
125
|
+
} = this.props;
|
|
126
|
+
const update = (0, _lodashEs.cloneDeep)(model);
|
|
127
|
+
update.choices = choices;
|
|
128
|
+
update.correctResponse = correctResponse;
|
|
129
|
+
onModelChanged(update);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
componentDidMount() {
|
|
133
|
+
const {
|
|
134
|
+
model,
|
|
135
|
+
onModelChanged
|
|
136
|
+
} = this.props || {};
|
|
137
|
+
const {
|
|
138
|
+
feedback
|
|
139
|
+
} = model || {};
|
|
140
|
+
const update = (0, _lodashEs.cloneDeep)(model);
|
|
141
|
+
|
|
142
|
+
// requirement made in PD-2182
|
|
143
|
+
if (!feedback) {
|
|
144
|
+
update.feedbackEnabled = false;
|
|
145
|
+
onModelChanged(update);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
const {
|
|
150
|
+
model,
|
|
151
|
+
imageSupport,
|
|
152
|
+
uploadSoundSupport,
|
|
153
|
+
onModelChanged,
|
|
154
|
+
configuration,
|
|
155
|
+
onConfigurationChanged
|
|
156
|
+
} = this.props;
|
|
157
|
+
const {
|
|
158
|
+
baseInputConfiguration = {},
|
|
159
|
+
choiceLabel = {},
|
|
160
|
+
choices = {},
|
|
161
|
+
contentDimensions = {},
|
|
162
|
+
feedback = {},
|
|
163
|
+
prompt = {},
|
|
164
|
+
placementArea = {},
|
|
165
|
+
maxImageWidth = {},
|
|
166
|
+
maxImageHeight = {},
|
|
167
|
+
numberedGuides = {},
|
|
168
|
+
orientation = {},
|
|
169
|
+
partialScoring = {},
|
|
170
|
+
rationale = {},
|
|
171
|
+
removeTilesAfterPlacing = {},
|
|
172
|
+
settingsPanelDisabled,
|
|
173
|
+
studentInstructions = {},
|
|
174
|
+
spellCheck = {},
|
|
175
|
+
scoringType = {},
|
|
176
|
+
targetLabel = {},
|
|
177
|
+
teacherInstructions = {},
|
|
178
|
+
withRubric = {},
|
|
179
|
+
mathMlOptions = {},
|
|
180
|
+
language = {},
|
|
181
|
+
languageChoices = {}
|
|
182
|
+
} = configuration || {};
|
|
183
|
+
const {
|
|
184
|
+
choiceLabelEnabled,
|
|
185
|
+
errors,
|
|
186
|
+
extraCSSRules,
|
|
187
|
+
feedbackEnabled,
|
|
188
|
+
promptEnabled,
|
|
189
|
+
rationaleEnabled,
|
|
190
|
+
spellCheckEnabled,
|
|
191
|
+
teacherInstructionsEnabled,
|
|
192
|
+
toolbarEditorPosition,
|
|
193
|
+
correctResponse
|
|
194
|
+
} = model || {};
|
|
195
|
+
const {
|
|
196
|
+
prompt: promptError,
|
|
197
|
+
rationale: rationaleError,
|
|
198
|
+
teacherInstructions: teacherInstructionsError
|
|
199
|
+
} = errors || {};
|
|
200
|
+
const ordering = {
|
|
201
|
+
choices: model.choices,
|
|
202
|
+
response: !correctResponse || (0, _lodashEs.isEmpty)(correctResponse) ? new Array(model.choices.length) : correctResponse,
|
|
203
|
+
tiles: (0, _utils.buildTiles)(model.choices, correctResponse)
|
|
204
|
+
};
|
|
205
|
+
const validationMessage = (0, _utils.generateValidationMessage)();
|
|
206
|
+
const {
|
|
207
|
+
singularLabel = '',
|
|
208
|
+
pluralLabel = ''
|
|
209
|
+
} = choices?.label && getSingularAndPlural(choices.label) || {};
|
|
210
|
+
const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
211
|
+
const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
212
|
+
const maxChoicesImageWidth = maxImageWidth && model.placementArea ? maxImageWidth.choicesWithPlacementArea : maxImageWidth.choicesWithoutPlacementArea || defaultImageMaxWidth;
|
|
213
|
+
const maxChoicesImageHeight = maxImageHeight && maxImageHeight.choices || defaultImageMaxHeight;
|
|
214
|
+
const toolbarOpts = {
|
|
215
|
+
position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
|
|
216
|
+
};
|
|
217
|
+
const panelSettings = {
|
|
218
|
+
choiceLabelEnabled: choiceLabel.settings && toggle(choiceLabel.label),
|
|
219
|
+
placementArea: placementArea.settings && toggle(placementArea.label),
|
|
220
|
+
numberedGuides: numberedGuides.settings && model.placementArea && toggle(numberedGuides.label),
|
|
221
|
+
orientation: orientation.settings && radio(orientation.label, ['vertical', 'horizontal']),
|
|
222
|
+
removeTilesAfterPlacing: removeTilesAfterPlacing.settings && toggle(removeTilesAfterPlacing.label),
|
|
223
|
+
partialScoring: partialScoring.settings && toggle(partialScoring.label),
|
|
224
|
+
feedbackEnabled: feedback.settings && toggle(feedback.label),
|
|
225
|
+
'language.enabled': language.settings && toggle(language.label, true),
|
|
226
|
+
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
|
|
227
|
+
};
|
|
228
|
+
const panelProperties = {
|
|
229
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
230
|
+
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
231
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
232
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
233
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
234
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
|
|
235
|
+
rubricEnabled: withRubric?.settings && toggle(withRubric?.label)
|
|
236
|
+
};
|
|
237
|
+
const getPluginProps = (props = {}) => ({
|
|
238
|
+
...baseInputConfiguration,
|
|
239
|
+
...props
|
|
240
|
+
});
|
|
241
|
+
return /*#__PURE__*/_react.default.createElement(_drag.DragProvider, {
|
|
242
|
+
onDragEnd: event => this.onDragEnd(event, ordering)
|
|
243
|
+
}, /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
|
|
244
|
+
extraCSSRules: extraCSSRules,
|
|
245
|
+
dimensions: contentDimensions,
|
|
246
|
+
hideSettings: settingsPanelDisabled,
|
|
247
|
+
settings: /*#__PURE__*/_react.default.createElement(Panel, {
|
|
248
|
+
model: model,
|
|
249
|
+
configuration: configuration,
|
|
250
|
+
onChangeModel: model => onModelChanged(model),
|
|
251
|
+
onChangeConfiguration: configuration => onConfigurationChanged(configuration, true),
|
|
252
|
+
groups: {
|
|
253
|
+
Settings: panelSettings,
|
|
254
|
+
Properties: panelProperties
|
|
255
|
+
}
|
|
256
|
+
})
|
|
257
|
+
}, teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
258
|
+
label: teacherInstructions.label
|
|
259
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
260
|
+
className: "prompt",
|
|
261
|
+
markup: model.teacherInstructions || '',
|
|
262
|
+
onChange: this.onTeacherInstructionsChange,
|
|
263
|
+
imageSupport: imageSupport,
|
|
264
|
+
nonEmpty: false,
|
|
265
|
+
error: teacherInstructionsError,
|
|
266
|
+
toolbarOpts: toolbarOpts,
|
|
267
|
+
pluginProps: getPluginProps(teacherInstructions?.inputConfiguration),
|
|
268
|
+
spellCheck: spellCheckEnabled,
|
|
269
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
270
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
271
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
272
|
+
languageCharactersProps: [{
|
|
273
|
+
language: 'spanish'
|
|
274
|
+
}, {
|
|
275
|
+
language: 'special'
|
|
276
|
+
}],
|
|
277
|
+
mathMlOptions: mathMlOptions
|
|
278
|
+
}), teacherInstructionsError && /*#__PURE__*/_react.default.createElement("div", {
|
|
279
|
+
className: "errorText"
|
|
280
|
+
}, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
281
|
+
label: prompt && prompt.label
|
|
282
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
283
|
+
className: "prompt",
|
|
284
|
+
markup: model.prompt,
|
|
285
|
+
onChange: this.onPromptChange,
|
|
286
|
+
imageSupport: imageSupport,
|
|
287
|
+
error: promptError,
|
|
288
|
+
toolbarOpts: toolbarOpts,
|
|
289
|
+
pluginProps: getPluginProps(prompt?.inputConfiguration),
|
|
290
|
+
spellCheck: spellCheckEnabled,
|
|
291
|
+
maxImageWidth: maxImageWidth && maxImageWidth.prompt,
|
|
292
|
+
maxImageHeight: maxImageHeight && maxImageHeight.prompt,
|
|
293
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
294
|
+
languageCharactersProps: [{
|
|
295
|
+
language: 'spanish'
|
|
296
|
+
}, {
|
|
297
|
+
language: 'special'
|
|
298
|
+
}],
|
|
299
|
+
mathMlOptions: mathMlOptions
|
|
300
|
+
}), promptError && /*#__PURE__*/_react.default.createElement("div", {
|
|
301
|
+
className: "errorText"
|
|
302
|
+
}, promptError)), /*#__PURE__*/_react.default.createElement(StyledChoicesWrapper, {
|
|
303
|
+
label: `Define ${pluralLabel}`,
|
|
304
|
+
labelExtraStyle: {
|
|
305
|
+
display: 'inline-flex'
|
|
306
|
+
}
|
|
307
|
+
}, /*#__PURE__*/_react.default.createElement(InlineFlexContainer, null, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
308
|
+
slotProps: {
|
|
309
|
+
tooltip: {
|
|
310
|
+
sx: {
|
|
311
|
+
fontSize: 14,
|
|
312
|
+
whiteSpace: 'pre',
|
|
313
|
+
maxWidth: '500px'
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
disableFocusListener: true,
|
|
318
|
+
disableTouchListener: true,
|
|
319
|
+
placement: 'right',
|
|
320
|
+
title: validationMessage
|
|
321
|
+
}, /*#__PURE__*/_react.default.createElement(_Info.default, {
|
|
322
|
+
fontSize: 'small',
|
|
323
|
+
color: 'primary',
|
|
324
|
+
style: {
|
|
325
|
+
marginLeft: '8px'
|
|
326
|
+
}
|
|
327
|
+
}))), /*#__PURE__*/_react.default.createElement(StyledRow, null, choiceLabelEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
328
|
+
label: choiceLabel && choiceLabel.label && `${singularLabel} label`
|
|
329
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, (0, _extends2.default)({}, model.placementArea && {
|
|
330
|
+
autoWidthToolbar: true
|
|
331
|
+
}, {
|
|
332
|
+
className: "prompt",
|
|
333
|
+
markup: model.choiceLabel,
|
|
334
|
+
onChange: this.onChoiceAreaLabelChange,
|
|
335
|
+
toolbarOpts: toolbarOpts,
|
|
336
|
+
pluginProps: getPluginProps(choiceLabel?.inputConfiguration),
|
|
337
|
+
spellCheck: spellCheckEnabled,
|
|
338
|
+
maxImageWidth: maxChoicesImageWidth,
|
|
339
|
+
maxImageHeight: maxChoicesImageHeight,
|
|
340
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
341
|
+
languageCharactersProps: [{
|
|
342
|
+
language: 'spanish'
|
|
343
|
+
}, {
|
|
344
|
+
language: 'special'
|
|
345
|
+
}],
|
|
346
|
+
mathMlOptions: mathMlOptions
|
|
347
|
+
}))), targetLabel.settings && model.placementArea && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
348
|
+
label: targetLabel && targetLabel.label && targetLabel.label
|
|
349
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
350
|
+
autoWidthToolbar: true,
|
|
351
|
+
className: "prompt",
|
|
352
|
+
markup: model.targetLabel,
|
|
353
|
+
onChange: this.onAnswerAreaLabelChange,
|
|
354
|
+
toolbarOpts: toolbarOpts,
|
|
355
|
+
spellCheck: spellCheckEnabled,
|
|
356
|
+
maxImageWidth: maxImageWidth && maxImageWidth.choicesWithPlacementArea || defaultImageMaxWidth,
|
|
357
|
+
maxImageHeight: maxChoicesImageHeight,
|
|
358
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
359
|
+
languageCharactersProps: [{
|
|
360
|
+
language: 'spanish'
|
|
361
|
+
}, {
|
|
362
|
+
language: 'special'
|
|
363
|
+
}],
|
|
364
|
+
mathMlOptions: mathMlOptions
|
|
365
|
+
}))), choices.settings && /*#__PURE__*/_react.default.createElement(_choiceEditor.default, {
|
|
366
|
+
correctResponse: correctResponse,
|
|
367
|
+
choices: model.choices,
|
|
368
|
+
onChange: this.onChoiceEditorChange,
|
|
369
|
+
imageSupport: imageSupport,
|
|
370
|
+
toolbarOpts: toolbarOpts,
|
|
371
|
+
pluginProps: getPluginProps(choices?.inputConfiguration),
|
|
372
|
+
choicesLabel: choices.label,
|
|
373
|
+
placementArea: model.placementArea,
|
|
374
|
+
singularChoiceLabel: singularLabel,
|
|
375
|
+
pluralChoiceLabel: pluralLabel,
|
|
376
|
+
spellCheck: spellCheckEnabled,
|
|
377
|
+
maxImageWidth: maxChoicesImageWidth,
|
|
378
|
+
maxImageHeight: maxChoicesImageHeight,
|
|
379
|
+
errors: errors || {},
|
|
380
|
+
mathMlOptions: mathMlOptions,
|
|
381
|
+
ordering: ordering
|
|
382
|
+
})), rationaleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
383
|
+
label: rationale.label
|
|
384
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
385
|
+
className: "prompt",
|
|
386
|
+
markup: model.rationale || '',
|
|
387
|
+
onChange: this.onRationaleChange,
|
|
388
|
+
imageSupport: imageSupport,
|
|
389
|
+
error: rationaleError,
|
|
390
|
+
toolbarOpts: toolbarOpts,
|
|
391
|
+
pluginProps: getPluginProps(rationale?.inputConfiguration),
|
|
392
|
+
spellCheck: spellCheckEnabled,
|
|
393
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
394
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
|
|
395
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
396
|
+
languageCharactersProps: [{
|
|
397
|
+
language: 'spanish'
|
|
398
|
+
}, {
|
|
399
|
+
language: 'special'
|
|
400
|
+
}],
|
|
401
|
+
mathMlOptions: mathMlOptions
|
|
402
|
+
}), rationaleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, rationaleError)), feedbackEnabled && /*#__PURE__*/_react.default.createElement(_configUi.FeedbackConfig, {
|
|
403
|
+
feedback: model.feedback,
|
|
404
|
+
onChange: this.onFeedbackChange,
|
|
405
|
+
imageSupport: imageSupport,
|
|
406
|
+
toolbarOpts: toolbarOpts
|
|
407
|
+
})));
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
exports.Design = Design;
|
|
411
|
+
(0, _defineProperty2.default)(Design, "propTypes", {
|
|
412
|
+
uploadSoundSupport: _propTypes.default.object
|
|
413
|
+
});
|
|
414
|
+
(0, _defineProperty2.default)(Design, "defaultProps", {});
|
|
415
|
+
Design.defaultProps = {
|
|
416
|
+
onModelChanged: () => {},
|
|
417
|
+
onConfigurationChanged: () => {}
|
|
418
|
+
};
|
|
419
|
+
Design.propTypes = {
|
|
420
|
+
model: _propTypes.default.object.isRequired,
|
|
421
|
+
configuration: _propTypes.default.object.isRequired,
|
|
422
|
+
onModelChanged: _propTypes.default.func,
|
|
423
|
+
onConfigurationChanged: _propTypes.default.func,
|
|
424
|
+
imageSupport: _propTypes.default.object
|
|
425
|
+
};
|
|
426
|
+
var _default = exports.default = Design;
|
|
427
|
+
//# sourceMappingURL=design.js.map
|