@pie-element/graphing-solution-set 6.1.2-next.1 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1 -0
- package/CHANGELOG.md +856 -0
- package/LICENSE.md +5 -0
- package/README.md +20 -0
- package/configure/CHANGELOG.json +1 -0
- package/configure/CHANGELOG.md +816 -0
- package/configure/lib/configure.js +312 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/correct-response.js +435 -0
- package/configure/lib/correct-response.js.map +1 -0
- package/configure/lib/defaults.js +357 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/graphing-config.js +408 -0
- package/configure/lib/graphing-config.js.map +1 -0
- package/configure/lib/index.js +163 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +630 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +29 -0
- package/controller/CHANGELOG.json +1 -0
- package/controller/CHANGELOG.md +675 -0
- package/controller/lib/defaults.js +69 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +351 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +212 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +22 -0
- package/demo-gss.gif +0 -0
- package/docs/config-schema.json +1560 -0
- package/docs/config-schema.json.md +1114 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +54 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +1800 -0
- package/docs/pie-schema.json.md +952 -0
- package/lib/index.js +164 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +355 -0
- package/lib/main.js.map +1 -0
- package/lib/utils.js +515 -0
- package/lib/utils.js.map +1 -0
- package/package.json +23 -86
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/configure.d.ts +0 -26
- package/dist/author/configure.js +0 -190
- package/dist/author/correct-response.d.ts +0 -33
- package/dist/author/correct-response.js +0 -206
- package/dist/author/defaults.d.ts +0 -238
- package/dist/author/defaults.js +0 -339
- package/dist/author/graphing-config.d.ts +0 -33
- package/dist/author/graphing-config.js +0 -237
- package/dist/author/index.d.ts +0 -62
- package/dist/author/index.js +0 -87
- package/dist/author/utils.d.ts +0 -46
- package/dist/author/utils.js +0 -474
- package/dist/browser/author/index.js +0 -1942
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/browser-pUycHh7Y.js +0 -348
- package/dist/browser/browser-pUycHh7Y.js.map +0 -1
- package/dist/browser/controller/index.js +0 -193
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -782
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-BxTk7Laj.js +0 -57671
- package/dist/browser/dist-BxTk7Laj.js.map +0 -1
- package/dist/browser/graphing-solution-set.css +0 -2
- package/dist/controller/defaults.d.ts +0 -64
- package/dist/controller/defaults.js +0 -54
- package/dist/controller/index.d.ts +0 -24
- package/dist/controller/index.js +0 -110
- package/dist/controller/utils.d.ts +0 -20
- package/dist/controller/utils.js +0 -39
- package/dist/delivery/index.d.ts +0 -22
- package/dist/delivery/index.js +0 -62
- package/dist/delivery/main.d.ts +0 -31
- package/dist/delivery/main.js +0 -198
- package/dist/delivery/utils.d.ts +0 -12
- package/dist/delivery/utils.js +0 -220
- package/dist/graphing-solution-set.css +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -405
- package/dist/index.js +0 -2
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
package/package.json
CHANGED
|
@@ -1,97 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/graphing-solution-set",
|
|
3
|
-
"
|
|
3
|
+
"repository": "pie-framework/pie-elements",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"version": "6.1.2",
|
|
4
8
|
"description": "",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
+
"postpublish": "../../scripts/postpublish"
|
|
12
|
+
},
|
|
5
13
|
"dependencies": {
|
|
6
14
|
"@emotion/react": "^11.14.0",
|
|
7
15
|
"@emotion/style": "^0.8.0",
|
|
8
16
|
"@mui/icons-material": "^7.3.4",
|
|
9
17
|
"@mui/material": "^7.3.4",
|
|
10
|
-
"@pie-
|
|
11
|
-
"@pie-lib/
|
|
12
|
-
"@pie-lib/
|
|
13
|
-
"@pie-lib/
|
|
18
|
+
"@pie-framework/pie-player-events": "^0.1.0",
|
|
19
|
+
"@pie-lib/config-ui": "13.0.6",
|
|
20
|
+
"@pie-lib/correct-answer-toggle": "4.0.3",
|
|
21
|
+
"@pie-lib/graphing-solution-set": "4.0.6",
|
|
22
|
+
"@pie-lib/math-rendering": "5.0.2",
|
|
23
|
+
"@pie-lib/render-ui": "6.1.1",
|
|
24
|
+
"classnames": "^2.2.6",
|
|
14
25
|
"debug": "^4.1.1",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"@pie-element/shared-lodash": "0.1.1-next.0",
|
|
18
|
-
"@pie-element/shared-configure-events": "0.1.0",
|
|
19
|
-
"@pie-element/shared-math-rendering-mathjax": "0.1.0",
|
|
20
|
-
"@pie-element/shared-player-events": "0.1.0",
|
|
21
|
-
"@emotion/core": "0.x.x",
|
|
22
|
-
"clsx": "^2.1.1"
|
|
23
|
-
},
|
|
24
|
-
"peerDependencies": {
|
|
25
|
-
"react": "^18.0.0",
|
|
26
|
-
"react-dom": "^18.0.0"
|
|
27
|
-
},
|
|
28
|
-
"exports": {
|
|
29
|
-
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"default": "./dist/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./delivery": {
|
|
34
|
-
"types": "./dist/delivery/index.d.ts",
|
|
35
|
-
"default": "./dist/delivery/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./browser/delivery": {
|
|
38
|
-
"default": "./dist/browser/delivery/index.js"
|
|
39
|
-
},
|
|
40
|
-
"./author": {
|
|
41
|
-
"types": "./dist/author/index.d.ts",
|
|
42
|
-
"default": "./dist/author/index.js"
|
|
43
|
-
},
|
|
44
|
-
"./browser/author": {
|
|
45
|
-
"default": "./dist/browser/author/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./configure": {
|
|
48
|
-
"types": "./dist/author/index.d.ts",
|
|
49
|
-
"default": "./dist/author/index.js"
|
|
50
|
-
},
|
|
51
|
-
"./controller": {
|
|
52
|
-
"types": "./dist/controller/index.d.ts",
|
|
53
|
-
"default": "./dist/controller/index.js"
|
|
54
|
-
},
|
|
55
|
-
"./controller.js": {
|
|
56
|
-
"types": "./dist/controller/index.d.ts",
|
|
57
|
-
"default": "./dist/controller/index.js"
|
|
58
|
-
},
|
|
59
|
-
"./browser/controller": {
|
|
60
|
-
"default": "./dist/browser/controller/index.js"
|
|
61
|
-
},
|
|
62
|
-
"./runtime-support": {
|
|
63
|
-
"types": "./dist/runtime-support.d.ts",
|
|
64
|
-
"default": "./dist/runtime-support.js"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"type": "module",
|
|
68
|
-
"main": "./dist/index.js",
|
|
69
|
-
"types": "./dist/index.d.ts",
|
|
70
|
-
"files": [
|
|
71
|
-
"configure.js",
|
|
72
|
-
"controller.js",
|
|
73
|
-
"dist"
|
|
74
|
-
],
|
|
75
|
-
"sideEffects": false,
|
|
76
|
-
"devDependencies": {
|
|
77
|
-
"vite": "^8.0.1",
|
|
78
|
-
"typescript": "^5.9.3",
|
|
79
|
-
"@vitejs/plugin-react": "^6.0.1",
|
|
80
|
-
"@types/react": "^18.2.0",
|
|
81
|
-
"@types/react-dom": "^18.2.0"
|
|
82
|
-
},
|
|
83
|
-
"scripts": {
|
|
84
|
-
"build": "bun x vite build && bun x vite build --config ../../../tools/vite/element-browser.config.ts && bun x vite build --config vite.config.iife.ts && bun x tsc --emitDeclarationOnly",
|
|
85
|
-
"dev": "bun x vite",
|
|
86
|
-
"demo": "bun x vite --mode demo",
|
|
87
|
-
"test": "bun x vitest run"
|
|
26
|
+
"react": "18.3.1",
|
|
27
|
+
"react-dom": "18.3.1"
|
|
88
28
|
},
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"react-dom": "18.2.0"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
29
|
+
"author": "",
|
|
30
|
+
"license": "ISC",
|
|
31
|
+
"gitHead": "206ff17a94e8e197744d059f97ad2b9a1bc9145d",
|
|
32
|
+
"main": "lib/index.js",
|
|
33
|
+
"module": "src/index.js"
|
|
97
34
|
}
|
package/configure.js
DELETED
package/controller.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './dist/controller/index.js';
|
|
@@ -1,26 +0,0 @@
|
|
|
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;
|
package/dist/author/configure.js
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
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 };
|
|
@@ -1,33 +0,0 @@
|
|
|
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;
|
|
@@ -1,206 +0,0 @@
|
|
|
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 };
|