@pie-element/match 13.0.4-next.20261011174919 → 13.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/configure.d.ts +45 -31
- package/dist/author/configure.js +37 -51
- package/dist/author/defaults.d.ts +59 -57
- package/dist/author/index.d.ts +18 -27
- package/dist/author/index.js +15 -4
- package/dist/author/utils.d.ts +33 -2
- package/dist/browser/author/index.js +24 -29
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +24 -29
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +12 -11
- package/dist/controller/index.d.ts +73 -7
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +437 -0
- package/dist/schemas/model.schema.json +478 -0
- package/dist/schemas/session.schema.json +36 -0
- package/dist/types.d.ts +183 -0
- package/package.json +21 -17
|
@@ -1,39 +1,53 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { MatchValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { MatchConfiguration, MatchFeedback, MatchModel, MatchRow } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<MatchModel> & {
|
|
7
|
+
headers: string[];
|
|
8
|
+
layout: number;
|
|
9
|
+
rows: MatchRow[];
|
|
10
|
+
errors?: MatchValidationErrors;
|
|
11
|
+
};
|
|
12
|
+
type MediaSupport<Handler> = {
|
|
13
|
+
add: (handler: Handler) => void;
|
|
14
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
15
|
+
};
|
|
16
|
+
export type ConfigureProps = {
|
|
17
|
+
model: AuthorModel;
|
|
18
|
+
configuration: MatchConfiguration;
|
|
19
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
20
|
+
onConfigurationChanged: (configuration: MatchConfiguration) => void;
|
|
21
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
22
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
23
|
+
};
|
|
24
|
+
type ConfigureState = {
|
|
25
|
+
activeTab: number;
|
|
26
|
+
dialog: {
|
|
27
|
+
open: boolean;
|
|
28
|
+
text?: string;
|
|
17
29
|
};
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
};
|
|
31
|
+
declare class Configure extends React.Component<ConfigureProps, ConfigureState> {
|
|
32
|
+
rowIdCounter: number;
|
|
33
|
+
constructor(props: ConfigureProps);
|
|
20
34
|
componentDidMount(): void;
|
|
21
|
-
validateRowsID(rows:
|
|
22
|
-
updatedRows:
|
|
35
|
+
validateRowsID(rows: MatchRow[] | undefined): {
|
|
36
|
+
updatedRows: MatchRow[];
|
|
23
37
|
wasChanged: boolean;
|
|
24
38
|
};
|
|
25
|
-
onTabChange:
|
|
26
|
-
onChangeTabIndex:
|
|
27
|
-
onChange:
|
|
28
|
-
onFeedbackChange:
|
|
29
|
-
onDeleteRow:
|
|
30
|
-
onAddRow:
|
|
31
|
-
onLayoutChange:
|
|
32
|
-
onResponseTypeChange:
|
|
33
|
-
onPartialScoringChange:
|
|
34
|
-
onPromptChanged:
|
|
35
|
-
onTeacherInstructionsChanged:
|
|
36
|
-
onRationaleChanged:
|
|
39
|
+
onTabChange: (_event: unknown, value: number) => void;
|
|
40
|
+
onChangeTabIndex: (index: number) => void;
|
|
41
|
+
onChange: (model: AuthorModel) => void;
|
|
42
|
+
onFeedbackChange: (feedback: MatchFeedback) => void;
|
|
43
|
+
onDeleteRow: (rowIndex: number) => void;
|
|
44
|
+
onAddRow: () => void;
|
|
45
|
+
onLayoutChange: (newLayout: number) => void;
|
|
46
|
+
onResponseTypeChange: (newChoiceMode: MatchModel["choiceMode"]) => void;
|
|
47
|
+
onPartialScoringChange: (partialScoring: boolean) => void;
|
|
48
|
+
onPromptChanged: (prompt: string) => void;
|
|
49
|
+
onTeacherInstructionsChanged: (teacherInstructions: string) => void;
|
|
50
|
+
onRationaleChanged: (rationale: string) => void;
|
|
37
51
|
render(): React.JSX.Element;
|
|
38
52
|
}
|
|
39
53
|
export declare const Config: typeof Configure;
|
package/dist/author/configure.js
CHANGED
|
@@ -2,37 +2,22 @@ import { getPluginProps as e } from "./utils.js";
|
|
|
2
2
|
import t from "./general-config-block.js";
|
|
3
3
|
import n from "./answer-config-block.js";
|
|
4
4
|
import r from "react";
|
|
5
|
-
import i from "
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import c from "
|
|
9
|
-
import { AlertDialog as l, FeedbackConfig as ee, InputContainer as u, layout as d, settings as f } from "@pie-lib/config-ui";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { styled as o } from "@mui/material/styles";
|
|
7
|
+
import s from "debug";
|
|
8
|
+
import { AlertDialog as c, FeedbackConfig as l, InputContainer as u, layout as d, settings as f } from "@pie-lib/config-ui";
|
|
10
9
|
import p from "@pie-lib/editable-html-tip-tap";
|
|
11
10
|
//#region src/author/configure.tsx
|
|
12
|
-
var
|
|
11
|
+
var m = s("@pie-element:match:configure"), { Panel: ee, toggle: h, radio: te, dropdown: g } = f, _ = o("div")(() => ({ "& .promptHolder": { width: "100%" } })), v = o("div")(({ theme: e }) => ({
|
|
13
12
|
width: "100%",
|
|
14
13
|
paddingTop: e.spacing(2),
|
|
15
14
|
marginBottom: e.spacing(2)
|
|
16
|
-
})),
|
|
15
|
+
})), y = o("div")(({ theme: e }) => ({
|
|
17
16
|
fontSize: e.typography.fontSize - 2,
|
|
18
17
|
color: e.palette.error.main,
|
|
19
18
|
paddingTop: e.spacing(1)
|
|
20
|
-
})),
|
|
21
|
-
|
|
22
|
-
onModelChanged: i.func,
|
|
23
|
-
onConfigurationChanged: i.func,
|
|
24
|
-
model: i.object.isRequired,
|
|
25
|
-
configuration: i.object.isRequired,
|
|
26
|
-
imageSupport: i.shape({
|
|
27
|
-
add: i.func.isRequired,
|
|
28
|
-
delete: i.func.isRequired
|
|
29
|
-
}),
|
|
30
|
-
uploadSoundSupport: i.shape({
|
|
31
|
-
add: i.func.isRequired,
|
|
32
|
-
delete: i.func.isRequired
|
|
33
|
-
})
|
|
34
|
-
};
|
|
35
|
-
static defaultProps = {};
|
|
19
|
+
})), b = class extends r.Component {
|
|
20
|
+
rowIdCounter;
|
|
36
21
|
constructor(e) {
|
|
37
22
|
super(e);
|
|
38
23
|
let t = 0;
|
|
@@ -111,7 +96,8 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
111
96
|
onResponseTypeChange = (e) => {
|
|
112
97
|
let { model: t } = this.props, n = { ...t };
|
|
113
98
|
e === "radio" && n.rows.forEach((e) => {
|
|
114
|
-
e.values.reduce((e, t) => t === !0 ? e + 1 : e)
|
|
99
|
+
let n = e.values.reduce((e, t) => t === !0 ? Number(e) + 1 : e);
|
|
100
|
+
Number(n) > 1 && (e.values = Array(t.layout - 1).fill(!1));
|
|
115
101
|
}), n.choiceMode = e, this.onChange(n);
|
|
116
102
|
};
|
|
117
103
|
onPartialScoringChange = (e) => {
|
|
@@ -136,44 +122,44 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
136
122
|
});
|
|
137
123
|
};
|
|
138
124
|
render() {
|
|
139
|
-
let { model: r, imageSupport:
|
|
125
|
+
let { model: r, imageSupport: o, onModelChanged: s, configuration: f, onConfigurationChanged: b, uploadSoundSupport: x } = this.props, { baseInputConfiguration: S = {}, contentDimensions: C = {}, feedback: w = {}, lockChoiceOrder: T = {}, maxImageWidth: E = {}, maxImageHeight: D = {}, partialScoring: O = {}, prompt: k = {}, rationale: A = {}, settingsPanelDisabled: j, scoringType: M = {}, spellCheck: N = {}, studentInstructions: P = {}, teacherInstructions: F = {}, withRubric: I = {}, language: L = {}, languageChoices: R = {} } = f || {}, { errors: z, extraCSSRules: B, feedbackEnabled: V, promptEnabled: H, rationaleEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: G, toolbarEditorPosition: K } = r || {}, { prompt: q, rationale: J, teacherInstructions: Y } = z || {}, { dialog: X } = this.state, Z = { position: K === "top" ? "top" : "bottom" }, Q = E && E.prompt, $ = D && D.prompt, ne = {
|
|
140
126
|
partialScoring: O.settings && h(O.label),
|
|
141
127
|
lockChoiceOrder: T.settings && h(T.label),
|
|
142
128
|
feedbackEnabled: w.settings && h(w.label),
|
|
143
129
|
"language.enabled": L.settings && h(L.label, !0),
|
|
144
|
-
language: L.settings && L.enabled &&
|
|
130
|
+
language: L.settings && L.enabled && g(R.label, R.options)
|
|
145
131
|
}, re = {
|
|
146
132
|
teacherInstructionsEnabled: F.settings && h(F.label),
|
|
147
133
|
studentInstructionsEnabled: P.settings && h(P.label),
|
|
148
134
|
promptEnabled: k.settings && h(k.label),
|
|
149
135
|
rationaleEnabled: A.settings && h(A.label),
|
|
150
136
|
spellCheckEnabled: N.settings && h(N.label),
|
|
151
|
-
scoringType: M.settings &&
|
|
137
|
+
scoringType: M.settings && te(M.label, ["auto", "rubric"]),
|
|
152
138
|
rubricEnabled: I?.settings && h(I?.label)
|
|
153
139
|
};
|
|
154
|
-
return
|
|
140
|
+
return m("[render] model", r), /* @__PURE__ */ i(_, { children: /* @__PURE__ */ a(d.ConfigLayout, {
|
|
155
141
|
extraCSSRules: B,
|
|
156
142
|
dimensions: C,
|
|
157
143
|
hideSettings: j,
|
|
158
|
-
settings: /* @__PURE__ */
|
|
144
|
+
settings: /* @__PURE__ */ i(ee, {
|
|
159
145
|
model: r,
|
|
160
|
-
configuration:
|
|
146
|
+
configuration: f,
|
|
161
147
|
onChangeModel: (e) => s(e),
|
|
162
|
-
onChangeConfiguration: (e) =>
|
|
148
|
+
onChangeConfiguration: (e) => b(e),
|
|
163
149
|
groups: {
|
|
164
150
|
Settings: ne,
|
|
165
151
|
Properties: re
|
|
166
152
|
}
|
|
167
153
|
}),
|
|
168
154
|
children: [
|
|
169
|
-
G && /* @__PURE__ */
|
|
155
|
+
G && /* @__PURE__ */ i(u, {
|
|
170
156
|
label: F.label,
|
|
171
157
|
className: "promptHolder",
|
|
172
|
-
children: /* @__PURE__ */
|
|
158
|
+
children: /* @__PURE__ */ a(v, { children: [/* @__PURE__ */ i(p, {
|
|
173
159
|
className: "prompt",
|
|
174
160
|
markup: r.teacherInstructions || "",
|
|
175
161
|
onChange: this.onTeacherInstructionsChanged,
|
|
176
|
-
imageSupport:
|
|
162
|
+
imageSupport: o,
|
|
177
163
|
error: Y,
|
|
178
164
|
nonEmpty: !1,
|
|
179
165
|
toolbarOpts: Z,
|
|
@@ -183,16 +169,16 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
183
169
|
maxImageHeight: D && D.teacherInstructions || $,
|
|
184
170
|
uploadSoundSupport: x,
|
|
185
171
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }]
|
|
186
|
-
}), Y && /* @__PURE__ */
|
|
172
|
+
}), Y && /* @__PURE__ */ i(y, { children: Y })] })
|
|
187
173
|
}),
|
|
188
|
-
H && /* @__PURE__ */
|
|
174
|
+
H && /* @__PURE__ */ i(u, {
|
|
189
175
|
label: k.label,
|
|
190
176
|
className: "promptHolder",
|
|
191
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ a(v, { children: [/* @__PURE__ */ i(p, {
|
|
192
178
|
className: "prompt",
|
|
193
179
|
markup: r.prompt,
|
|
194
180
|
onChange: this.onPromptChanged,
|
|
195
|
-
imageSupport:
|
|
181
|
+
imageSupport: o,
|
|
196
182
|
error: q,
|
|
197
183
|
nonEmpty: !1,
|
|
198
184
|
disableUnderline: !0,
|
|
@@ -203,18 +189,18 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
203
189
|
maxImageHeight: D && D.prompt,
|
|
204
190
|
uploadSoundSupport: x,
|
|
205
191
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }]
|
|
206
|
-
}), q && /* @__PURE__ */
|
|
192
|
+
}), q && /* @__PURE__ */ i(y, { children: q })] })
|
|
207
193
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ i(t, {
|
|
209
195
|
model: r,
|
|
210
|
-
configuration:
|
|
196
|
+
configuration: f,
|
|
211
197
|
onResponseTypeChange: this.onResponseTypeChange,
|
|
212
198
|
onLayoutChange: this.onLayoutChange
|
|
213
199
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ i(n, {
|
|
215
201
|
model: r,
|
|
216
|
-
configuration:
|
|
217
|
-
imageSupport:
|
|
202
|
+
configuration: f,
|
|
203
|
+
imageSupport: o,
|
|
218
204
|
onChange: this.onChange,
|
|
219
205
|
onAddRow: this.onAddRow,
|
|
220
206
|
onDeleteRow: this.onDeleteRow,
|
|
@@ -222,14 +208,14 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
222
208
|
spellCheck: W,
|
|
223
209
|
uploadSoundSupport: x
|
|
224
210
|
}),
|
|
225
|
-
U && /* @__PURE__ */
|
|
211
|
+
U && /* @__PURE__ */ i(u, {
|
|
226
212
|
label: A.label,
|
|
227
213
|
className: "promptHolder",
|
|
228
|
-
children: /* @__PURE__ */
|
|
214
|
+
children: /* @__PURE__ */ a(v, { children: [/* @__PURE__ */ i(p, {
|
|
229
215
|
className: "prompt",
|
|
230
216
|
markup: r.rationale || "",
|
|
231
217
|
onChange: this.onRationaleChanged,
|
|
232
|
-
imageSupport:
|
|
218
|
+
imageSupport: o,
|
|
233
219
|
error: J,
|
|
234
220
|
toolbarOpts: Z,
|
|
235
221
|
pluginProps: e(A?.inputConfiguration, S),
|
|
@@ -238,14 +224,14 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
238
224
|
maxImageHeight: D && D.rationale || $,
|
|
239
225
|
uploadSoundSupport: x,
|
|
240
226
|
languageCharactersProps: [{ language: "spanish" }, { language: "special" }]
|
|
241
|
-
}), J && /* @__PURE__ */
|
|
227
|
+
}), J && /* @__PURE__ */ i(y, { children: J })] })
|
|
242
228
|
}),
|
|
243
|
-
V && /* @__PURE__ */
|
|
229
|
+
V && /* @__PURE__ */ i(l, {
|
|
244
230
|
feedback: r.feedback,
|
|
245
231
|
onChange: this.onFeedbackChange,
|
|
246
232
|
toolbarOpts: Z
|
|
247
233
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ i(c, {
|
|
249
235
|
open: X.open,
|
|
250
236
|
title: "Warning",
|
|
251
237
|
text: X.text,
|
|
@@ -256,4 +242,4 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
|
|
|
256
242
|
}
|
|
257
243
|
};
|
|
258
244
|
//#endregion
|
|
259
|
-
export {
|
|
245
|
+
export { b as default };
|
|
@@ -1,159 +1,161 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { MatchRow } from '../types.js';
|
|
1
3
|
/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
|
|
2
4
|
* functionalities are not defined yet - the value for those can belong to
|
|
3
5
|
* model or to configuration
|
|
4
6
|
*/
|
|
5
7
|
declare const _default: {
|
|
6
8
|
model: {
|
|
7
|
-
choiceMode:
|
|
8
|
-
feedbackEnabled:
|
|
9
|
+
choiceMode: "radio";
|
|
10
|
+
feedbackEnabled: false;
|
|
9
11
|
headers: string[];
|
|
10
12
|
layout: number;
|
|
11
|
-
lockChoiceOrder:
|
|
12
|
-
partialScoring:
|
|
13
|
+
lockChoiceOrder: true;
|
|
14
|
+
partialScoring: false;
|
|
13
15
|
prompt: string;
|
|
14
|
-
promptEnabled:
|
|
16
|
+
promptEnabled: true;
|
|
15
17
|
rationale: string;
|
|
16
|
-
rationaleEnabled:
|
|
17
|
-
rows:
|
|
18
|
-
scoringType:
|
|
19
|
-
studentInstructionsEnabled:
|
|
18
|
+
rationaleEnabled: true;
|
|
19
|
+
rows: MatchRow[];
|
|
20
|
+
scoringType: "auto";
|
|
21
|
+
studentInstructionsEnabled: true;
|
|
20
22
|
teacherInstructions: string;
|
|
21
|
-
teacherInstructionsEnabled:
|
|
22
|
-
toolbarEditorPosition:
|
|
23
|
+
teacherInstructionsEnabled: true;
|
|
24
|
+
toolbarEditorPosition: "bottom";
|
|
23
25
|
};
|
|
24
26
|
configuration: {
|
|
25
27
|
baseInputConfiguration: {
|
|
26
28
|
h3: {
|
|
27
|
-
disabled:
|
|
29
|
+
disabled: true;
|
|
28
30
|
};
|
|
29
31
|
audio: {
|
|
30
|
-
disabled:
|
|
32
|
+
disabled: false;
|
|
31
33
|
};
|
|
32
34
|
video: {
|
|
33
|
-
disabled:
|
|
35
|
+
disabled: false;
|
|
34
36
|
};
|
|
35
37
|
image: {
|
|
36
|
-
disabled:
|
|
38
|
+
disabled: false;
|
|
37
39
|
};
|
|
38
40
|
textAlign: {
|
|
39
|
-
disabled:
|
|
41
|
+
disabled: true;
|
|
40
42
|
};
|
|
41
43
|
showParagraphs: {
|
|
42
|
-
disabled:
|
|
44
|
+
disabled: false;
|
|
43
45
|
};
|
|
44
46
|
separateParagraphs: {
|
|
45
|
-
disabled:
|
|
47
|
+
disabled: true;
|
|
46
48
|
};
|
|
47
49
|
};
|
|
48
50
|
rows: {
|
|
49
51
|
inputConfiguration: {
|
|
50
52
|
audio: {
|
|
51
|
-
disabled:
|
|
53
|
+
disabled: true;
|
|
52
54
|
};
|
|
53
55
|
video: {
|
|
54
|
-
disabled:
|
|
56
|
+
disabled: true;
|
|
55
57
|
};
|
|
56
58
|
image: {
|
|
57
|
-
disabled:
|
|
59
|
+
disabled: false;
|
|
58
60
|
};
|
|
59
61
|
};
|
|
60
62
|
};
|
|
61
63
|
feedback: {
|
|
62
|
-
settings:
|
|
64
|
+
settings: true;
|
|
63
65
|
label: string;
|
|
64
|
-
enabled:
|
|
66
|
+
enabled: true;
|
|
65
67
|
};
|
|
66
68
|
headers: {
|
|
67
|
-
settings:
|
|
69
|
+
settings: true;
|
|
68
70
|
inputConfiguration: {
|
|
69
71
|
audio: {
|
|
70
|
-
disabled:
|
|
72
|
+
disabled: true;
|
|
71
73
|
};
|
|
72
74
|
video: {
|
|
73
|
-
disabled:
|
|
75
|
+
disabled: true;
|
|
74
76
|
};
|
|
75
77
|
image: {
|
|
76
|
-
disabled:
|
|
78
|
+
disabled: false;
|
|
77
79
|
};
|
|
78
80
|
};
|
|
79
81
|
};
|
|
80
82
|
layout: {
|
|
81
|
-
settings:
|
|
83
|
+
settings: true;
|
|
82
84
|
label: string;
|
|
83
85
|
};
|
|
84
86
|
lockChoiceOrder: {
|
|
85
|
-
settings:
|
|
87
|
+
settings: false;
|
|
86
88
|
label: string;
|
|
87
89
|
};
|
|
88
90
|
partialScoring: {
|
|
89
|
-
settings:
|
|
91
|
+
settings: false;
|
|
90
92
|
label: string;
|
|
91
93
|
};
|
|
92
94
|
choiceMode: {
|
|
93
|
-
settings:
|
|
95
|
+
settings: true;
|
|
94
96
|
label: string;
|
|
95
97
|
};
|
|
96
98
|
prompt: {
|
|
97
|
-
settings:
|
|
99
|
+
settings: true;
|
|
98
100
|
label: string;
|
|
99
101
|
inputConfiguration: {
|
|
100
102
|
audio: {
|
|
101
|
-
disabled:
|
|
103
|
+
disabled: false;
|
|
102
104
|
};
|
|
103
105
|
video: {
|
|
104
|
-
disabled:
|
|
106
|
+
disabled: false;
|
|
105
107
|
};
|
|
106
108
|
image: {
|
|
107
|
-
disabled:
|
|
109
|
+
disabled: false;
|
|
108
110
|
};
|
|
109
111
|
};
|
|
110
|
-
required:
|
|
112
|
+
required: false;
|
|
111
113
|
};
|
|
112
114
|
rationale: {
|
|
113
|
-
settings:
|
|
115
|
+
settings: true;
|
|
114
116
|
label: string;
|
|
115
117
|
inputConfiguration: {
|
|
116
118
|
audio: {
|
|
117
|
-
disabled:
|
|
119
|
+
disabled: false;
|
|
118
120
|
};
|
|
119
121
|
video: {
|
|
120
|
-
disabled:
|
|
122
|
+
disabled: false;
|
|
121
123
|
};
|
|
122
124
|
image: {
|
|
123
|
-
disabled:
|
|
125
|
+
disabled: false;
|
|
124
126
|
};
|
|
125
127
|
};
|
|
126
|
-
required:
|
|
128
|
+
required: false;
|
|
127
129
|
};
|
|
128
|
-
settingsPanelDisabled:
|
|
130
|
+
settingsPanelDisabled: false;
|
|
129
131
|
spellCheck: {
|
|
130
132
|
label: string;
|
|
131
|
-
settings:
|
|
132
|
-
enabled:
|
|
133
|
+
settings: false;
|
|
134
|
+
enabled: true;
|
|
133
135
|
};
|
|
134
136
|
scoringType: {
|
|
135
|
-
settings:
|
|
137
|
+
settings: false;
|
|
136
138
|
label: string;
|
|
137
139
|
};
|
|
138
140
|
studentInstructions: {
|
|
139
|
-
settings:
|
|
141
|
+
settings: false;
|
|
140
142
|
label: string;
|
|
141
143
|
};
|
|
142
144
|
teacherInstructions: {
|
|
143
|
-
settings:
|
|
145
|
+
settings: true;
|
|
144
146
|
label: string;
|
|
145
147
|
inputConfiguration: {
|
|
146
148
|
audio: {
|
|
147
|
-
disabled:
|
|
149
|
+
disabled: false;
|
|
148
150
|
};
|
|
149
151
|
video: {
|
|
150
|
-
disabled:
|
|
152
|
+
disabled: false;
|
|
151
153
|
};
|
|
152
154
|
image: {
|
|
153
|
-
disabled:
|
|
155
|
+
disabled: false;
|
|
154
156
|
};
|
|
155
157
|
};
|
|
156
|
-
required:
|
|
158
|
+
required: false;
|
|
157
159
|
};
|
|
158
160
|
maxImageWidth: {
|
|
159
161
|
teacherInstructions: number;
|
|
@@ -168,7 +170,7 @@ declare const _default: {
|
|
|
168
170
|
rowTitles: number;
|
|
169
171
|
};
|
|
170
172
|
withRubric: {
|
|
171
|
-
settings:
|
|
173
|
+
settings: false;
|
|
172
174
|
label: string;
|
|
173
175
|
};
|
|
174
176
|
minQuestions: number;
|
|
@@ -178,17 +180,17 @@ declare const _default: {
|
|
|
178
180
|
maxLengthAnswers: number;
|
|
179
181
|
maxLengthFirstColumnHeading: number;
|
|
180
182
|
mathMlOptions: {
|
|
181
|
-
mmlOutput:
|
|
182
|
-
mmlEditing:
|
|
183
|
+
mmlOutput: false;
|
|
184
|
+
mmlEditing: false;
|
|
183
185
|
};
|
|
184
186
|
language: {
|
|
185
|
-
settings:
|
|
187
|
+
settings: false;
|
|
186
188
|
label: string;
|
|
187
|
-
enabled:
|
|
189
|
+
enabled: false;
|
|
188
190
|
};
|
|
189
191
|
languageChoices: {
|
|
190
192
|
label: string;
|
|
191
|
-
options:
|
|
193
|
+
options: ConfigureLanguageOptionsProp[];
|
|
192
194
|
};
|
|
193
195
|
};
|
|
194
196
|
};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
+
import { type AuthorModel } from './configure.js';
|
|
2
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { MatchConfiguration, MatchModel } from '../types.js';
|
|
1
4
|
export default class MatchConfigure extends HTMLElement {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
partialScoring: boolean;
|
|
9
|
-
prompt: string;
|
|
10
|
-
promptEnabled: boolean;
|
|
11
|
-
rationale: string;
|
|
12
|
-
rationaleEnabled: boolean;
|
|
13
|
-
rows: never[];
|
|
14
|
-
scoringType: string;
|
|
15
|
-
studentInstructionsEnabled: boolean;
|
|
16
|
-
teacherInstructions: string;
|
|
17
|
-
teacherInstructionsEnabled: boolean;
|
|
18
|
-
toolbarEditorPosition: string;
|
|
19
|
-
};
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _modelCopy?;
|
|
8
|
+
private _configuration;
|
|
9
|
+
hasPlayerAsParent?: boolean;
|
|
10
|
+
static createDefaultModel: (model?: Partial<MatchModel>) => AuthorModel;
|
|
20
11
|
constructor();
|
|
21
|
-
set model(m:
|
|
22
|
-
resetModelAfterConfigurationIsSet:
|
|
23
|
-
set configuration(c:
|
|
24
|
-
onModelChanged(model:
|
|
25
|
-
onConfigurationChanged(config:
|
|
12
|
+
set model(m: Partial<MatchModel>);
|
|
13
|
+
resetModelAfterConfigurationIsSet: () => void;
|
|
14
|
+
set configuration(c: MatchConfiguration);
|
|
15
|
+
onModelChanged(model: AuthorModel): void;
|
|
16
|
+
onConfigurationChanged(config: MatchConfiguration): void;
|
|
26
17
|
/**
|
|
27
18
|
*
|
|
28
19
|
* @param {done, progress, file} handler
|
|
29
20
|
*/
|
|
30
|
-
insertImage(handler:
|
|
31
|
-
onDeleteImage(src:
|
|
32
|
-
insertSound(handler:
|
|
33
|
-
onDeleteSound(src:
|
|
21
|
+
insertImage(handler: ImageHandler): void;
|
|
22
|
+
onDeleteImage(src: string, done: DeleteDone): void;
|
|
23
|
+
insertSound(handler: SoundHandler): void;
|
|
24
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
34
25
|
_render(): void;
|
|
35
26
|
connectedCallback(): void;
|
|
36
27
|
disconnectedCallback(): void;
|
package/dist/author/index.js
CHANGED
|
@@ -7,6 +7,11 @@ import s from "debug";
|
|
|
7
7
|
import { DeleteImageEvent as c, DeleteSoundEvent as l, InsertImageEvent as u, InsertSoundEvent as d, ModelUpdatedEvent as f } from "@pie-element/shared-configure-events";
|
|
8
8
|
//#region src/author/index.ts
|
|
9
9
|
var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
|
|
10
|
+
_root;
|
|
11
|
+
_model;
|
|
12
|
+
_modelCopy;
|
|
13
|
+
_configuration;
|
|
14
|
+
hasPlayerAsParent;
|
|
10
15
|
static createDefaultModel = (e = {}) => ({
|
|
11
16
|
...t.model,
|
|
12
17
|
...e
|
|
@@ -26,10 +31,16 @@ var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
|
|
|
26
31
|
...t.configuration,
|
|
27
32
|
...e
|
|
28
33
|
};
|
|
29
|
-
this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
if (this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled) n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value);
|
|
35
|
+
else if (n.language.settings && this._model.language) {
|
|
36
|
+
n.language.enabled = !0, (!n.languageChoices.options || !n.languageChoices.options.length) && (n.languageChoices.options = []);
|
|
37
|
+
let e = this._model.language;
|
|
38
|
+
n.languageChoices.options.find((t) => t.value === e) || n.languageChoices.options.push({
|
|
39
|
+
value: e,
|
|
40
|
+
label: e
|
|
41
|
+
});
|
|
42
|
+
} else delete this._model.language;
|
|
43
|
+
a(e?.rows?.inputConfiguration) && (o(n.rows, "inputConfiguration.image.disabled", !this._model?.enableImages), o(n.rows, "inputConfiguration.video.disabled", !0), o(n.rows, "inputConfiguration.audio.disabled", !0)), this._render();
|
|
33
44
|
}
|
|
34
45
|
onModelChanged(e) {
|
|
35
46
|
this._model = e, p("[onModelChanged]: ", this._model), this._render(), this.dispatchEvent(new f(this._model));
|
package/dist/author/utils.d.ts
CHANGED
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { EditableHtmlConfigureProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { MatchConfiguration, MatchModel } from '../types.js';
|
|
3
|
+
export declare const getPluginProps: (props?: EditableHtmlConfigureProp, baseInputConfiguration?: EditableHtmlConfigureProp) => {
|
|
4
|
+
math?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
5
|
+
audio?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
6
|
+
video?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
7
|
+
image?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
8
|
+
customPlugins?: import("@pie-element/shared-types").CustomPlugin[];
|
|
9
|
+
blockquote?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
10
|
+
h3?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
11
|
+
characters?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
12
|
+
bold?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
13
|
+
html?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
14
|
+
italic?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
15
|
+
ol_list?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
16
|
+
redo?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
17
|
+
strikethrough?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
18
|
+
sub?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
19
|
+
sup?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
20
|
+
table?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
21
|
+
ul_list?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
22
|
+
underline?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
23
|
+
undo?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
24
|
+
textAlign?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
25
|
+
showParagraphs?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
26
|
+
separateParagraphs?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
27
|
+
pasteFormatting?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
28
|
+
superscript?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
29
|
+
subscript?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
30
|
+
languageCharacters?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
31
|
+
responseArea?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
|
|
32
|
+
};
|
|
33
|
+
export declare const generateValidationMessage: (model: Partial<MatchModel>, configuration: MatchConfiguration) => string;
|