@pie-element/math-templated 7.1.1-next.147 → 7.1.1-next.16
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/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/defaults.d.ts +173 -0
- package/dist/author/defaults.js +123 -0
- package/dist/author/design.d.ts +35 -0
- package/dist/author/design.js +360 -0
- package/dist/author/index.d.ts +43 -0
- package/dist/author/index.js +100 -0
- package/dist/author/markupUtils.d.ts +11 -0
- package/dist/author/markupUtils.js +10 -0
- package/dist/author/response.d.ts +41 -0
- package/dist/author/response.js +238 -0
- package/dist/author/utils.d.ts +9 -0
- package/dist/author/utils.js +7 -0
- package/dist/browser/author/index.js +37244 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/browser-_ggI30Zt.js +342 -0
- package/dist/browser/browser-_ggI30Zt.js.map +1 -0
- package/dist/browser/controller/index.js +37733 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +81 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-DiGNNRzu.js +1426 -0
- package/dist/browser/dist-DiGNNRzu.js.map +1 -0
- package/dist/browser/horizontal-keypad-xHeOxFVV.js +14441 -0
- package/dist/browser/horizontal-keypad-xHeOxFVV.js.map +1 -0
- package/dist/browser/main-BLv4ZW26.js +1270 -0
- package/dist/browser/main-BLv4ZW26.js.map +1 -0
- package/dist/browser/math-templated.css +2 -0
- package/dist/browser/print/index.js +47 -0
- package/dist/browser/print/index.js.map +1 -0
- package/dist/controller/defaults.d.ts +29 -0
- package/dist/controller/defaults.js +23 -0
- package/dist/controller/index.d.ts +45 -0
- package/dist/controller/index.js +154 -0
- package/dist/delivery/index.d.ts +20 -0
- package/dist/delivery/index.js +51 -0
- package/dist/delivery/main.d.ts +40 -0
- package/dist/delivery/main.js +492 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +202 -0
- package/dist/index.js +2 -0
- package/dist/math-templated.css +2 -0
- package/dist/print/index.d.ts +15 -0
- package/dist/print/index.js +47 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +99 -22
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -1134
- package/LICENSE.md +0 -5
- package/README.md +0 -0
- package/configure/CHANGELOG.json +0 -1
- package/configure/CHANGELOG.md +0 -1011
- package/configure/lib/defaults.js +0 -172
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/design.js +0 -546
- package/configure/lib/design.js.map +0 -1
- package/configure/lib/index.js +0 -173
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/markupUtils.js +0 -39
- package/configure/lib/markupUtils.js.map +0 -1
- package/configure/lib/response.js +0 -394
- package/configure/lib/response.js.map +0 -1
- package/configure/lib/utils.js +0 -15
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -26
- package/controller/CHANGELOG.json +0 -1
- package/controller/CHANGELOG.md +0 -870
- package/controller/lib/defaults.js +0 -28
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -360
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -17
- package/docs/config-schema.json +0 -2251
- package/docs/config-schema.json.md +0 -1658
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -42
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -14
- package/docs/pie-schema.json +0 -1231
- package/docs/pie-schema.json.md +0 -894
- package/lib/index.js +0 -77
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -877
- package/lib/main.js.map +0 -1
- package/lib/print.js +0 -88
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -3711
- package/module/demo.js +0 -67
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -22
- package/module/print-demo.js +0 -105
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/configure.js
ADDED
package/controller.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/controller/index.js';
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/math-templated/configure/src/defaults.js
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: {
|
|
10
|
+
model: {
|
|
11
|
+
allowTrailingZerosDefault: boolean;
|
|
12
|
+
equationEditor: string;
|
|
13
|
+
ignoreOrderDefault: boolean;
|
|
14
|
+
markup: string;
|
|
15
|
+
playerSpellCheckEnabled: boolean;
|
|
16
|
+
prompt: string;
|
|
17
|
+
promptEnabled: boolean;
|
|
18
|
+
rationale: string;
|
|
19
|
+
rationaleEnabled: boolean;
|
|
20
|
+
responses: {};
|
|
21
|
+
spellCheckEnabled: boolean;
|
|
22
|
+
teacherInstructions: string;
|
|
23
|
+
teacherInstructionsEnabled: boolean;
|
|
24
|
+
toolbarEditorPosition: string;
|
|
25
|
+
validationDefault: string;
|
|
26
|
+
};
|
|
27
|
+
configuration: {
|
|
28
|
+
ignoreOrder: {
|
|
29
|
+
settings: boolean;
|
|
30
|
+
label: string;
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
};
|
|
33
|
+
allowTrailingZeros: {
|
|
34
|
+
settings: boolean;
|
|
35
|
+
label: string;
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
};
|
|
38
|
+
partialScoring: {
|
|
39
|
+
settings: boolean;
|
|
40
|
+
label: string;
|
|
41
|
+
};
|
|
42
|
+
baseInputConfiguration: {
|
|
43
|
+
html: {
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
};
|
|
46
|
+
audio: {
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
};
|
|
49
|
+
video: {
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
};
|
|
52
|
+
image: {
|
|
53
|
+
disabled: boolean;
|
|
54
|
+
};
|
|
55
|
+
h3: {
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
};
|
|
58
|
+
blockquote: {
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
};
|
|
61
|
+
textAlign: {
|
|
62
|
+
disabled: boolean;
|
|
63
|
+
};
|
|
64
|
+
showParagraphs: {
|
|
65
|
+
disabled: boolean;
|
|
66
|
+
};
|
|
67
|
+
separateParagraphs: {
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
prompt: {
|
|
72
|
+
label: string;
|
|
73
|
+
settings: boolean;
|
|
74
|
+
inputConfiguration: {
|
|
75
|
+
audio: {
|
|
76
|
+
disabled: boolean;
|
|
77
|
+
};
|
|
78
|
+
video: {
|
|
79
|
+
disabled: boolean;
|
|
80
|
+
};
|
|
81
|
+
image: {
|
|
82
|
+
disabled: boolean;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
required: boolean;
|
|
86
|
+
};
|
|
87
|
+
spellCheck: {
|
|
88
|
+
label: string;
|
|
89
|
+
settings: boolean;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
};
|
|
92
|
+
editSource: {
|
|
93
|
+
label: string;
|
|
94
|
+
settings: boolean;
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
};
|
|
97
|
+
playerSpellCheck: {
|
|
98
|
+
label: string;
|
|
99
|
+
settings: boolean;
|
|
100
|
+
enabled: boolean;
|
|
101
|
+
};
|
|
102
|
+
teacherInstructions: {
|
|
103
|
+
settings: boolean;
|
|
104
|
+
label: string;
|
|
105
|
+
inputConfiguration: {
|
|
106
|
+
audio: {
|
|
107
|
+
disabled: boolean;
|
|
108
|
+
};
|
|
109
|
+
video: {
|
|
110
|
+
disabled: boolean;
|
|
111
|
+
};
|
|
112
|
+
image: {
|
|
113
|
+
disabled: boolean;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
required: boolean;
|
|
117
|
+
};
|
|
118
|
+
rationale: {
|
|
119
|
+
settings: boolean;
|
|
120
|
+
label: string;
|
|
121
|
+
inputConfiguration: {
|
|
122
|
+
audio: {
|
|
123
|
+
disabled: boolean;
|
|
124
|
+
};
|
|
125
|
+
video: {
|
|
126
|
+
disabled: boolean;
|
|
127
|
+
};
|
|
128
|
+
image: {
|
|
129
|
+
disabled: boolean;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
required: boolean;
|
|
133
|
+
};
|
|
134
|
+
template: {
|
|
135
|
+
inputConfiguration: {
|
|
136
|
+
audio: {
|
|
137
|
+
disabled: boolean;
|
|
138
|
+
};
|
|
139
|
+
video: {
|
|
140
|
+
disabled: boolean;
|
|
141
|
+
};
|
|
142
|
+
image: {
|
|
143
|
+
disabled: boolean;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
maxImageWidth: {
|
|
148
|
+
teacherInstructions: number;
|
|
149
|
+
prompt: number;
|
|
150
|
+
rationale: number;
|
|
151
|
+
};
|
|
152
|
+
maxImageHeight: {
|
|
153
|
+
teacherInstructions: number;
|
|
154
|
+
prompt: number;
|
|
155
|
+
rationale: number;
|
|
156
|
+
};
|
|
157
|
+
mathMlOptions: {
|
|
158
|
+
mmlOutput: boolean;
|
|
159
|
+
mmlEditing: boolean;
|
|
160
|
+
};
|
|
161
|
+
language: {
|
|
162
|
+
settings: boolean;
|
|
163
|
+
label: string;
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
};
|
|
166
|
+
languageChoices: {
|
|
167
|
+
label: string;
|
|
168
|
+
options: never[];
|
|
169
|
+
};
|
|
170
|
+
maxResponseAreas: number;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//#region src/author/defaults.ts
|
|
2
|
+
var e = {
|
|
3
|
+
model: {
|
|
4
|
+
allowTrailingZerosDefault: !1,
|
|
5
|
+
equationEditor: "8",
|
|
6
|
+
ignoreOrderDefault: !1,
|
|
7
|
+
markup: "",
|
|
8
|
+
playerSpellCheckEnabled: !0,
|
|
9
|
+
prompt: "",
|
|
10
|
+
promptEnabled: !0,
|
|
11
|
+
rationale: "",
|
|
12
|
+
rationaleEnabled: !0,
|
|
13
|
+
responses: {},
|
|
14
|
+
spellCheckEnabled: !0,
|
|
15
|
+
teacherInstructions: "",
|
|
16
|
+
teacherInstructionsEnabled: !0,
|
|
17
|
+
toolbarEditorPosition: "bottom",
|
|
18
|
+
validationDefault: "literal"
|
|
19
|
+
},
|
|
20
|
+
configuration: {
|
|
21
|
+
ignoreOrder: {
|
|
22
|
+
settings: !0,
|
|
23
|
+
label: "Ignore Order",
|
|
24
|
+
enabled: !0
|
|
25
|
+
},
|
|
26
|
+
allowTrailingZeros: {
|
|
27
|
+
settings: !0,
|
|
28
|
+
label: "Allow Trailing Zeros",
|
|
29
|
+
enabled: !0
|
|
30
|
+
},
|
|
31
|
+
partialScoring: {
|
|
32
|
+
settings: !0,
|
|
33
|
+
label: "Allow Partial Scoring"
|
|
34
|
+
},
|
|
35
|
+
baseInputConfiguration: {
|
|
36
|
+
html: { disabled: !0 },
|
|
37
|
+
audio: { disabled: !1 },
|
|
38
|
+
video: { disabled: !1 },
|
|
39
|
+
image: { disabled: !1 },
|
|
40
|
+
h3: { disabled: !0 },
|
|
41
|
+
blockquote: { disabled: !0 },
|
|
42
|
+
textAlign: { disabled: !0 },
|
|
43
|
+
showParagraphs: { disabled: !1 },
|
|
44
|
+
separateParagraphs: { disabled: !0 }
|
|
45
|
+
},
|
|
46
|
+
prompt: {
|
|
47
|
+
label: "Prompt",
|
|
48
|
+
settings: !0,
|
|
49
|
+
inputConfiguration: {
|
|
50
|
+
audio: { disabled: !1 },
|
|
51
|
+
video: { disabled: !1 },
|
|
52
|
+
image: { disabled: !1 }
|
|
53
|
+
},
|
|
54
|
+
required: !1
|
|
55
|
+
},
|
|
56
|
+
spellCheck: {
|
|
57
|
+
label: "Spellcheck",
|
|
58
|
+
settings: !1,
|
|
59
|
+
enabled: !0
|
|
60
|
+
},
|
|
61
|
+
editSource: {
|
|
62
|
+
label: "Edit Source",
|
|
63
|
+
settings: !1,
|
|
64
|
+
enabled: !1
|
|
65
|
+
},
|
|
66
|
+
playerSpellCheck: {
|
|
67
|
+
label: "Student Spellcheck",
|
|
68
|
+
settings: !0,
|
|
69
|
+
enabled: !0
|
|
70
|
+
},
|
|
71
|
+
teacherInstructions: {
|
|
72
|
+
settings: !0,
|
|
73
|
+
label: "Teacher Instructions",
|
|
74
|
+
inputConfiguration: {
|
|
75
|
+
audio: { disabled: !1 },
|
|
76
|
+
video: { disabled: !1 },
|
|
77
|
+
image: { disabled: !1 }
|
|
78
|
+
},
|
|
79
|
+
required: !1
|
|
80
|
+
},
|
|
81
|
+
rationale: {
|
|
82
|
+
settings: !0,
|
|
83
|
+
label: "Rationale",
|
|
84
|
+
inputConfiguration: {
|
|
85
|
+
audio: { disabled: !1 },
|
|
86
|
+
video: { disabled: !1 },
|
|
87
|
+
image: { disabled: !1 }
|
|
88
|
+
},
|
|
89
|
+
required: !1
|
|
90
|
+
},
|
|
91
|
+
template: { inputConfiguration: {
|
|
92
|
+
audio: { disabled: !1 },
|
|
93
|
+
video: { disabled: !1 },
|
|
94
|
+
image: { disabled: !1 }
|
|
95
|
+
} },
|
|
96
|
+
maxImageWidth: {
|
|
97
|
+
teacherInstructions: 300,
|
|
98
|
+
prompt: 300,
|
|
99
|
+
rationale: 300
|
|
100
|
+
},
|
|
101
|
+
maxImageHeight: {
|
|
102
|
+
teacherInstructions: 300,
|
|
103
|
+
prompt: 300,
|
|
104
|
+
rationale: 300
|
|
105
|
+
},
|
|
106
|
+
mathMlOptions: {
|
|
107
|
+
mmlOutput: !1,
|
|
108
|
+
mmlEditing: !1
|
|
109
|
+
},
|
|
110
|
+
language: {
|
|
111
|
+
settings: !1,
|
|
112
|
+
label: "Specify Language",
|
|
113
|
+
enabled: !1
|
|
114
|
+
},
|
|
115
|
+
languageChoices: {
|
|
116
|
+
label: "Language Choices",
|
|
117
|
+
options: []
|
|
118
|
+
},
|
|
119
|
+
maxResponseAreas: 10
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { e as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/math-templated/configure/src/design.jsx
|
|
3
|
+
* @auto-generated
|
|
4
|
+
*
|
|
5
|
+
* This file is automatically synced from pie-elements and converted to TypeScript.
|
|
6
|
+
* Manual edits will be overwritten on next sync.
|
|
7
|
+
* To make changes, edit the upstream JavaScript file and run sync again.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class Design extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
model: PropTypes.Validator<object>;
|
|
14
|
+
configuration: PropTypes.Validator<object>;
|
|
15
|
+
onModelChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
16
|
+
onConfigurationChanged: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
|
|
18
|
+
add: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
delete: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
+
}>>;
|
|
21
|
+
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
22
|
+
};
|
|
23
|
+
state: {};
|
|
24
|
+
componentDidMount(): void;
|
|
25
|
+
handleChange: any;
|
|
26
|
+
onResponseChange: any;
|
|
27
|
+
onResponseDone: any;
|
|
28
|
+
onChangeResponse: any;
|
|
29
|
+
onResponsesChanged: any;
|
|
30
|
+
onChange: any;
|
|
31
|
+
onHandleAreaChange: import("@pie-element/shared-lodash").CancelableFunction<(nodes: any) => void>;
|
|
32
|
+
onBlur: any;
|
|
33
|
+
render(): React.JSX.Element;
|
|
34
|
+
}
|
|
35
|
+
export default Design;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { Response as e } from "./response.js";
|
|
2
|
+
import { createSlateMarkup as t, processMarkup as n } from "./markupUtils.js";
|
|
3
|
+
import { generateValidationMessage as r } from "./utils.js";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import a from "prop-types";
|
|
6
|
+
import { cloneDeep as o, pick as s, throttle as c } from "@pie-element/shared-lodash";
|
|
7
|
+
import { styled as l } from "@mui/material/styles";
|
|
8
|
+
import u from "@mui/material/Tooltip";
|
|
9
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
import p from "@mui/material/Typography";
|
|
11
|
+
import m from "@mui/material/Select";
|
|
12
|
+
import h from "@mui/material/MenuItem";
|
|
13
|
+
import g from "@mui/icons-material/Info";
|
|
14
|
+
import { InputContainer as _, layout as ee, settings as v } from "@pie-lib/config-ui";
|
|
15
|
+
import y, { ALL_PLUGINS as b } from "@pie-lib/editable-html-tip-tap";
|
|
16
|
+
//#region src/author/design.tsx
|
|
17
|
+
var { dropdown: te } = v, { Panel: ne, toggle: x } = v, S = l(_)(({ theme: e }) => ({
|
|
18
|
+
width: "100%",
|
|
19
|
+
paddingTop: e.spacing(2),
|
|
20
|
+
marginBottom: e.spacing(2)
|
|
21
|
+
})), C = l(y)({ width: "100%" }), w = l("div")(({ theme: e }) => ({
|
|
22
|
+
color: e.palette.error.main,
|
|
23
|
+
fontSize: "0.75rem",
|
|
24
|
+
marginTop: e.spacing(1)
|
|
25
|
+
})), T = l("div")(({ theme: e }) => ({
|
|
26
|
+
color: e.palette.error.main,
|
|
27
|
+
fontSize: "0.75rem",
|
|
28
|
+
marginBottom: e.spacing(1)
|
|
29
|
+
})), re = l(y)(({ theme: e }) => ({
|
|
30
|
+
width: "100%",
|
|
31
|
+
marginTop: e.spacing(2),
|
|
32
|
+
marginBottom: e.spacing(3)
|
|
33
|
+
})), ie = l(_)(({ theme: e }) => ({
|
|
34
|
+
width: "100%",
|
|
35
|
+
marginTop: e.spacing(2),
|
|
36
|
+
"& > *:not(label)": { marginTop: e.spacing(1) },
|
|
37
|
+
marginBottom: e.spacing(2)
|
|
38
|
+
})), ae = l(m)({ width: "100%" }), E = l(p)(({ theme: e }) => ({
|
|
39
|
+
fontSize: e.typography.fontSize * 1.25,
|
|
40
|
+
fontWeight: "bold"
|
|
41
|
+
})), D = l("div")({
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
gap: "8px"
|
|
45
|
+
}), oe = l(u)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
|
|
46
|
+
fontSize: e.typography.fontSize - 2,
|
|
47
|
+
whiteSpace: "pre",
|
|
48
|
+
maxWidth: "500px"
|
|
49
|
+
} })), O = (e) => {
|
|
50
|
+
let t = document.createElement("div");
|
|
51
|
+
return t.innerHTML = e.trim(), t;
|
|
52
|
+
}, k = class extends i.Component {
|
|
53
|
+
static propTypes = {
|
|
54
|
+
model: a.object.isRequired,
|
|
55
|
+
configuration: a.object.isRequired,
|
|
56
|
+
onModelChanged: a.func.isRequired,
|
|
57
|
+
onConfigurationChanged: a.func.isRequired,
|
|
58
|
+
imageSupport: a.shape({
|
|
59
|
+
add: a.func.isRequired,
|
|
60
|
+
delete: a.func.isRequired
|
|
61
|
+
}),
|
|
62
|
+
uploadSoundSupport: a.object
|
|
63
|
+
};
|
|
64
|
+
state = {};
|
|
65
|
+
componentDidMount() {
|
|
66
|
+
let { model: { slateMarkup: e } } = this.props;
|
|
67
|
+
this.setState({ markup: e });
|
|
68
|
+
}
|
|
69
|
+
handleChange = (e, t) => {
|
|
70
|
+
let { onModelChanged: n, model: r } = this.props, i = o(r);
|
|
71
|
+
i[e] = t, n(i);
|
|
72
|
+
};
|
|
73
|
+
onResponseChange = (e, t) => {
|
|
74
|
+
let { model: n, onModelChanged: r } = this.props, i = { ...n };
|
|
75
|
+
i.responses[t] = e, r(i);
|
|
76
|
+
};
|
|
77
|
+
onResponseDone = () => {
|
|
78
|
+
let { model: e, onModelChanged: n } = this.props;
|
|
79
|
+
n({
|
|
80
|
+
...e,
|
|
81
|
+
slateMarkup: t(e.markup, e.responses)
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
onChangeResponse = (e, t) => {
|
|
85
|
+
let { model: n, onModelChanged: r } = this.props, { responses: i } = n;
|
|
86
|
+
i[e] ? i[e][0].answer = t || "" : i[e] = [{
|
|
87
|
+
answer: t || "",
|
|
88
|
+
id: "response" + e,
|
|
89
|
+
allowSpaces: !0
|
|
90
|
+
}], r({
|
|
91
|
+
...n,
|
|
92
|
+
responses: i
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
onResponsesChanged = (e) => {
|
|
96
|
+
this.props.onModelChanged({
|
|
97
|
+
...this.props.model,
|
|
98
|
+
responses: e
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
onChange = (e) => {
|
|
102
|
+
let { model: { responses: t, validationDefault: r, allowTrailingZerosDefault: i, ignoreOrderDefault: a }, onModelChanged: o } = this.props, s = {}, c = O(e);
|
|
103
|
+
c.querySelectorAll("[data-type=\"math_templated\"]").forEach((e, n) => {
|
|
104
|
+
let { value: o, index: c } = e.dataset;
|
|
105
|
+
o || (e.dataset.value = ""), s[n] = t[c] || {
|
|
106
|
+
allowSpaces: !0,
|
|
107
|
+
validation: r || "symbolic",
|
|
108
|
+
allowTrailingZeros: i || !1,
|
|
109
|
+
ignoreOrder: a || !1,
|
|
110
|
+
answer: "",
|
|
111
|
+
alternates: {}
|
|
112
|
+
}, e.dataset.index = n.toString();
|
|
113
|
+
});
|
|
114
|
+
let l = n(e);
|
|
115
|
+
this.setState({ cachedResponses: void 0 }, () => o({
|
|
116
|
+
...this.props.model,
|
|
117
|
+
slateMarkup: c.innerHTML,
|
|
118
|
+
responses: s,
|
|
119
|
+
markup: l
|
|
120
|
+
}));
|
|
121
|
+
};
|
|
122
|
+
onHandleAreaChange = c((e) => {
|
|
123
|
+
let { model: { responses: t }, onModelChanged: n } = this.props, { cachedResponses: r } = this.state;
|
|
124
|
+
if (!e) return;
|
|
125
|
+
let i = t ? o(t) : {}, a = r ? o(r) : {};
|
|
126
|
+
e.forEach((e) => {
|
|
127
|
+
let t = e.index;
|
|
128
|
+
!i[t] && a[t] ? (Object.assign(i, s(a, t)), Object.prototype.hasOwnProperty.call(a, t) && delete a[t]) : (Object.assign(a, s(i, t)), Object.prototype.hasOwnProperty.call(i, t) && delete i[t]);
|
|
129
|
+
}), this.setState({ cachedResponses: a }, () => n({
|
|
130
|
+
...this.props.model,
|
|
131
|
+
responses: i
|
|
132
|
+
}));
|
|
133
|
+
}, 500, {
|
|
134
|
+
trailing: !1,
|
|
135
|
+
leading: !0
|
|
136
|
+
});
|
|
137
|
+
onBlur = (e) => {
|
|
138
|
+
let { relatedTarget: t, currentTarget: n } = e || {};
|
|
139
|
+
function r(e, t = 0) {
|
|
140
|
+
if (!e || t >= 16) return null;
|
|
141
|
+
let n = e.offsetParent;
|
|
142
|
+
return n ? n.getAttribute("role") === "tooltip" ? n : r(n, t + 1) : null;
|
|
143
|
+
}
|
|
144
|
+
function i(e, t = 0) {
|
|
145
|
+
if (!e || t >= 4) return null;
|
|
146
|
+
let n = e?.children?.[0];
|
|
147
|
+
return n ? n.attributes && n.attributes["data-keypad"] ? n : i(n, t + 1) : null;
|
|
148
|
+
}
|
|
149
|
+
let a = r(t), o = a ? i(a) : null;
|
|
150
|
+
(!t || !n || !o?.attributes["data-keypad"]) && this.setState({ activeAnswerBlock: "" });
|
|
151
|
+
};
|
|
152
|
+
render() {
|
|
153
|
+
let { configuration: t, imageSupport: n, model: i, onConfigurationChanged: a, onModelChanged: o, uploadSoundSupport: s } = this.props, { baseInputConfiguration: c = {}, contentDimensions: l = {}, prompt: u = {}, rationale: p = {}, settingsPanelDisabled: m, teacherInstructions: _ = {}, language: v = {}, languageChoices: y = {}, spellCheck: O = {}, playerSpellCheck: k = {}, maxImageWidth: A = {}, maxImageHeight: j = {}, mathMlOptions: M = {}, template: se = {}, editSource: N = {}, ignoreOrder: ce = {}, allowTrailingZeros: le = {}, partialScoring: P = {}, maxResponseAreas: F } = t || {}, { errors: I, extraCSSRules: L, promptEnabled: R, rationaleEnabled: z, spellCheckEnabled: B, teacherInstructionsEnabled: V, toolbarEditorPosition: H, responses: U, equationEditor: W } = i || {}, { prompt: G, rationale: K, responseAreas: q, teacherInstructions: J, responses: Y = {} } = I || {}, ue = r(t), de = {
|
|
154
|
+
"language.enabled": v.settings && x(v.label, !0),
|
|
155
|
+
language: v.settings && v.enabled && te(y.label, y.options)
|
|
156
|
+
}, fe = {
|
|
157
|
+
teacherInstructionsEnabled: _.settings && x(_.label),
|
|
158
|
+
rationaleEnabled: p.settings && x(p.label),
|
|
159
|
+
promptEnabled: u.settings && x(u.label),
|
|
160
|
+
spellCheckEnabled: O.settings && x(O.label),
|
|
161
|
+
playerSpellCheckEnabled: k.settings && x(k.label),
|
|
162
|
+
"editSource.enabled": N?.settings && x(N.label, !0),
|
|
163
|
+
partialScoring: P.settings && x(P.label)
|
|
164
|
+
}, X = A && A.prompt, Z = j && j.prompt, Q = { position: H === "top" ? "top" : "bottom" }, $ = (e = {}, t = {}) => ({
|
|
165
|
+
...t,
|
|
166
|
+
...e
|
|
167
|
+
});
|
|
168
|
+
return /* @__PURE__ */ f(ee.ConfigLayout, {
|
|
169
|
+
extraCSSRules: L,
|
|
170
|
+
dimensions: l,
|
|
171
|
+
hideSettings: m,
|
|
172
|
+
settings: /* @__PURE__ */ d(ne, {
|
|
173
|
+
model: i,
|
|
174
|
+
configuration: t,
|
|
175
|
+
onChangeModel: (e) => o(e),
|
|
176
|
+
onChangeConfiguration: a,
|
|
177
|
+
groups: {
|
|
178
|
+
Settings: de,
|
|
179
|
+
Properties: fe
|
|
180
|
+
}
|
|
181
|
+
}),
|
|
182
|
+
children: [
|
|
183
|
+
V && /* @__PURE__ */ f(S, {
|
|
184
|
+
label: _.label,
|
|
185
|
+
children: [/* @__PURE__ */ d(C, {
|
|
186
|
+
markup: i.teacherInstructions || "",
|
|
187
|
+
onChange: (e) => this.handleChange("teacherInstructions", e),
|
|
188
|
+
imageSupport: n,
|
|
189
|
+
nonEmpty: !1,
|
|
190
|
+
error: J,
|
|
191
|
+
toolbarOpts: Q,
|
|
192
|
+
pluginProps: $(_?.inputConfiguration, c),
|
|
193
|
+
spellCheck: B,
|
|
194
|
+
maxImageWidth: A && A.teacherInstructions || X,
|
|
195
|
+
maxImageHeight: j && j.teacherInstructions || Z,
|
|
196
|
+
uploadSoundSupport: s,
|
|
197
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
198
|
+
mathMlOptions: M
|
|
199
|
+
}), J && /* @__PURE__ */ d(w, { children: J })]
|
|
200
|
+
}),
|
|
201
|
+
R && /* @__PURE__ */ f(S, {
|
|
202
|
+
label: u.label,
|
|
203
|
+
children: [/* @__PURE__ */ d(C, {
|
|
204
|
+
markup: i.prompt,
|
|
205
|
+
onChange: (e) => this.handleChange("prompt", e),
|
|
206
|
+
imageSupport: n,
|
|
207
|
+
nonEmpty: !1,
|
|
208
|
+
disableUnderline: !0,
|
|
209
|
+
error: G,
|
|
210
|
+
toolbarOpts: Q,
|
|
211
|
+
pluginProps: $(_?.inputConfiguration, c),
|
|
212
|
+
spellCheck: B,
|
|
213
|
+
maxImageWidth: X,
|
|
214
|
+
maxImageHeight: Z,
|
|
215
|
+
uploadSoundSupport: s,
|
|
216
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
217
|
+
mathMlOptions: M
|
|
218
|
+
}), G && /* @__PURE__ */ d(w, { children: G })]
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ f(D, { children: [/* @__PURE__ */ d(E, {
|
|
221
|
+
component: "div",
|
|
222
|
+
children: "Response Template"
|
|
223
|
+
}), /* @__PURE__ */ d(oe, {
|
|
224
|
+
disableFocusListener: !0,
|
|
225
|
+
disableTouchListener: !0,
|
|
226
|
+
placement: "right",
|
|
227
|
+
title: ue,
|
|
228
|
+
children: /* @__PURE__ */ d(g, {
|
|
229
|
+
fontSize: "small",
|
|
230
|
+
color: "primary"
|
|
231
|
+
})
|
|
232
|
+
})] }),
|
|
233
|
+
/* @__PURE__ */ d(re, {
|
|
234
|
+
activePlugins: b,
|
|
235
|
+
toolbarOpts: { position: "top" },
|
|
236
|
+
spellCheck: B,
|
|
237
|
+
pluginProps: $(se?.inputConfiguration, c),
|
|
238
|
+
responseAreaProps: {
|
|
239
|
+
type: "math-templated",
|
|
240
|
+
respAreaToolbar: null,
|
|
241
|
+
error: () => Y,
|
|
242
|
+
onHandleAreaChange: this.onHandleAreaChange,
|
|
243
|
+
maxResponseAreas: F
|
|
244
|
+
},
|
|
245
|
+
markup: i.slateMarkup,
|
|
246
|
+
onChange: this.onChange,
|
|
247
|
+
imageSupport: n,
|
|
248
|
+
disableImageAlignmentButtons: !0,
|
|
249
|
+
onBlur: this.onBlur,
|
|
250
|
+
disabled: !1,
|
|
251
|
+
highlightShape: !1,
|
|
252
|
+
error: q,
|
|
253
|
+
uploadSoundSupport: s,
|
|
254
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
255
|
+
mathMlOptions: M
|
|
256
|
+
}),
|
|
257
|
+
q && /* @__PURE__ */ d(T, { children: q }),
|
|
258
|
+
/* @__PURE__ */ d(E, { children: "Define Response" }),
|
|
259
|
+
/* @__PURE__ */ d(ie, {
|
|
260
|
+
label: "Response Template Equation Editor",
|
|
261
|
+
children: /* @__PURE__ */ f(ae, {
|
|
262
|
+
MenuProps: { transitionDuration: {
|
|
263
|
+
enter: 225,
|
|
264
|
+
exit: 195
|
|
265
|
+
} },
|
|
266
|
+
onChange: (e) => this.handleChange("equationEditor", e.target.value),
|
|
267
|
+
value: W,
|
|
268
|
+
children: [
|
|
269
|
+
/* @__PURE__ */ d(h, {
|
|
270
|
+
value: "non-negative-integers",
|
|
271
|
+
children: "Numeric - Non-Negative Integers"
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ d(h, {
|
|
274
|
+
value: "integers",
|
|
275
|
+
children: "Numeric - Integers"
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ d(h, {
|
|
278
|
+
value: "decimals",
|
|
279
|
+
children: "Numeric - Decimals"
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ d(h, {
|
|
282
|
+
value: "fractions",
|
|
283
|
+
children: "Numeric - Fractions"
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ d(h, {
|
|
286
|
+
value: 1,
|
|
287
|
+
children: "Grade 1 - 2"
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ d(h, {
|
|
290
|
+
value: 3,
|
|
291
|
+
children: "Grade 3 - 5"
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ d(h, {
|
|
294
|
+
value: 6,
|
|
295
|
+
children: "Grade 6 - 7"
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ d(h, {
|
|
298
|
+
value: 8,
|
|
299
|
+
children: "Grade 8 - HS"
|
|
300
|
+
}),
|
|
301
|
+
/* @__PURE__ */ d(h, {
|
|
302
|
+
value: "geometry",
|
|
303
|
+
children: "Geometry"
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ d(h, {
|
|
306
|
+
value: "advanced-algebra",
|
|
307
|
+
children: "Advanced Algebra"
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ d(h, {
|
|
310
|
+
value: "statistics",
|
|
311
|
+
children: "Statistics"
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ d(h, {
|
|
314
|
+
value: "item-authoring",
|
|
315
|
+
children: "Item Authoring"
|
|
316
|
+
})
|
|
317
|
+
]
|
|
318
|
+
})
|
|
319
|
+
}),
|
|
320
|
+
Object.keys(U || {}).map((t, n) => {
|
|
321
|
+
let r = U[n];
|
|
322
|
+
return r ? /* @__PURE__ */ d(e, {
|
|
323
|
+
responseKey: n,
|
|
324
|
+
mode: W,
|
|
325
|
+
response: r,
|
|
326
|
+
onResponseChange: this.onResponseChange,
|
|
327
|
+
onResponseDone: this.onResponseDone,
|
|
328
|
+
index: n,
|
|
329
|
+
cIgnoreOrder: ce,
|
|
330
|
+
cAllowTrailingZeros: le,
|
|
331
|
+
error: Y && Y[n]
|
|
332
|
+
}, n) : null;
|
|
333
|
+
}),
|
|
334
|
+
z && /* @__PURE__ */ f(S, {
|
|
335
|
+
label: p.label,
|
|
336
|
+
children: [/* @__PURE__ */ d(C, {
|
|
337
|
+
markup: i.rationale || "",
|
|
338
|
+
onChange: (e) => this.handleChange("rationale", e),
|
|
339
|
+
imageSupport: n,
|
|
340
|
+
nonEmpty: !1,
|
|
341
|
+
error: K,
|
|
342
|
+
toolbarOpts: Q,
|
|
343
|
+
pluginProps: $(p?.inputConfiguration, {
|
|
344
|
+
...c,
|
|
345
|
+
math: { controlledKeypadMode: !1 }
|
|
346
|
+
}),
|
|
347
|
+
spellCheck: B,
|
|
348
|
+
maxImageWidth: A && A.rationale || X,
|
|
349
|
+
maxImageHeight: j && j.rationale || Z,
|
|
350
|
+
uploadSoundSupport: s,
|
|
351
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
352
|
+
mathMlOptions: M
|
|
353
|
+
}), K && /* @__PURE__ */ d(w, { children: K })]
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
//#endregion
|
|
360
|
+
export { k as Design, k as default };
|