@pie-element/graphing 3.5.3 → 3.5.4-next.1016
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.md +163 -0
- package/configure/CHANGELOG.md +152 -0
- package/configure/lib/configure.js +108 -47
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/correct-response.js +287 -54
- package/configure/lib/correct-response.js.map +1 -1
- package/configure/lib/defaults.js +49 -7
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/graphing-config.js +160 -184
- package/configure/lib/graphing-config.js.map +1 -1
- package/configure/lib/index.js +43 -18
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/utils.js +94 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +40 -0
- package/controller/lib/defaults.js +9 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +48 -23
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +8 -6
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/config-schema.json +282 -0
- package/docs/config-schema.json.md +213 -1
- package/docs/demo/generate.js +8 -1
- package/docs/pie-schema.json +228 -3
- package/docs/pie-schema.json.md +166 -2
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +15 -19
- package/lib/main.js.map +1 -1
- package/lib/utils.js +3 -1
- package/lib/utils.js.map +1 -1
- package/package.json +6 -6
- package/module/configure.js +0 -1260
- package/module/controller.js +0 -21893
- package/module/demo.js +0 -92
- package/module/element.js +0 -245
- package/module/index.html +0 -16
- package/module/manifest.json +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,169 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.7.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.14...@pie-element/graphing@3.7.15) (2022-03-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.7.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.13...@pie-element/graphing@3.7.14) (2022-03-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.7.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.12...@pie-element/graphing@3.7.13) (2022-03-08)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [3.7.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.11...@pie-element/graphing@3.7.12) (2022-03-08)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [3.7.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.10...@pie-element/graphing@3.7.11) (2022-02-21)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [3.7.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.9...@pie-element/graphing@3.7.10) (2022-02-04)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [3.7.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.8...@pie-element/graphing@3.7.9) (2022-01-24)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Bug Fixes
|
|
58
|
+
|
|
59
|
+
* **graphing:** no correctness indicator if correct response is authored PD-1500 ([f03b8c1](https://github.com/pie-framework/pie-elements/commit/f03b8c15919a4fa3bb3eb91d56fd4b7d45508e83))
|
|
60
|
+
* use preview prompt for prompt, rationale and teacher instructions to fix table rendering PD-1456 ([f330601](https://github.com/pie-framework/pie-elements/commit/f3306019a2d1c8ce3e2783823dfe9ef0a0394e4f))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## [3.7.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.7...@pie-element/graphing@3.7.8) (2022-01-10)
|
|
67
|
+
|
|
68
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## [3.7.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.6...@pie-element/graphing@3.7.7) (2021-12-23)
|
|
75
|
+
|
|
76
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## [3.7.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.4...@pie-element/graphing@3.7.5) (2021-12-13)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [3.7.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.7.1...@pie-element/graphing@3.7.2) (2021-11-29)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## [3.7.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.6.3...@pie-element/graphing@3.7.1) (2021-11-11)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# [3.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.5.3...@pie-element/graphing@3.7.0) (2021-11-11)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Bug Fixes
|
|
110
|
+
|
|
111
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
112
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
113
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
* **graphing:** BREAKING CHANGE - update model and config schemas. Change model arrows prop and add arrows in config PD-483 ([fb1c27b](https://github.com/pie-framework/pie-elements/commit/fb1c27bcc25632c15d228d14483835d919e2d357))
|
|
119
|
+
* **graphing:** control over displaying graph arrows PD-483 ([6f98639](https://github.com/pie-framework/pie-elements/commit/6f98639b4bcce0e7ce75f28435c6fe1c8db8a4d4))
|
|
120
|
+
* **graphing:** Displayed point coordinates on hover PD-188 \n BREAKING CHANGE: Added coordinatesOnHover property to the model ([124cc2d](https://github.com/pie-framework/pie-elements/commit/124cc2de418fbdd1825c6c39eee550875a3e24af))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## [3.6.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.6.2...@pie-element/graphing@3.6.3) (2021-10-04)
|
|
128
|
+
|
|
129
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## [3.6.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.6.1...@pie-element/graphing@3.6.2) (2021-09-20)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Bug Fixes
|
|
139
|
+
|
|
140
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
141
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
142
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
## [3.6.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.6.0...@pie-element/graphing@3.6.1) (2021-09-01)
|
|
149
|
+
|
|
150
|
+
**Note:** Version bump only for package @pie-element/graphing
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# [3.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.5.3...@pie-element/graphing@3.6.0) (2021-08-05)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### Features
|
|
160
|
+
|
|
161
|
+
* **graphing:** BREAKING CHANGE - update model and config schemas. Change model arrows prop and add arrows in config PD-483 ([fb1c27b](https://github.com/pie-framework/pie-elements/commit/fb1c27bcc25632c15d228d14483835d919e2d357))
|
|
162
|
+
* **graphing:** control over displaying graph arrows PD-483 ([6f98639](https://github.com/pie-framework/pie-elements/commit/6f98639b4bcce0e7ce75f28435c6fe1c8db8a4d4))
|
|
163
|
+
* **graphing:** Displayed point coordinates on hover PD-188 \n BREAKING CHANGE: Added coordinatesOnHover property to the model ([124cc2d](https://github.com/pie-framework/pie-elements/commit/124cc2de418fbdd1825c6c39eee550875a3e24af))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
6
169
|
## [3.5.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing@3.5.1...@pie-element/graphing@3.5.3) (2021-08-05)
|
|
7
170
|
|
|
8
171
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,158 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.3.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.14...@pie-element/graphing-configure@3.3.15) (2022-03-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.3.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.13...@pie-element/graphing-configure@3.3.14) (2022-03-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.3.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.12...@pie-element/graphing-configure@3.3.13) (2022-03-08)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [3.3.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.11...@pie-element/graphing-configure@3.3.12) (2022-03-08)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [3.3.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.10...@pie-element/graphing-configure@3.3.11) (2022-02-21)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [3.3.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.9...@pie-element/graphing-configure@3.3.10) (2022-02-04)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [3.3.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.8...@pie-element/graphing-configure@3.3.9) (2022-01-24)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Bug Fixes
|
|
58
|
+
|
|
59
|
+
* **graphing:** no correctness indicator if correct response is authored PD-1500 ([f03b8c1](https://github.com/pie-framework/pie-elements/commit/f03b8c15919a4fa3bb3eb91d56fd4b7d45508e83))
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [3.3.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.7...@pie-element/graphing-configure@3.3.8) (2022-01-10)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## [3.3.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.6...@pie-element/graphing-configure@3.3.7) (2021-12-23)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## [3.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.4...@pie-element/graphing-configure@3.3.5) (2021-12-13)
|
|
82
|
+
|
|
83
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## [3.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.3.1...@pie-element/graphing-configure@3.3.2) (2021-11-29)
|
|
90
|
+
|
|
91
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## [3.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.2.2...@pie-element/graphing-configure@3.3.1) (2021-11-11)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# [3.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.1.27...@pie-element/graphing-configure@3.3.0) (2021-11-11)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Bug Fixes
|
|
109
|
+
|
|
110
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
111
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
112
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Features
|
|
116
|
+
|
|
117
|
+
* **graphing:** control over displaying graph arrows PD-483 ([6f98639](https://github.com/pie-framework/pie-elements/commit/6f98639b4bcce0e7ce75f28435c6fe1c8db8a4d4))
|
|
118
|
+
* **graphing:** Displayed point coordinates on hover PD-188 \n BREAKING CHANGE: Added coordinatesOnHover property to the model ([124cc2d](https://github.com/pie-framework/pie-elements/commit/124cc2de418fbdd1825c6c39eee550875a3e24af))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
## [3.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.2.1...@pie-element/graphing-configure@3.2.2) (2021-10-04)
|
|
126
|
+
|
|
127
|
+
**Note:** Version bump only for package @pie-element/graphing-configure
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## [3.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.2.0...@pie-element/graphing-configure@3.2.1) (2021-09-20)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### Bug Fixes
|
|
137
|
+
|
|
138
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
139
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
140
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# [3.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.1.27...@pie-element/graphing-configure@3.2.0) (2021-08-05)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Features
|
|
150
|
+
|
|
151
|
+
* **graphing:** control over displaying graph arrows PD-483 ([6f98639](https://github.com/pie-framework/pie-elements/commit/6f98639b4bcce0e7ce75f28435c6fe1c8db8a4d4))
|
|
152
|
+
* **graphing:** Displayed point coordinates on hover PD-188 \n BREAKING CHANGE: Added coordinatesOnHover property to the model ([124cc2d](https://github.com/pie-framework/pie-elements/commit/124cc2de418fbdd1825c6c39eee550875a3e24af))
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
6
158
|
## [3.1.27](https://github.com/pie-framework/pie-elements/compare/@pie-element/graphing-configure@3.1.25...@pie-element/graphing-configure@3.1.27) (2021-08-05)
|
|
7
159
|
|
|
8
160
|
|
|
@@ -39,17 +39,18 @@ var _graphingConfig = _interopRequireDefault(require("./graphing-config"));
|
|
|
39
39
|
|
|
40
40
|
var _correctResponse = _interopRequireDefault(require("./correct-response"));
|
|
41
41
|
|
|
42
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
42
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
43
|
|
|
44
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
44
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
45
|
|
|
46
46
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
47
47
|
|
|
48
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
49
|
|
|
50
50
|
var Panel = _configUi.settings.Panel,
|
|
51
51
|
toggle = _configUi.settings.toggle,
|
|
52
|
-
radio = _configUi.settings.radio
|
|
52
|
+
radio = _configUi.settings.radio,
|
|
53
|
+
checkboxes = _configUi.settings.checkboxes;
|
|
53
54
|
var log = (0, _debug["default"])('@pie-element:graphing:configure');
|
|
54
55
|
|
|
55
56
|
var styles = function styles(theme) {
|
|
@@ -119,46 +120,91 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
(0, _createClass2["default"])(Configure, [{
|
|
122
|
-
key: "
|
|
123
|
-
value: function
|
|
123
|
+
key: "componentDidMount",
|
|
124
|
+
value: function componentDidMount() {
|
|
125
|
+
// This is used for offering support for old models which have the property arrows: boolean
|
|
126
|
+
// Same thing is set in the controller: packages/graphing/controller/src/index.js - model
|
|
124
127
|
var _this$props4 = this.props,
|
|
125
|
-
classes = _this$props4.classes,
|
|
126
|
-
model = _this$props4.model,
|
|
127
|
-
configuration = _this$props4.configuration,
|
|
128
|
-
onConfigurationChanged = _this$props4.onConfigurationChanged,
|
|
129
128
|
onModelChanged = _this$props4.onModelChanged,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
129
|
+
model = _this$props4.model;
|
|
130
|
+
|
|
131
|
+
var _ref = model || {},
|
|
132
|
+
arrows = _ref.arrows;
|
|
133
|
+
|
|
134
|
+
if (typeof arrows === 'boolean') {
|
|
135
|
+
if (arrows) {
|
|
136
|
+
arrows = {
|
|
137
|
+
left: true,
|
|
138
|
+
right: true,
|
|
139
|
+
up: true,
|
|
140
|
+
down: true
|
|
141
|
+
};
|
|
142
|
+
} else {
|
|
143
|
+
arrows = {
|
|
144
|
+
left: false,
|
|
145
|
+
right: false,
|
|
146
|
+
up: false,
|
|
147
|
+
down: false
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
152
|
+
arrows: arrows
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "render",
|
|
158
|
+
value: function render() {
|
|
159
|
+
var _this$props5 = this.props,
|
|
160
|
+
classes = _this$props5.classes,
|
|
161
|
+
model = _this$props5.model,
|
|
162
|
+
configuration = _this$props5.configuration,
|
|
163
|
+
onConfigurationChanged = _this$props5.onConfigurationChanged,
|
|
164
|
+
onModelChanged = _this$props5.onModelChanged,
|
|
165
|
+
imageSupport = _this$props5.imageSupport;
|
|
166
|
+
|
|
167
|
+
var _ref2 = configuration || {},
|
|
168
|
+
_ref2$arrows = _ref2.arrows,
|
|
169
|
+
arrows = _ref2$arrows === void 0 ? {} : _ref2$arrows,
|
|
170
|
+
_ref2$authoring = _ref2.authoring,
|
|
171
|
+
authoring = _ref2$authoring === void 0 ? {} : _ref2$authoring,
|
|
172
|
+
_ref2$coordinatesOnHo = _ref2.coordinatesOnHover,
|
|
173
|
+
coordinatesOnHover = _ref2$coordinatesOnHo === void 0 ? {} : _ref2$coordinatesOnHo,
|
|
174
|
+
_ref2$graphDimensions = _ref2.graphDimensions,
|
|
175
|
+
graphDimensions = _ref2$graphDimensions === void 0 ? {} : _ref2$graphDimensions,
|
|
176
|
+
_ref2$labels = _ref2.labels,
|
|
177
|
+
labels = _ref2$labels === void 0 ? {} : _ref2$labels,
|
|
178
|
+
_ref2$padding = _ref2.padding,
|
|
179
|
+
padding = _ref2$padding === void 0 ? {} : _ref2$padding,
|
|
180
|
+
_ref2$prompt = _ref2.prompt,
|
|
181
|
+
prompt = _ref2$prompt === void 0 ? {} : _ref2$prompt,
|
|
182
|
+
_ref2$title = _ref2.title,
|
|
183
|
+
title = _ref2$title === void 0 ? {} : _ref2$title,
|
|
184
|
+
_ref2$rationale = _ref2.rationale,
|
|
185
|
+
rationale = _ref2$rationale === void 0 ? {} : _ref2$rationale,
|
|
186
|
+
_ref2$scoringType = _ref2.scoringType,
|
|
187
|
+
scoringType = _ref2$scoringType === void 0 ? {} : _ref2$scoringType,
|
|
188
|
+
_ref2$spellCheck = _ref2.spellCheck,
|
|
189
|
+
spellCheck = _ref2$spellCheck === void 0 ? {} : _ref2$spellCheck,
|
|
190
|
+
_ref2$studentInstruct = _ref2.studentInstructions,
|
|
191
|
+
studentInstructions = _ref2$studentInstruct === void 0 ? {} : _ref2$studentInstruct,
|
|
192
|
+
_ref2$teacherInstruct = _ref2.teacherInstructions,
|
|
193
|
+
teacherInstructions = _ref2$teacherInstruct === void 0 ? {} : _ref2$teacherInstruct,
|
|
194
|
+
_ref2$maxImageWidth = _ref2.maxImageWidth,
|
|
195
|
+
maxImageWidth = _ref2$maxImageWidth === void 0 ? {} : _ref2$maxImageWidth,
|
|
196
|
+
_ref2$maxImageHeight = _ref2.maxImageHeight,
|
|
197
|
+
maxImageHeight = _ref2$maxImageHeight === void 0 ? {} : _ref2$maxImageHeight;
|
|
198
|
+
|
|
199
|
+
var _ref3 = model || {},
|
|
200
|
+
teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled,
|
|
201
|
+
promptEnabled = _ref3.promptEnabled,
|
|
202
|
+
rationaleEnabled = _ref3.rationaleEnabled,
|
|
203
|
+
spellCheckEnabled = _ref3.spellCheckEnabled;
|
|
154
204
|
|
|
155
205
|
log('[render] model', model);
|
|
156
|
-
|
|
157
|
-
var
|
|
158
|
-
teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
|
|
159
|
-
promptEnabled = _ref2.promptEnabled,
|
|
160
|
-
rationaleEnabled = _ref2.rationaleEnabled;
|
|
161
|
-
|
|
206
|
+
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
207
|
+
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
162
208
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
163
209
|
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
164
210
|
model: model,
|
|
@@ -167,10 +213,16 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
167
213
|
onChangeConfiguration: onConfigurationChanged,
|
|
168
214
|
groups: {
|
|
169
215
|
'Item Type': {
|
|
170
|
-
arrows: arrows.settings &&
|
|
216
|
+
arrows: arrows.settings && checkboxes(arrows.label, {
|
|
217
|
+
left: arrows.left,
|
|
218
|
+
right: arrows.right,
|
|
219
|
+
up: arrows.up,
|
|
220
|
+
down: arrows.down
|
|
221
|
+
}),
|
|
171
222
|
'title.enabled': title.settings && toggle(title.label, true),
|
|
172
223
|
padding: padding.settings && toggle(padding.label),
|
|
173
|
-
labels: labels.settings && toggle(labels.label)
|
|
224
|
+
labels: labels.settings && toggle(labels.label),
|
|
225
|
+
coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label)
|
|
174
226
|
},
|
|
175
227
|
Properties: {
|
|
176
228
|
'authoring.enabled': authoring.settings && toggle(authoring.label, true),
|
|
@@ -178,6 +230,7 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
178
230
|
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
179
231
|
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
180
232
|
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
233
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
181
234
|
scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring'])
|
|
182
235
|
}
|
|
183
236
|
}
|
|
@@ -195,7 +248,10 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
195
248
|
markup: model.teacherInstructions || '',
|
|
196
249
|
onChange: this.onTeacherInstructionsChange,
|
|
197
250
|
imageSupport: imageSupport,
|
|
198
|
-
nonEmpty: false
|
|
251
|
+
nonEmpty: false,
|
|
252
|
+
spellCheck: spellCheckEnabled,
|
|
253
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
254
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight
|
|
199
255
|
})), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
200
256
|
label: prompt.label,
|
|
201
257
|
className: classes.promptHolder
|
|
@@ -205,7 +261,10 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
205
261
|
onChange: this.onPromptChange,
|
|
206
262
|
imageSupport: imageSupport,
|
|
207
263
|
nonEmpty: false,
|
|
208
|
-
|
|
264
|
+
spellCheck: spellCheckEnabled,
|
|
265
|
+
disableUnderline: true,
|
|
266
|
+
maxImageWidth: defaultImageMaxWidth,
|
|
267
|
+
maxImageHeight: defaultImageMaxHeight
|
|
209
268
|
})), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
210
269
|
label: rationale.label || 'Rationale',
|
|
211
270
|
className: classes.promptHolder
|
|
@@ -213,14 +272,16 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
213
272
|
className: classes.prompt,
|
|
214
273
|
markup: model.rationale || '',
|
|
215
274
|
onChange: this.onRationaleChange,
|
|
216
|
-
imageSupport: imageSupport
|
|
275
|
+
imageSupport: imageSupport,
|
|
276
|
+
spellCheck: spellCheckEnabled,
|
|
277
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
278
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight
|
|
217
279
|
})), /*#__PURE__*/_react["default"].createElement(_graphingConfig["default"], {
|
|
218
280
|
authoringEnabled: authoring && authoring.enabled,
|
|
219
|
-
|
|
281
|
+
graphDimensions: graphDimensions,
|
|
220
282
|
model: model,
|
|
221
283
|
onChange: this.props.onModelChanged
|
|
222
284
|
}), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
|
|
223
|
-
config: config,
|
|
224
285
|
model: model,
|
|
225
286
|
onChange: this.props.onModelChanged
|
|
226
287
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","classes","configuration","onConfigurationChanged","imageSupport","config","graph","arrows","padding","labels","scoringType","studentInstructions","authoring","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","enabled","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAC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import { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\n\nconst { Panel, toggle, radio } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const config = model.graph;\n\n const {\n arrows = {},\n title = {},\n padding = {},\n labels = {},\n rationale = {},\n scoringType = {},\n studentInstructions = {},\n teacherInstructions = {},\n prompt = {},\n authoring = {}\n } = configuration || {};\n log('[render] model', model);\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled } =\n model || {};\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && toggle(arrows.label),\n 'title.enabled': title.settings && toggle(title.label, true),\n padding: padding.settings && toggle(padding.label),\n labels: labels.settings && toggle(labels.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoringEnabled={authoring && authoring.enabled}\n config={config}\n model={model}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n config={config}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|
|
1
|
+
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","arrows","left","right","up","down","classes","configuration","onConfigurationChanged","imageSupport","authoring","coordinatesOnHover","graphDimensions","labels","padding","scoringType","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","defaultImageMaxWidth","defaultImageMaxHeight","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","enabled","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA6CC,kBAA7C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA6CD,kBAA7C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA6CF,kBAA7C,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAA6CH,kBAA7C,CAA8BG,UAA9B;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADgB;AAOvBE,IAAAA,OAAO,EAA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AA,aAAa,EAAE4B,sBAAUE,MAAV,CAAiBC;AANf,C;iCADR3C,S,kBAUW;AAAEW,EAAAA,OAAO,EAAE;AAAX,C;;eA2MT,wBAAW1B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n const { onModelChanged, model } = this.props;\n let { arrows } = model || {};\n\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }\n\n onModelChanged({ ...model, arrows });\n }\n }\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const {\n arrows = {},\n authoring = {},\n coordinatesOnHover = {},\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n title = {},\n rationale = {},\n scoringType = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n maxImageWidth = {},\n maxImageHeight = {}\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled, spellCheckEnabled } =\n model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down\n }),\n 'title.enabled': title.settings && toggle(title.label, true),\n padding: padding.settings && toggle(padding.label),\n labels: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoringEnabled={authoring && authoring.enabled}\n graphDimensions={graphDimensions}\n model={model}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|