@pie-element/graphing-solution-set 6.1.1 → 6.1.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/configure.d.ts +26 -0
- package/dist/author/configure.js +190 -0
- package/dist/author/correct-response.d.ts +33 -0
- package/dist/author/correct-response.js +206 -0
- package/dist/author/defaults.d.ts +238 -0
- package/dist/author/defaults.js +339 -0
- package/dist/author/graphing-config.d.ts +33 -0
- package/dist/author/graphing-config.js +237 -0
- package/dist/author/index.d.ts +62 -0
- package/dist/author/index.js +87 -0
- package/dist/author/utils.d.ts +46 -0
- package/dist/author/utils.js +474 -0
- package/dist/browser/author/index.js +1942 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/browser-pUycHh7Y.js +348 -0
- package/dist/browser/browser-pUycHh7Y.js.map +1 -0
- package/dist/browser/controller/index.js +193 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +782 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-BxTk7Laj.js +57671 -0
- package/dist/browser/dist-BxTk7Laj.js.map +1 -0
- package/dist/browser/graphing-solution-set.css +2 -0
- package/dist/controller/defaults.d.ts +64 -0
- package/dist/controller/defaults.js +54 -0
- package/dist/controller/index.d.ts +24 -0
- package/dist/controller/index.js +110 -0
- package/dist/controller/utils.d.ts +20 -0
- package/dist/controller/utils.js +39 -0
- package/dist/delivery/index.d.ts +22 -0
- package/dist/delivery/index.js +62 -0
- package/dist/delivery/main.d.ts +31 -0
- package/dist/delivery/main.js +198 -0
- package/dist/delivery/utils.d.ts +12 -0
- package/dist/delivery/utils.js +220 -0
- package/dist/graphing-solution-set.css +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +405 -0
- package/dist/index.js +2 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +86 -23
- package/CHANGELOG.json +0 -1
- package/CHANGELOG.md +0 -850
- package/LICENSE.md +0 -5
- package/README.md +0 -20
- package/configure/CHANGELOG.json +0 -1
- package/configure/CHANGELOG.md +0 -810
- package/configure/lib/configure.js +0 -312
- package/configure/lib/configure.js.map +0 -1
- package/configure/lib/correct-response.js +0 -435
- package/configure/lib/correct-response.js.map +0 -1
- package/configure/lib/defaults.js +0 -357
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/graphing-config.js +0 -408
- package/configure/lib/graphing-config.js.map +0 -1
- package/configure/lib/index.js +0 -163
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/utils.js +0 -630
- package/configure/lib/utils.js.map +0 -1
- package/configure/package.json +0 -29
- package/controller/CHANGELOG.json +0 -1
- package/controller/CHANGELOG.md +0 -675
- package/controller/lib/defaults.js +0 -69
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -351
- package/controller/lib/index.js.map +0 -1
- package/controller/lib/utils.js +0 -212
- package/controller/lib/utils.js.map +0 -1
- package/controller/package.json +0 -22
- package/demo-gss.gif +0 -0
- package/docs/config-schema.json +0 -1560
- package/docs/config-schema.json.md +0 -1114
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -54
- package/docs/demo/index.html +0 -1
- package/docs/demo/session.js +0 -6
- package/docs/pie-schema.json +0 -1800
- package/docs/pie-schema.json.md +0 -952
- package/lib/index.js +0 -164
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -355
- package/lib/main.js.map +0 -1
- package/lib/utils.js +0 -515
- package/lib/utils.js.map +0 -1
package/configure.js
ADDED
package/controller.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/controller/index.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/graphing-solution-set/configure/src/configure.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 Configure extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
+
onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
15
|
+
imageSupport: PropTypes.Requireable<object>;
|
|
16
|
+
uploadSoundSupport: PropTypes.Requireable<object>;
|
|
17
|
+
model: PropTypes.Validator<object>;
|
|
18
|
+
configuration: PropTypes.Validator<object>;
|
|
19
|
+
};
|
|
20
|
+
componentDidMount(): void;
|
|
21
|
+
onRationaleChange: any;
|
|
22
|
+
onPromptChange: any;
|
|
23
|
+
onTeacherInstructionsChange: any;
|
|
24
|
+
render(): React.JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export default Configure;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import e from "./graphing-config.js";
|
|
2
|
+
import t from "./correct-response.js";
|
|
3
|
+
import n from "react";
|
|
4
|
+
import r from "prop-types";
|
|
5
|
+
import { styled as i } from "@mui/material/styles";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
import { InputContainer as s, layout as c, settings as l } from "@pie-lib/config-ui";
|
|
8
|
+
import u from "debug";
|
|
9
|
+
import d from "@mui/material/Typography";
|
|
10
|
+
import f from "@pie-lib/editable-html-tip-tap";
|
|
11
|
+
//#region src/author/configure.tsx
|
|
12
|
+
var { Panel: p, toggle: m, radio: h, checkboxes: g, textField: _, dropdown: v } = l;
|
|
13
|
+
u("@pie-element:graphing-solution-set:configure");
|
|
14
|
+
var y = i(s)(({ theme: e }) => ({
|
|
15
|
+
width: "100%",
|
|
16
|
+
paddingTop: e.spacing(2),
|
|
17
|
+
marginBottom: e.spacing(2),
|
|
18
|
+
marginTop: e.spacing(2)
|
|
19
|
+
})), b = i(d)(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), x = class extends n.Component {
|
|
20
|
+
static propTypes = {
|
|
21
|
+
onModelChanged: r.func,
|
|
22
|
+
onConfigurationChanged: r.func,
|
|
23
|
+
imageSupport: r.object,
|
|
24
|
+
uploadSoundSupport: r.object,
|
|
25
|
+
model: r.object.isRequired,
|
|
26
|
+
configuration: r.object.isRequired
|
|
27
|
+
};
|
|
28
|
+
componentDidMount() {
|
|
29
|
+
let { configuration: e, onModelChanged: t, model: n } = this.props, { title: r, graphDimensions: i } = e || {}, { arrows: a, titleEnabled: o, dimensionsEnabled: s } = n || {};
|
|
30
|
+
typeof a == "boolean" && (a = a ? {
|
|
31
|
+
left: !0,
|
|
32
|
+
right: !0,
|
|
33
|
+
up: !0,
|
|
34
|
+
down: !0
|
|
35
|
+
} : {
|
|
36
|
+
left: !1,
|
|
37
|
+
right: !1,
|
|
38
|
+
up: !1,
|
|
39
|
+
down: !1
|
|
40
|
+
});
|
|
41
|
+
let c = o ?? r.enabled, l = s ?? i.enabled;
|
|
42
|
+
t && t({
|
|
43
|
+
...n,
|
|
44
|
+
arrows: a,
|
|
45
|
+
titleEnabled: c,
|
|
46
|
+
dimensionsEnabled: l
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
onRationaleChange = (e) => {
|
|
50
|
+
let { onModelChanged: t, model: n } = this.props;
|
|
51
|
+
t({
|
|
52
|
+
...n,
|
|
53
|
+
rationale: e
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
onPromptChange = (e) => {
|
|
57
|
+
let { onModelChanged: t, model: n } = this.props;
|
|
58
|
+
t({
|
|
59
|
+
...n,
|
|
60
|
+
prompt: e
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
onTeacherInstructionsChange = (e) => {
|
|
64
|
+
let { onModelChanged: t, model: n } = this.props;
|
|
65
|
+
t({
|
|
66
|
+
...n,
|
|
67
|
+
teacherInstructions: e
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
render() {
|
|
71
|
+
let { model: n, configuration: r, onConfigurationChanged: i, onModelChanged: s, imageSupport: l, uploadSoundSupport: u } = this.props, { arrows: d = {}, authoring: x = {}, coordinatesOnHover: S = {}, contentDimensions: C = {}, gridConfigurations: w = [], graphDimensions: T = {}, instruction: E = {}, labels: D = {}, padding: O = {}, prompt: k = {}, rationale: A = {}, scoringType: j = {}, settingsPanelDisabled: M, spellCheck: N = {}, studentInstructions: P = {}, teacherInstructions: F = {}, title: I = {}, maxImageWidth: L = {}, maxImageHeight: R = {}, withRubric: z = {}, language: B = {}, languageChoices: V = {}, mathMlOptions: H = {} } = r || {}, { errors: U = {}, extraCSSRules: W, labelsEnabled: G, dimensionsEnabled: K, promptEnabled: q, rationaleEnabled: J, spellCheckEnabled: Y, teacherInstructionsEnabled: X, titleEnabled: Z } = n || {}, Q = L && L.prompt, $ = R && R.prompt, ee = {
|
|
72
|
+
top: D.top,
|
|
73
|
+
right: D.right,
|
|
74
|
+
bottom: D.bottom,
|
|
75
|
+
left: D.left
|
|
76
|
+
}, te = {
|
|
77
|
+
arrows: d.settings && g(d.label, {
|
|
78
|
+
left: d.left,
|
|
79
|
+
right: d.right,
|
|
80
|
+
up: d.up,
|
|
81
|
+
down: d.down
|
|
82
|
+
}),
|
|
83
|
+
titleEnabled: I.settings && m(I.label),
|
|
84
|
+
padding: O.settings && m(O.label),
|
|
85
|
+
labelsEnabled: D.settings && m(D.label),
|
|
86
|
+
"language.enabled": B.settings && m(B.label, !0),
|
|
87
|
+
language: B.settings && B.enabled && v(V.label, V.options),
|
|
88
|
+
dimensionsEnabled: T.settings && m(T.label),
|
|
89
|
+
coordinatesOnHover: S.settings && m(S.label)
|
|
90
|
+
}, ne = {
|
|
91
|
+
"authoring.enabled": x.settings && m(x.label, !0),
|
|
92
|
+
teacherInstructionsEnabled: F.settings && m(F.label),
|
|
93
|
+
studentInstructionsEnabled: P.settings && m(P.label),
|
|
94
|
+
promptEnabled: k.settings && m(k.label),
|
|
95
|
+
rationaleEnabled: A.settings && m(A.label),
|
|
96
|
+
spellCheckEnabled: N.settings && m(N.label),
|
|
97
|
+
scoringType: j.settings && h(j.label, ["dichotomous", "partial scoring"]),
|
|
98
|
+
rubricEnabled: z?.settings && m(z?.label),
|
|
99
|
+
instruction: E.settings && _(E.label)
|
|
100
|
+
};
|
|
101
|
+
return /* @__PURE__ */ o(c.ConfigLayout, {
|
|
102
|
+
extraCSSRules: W,
|
|
103
|
+
dimensions: C,
|
|
104
|
+
hideSettings: M,
|
|
105
|
+
settings: /* @__PURE__ */ a(p, {
|
|
106
|
+
model: n,
|
|
107
|
+
configuration: r,
|
|
108
|
+
onChangeModel: s,
|
|
109
|
+
onChangeConfiguration: i,
|
|
110
|
+
groups: {
|
|
111
|
+
Settings: te,
|
|
112
|
+
Properties: ne
|
|
113
|
+
}
|
|
114
|
+
}),
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ a(b, {
|
|
117
|
+
component: "div",
|
|
118
|
+
variant: "body1",
|
|
119
|
+
children: E?.label || ""
|
|
120
|
+
}),
|
|
121
|
+
X && /* @__PURE__ */ a(y, {
|
|
122
|
+
label: F.label,
|
|
123
|
+
children: /* @__PURE__ */ a(f, {
|
|
124
|
+
markup: n.teacherInstructions || "",
|
|
125
|
+
onChange: this.onTeacherInstructionsChange,
|
|
126
|
+
imageSupport: l,
|
|
127
|
+
nonEmpty: !1,
|
|
128
|
+
spellCheck: Y,
|
|
129
|
+
maxImageWidth: L && L.teacherInstructions || Q,
|
|
130
|
+
maxImageHeight: R && R.teacherInstructions || $,
|
|
131
|
+
uploadSoundSupport: u,
|
|
132
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
133
|
+
mathMlOptions: H
|
|
134
|
+
})
|
|
135
|
+
}),
|
|
136
|
+
q && /* @__PURE__ */ a(y, {
|
|
137
|
+
label: k.label,
|
|
138
|
+
children: /* @__PURE__ */ a(f, {
|
|
139
|
+
markup: n.prompt,
|
|
140
|
+
onChange: this.onPromptChange,
|
|
141
|
+
imageSupport: l,
|
|
142
|
+
nonEmpty: !1,
|
|
143
|
+
spellCheck: Y,
|
|
144
|
+
disableUnderline: !0,
|
|
145
|
+
maxImageWidth: Q,
|
|
146
|
+
maxImageHeight: $,
|
|
147
|
+
uploadSoundSupport: u,
|
|
148
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
149
|
+
mathMlOptions: H
|
|
150
|
+
})
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ a(e, {
|
|
153
|
+
authoring: x,
|
|
154
|
+
gridConfigurations: w,
|
|
155
|
+
graphDimensions: T,
|
|
156
|
+
labelsPlaceholders: ee,
|
|
157
|
+
model: n,
|
|
158
|
+
showLabels: G,
|
|
159
|
+
dimensionsEnabled: K,
|
|
160
|
+
showTitle: Z,
|
|
161
|
+
titlePlaceholder: I.placeholder,
|
|
162
|
+
onChange: this.props.onModelChanged,
|
|
163
|
+
mathMlOptions: H
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ a(t, {
|
|
166
|
+
errors: U,
|
|
167
|
+
model: n,
|
|
168
|
+
onChange: this.props.onModelChanged,
|
|
169
|
+
mathMlOptions: H
|
|
170
|
+
}),
|
|
171
|
+
J && /* @__PURE__ */ a(y, {
|
|
172
|
+
label: A.label || "Rationale",
|
|
173
|
+
children: /* @__PURE__ */ a(f, {
|
|
174
|
+
markup: n.rationale || "",
|
|
175
|
+
onChange: this.onRationaleChange,
|
|
176
|
+
imageSupport: l,
|
|
177
|
+
spellCheck: Y,
|
|
178
|
+
maxImageWidth: L && L.rationale || Q,
|
|
179
|
+
maxImageHeight: R && R.rationale || $,
|
|
180
|
+
uploadSoundSupport: u,
|
|
181
|
+
languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
|
|
182
|
+
mathMlOptions: H
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
//#endregion
|
|
190
|
+
export { x as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/graphing-solution-set/configure/src/correct-response.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 * as React from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
export declare class CorrectResponse extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
errors: PropTypes.Requireable<object>;
|
|
14
|
+
model: PropTypes.Validator<object>;
|
|
15
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
16
|
+
};
|
|
17
|
+
state: {
|
|
18
|
+
dialog: {
|
|
19
|
+
open: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
handleAlertDialog: (open: any, callback: any) => void;
|
|
23
|
+
changeMarks: any;
|
|
24
|
+
onResetClick: any;
|
|
25
|
+
changeNumberOfLines: any;
|
|
26
|
+
changeLine: any;
|
|
27
|
+
onSolutionSetSelected: any;
|
|
28
|
+
onChangeGssLineData: any;
|
|
29
|
+
handleGssLineDataChange: any;
|
|
30
|
+
updateModel: any;
|
|
31
|
+
render(): React.JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
export default CorrectResponse;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { checkIfLinesAreAdded as e, findSectionsInSolutionSet as t, pointInsidePolygon as n } from "./utils.js";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import i from "prop-types";
|
|
4
|
+
import { styled as a } from "@mui/material/styles";
|
|
5
|
+
import { GraphContainer as o } from "@pie-lib/graphing-solution-set";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { AlertDialog as l } from "@pie-lib/config-ui";
|
|
8
|
+
import { set as u } from "@pie-element/shared-lodash";
|
|
9
|
+
import { RadioGroup as d, Typography as f } from "@mui/material";
|
|
10
|
+
import p from "@mui/material/Radio";
|
|
11
|
+
import m from "@mui/material/FormControlLabel";
|
|
12
|
+
//#region src/author/correct-response.tsx
|
|
13
|
+
var h = a(f)(({ theme: e }) => ({
|
|
14
|
+
marginTop: e.spacing(1.5),
|
|
15
|
+
marginBottom: e.spacing(1)
|
|
16
|
+
})), g = a(m)({
|
|
17
|
+
height: "20px",
|
|
18
|
+
width: "fit-content",
|
|
19
|
+
padding: ".5rem 0"
|
|
20
|
+
}), _ = a(p)({ color: "#000000 !important" }), v = a("div")(({ theme: e }) => ({
|
|
21
|
+
fontSize: e.typography.fontSize - 2,
|
|
22
|
+
color: e.palette.error.main,
|
|
23
|
+
paddingTop: e.spacing(1)
|
|
24
|
+
})), y = class extends r.Component {
|
|
25
|
+
static propTypes = {
|
|
26
|
+
errors: i.object,
|
|
27
|
+
model: i.object.isRequired,
|
|
28
|
+
onChange: i.func.isRequired
|
|
29
|
+
};
|
|
30
|
+
state = { dialog: { open: !1 } };
|
|
31
|
+
handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
|
|
32
|
+
changeMarks = (e) => {
|
|
33
|
+
let { model: t, onChange: n } = this.props, { gssLineData: r } = t;
|
|
34
|
+
r.selectedTool === "lineA" && e.length > 0 && (e[0].fill = r.lineA.lineType), r.selectedTool === "lineB" && e.length > 1 && (e[1].fill = r.lineB.lineType), e.length === 0 && (r.selectedTool = "lineA", u(t, "gssLineData", r)), u(t, "answers.correctAnswer.marks", e), n(t);
|
|
35
|
+
};
|
|
36
|
+
onResetClick = () => {
|
|
37
|
+
let { model: e, onChange: t } = this.props, { gssLineData: n, answers: r } = e;
|
|
38
|
+
this.setState({ dialog: {
|
|
39
|
+
open: !0,
|
|
40
|
+
title: "Warning",
|
|
41
|
+
text: "This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?",
|
|
42
|
+
onConfirm: () => {
|
|
43
|
+
r.correctAnswer.marks = [], n.selectedTool = "lineA", n.lineA.lineType = "Solid", n.lineB && (n.lineB.lineType = "Solid"), u(e, "answers", r), u(e, "gssLineData", n), t(e), this.handleAlertDialog(!1);
|
|
44
|
+
},
|
|
45
|
+
onClose: () => this.handleAlertDialog(!1)
|
|
46
|
+
} });
|
|
47
|
+
};
|
|
48
|
+
changeNumberOfLines = (e, t) => {
|
|
49
|
+
let { model: n } = this.props;
|
|
50
|
+
n.gssLineData.selectedTool === "solutionSet" ? this.setState({ dialog: {
|
|
51
|
+
open: !0,
|
|
52
|
+
title: "Warning",
|
|
53
|
+
text: "Changing number of lines after adding solution set will remove added solution set. Are you sure you want to continue?",
|
|
54
|
+
onConfirm: () => {
|
|
55
|
+
this.changeLine(e, t), this.handleAlertDialog(!1);
|
|
56
|
+
},
|
|
57
|
+
onClose: () => this.handleAlertDialog(!1)
|
|
58
|
+
} }) : this.changeLine(e, t);
|
|
59
|
+
};
|
|
60
|
+
changeLine = (e, t) => {
|
|
61
|
+
let { model: n, onChange: r } = this.props, { answers: i } = n, a = n.gssLineData;
|
|
62
|
+
i.correctAnswer.marks = i.correctAnswer.marks.filter((e) => e.type !== "polygon"), Number.parseInt(t) === 1 ? (delete a.lineB, i.correctAnswer.marks.length > 1 && i.correctAnswer.marks.pop(), a.numberOfLines = 1, a.selectedTool = "lineA") : (a.numberOfLines = 2, i.correctAnswer.marks.length > 0 && (a.selectedTool = "lineB"), a.lineB = { lineType: "Solid" }), u(n, "answers", i), u(n, "gssLineData", a), r(n);
|
|
63
|
+
};
|
|
64
|
+
onSolutionSetSelected = (e) => {
|
|
65
|
+
let { model: t, onChange: r } = this.props, { answers: i, gssLineData: a } = t;
|
|
66
|
+
for (let t of a.sections) if (n(e, t)) {
|
|
67
|
+
let e = {
|
|
68
|
+
points: t,
|
|
69
|
+
building: !1,
|
|
70
|
+
type: "polygon",
|
|
71
|
+
closed: !0,
|
|
72
|
+
isSolution: !0
|
|
73
|
+
};
|
|
74
|
+
i.correctAnswer.marks = i.correctAnswer.marks.filter((e) => e.type !== "polygon"), i.correctAnswer.marks.push(e);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
u(t, "answers", i), r(t);
|
|
78
|
+
};
|
|
79
|
+
onChangeGssLineData = (n, r) => {
|
|
80
|
+
let { model: i } = this.props, { answers: a, domain: o, range: s } = i;
|
|
81
|
+
if (n.selectedTool === "solutionSet") {
|
|
82
|
+
let i = a.correctAnswer.marks.filter((e) => e.type !== "polygon");
|
|
83
|
+
if (!e(n, i)) n.selectedTool = r, this.setState({ dialog: {
|
|
84
|
+
open: !0,
|
|
85
|
+
title: "Warning",
|
|
86
|
+
text: "Please define the line(s) and then select a solution set for the item.",
|
|
87
|
+
onConfirm: () => this.handleAlertDialog(!1)
|
|
88
|
+
} });
|
|
89
|
+
else {
|
|
90
|
+
let e = a.correctAnswer.marks.filter((e) => e.type !== "polygon");
|
|
91
|
+
n = t(n, e, o, s);
|
|
92
|
+
}
|
|
93
|
+
this.handleGssLineDataChange(n, a);
|
|
94
|
+
} else {
|
|
95
|
+
let e = a.correctAnswer.marks.filter((e) => e.type === "polygon");
|
|
96
|
+
r === "solutionSet" && e.length > 0 ? this.setState({ dialog: {
|
|
97
|
+
open: !0,
|
|
98
|
+
title: "Warning",
|
|
99
|
+
text: "Changing a line after adding a solution set will clear your selected solution set. Click 'Clear Solution Set' to change the line. Otherwise, click 'Cancel'.",
|
|
100
|
+
onConfirm: () => {
|
|
101
|
+
a.correctAnswer.marks = a.correctAnswer.marks.filter((e) => e.type !== "polygon"), this.handleGssLineDataChange(n, a), this.handleAlertDialog(!1);
|
|
102
|
+
},
|
|
103
|
+
onConfirmText: "CLEAR SOLUTION SET",
|
|
104
|
+
onClose: () => {
|
|
105
|
+
n.selectedTool = r, this.handleGssLineDataChange(n, a), this.handleAlertDialog(!1);
|
|
106
|
+
}
|
|
107
|
+
} }) : this.handleGssLineDataChange(n, a);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
handleGssLineDataChange = (e, t) => {
|
|
111
|
+
let { model: n, onChange: r } = this.props;
|
|
112
|
+
t.correctAnswer.marks.length > 0 && t.correctAnswer.marks[0] && e.lineA && (t.correctAnswer.marks[0].fill = e.lineA.lineType), t.correctAnswer.marks.length > 1 && t.correctAnswer.marks[1] && e.lineB && (t.correctAnswer.marks[1].fill = e.lineB.lineType), (e.selectedTool === "lineB" && t.correctAnswer.marks.length === 0 || e.selectedTool === "lineB" && t.correctAnswer.marks[0].building) && (this.setState({ dialog: {
|
|
113
|
+
open: !0,
|
|
114
|
+
title: "Warning",
|
|
115
|
+
text: "Please add Line A to the graph before adding Line B",
|
|
116
|
+
onConfirm: () => this.handleAlertDialog(!1)
|
|
117
|
+
} }), e.selectedTool = "lineA"), e.selectedTool === "lineA" && t.correctAnswer.marks.length > 1 && t.correctAnswer.marks[1].building && (this.setState({ dialog: {
|
|
118
|
+
open: !0,
|
|
119
|
+
title: "Warning",
|
|
120
|
+
text: "Please add Line B to the graph before switching to Line A",
|
|
121
|
+
onConfirm: () => this.handleAlertDialog(!1)
|
|
122
|
+
} }), e.selectedTool = "lineB"), u(n, "gssLineData", e), u(n, "answers", t), r(n);
|
|
123
|
+
};
|
|
124
|
+
updateModel = (e) => {
|
|
125
|
+
let { model: t, onChange: n } = this.props;
|
|
126
|
+
n({
|
|
127
|
+
...t,
|
|
128
|
+
...e
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
render() {
|
|
132
|
+
let { errors: e, model: t, mathMlOptions: n = {} } = this.props, { dialog: i } = this.state, { gssLineData: a = {
|
|
133
|
+
numberOfLines: 1,
|
|
134
|
+
selectedTool: "lineA",
|
|
135
|
+
lineA: { lineType: "Solid" }
|
|
136
|
+
}, arrows: u, coordinatesOnHover: p, domain: m, graph: y = {}, labels: b, labelsEnabled: x, range: S, title: C, titleEnabled: w, answers: T } = t || {}, { correctAnswerErrors: E = "" } = e || {};
|
|
137
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
138
|
+
/* @__PURE__ */ s(f, {
|
|
139
|
+
component: "div",
|
|
140
|
+
variant: "h6",
|
|
141
|
+
children: "Define Line Type(s) and Correct Response"
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ s(h, {
|
|
144
|
+
component: "div",
|
|
145
|
+
variant: "body1",
|
|
146
|
+
children: "Use this interface to choose how many lines students will be able to draw, and to define the correct answer."
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ s(h, {
|
|
149
|
+
component: "div",
|
|
150
|
+
variant: "body1",
|
|
151
|
+
children: "Choose Number of Lines"
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ c(d, {
|
|
154
|
+
name: "numberOfLines",
|
|
155
|
+
value: a.numberOfLines,
|
|
156
|
+
onChange: this.changeNumberOfLines,
|
|
157
|
+
children: [/* @__PURE__ */ s(g, {
|
|
158
|
+
value: "1",
|
|
159
|
+
control: /* @__PURE__ */ s(_, { checked: a.numberOfLines === 1 }),
|
|
160
|
+
label: "One"
|
|
161
|
+
}), /* @__PURE__ */ s(g, {
|
|
162
|
+
value: "2",
|
|
163
|
+
control: /* @__PURE__ */ s(_, { checked: a.numberOfLines === 2 }),
|
|
164
|
+
label: "Two"
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ c(r.Fragment, { children: [/* @__PURE__ */ s(o, {
|
|
168
|
+
style: E.correctAnswer && { border: "2px solid red" },
|
|
169
|
+
axesSettings: { includeArrows: u },
|
|
170
|
+
backgroundMarks: [],
|
|
171
|
+
coordinatesOnHover: p,
|
|
172
|
+
disabledLabels: !0,
|
|
173
|
+
disabledTitle: !0,
|
|
174
|
+
domain: m,
|
|
175
|
+
draggableTools: !0,
|
|
176
|
+
labels: b,
|
|
177
|
+
marks: T && T.correctAnswer && T.correctAnswer.marks ? T.correctAnswer.marks : [],
|
|
178
|
+
onChangeMarks: (e) => this.changeMarks(e),
|
|
179
|
+
onCustomReset: this.onResetClick,
|
|
180
|
+
range: S,
|
|
181
|
+
showLabels: x,
|
|
182
|
+
showTitle: w,
|
|
183
|
+
size: {
|
|
184
|
+
width: y.width,
|
|
185
|
+
height: y.height
|
|
186
|
+
},
|
|
187
|
+
title: C,
|
|
188
|
+
gssLineData: a,
|
|
189
|
+
onChangeGssLineData: this.onChangeGssLineData,
|
|
190
|
+
onSolutionSetSelected: this.onSolutionSetSelected,
|
|
191
|
+
toolbarTools: ["line", "polygon"],
|
|
192
|
+
mathMlOptions: n
|
|
193
|
+
}), E.correctAnswer && /* @__PURE__ */ s(v, { children: E.correctAnswer })] }),
|
|
194
|
+
/* @__PURE__ */ s(l, {
|
|
195
|
+
open: i.open,
|
|
196
|
+
title: i.title,
|
|
197
|
+
text: i.text,
|
|
198
|
+
onClose: i.onClose,
|
|
199
|
+
onConfirm: i.onConfirm,
|
|
200
|
+
onConfirmText: i.onConfirmText ? i.onConfirmText : "OK"
|
|
201
|
+
})
|
|
202
|
+
] });
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
//#endregion
|
|
206
|
+
export { y as default };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/graphing-solution-set/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
|
+
answers: {
|
|
12
|
+
correctAnswer: {
|
|
13
|
+
name: string;
|
|
14
|
+
marks: never[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
arrows: {
|
|
18
|
+
left: boolean;
|
|
19
|
+
right: boolean;
|
|
20
|
+
up: boolean;
|
|
21
|
+
down: boolean;
|
|
22
|
+
};
|
|
23
|
+
marks: never[];
|
|
24
|
+
defaultGridConfiguration: number;
|
|
25
|
+
domain: {
|
|
26
|
+
min: number;
|
|
27
|
+
max: number;
|
|
28
|
+
step: number;
|
|
29
|
+
labelStep: number;
|
|
30
|
+
axisLabel: string;
|
|
31
|
+
};
|
|
32
|
+
graph: {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
gssLineData: {
|
|
37
|
+
numberOfLines: number;
|
|
38
|
+
selectedTool: string;
|
|
39
|
+
sections: never[];
|
|
40
|
+
lineA: {
|
|
41
|
+
lineType: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
includeAxes: boolean;
|
|
45
|
+
labels: {};
|
|
46
|
+
labelsEnabled: boolean;
|
|
47
|
+
padding: boolean;
|
|
48
|
+
prompt: string;
|
|
49
|
+
range: {
|
|
50
|
+
min: number;
|
|
51
|
+
max: number;
|
|
52
|
+
step: number;
|
|
53
|
+
labelStep: number;
|
|
54
|
+
axisLabel: string;
|
|
55
|
+
};
|
|
56
|
+
rationale: string;
|
|
57
|
+
standardGrid: boolean;
|
|
58
|
+
title: string;
|
|
59
|
+
coordinatesOnHover: boolean;
|
|
60
|
+
promptEnabled: boolean;
|
|
61
|
+
rationaleEnabled: boolean;
|
|
62
|
+
teacherInstructionsEnabled: boolean;
|
|
63
|
+
studentInstructionsEnabled: boolean;
|
|
64
|
+
};
|
|
65
|
+
configuration: {
|
|
66
|
+
authoring: {
|
|
67
|
+
settings: boolean;
|
|
68
|
+
label: string;
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
includeAxesEnabled: boolean;
|
|
71
|
+
standardGridEnabled: boolean;
|
|
72
|
+
min: {
|
|
73
|
+
label: string;
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
};
|
|
76
|
+
max: {
|
|
77
|
+
label: string;
|
|
78
|
+
enabled: boolean;
|
|
79
|
+
};
|
|
80
|
+
axisLabel: {
|
|
81
|
+
label: string;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
};
|
|
84
|
+
step: {
|
|
85
|
+
label: string;
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
};
|
|
88
|
+
labelStep: {
|
|
89
|
+
label: string;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
arrows: {
|
|
94
|
+
settings: boolean;
|
|
95
|
+
label: string;
|
|
96
|
+
left: {
|
|
97
|
+
label: string;
|
|
98
|
+
};
|
|
99
|
+
right: {
|
|
100
|
+
label: string;
|
|
101
|
+
};
|
|
102
|
+
up: {
|
|
103
|
+
label: string;
|
|
104
|
+
};
|
|
105
|
+
down: {
|
|
106
|
+
label: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
gridConfigurations: {
|
|
110
|
+
label: string;
|
|
111
|
+
arrows: {
|
|
112
|
+
left: boolean;
|
|
113
|
+
right: boolean;
|
|
114
|
+
up: boolean;
|
|
115
|
+
down: boolean;
|
|
116
|
+
};
|
|
117
|
+
domain: {
|
|
118
|
+
min: number;
|
|
119
|
+
max: number;
|
|
120
|
+
step: number;
|
|
121
|
+
padding: number;
|
|
122
|
+
labelStep: number;
|
|
123
|
+
axisLabel: string;
|
|
124
|
+
};
|
|
125
|
+
graph: {
|
|
126
|
+
width: number;
|
|
127
|
+
height: number;
|
|
128
|
+
};
|
|
129
|
+
includeAxes: boolean;
|
|
130
|
+
labels: {
|
|
131
|
+
top: string;
|
|
132
|
+
right: string;
|
|
133
|
+
bottom: string;
|
|
134
|
+
left: string;
|
|
135
|
+
};
|
|
136
|
+
padding: boolean;
|
|
137
|
+
range: {
|
|
138
|
+
min: number;
|
|
139
|
+
max: number;
|
|
140
|
+
step: number;
|
|
141
|
+
padding: number;
|
|
142
|
+
labelStep: number;
|
|
143
|
+
axisLabel: string;
|
|
144
|
+
};
|
|
145
|
+
standardGrid: boolean;
|
|
146
|
+
title: string;
|
|
147
|
+
}[];
|
|
148
|
+
graphDimensions: {
|
|
149
|
+
settings: boolean;
|
|
150
|
+
label: string;
|
|
151
|
+
enabled: boolean;
|
|
152
|
+
min: number;
|
|
153
|
+
max: number;
|
|
154
|
+
step: number;
|
|
155
|
+
};
|
|
156
|
+
padding: {
|
|
157
|
+
settings: boolean;
|
|
158
|
+
label: string;
|
|
159
|
+
};
|
|
160
|
+
labels: {
|
|
161
|
+
settings: boolean;
|
|
162
|
+
label: string;
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
top: string;
|
|
165
|
+
right: string;
|
|
166
|
+
bottom: string;
|
|
167
|
+
left: string;
|
|
168
|
+
};
|
|
169
|
+
prompt: {
|
|
170
|
+
settings: boolean;
|
|
171
|
+
label: string;
|
|
172
|
+
};
|
|
173
|
+
rationale: {
|
|
174
|
+
settings: boolean;
|
|
175
|
+
label: string;
|
|
176
|
+
};
|
|
177
|
+
scoringType: {
|
|
178
|
+
settings: boolean;
|
|
179
|
+
label: string;
|
|
180
|
+
};
|
|
181
|
+
studentInstructions: {
|
|
182
|
+
settings: boolean;
|
|
183
|
+
label: string;
|
|
184
|
+
};
|
|
185
|
+
teacherInstructions: {
|
|
186
|
+
settings: boolean;
|
|
187
|
+
label: string;
|
|
188
|
+
};
|
|
189
|
+
title: {
|
|
190
|
+
settings: boolean;
|
|
191
|
+
label: string;
|
|
192
|
+
enabled: boolean;
|
|
193
|
+
placeholder: string;
|
|
194
|
+
};
|
|
195
|
+
instruction: {
|
|
196
|
+
settings: boolean;
|
|
197
|
+
label: string;
|
|
198
|
+
};
|
|
199
|
+
settingsPanelDisabled: boolean;
|
|
200
|
+
spellCheck: {
|
|
201
|
+
label: string;
|
|
202
|
+
settings: boolean;
|
|
203
|
+
enabled: boolean;
|
|
204
|
+
};
|
|
205
|
+
coordinatesOnHover: {
|
|
206
|
+
settings: boolean;
|
|
207
|
+
label: string;
|
|
208
|
+
};
|
|
209
|
+
maxImageWidth: {
|
|
210
|
+
teacherInstructions: number;
|
|
211
|
+
prompt: number;
|
|
212
|
+
rationale: number;
|
|
213
|
+
};
|
|
214
|
+
maxImageHeight: {
|
|
215
|
+
teacherInstructions: number;
|
|
216
|
+
prompt: number;
|
|
217
|
+
rationale: number;
|
|
218
|
+
};
|
|
219
|
+
withRubric: {
|
|
220
|
+
settings: boolean;
|
|
221
|
+
label: string;
|
|
222
|
+
};
|
|
223
|
+
language: {
|
|
224
|
+
settings: boolean;
|
|
225
|
+
label: string;
|
|
226
|
+
enabled: boolean;
|
|
227
|
+
};
|
|
228
|
+
languageChoices: {
|
|
229
|
+
label: string;
|
|
230
|
+
options: never[];
|
|
231
|
+
};
|
|
232
|
+
mathMlOptions: {
|
|
233
|
+
mmlOutput: boolean;
|
|
234
|
+
mmlEditing: boolean;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
export default _default;
|