@pie-element/multiple-choice 14.0.4-next.20261011174919 → 14.0.4
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/dist/author/defaults.d.ts +60 -58
- package/dist/author/index.d.ts +19 -11
- package/dist/author/index.js +6 -1
- package/dist/author/main.d.ts +30 -19
- package/dist/author/main.js +121 -133
- package/dist/author/utils.d.ts +2 -1
- package/dist/browser/author/index.js +15 -23
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +9 -8
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +15 -23
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +9 -8
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +13 -13
- package/dist/controller/index.d.ts +103 -32
- package/dist/controller/index.js +9 -8
- package/dist/controller/utils.d.ts +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +447 -0
- package/dist/schemas/model.schema.json +567 -0
- package/dist/schemas/session.schema.json +30 -0
- package/dist/types.d.ts +243 -0
- package/package.json +18 -14
package/dist/author/main.js
CHANGED
|
@@ -1,225 +1,213 @@
|
|
|
1
1
|
import { generateValidationMessage as e } from "./utils.js";
|
|
2
2
|
import t from "react";
|
|
3
|
-
import n from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import s from "@
|
|
8
|
-
import
|
|
9
|
-
import l from "@pie-lib/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import ne from "@mui/icons-material/Info";
|
|
3
|
+
import { color as n } from "@pie-lib/render-ui";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { styled as a } from "@mui/material/styles";
|
|
6
|
+
import o from "@mui/material/Box";
|
|
7
|
+
import { merge as s } from "@pie-element/shared-lodash";
|
|
8
|
+
import c from "@pie-lib/editable-html-tip-tap";
|
|
9
|
+
import { AlertDialog as ee, ChoiceConfiguration as te, InputContainer as l, choiceUtils as u, layout as ne, settings as d } from "@pie-lib/config-ui";
|
|
10
|
+
import f from "@mui/material/Button";
|
|
11
|
+
import p from "@mui/material/Tooltip";
|
|
12
|
+
import m from "@mui/material/Typography";
|
|
13
|
+
import re from "@mui/icons-material/Info";
|
|
15
14
|
//#region src/author/main.tsx
|
|
16
|
-
var { Panel:
|
|
15
|
+
var { Panel: ie, toggle: h, radio: g, dropdown: _ } = d, ae = 9, oe = a(l)(({ theme: e }) => ({
|
|
17
16
|
width: "100%",
|
|
18
17
|
paddingTop: e.spacing(2),
|
|
19
18
|
marginBottom: e.spacing(2)
|
|
20
|
-
})),
|
|
19
|
+
})), se = a(l)(({ theme: e }) => ({
|
|
21
20
|
flex: 1,
|
|
22
21
|
marginTop: e.spacing(1.5),
|
|
23
22
|
paddingTop: e.spacing(2),
|
|
24
23
|
marginLeft: e.spacing(3.5)
|
|
25
|
-
})),
|
|
24
|
+
})), ce = a(l)(({ theme: e }) => ({
|
|
26
25
|
display: "flex",
|
|
27
26
|
flexDirection: "column",
|
|
28
27
|
marginBottom: e.spacing(1),
|
|
29
28
|
width: "100%"
|
|
30
|
-
})),
|
|
29
|
+
})), v = a(f)(({ theme: e }) => ({
|
|
31
30
|
marginTop: e.spacing(1),
|
|
32
31
|
float: "right"
|
|
33
|
-
})),
|
|
32
|
+
})), le = a(v)({
|
|
34
33
|
cursor: "not-allowed",
|
|
35
34
|
pointerEvents: "all",
|
|
36
|
-
backgroundColor:
|
|
37
|
-
"&:hover": { backgroundColor:
|
|
38
|
-
"&:focus": { backgroundColor:
|
|
39
|
-
}),
|
|
35
|
+
backgroundColor: n.disabled(),
|
|
36
|
+
"&:hover": { backgroundColor: n.disabled() },
|
|
37
|
+
"&:focus": { backgroundColor: n.disabled() }
|
|
38
|
+
}), ue = a(o)({
|
|
40
39
|
display: "flex",
|
|
41
40
|
alignItems: "center"
|
|
42
|
-
}),
|
|
41
|
+
}), de = a(m)(({ theme: e }) => ({
|
|
43
42
|
fontSize: e.typography.fontSize + 2,
|
|
44
43
|
marginRight: e.spacing(1)
|
|
45
|
-
})),
|
|
44
|
+
})), y = a(p)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
46
45
|
fontSize: e.typography.fontSize - 2,
|
|
47
46
|
whiteSpace: "pre",
|
|
48
47
|
maxWidth: "500px"
|
|
49
|
-
} })),
|
|
48
|
+
} })), b = a("div")(({ theme: e }) => ({
|
|
50
49
|
fontSize: e.typography.fontSize - 2,
|
|
51
50
|
color: e.palette.error.main,
|
|
52
51
|
paddingTop: e.spacing(1)
|
|
53
|
-
})),
|
|
54
|
-
let { model: n, configuration:
|
|
55
|
-
|
|
52
|
+
})), x = (t) => {
|
|
53
|
+
let { model: n, configuration: a, onPromptChanged: o, onChoiceChanged: s, onRemoveChoice: ee, onAddChoice: l, imageSupport: u, uploadSoundSupport: d, onChangeModel: f, onConfigurationChanged: p, onTeacherInstructionsChanged: m } = t, { addChoiceButton: x = {}, contentDimensions: S = {}, feedback: fe = {}, deleteChoice: pe = {}, choiceMode: C = {}, choicePrefix: w = {}, partialScoring: T = {}, lockChoiceOrder: E = {}, teacherInstructions: D = {}, studentInstructions: O = {}, rationale: k = {}, scoringType: A = {}, sequentialChoiceLabels: j = {}, settingsPanelDisabled: me, choicesLayout: M = {}, spellCheck: N = {}, gridColumns: he = {}, maxImageWidth: P = {}, maxImageHeight: F = {}, prompt: I = {}, withRubric: L = {}, mathMlOptions: R = {}, language: z = {}, languageChoices: B = {} } = a || {}, { maxAnswerChoices: V } = a || {}, { limitChoicesNumber: ge, teacherInstructionsEnabled: _e, rationaleEnabled: ve, feedbackEnabled: ye, promptEnabled: be, spellCheckEnabled: H, choices: U, errors: xe, toolbarEditorPosition: Se, extraCSSRules: Ce } = n || {}, { answerChoices: W, choices: we, correctResponse: G, prompt: K, rationale: q, teacherInstructions: J } = xe || {}, Y = U?.length ? Array.from({ length: U.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: Te = {} } = a, X = { position: Se === "top" ? "top" : "bottom" };
|
|
54
|
+
ge && (V = ae);
|
|
56
55
|
let Z = (e = {}) => ({
|
|
57
56
|
...Te,
|
|
58
57
|
...e
|
|
59
|
-
}), Ee = e(
|
|
60
|
-
choiceMode:
|
|
61
|
-
"sequentialChoiceLabels.enabled":
|
|
62
|
-
choicePrefix:
|
|
63
|
-
partialScoring:
|
|
64
|
-
lockChoiceOrder:
|
|
65
|
-
feedbackEnabled:
|
|
66
|
-
choicesLayout:
|
|
58
|
+
}), Ee = e(a), Q = P && P.prompt, $ = F && F.prompt, De = V && U?.length >= V ? `Only ${V} allowed maximum` : "", Oe = {
|
|
59
|
+
choiceMode: C.settings && g(C.label, ["checkbox", "radio"]),
|
|
60
|
+
"sequentialChoiceLabels.enabled": j.settings && h(j.label, !0),
|
|
61
|
+
choicePrefix: w.settings && g(w.label, ["numbers", "letters"]),
|
|
62
|
+
partialScoring: T.settings && h(T.label),
|
|
63
|
+
lockChoiceOrder: E.settings && h(E.label),
|
|
64
|
+
feedbackEnabled: fe.settings && h(fe.label),
|
|
65
|
+
choicesLayout: M.settings && _(M.label, [
|
|
67
66
|
"vertical",
|
|
68
67
|
"grid",
|
|
69
68
|
"horizontal"
|
|
70
69
|
]),
|
|
71
|
-
gridColumns:
|
|
72
|
-
"language.enabled":
|
|
73
|
-
language:
|
|
70
|
+
gridColumns: M.settings && n.choicesLayout === "grid" && Y.length > 0 && _(he.label, Y),
|
|
71
|
+
"language.enabled": z.settings && h(z.label, !0),
|
|
72
|
+
language: z.settings && z.enabled && _(B.label, B.options)
|
|
74
73
|
}, ke = {
|
|
75
|
-
teacherInstructionsEnabled:
|
|
76
|
-
studentInstructionsEnabled:
|
|
77
|
-
promptEnabled:
|
|
78
|
-
rationaleEnabled:
|
|
79
|
-
spellCheckEnabled:
|
|
80
|
-
scoringType:
|
|
81
|
-
rubricEnabled:
|
|
74
|
+
teacherInstructionsEnabled: D.settings && h(D.label),
|
|
75
|
+
studentInstructionsEnabled: O.settings && h(O.label),
|
|
76
|
+
promptEnabled: I.settings && h(I.label),
|
|
77
|
+
rationaleEnabled: k.settings && h(k.label),
|
|
78
|
+
spellCheckEnabled: N.settings && h(N.label),
|
|
79
|
+
scoringType: A.settings && g(A.label, ["auto", "rubric"]),
|
|
80
|
+
rubricEnabled: L?.settings && h(L?.label)
|
|
82
81
|
};
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
dimensions:
|
|
85
|
-
hideSettings:
|
|
86
|
-
extraCSSRules:
|
|
82
|
+
return /* @__PURE__ */ i(ne.ConfigLayout, {
|
|
83
|
+
dimensions: S,
|
|
84
|
+
hideSettings: me,
|
|
85
|
+
extraCSSRules: Ce,
|
|
87
86
|
classes: {},
|
|
88
|
-
settings: /* @__PURE__ */
|
|
87
|
+
settings: /* @__PURE__ */ r(ie, {
|
|
89
88
|
model: n,
|
|
90
|
-
onChangeModel:
|
|
91
|
-
configuration:
|
|
92
|
-
onChangeConfiguration:
|
|
89
|
+
onChangeModel: f,
|
|
90
|
+
configuration: a,
|
|
91
|
+
onChangeConfiguration: p,
|
|
93
92
|
groups: {
|
|
94
93
|
Settings: Oe,
|
|
95
94
|
Properties: ke
|
|
96
95
|
}
|
|
97
96
|
}),
|
|
98
97
|
children: [
|
|
99
|
-
|
|
100
|
-
label:
|
|
101
|
-
children: [/* @__PURE__ */
|
|
98
|
+
_e && /* @__PURE__ */ i(oe, {
|
|
99
|
+
label: D.label,
|
|
100
|
+
children: [/* @__PURE__ */ r(c, {
|
|
102
101
|
markup: n.teacherInstructions || "",
|
|
103
|
-
onChange:
|
|
104
|
-
imageSupport:
|
|
102
|
+
onChange: m,
|
|
103
|
+
imageSupport: u,
|
|
105
104
|
nonEmpty: !1,
|
|
106
105
|
disableUnderline: !0,
|
|
107
|
-
error:
|
|
106
|
+
error: J,
|
|
108
107
|
toolbarOpts: X,
|
|
109
|
-
pluginProps: Z(
|
|
110
|
-
spellCheck:
|
|
111
|
-
maxImageWidth:
|
|
112
|
-
maxImageHeight:
|
|
113
|
-
uploadSoundSupport:
|
|
108
|
+
pluginProps: Z(a?.teacherInstructions?.inputConfiguration),
|
|
109
|
+
spellCheck: H,
|
|
110
|
+
maxImageWidth: P && P.teacherInstructions || Q,
|
|
111
|
+
maxImageHeight: F && F.teacherInstructions || $,
|
|
112
|
+
uploadSoundSupport: d,
|
|
114
113
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
115
|
-
mathMlOptions:
|
|
116
|
-
}),
|
|
114
|
+
mathMlOptions: R
|
|
115
|
+
}), J && /* @__PURE__ */ r(b, { children: J })]
|
|
117
116
|
}),
|
|
118
|
-
|
|
119
|
-
label:
|
|
120
|
-
children: [/* @__PURE__ */
|
|
117
|
+
be && /* @__PURE__ */ i(oe, {
|
|
118
|
+
label: I.label,
|
|
119
|
+
children: [/* @__PURE__ */ r(c, {
|
|
121
120
|
markup: n.prompt,
|
|
122
121
|
onChange: o,
|
|
123
|
-
imageSupport:
|
|
122
|
+
imageSupport: u,
|
|
124
123
|
nonEmpty: !1,
|
|
125
124
|
disableUnderline: !0,
|
|
126
|
-
error:
|
|
125
|
+
error: K,
|
|
127
126
|
toolbarOpts: X,
|
|
128
|
-
pluginProps: Z(
|
|
129
|
-
spellCheck:
|
|
130
|
-
maxImageWidth:
|
|
131
|
-
maxImageHeight:
|
|
132
|
-
uploadSoundSupport:
|
|
127
|
+
pluginProps: Z(a?.prompt?.inputConfiguration),
|
|
128
|
+
spellCheck: H,
|
|
129
|
+
maxImageWidth: P && P.prompt,
|
|
130
|
+
maxImageHeight: F && F.prompt,
|
|
131
|
+
uploadSoundSupport: d,
|
|
133
132
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
134
|
-
mathMlOptions:
|
|
135
|
-
}),
|
|
133
|
+
mathMlOptions: R
|
|
134
|
+
}), K && /* @__PURE__ */ r(b, { children: K })]
|
|
136
135
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ i(ue, { children: [/* @__PURE__ */ r(de, {
|
|
138
137
|
component: "div",
|
|
139
138
|
children: "Choices"
|
|
140
|
-
}), /* @__PURE__ */
|
|
139
|
+
}), /* @__PURE__ */ r(y, {
|
|
141
140
|
disableFocusListener: !0,
|
|
142
141
|
disableTouchListener: !0,
|
|
143
142
|
placement: "right",
|
|
144
143
|
title: Ee,
|
|
145
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ r(re, {
|
|
146
145
|
fontSize: "small",
|
|
147
146
|
color: "primary"
|
|
148
147
|
})
|
|
149
148
|
})] }),
|
|
150
|
-
|
|
149
|
+
U.map((e, t) => /* @__PURE__ */ i(ce, { children: [/* @__PURE__ */ r(te, {
|
|
151
150
|
index: t + 1,
|
|
152
151
|
useLetterOrdering: n.choicePrefix === "letters",
|
|
153
152
|
mode: n.choiceMode,
|
|
154
153
|
data: e,
|
|
155
154
|
defaultFeedback: {},
|
|
156
|
-
imageSupport:
|
|
155
|
+
imageSupport: u,
|
|
157
156
|
disableImageAlignmentButtons: !0,
|
|
158
|
-
onDelete: () =>
|
|
157
|
+
onDelete: () => ee(t),
|
|
159
158
|
onChange: (e) => s(t, e),
|
|
160
|
-
allowFeedBack:
|
|
161
|
-
allowDelete:
|
|
159
|
+
allowFeedBack: ye,
|
|
160
|
+
allowDelete: pe.settings,
|
|
162
161
|
noLabels: !0,
|
|
163
|
-
pluginOpts: Z(
|
|
162
|
+
pluginOpts: Z(a?.choices?.inputConfiguration),
|
|
164
163
|
toolbarOpts: X,
|
|
165
|
-
spellCheck:
|
|
166
|
-
error:
|
|
167
|
-
noCorrectAnswerError:
|
|
168
|
-
maxImageWidth:
|
|
169
|
-
maxImageHeight:
|
|
170
|
-
uploadSoundSupport:
|
|
171
|
-
mathMlOptions:
|
|
172
|
-
}, t),
|
|
173
|
-
label:
|
|
174
|
-
children: [/* @__PURE__ */
|
|
164
|
+
spellCheck: H,
|
|
165
|
+
error: we?.[e.value] || null,
|
|
166
|
+
noCorrectAnswerError: G,
|
|
167
|
+
maxImageWidth: P && P.choices || Q,
|
|
168
|
+
maxImageHeight: F && F.choices || $,
|
|
169
|
+
uploadSoundSupport: d,
|
|
170
|
+
mathMlOptions: R
|
|
171
|
+
}, t), ve && /* @__PURE__ */ i(se, {
|
|
172
|
+
label: k.label,
|
|
173
|
+
children: [/* @__PURE__ */ r(c, {
|
|
175
174
|
markup: e.rationale || "",
|
|
176
175
|
onChange: (n) => s(t, {
|
|
177
176
|
...e,
|
|
178
177
|
rationale: n
|
|
179
178
|
}),
|
|
180
|
-
imageSupport:
|
|
181
|
-
error:
|
|
179
|
+
imageSupport: u,
|
|
180
|
+
error: q?.[e.value] || null,
|
|
182
181
|
toolbarOpts: X,
|
|
183
|
-
pluginProps: Z(
|
|
184
|
-
spellCheck:
|
|
185
|
-
maxImageWidth:
|
|
186
|
-
maxImageHeight:
|
|
187
|
-
uploadSoundSupport:
|
|
182
|
+
pluginProps: Z(a?.rationale?.inputConfiguration),
|
|
183
|
+
spellCheck: H,
|
|
184
|
+
maxImageWidth: P && P.rationale || Q,
|
|
185
|
+
maxImageHeight: F && F.rationale || $,
|
|
186
|
+
uploadSoundSupport: d,
|
|
188
187
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
189
|
-
mathMlOptions:
|
|
190
|
-
}),
|
|
188
|
+
mathMlOptions: R
|
|
189
|
+
}), q?.[e.value] && /* @__PURE__ */ r(b, { children: q?.[e.value] })]
|
|
191
190
|
}, `rationale-${t}`)] }, `choice-${t}`)),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
G && /* @__PURE__ */ r(b, { children: G }),
|
|
192
|
+
W && /* @__PURE__ */ r(b, { children: W }),
|
|
193
|
+
x.settings && /* @__PURE__ */ r(y, {
|
|
195
194
|
title: De,
|
|
196
|
-
children:
|
|
195
|
+
children: V && U?.length >= V ? /* @__PURE__ */ r(le, {
|
|
197
196
|
variant: "contained",
|
|
198
197
|
color: "primary",
|
|
199
|
-
onClick:
|
|
198
|
+
onClick: l,
|
|
200
199
|
disabled: !0,
|
|
201
|
-
children:
|
|
202
|
-
}) : /* @__PURE__ */
|
|
200
|
+
children: x.label
|
|
201
|
+
}) : /* @__PURE__ */ r(v, {
|
|
203
202
|
variant: "contained",
|
|
204
203
|
color: "primary",
|
|
205
|
-
onClick:
|
|
206
|
-
children:
|
|
204
|
+
onClick: l,
|
|
205
|
+
children: x.label
|
|
207
206
|
})
|
|
208
207
|
})
|
|
209
208
|
]
|
|
210
209
|
});
|
|
211
|
-
},
|
|
212
|
-
static propTypes = {
|
|
213
|
-
model: n.object.isRequired,
|
|
214
|
-
configuration: n.object.isRequired,
|
|
215
|
-
disableSidePanel: n.bool,
|
|
216
|
-
onModelChanged: n.func.isRequired,
|
|
217
|
-
onConfigurationChanged: n.func.isRequired,
|
|
218
|
-
imageSupport: n.shape({
|
|
219
|
-
add: n.func.isRequired,
|
|
220
|
-
delete: n.func.isRequired
|
|
221
|
-
})
|
|
222
|
-
};
|
|
210
|
+
}, S = class extends t.Component {
|
|
223
211
|
state = { showWarning: !1 };
|
|
224
212
|
onRemoveChoice = (e) => {
|
|
225
213
|
let { model: t, configuration: n, onModelChanged: r } = this.props, { minAnswerChoices: i } = n || {};
|
|
@@ -231,15 +219,15 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ the
|
|
|
231
219
|
};
|
|
232
220
|
onAddChoice = () => {
|
|
233
221
|
let { model: e, configuration: t, onModelChanged: n } = this.props, { maxAnswerChoices: r } = t || {}, { limitChoicesNumber: i } = e || {};
|
|
234
|
-
i && (r =
|
|
222
|
+
i && (r = ae), !(r && e.choices.length >= r) && (e.choices.push({
|
|
235
223
|
label: "",
|
|
236
|
-
value:
|
|
224
|
+
value: u.firstAvailableIndex(e.choices.map((e) => e.value), 0),
|
|
237
225
|
feedback: { type: "none" }
|
|
238
226
|
}), n({ choices: e.choices }));
|
|
239
227
|
};
|
|
240
228
|
onChoiceChanged = (e, t) => {
|
|
241
229
|
let { model: n, onModelChanged: r } = this.props;
|
|
242
|
-
t.correct && n.choiceMode === "radio" && (n.choices = n.choices.map((e) =>
|
|
230
|
+
t.correct && n.choiceMode === "radio" && (n.choices = n.choices.map((e) => s({}, e, { correct: !1 }))), n.choices.splice(e, 1, t), r({ choices: n.choices });
|
|
243
231
|
};
|
|
244
232
|
onPromptChanged = (e) => {
|
|
245
233
|
this.props.onModelChanged({ prompt: e });
|
|
@@ -267,12 +255,12 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ the
|
|
|
267
255
|
};
|
|
268
256
|
render() {
|
|
269
257
|
let { configuration: { minAnswerChoices: e } = {} } = this.props, { showWarning: n } = this.state;
|
|
270
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ i(t.Fragment, { children: [/* @__PURE__ */ r(ee, {
|
|
271
259
|
open: n,
|
|
272
260
|
title: "Warning",
|
|
273
261
|
text: `There can't be less than ${e || 0} choices.`,
|
|
274
262
|
onConfirm: () => this.setState({ showWarning: !1 })
|
|
275
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ r(x, {
|
|
276
264
|
...this.props,
|
|
277
265
|
onChangeModel: this.onModelChanged,
|
|
278
266
|
onRemoveChoice: this.onRemoveChoice,
|
|
@@ -284,4 +272,4 @@ var { Panel: re, toggle: _, radio: v, dropdown: y } = p, b = 9, ie = o(d)(({ the
|
|
|
284
272
|
}
|
|
285
273
|
};
|
|
286
274
|
//#endregion
|
|
287
|
-
export {
|
|
275
|
+
export { S as Main, S as default };
|
package/dist/author/utils.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { MultipleChoiceConfiguration } from '../types.js';
|
|
2
|
+
export declare const generateValidationMessage: (config: MultipleChoiceConfiguration) => string;
|
|
@@ -34214,7 +34214,8 @@ var BH = We, VH = BH.default, HH = VH && typeof VH == "object" ? VH : BH, UH = z
|
|
|
34214
34214
|
toolbarOpts: H.default.object,
|
|
34215
34215
|
uploadSoundSupport: H.default.object,
|
|
34216
34216
|
maxImageWidth: H.default.number,
|
|
34217
|
-
maxImageHeight: H.default.number
|
|
34217
|
+
maxImageHeight: H.default.number,
|
|
34218
|
+
mathMlOptions: H.default.object
|
|
34218
34219
|
};
|
|
34219
34220
|
static defaultProps = {
|
|
34220
34221
|
index: -1,
|
|
@@ -35167,15 +35168,12 @@ var IW = class extends _t.Component {
|
|
|
35167
35168
|
}), BW = (e) => typeof e == "string" ? {
|
|
35168
35169
|
label: e,
|
|
35169
35170
|
value: e
|
|
35170
|
-
} : e, VW =
|
|
35171
|
-
|
|
35172
|
-
|
|
35173
|
-
|
|
35174
|
-
|
|
35175
|
-
|
|
35176
|
-
isConfigProperty: n
|
|
35177
|
-
};
|
|
35178
|
-
}, HW = (e, t, n = !1) => ({
|
|
35171
|
+
} : e, VW = (e, t, n = !1) => ({
|
|
35172
|
+
type: "radio",
|
|
35173
|
+
label: e,
|
|
35174
|
+
choices: t && t.map((e) => BW(e)),
|
|
35175
|
+
isConfigProperty: n
|
|
35176
|
+
}), HW = (e, t, n = !1) => ({
|
|
35179
35177
|
type: "dropdown",
|
|
35180
35178
|
label: e,
|
|
35181
35179
|
choices: t,
|
|
@@ -35252,7 +35250,7 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
|
|
|
35252
35250
|
color: e.palette.error.main,
|
|
35253
35251
|
paddingTop: e.spacing(1)
|
|
35254
35252
|
})), hG = (e) => {
|
|
35255
|
-
let { model: t, configuration: n, onPromptChanged: r, onChoiceChanged: i, onRemoveChoice: a, onAddChoice: o, imageSupport: s, uploadSoundSupport: c, onChangeModel: l, onConfigurationChanged: u, onTeacherInstructionsChanged: d } = e, { addChoiceButton: f = {}, contentDimensions: p = {}, feedback: m = {}, deleteChoice: h = {}, choiceMode: g = {}, choicePrefix: _ = {}, partialScoring: v = {}, lockChoiceOrder: y = {}, teacherInstructions: b = {}, studentInstructions: x = {}, rationale: S = {}, scoringType: C = {}, sequentialChoiceLabels: ee = {}, settingsPanelDisabled: w, choicesLayout: T, spellCheck: te = {}, gridColumns: ne, maxImageWidth: re = {}, maxImageHeight: E = {}, prompt: ie = {}, withRubric: ae = {}, mathMlOptions: oe = {}, language: se = {}, languageChoices: ce = {} } = n || {}, { maxAnswerChoices: le } = n || {}, { limitChoicesNumber: ue, teacherInstructionsEnabled: de, rationaleEnabled: D, feedbackEnabled: O, promptEnabled: fe, spellCheckEnabled: pe, choices: k, errors: me, toolbarEditorPosition: he, extraCSSRules: ge } = t || {}, { answerChoices: _e, choices: ve, correctResponse: ye, prompt: be, rationale: xe, teacherInstructions: Se } = me || {}, Ce = k?.length ? Array.from({ length: k.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: we = {} } = n, Te = { position: he === "top" ? "top" : "bottom" };
|
|
35253
|
+
let { model: t, configuration: n, onPromptChanged: r, onChoiceChanged: i, onRemoveChoice: a, onAddChoice: o, imageSupport: s, uploadSoundSupport: c, onChangeModel: l, onConfigurationChanged: u, onTeacherInstructionsChanged: d } = e, { addChoiceButton: f = {}, contentDimensions: p = {}, feedback: m = {}, deleteChoice: h = {}, choiceMode: g = {}, choicePrefix: _ = {}, partialScoring: v = {}, lockChoiceOrder: y = {}, teacherInstructions: b = {}, studentInstructions: x = {}, rationale: S = {}, scoringType: C = {}, sequentialChoiceLabels: ee = {}, settingsPanelDisabled: w, choicesLayout: T = {}, spellCheck: te = {}, gridColumns: ne = {}, maxImageWidth: re = {}, maxImageHeight: E = {}, prompt: ie = {}, withRubric: ae = {}, mathMlOptions: oe = {}, language: se = {}, languageChoices: ce = {} } = n || {}, { maxAnswerChoices: le } = n || {}, { limitChoicesNumber: ue, teacherInstructionsEnabled: de, rationaleEnabled: D, feedbackEnabled: O, promptEnabled: fe, spellCheckEnabled: pe, choices: k, errors: me, toolbarEditorPosition: he, extraCSSRules: ge } = t || {}, { answerChoices: _e, choices: ve, correctResponse: ye, prompt: be, rationale: xe, teacherInstructions: Se } = me || {}, Ce = k?.length ? Array.from({ length: k.length }, (e, t) => `${t + 1}`) : [], { baseInputConfiguration: we = {} } = n, Te = { position: he === "top" ? "top" : "bottom" };
|
|
35256
35254
|
ue && (le = aG);
|
|
35257
35255
|
let A = (e = {}) => ({
|
|
35258
35256
|
...we,
|
|
@@ -35410,17 +35408,6 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
|
|
|
35410
35408
|
]
|
|
35411
35409
|
});
|
|
35412
35410
|
}, gG = class extends _t.Component {
|
|
35413
|
-
static propTypes = {
|
|
35414
|
-
model: H.default.object.isRequired,
|
|
35415
|
-
configuration: H.default.object.isRequired,
|
|
35416
|
-
disableSidePanel: H.default.bool,
|
|
35417
|
-
onModelChanged: H.default.func.isRequired,
|
|
35418
|
-
onConfigurationChanged: H.default.func.isRequired,
|
|
35419
|
-
imageSupport: H.default.shape({
|
|
35420
|
-
add: H.default.func.isRequired,
|
|
35421
|
-
delete: H.default.func.isRequired
|
|
35422
|
-
})
|
|
35423
|
-
};
|
|
35424
35411
|
state = { showWarning: !1 };
|
|
35425
35412
|
onRemoveChoice = (e) => {
|
|
35426
35413
|
let { model: t, configuration: n, onModelChanged: r } = this.props, { minAnswerChoices: i } = n || {};
|
|
@@ -35654,6 +35641,11 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
|
|
|
35654
35641
|
}
|
|
35655
35642
|
};
|
|
35656
35643
|
}, xG = class e extends HTMLElement {
|
|
35644
|
+
_root;
|
|
35645
|
+
_reactContainer;
|
|
35646
|
+
_model;
|
|
35647
|
+
_configuration;
|
|
35648
|
+
_disableSidePanel;
|
|
35657
35649
|
static createDefaultModel = (e = {}) => {
|
|
35658
35650
|
let t = oW.normalizeChoices({
|
|
35659
35651
|
..._G.model,
|
|
@@ -35675,7 +35667,7 @@ var YW = We, XW = YW.default, ZW = XW && typeof XW == "object" ? XW : YW, QW = J
|
|
|
35675
35667
|
..._G.configuration,
|
|
35676
35668
|
...t.configuration
|
|
35677
35669
|
};
|
|
35678
|
-
this._configuration = n, n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (
|
|
35670
|
+
this._configuration = n, n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (n.language.enabled = !0, (!n.languageChoices.options || !n.languageChoices.options.length) && (n.languageChoices.options = []), n.languageChoices.options.find((e) => e.value === this._model.language) || n.languageChoices.options.push({
|
|
35679
35671
|
value: this._model.language,
|
|
35680
35672
|
label: this._model.language
|
|
35681
35673
|
})) : delete this._model.language, this._render();
|