@pie-element/categorize 6.9.9 → 6.9.10-beta.1445

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +394 -0
  2. package/configure/CHANGELOG.md +377 -0
  3. package/configure/lib/defaults.js +50 -3
  4. package/configure/lib/defaults.js.map +1 -1
  5. package/configure/lib/design/builder.js +8 -5
  6. package/configure/lib/design/builder.js.map +1 -1
  7. package/configure/lib/design/buttons.js +5 -3
  8. package/configure/lib/design/buttons.js.map +1 -1
  9. package/configure/lib/design/categories/RowLabel.js +68 -0
  10. package/configure/lib/design/categories/RowLabel.js.map +1 -0
  11. package/configure/lib/design/categories/alternateResponses.js +121 -17
  12. package/configure/lib/design/categories/alternateResponses.js.map +1 -1
  13. package/configure/lib/design/categories/category.js +50 -6
  14. package/configure/lib/design/categories/category.js.map +1 -1
  15. package/configure/lib/design/categories/choice-preview.js +17 -4
  16. package/configure/lib/design/categories/choice-preview.js.map +1 -1
  17. package/configure/lib/design/categories/droppable-placeholder.js +23 -3
  18. package/configure/lib/design/categories/droppable-placeholder.js.map +1 -1
  19. package/configure/lib/design/categories/index.js +165 -72
  20. package/configure/lib/design/categories/index.js.map +1 -1
  21. package/configure/lib/design/choices/choice.js +80 -13
  22. package/configure/lib/design/choices/choice.js.map +1 -1
  23. package/configure/lib/design/choices/config.js +8 -113
  24. package/configure/lib/design/choices/config.js.map +1 -1
  25. package/configure/lib/design/choices/index.js +83 -10
  26. package/configure/lib/design/choices/index.js.map +1 -1
  27. package/configure/lib/design/header.js +17 -5
  28. package/configure/lib/design/header.js.map +1 -1
  29. package/configure/lib/design/index.js +158 -61
  30. package/configure/lib/design/index.js.map +1 -1
  31. package/configure/lib/design/input-header.js +57 -11
  32. package/configure/lib/design/input-header.js.map +1 -1
  33. package/configure/lib/index.js +17 -3
  34. package/configure/lib/index.js.map +1 -1
  35. package/configure/lib/main.js +3 -1
  36. package/configure/lib/main.js.map +1 -1
  37. package/configure/lib/utils.js +27 -0
  38. package/configure/lib/utils.js.map +1 -0
  39. package/configure/package.json +9 -9
  40. package/controller/CHANGELOG.md +89 -0
  41. package/controller/lib/defaults.js +18 -0
  42. package/controller/lib/defaults.js.map +1 -1
  43. package/controller/lib/index.js +160 -24
  44. package/controller/lib/index.js.map +1 -1
  45. package/controller/lib/utils.js +60 -0
  46. package/controller/lib/utils.js.map +1 -0
  47. package/controller/package.json +4 -4
  48. package/docs/config-schema.json +181 -0
  49. package/docs/config-schema.json.md +141 -1
  50. package/docs/demo/config.js +2 -2
  51. package/docs/demo/generate.js +3 -3
  52. package/docs/demo/index.html +1 -1
  53. package/docs/pie-schema.json +48 -5
  54. package/docs/pie-schema.json.md +36 -5
  55. package/lib/categorize/categories.js +14 -4
  56. package/lib/categorize/categories.js.map +1 -1
  57. package/lib/categorize/category.js +3 -3
  58. package/lib/categorize/category.js.map +1 -1
  59. package/lib/categorize/choice.js +3 -3
  60. package/lib/categorize/choice.js.map +1 -1
  61. package/lib/categorize/choices.js +16 -7
  62. package/lib/categorize/choices.js.map +1 -1
  63. package/lib/categorize/droppable-placeholder.js +5 -3
  64. package/lib/categorize/droppable-placeholder.js.map +1 -1
  65. package/lib/categorize/grid-content.js +2 -2
  66. package/lib/categorize/grid-content.js.map +1 -1
  67. package/lib/categorize/index.js +36 -17
  68. package/lib/categorize/index.js.map +1 -1
  69. package/lib/index.js +3 -0
  70. package/lib/index.js.map +1 -1
  71. package/package.json +9 -8
@@ -3,6 +3,383 @@
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
+ ## [6.7.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.7.0...@pie-element/categorize-configure@6.7.1) (2023-01-17)
7
+
8
+ **Note:** Version bump only for package @pie-element/categorize-configure
9
+
10
+
11
+
12
+
13
+
14
+ # [6.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.6.0...@pie-element/categorize-configure@6.7.0) (2023-01-17)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * build ([7051f69](https://github.com/pie-framework/pie-elements/commit/7051f6957042a30597066a1bf435e8674c9d3721))
20
+ * **categorize:** correct answer is not recognised-PD-1975 ([5ab33fb](https://github.com/pie-framework/pie-elements/commit/5ab33fb76d4490a7f76b48fe1815204db76e2de3))
21
+
22
+
23
+ ### Features
24
+
25
+ * build ([dfbd59c](https://github.com/pie-framework/pie-elements/commit/dfbd59c15921e1599b9009fd644ed26db86b82f6))
26
+ * update pie-libs ([6423903](https://github.com/pie-framework/pie-elements/commit/6423903898b041f56db2111de2e4aac4ee9f1fd3))
27
+ * **categorize:** Add an Allow Alternate Correct Answers setting-PD-1973 ([b84c1f8](https://github.com/pie-framework/pie-elements/commit/b84c1f815dfbd954a9fd2b815bcdcff40e0994e5))
28
+ * **categorize:** Replace the trashcan icons for choices in response-PD-1994 ([f0d7625](https://github.com/pie-framework/pie-elements/commit/f0d762586a932fd2f471ffe568d92c1b838d9ac5))
29
+
30
+
31
+
32
+
33
+
34
+ # [6.6.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.5.1...@pie-element/categorize-configure@6.6.0) (2023-01-05)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * **categorize:** avoid dropping choice when user tries to move it to an alternate with other index-1967 ([8081621](https://github.com/pie-framework/pie-elements/commit/808162197c5cbf257bf503f2b7d4ea28111d073b))
40
+ * **categorize:** transform to else if Pd-1967 ([b124162](https://github.com/pie-framework/pie-elements/commit/b124162ccfcccd0600ca0fcee1431796cc5a7b53))
41
+
42
+
43
+ ### Features
44
+
45
+ * update pie-libs ([b174476](https://github.com/pie-framework/pie-elements/commit/b174476729119a0689f1f8adfc8c235246676cab))
46
+ * update pie-libs ([f72c3c8](https://github.com/pie-framework/pie-elements/commit/f72c3c8d8bc9bbf061bb81502317157a63c22972))
47
+ * update pie-libs ([8490729](https://github.com/pie-framework/pie-elements/commit/8490729a2389d36fd3968f0806119fde96577842))
48
+ * **categorize:** added configuration prop to hide the settings panel PD-1999 ([405c321](https://github.com/pie-framework/pie-elements/commit/405c3215f6953d9326d1eee25444a2bf00167d95))
49
+ * **categorize:** ensure no extra choices in alternate when categoryCount 1-PD-1967 ([7363bb7](https://github.com/pie-framework/pie-elements/commit/7363bb76767418239fa7b250331dbc4a3d4ae9ac))
50
+ * **categorize:** Ensure that there are no extra choices in alternate, add cond for canDrag-PD-1967 ([dc568f9](https://github.com/pie-framework/pie-elements/commit/dc568f9822569c75394358879318468595f14033))
51
+ * **categorize:** rearrange the choices via drag and drop-PD-1967 ([c1480a1](https://github.com/pie-framework/pie-elements/commit/c1480a168d6bb50c78e603f3c6ba04bb3ed1c6be))
52
+
53
+
54
+
55
+
56
+
57
+ ## [6.5.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.5.0...@pie-element/categorize-configure@6.5.1) (2022-12-21)
58
+
59
+
60
+ ### Bug Fixes
61
+
62
+ * updated pie-libs ([8cb5b90](https://github.com/pie-framework/pie-elements/commit/8cb5b90d501ccbdf5ffd764e6555faa48b8f54d6))
63
+
64
+
65
+
66
+
67
+
68
+ # [6.5.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.4.0...@pie-element/categorize-configure@6.5.0) (2022-12-20)
69
+
70
+
71
+ ### Bug Fixes
72
+
73
+ * updated pie-libs ([6549302](https://github.com/pie-framework/pie-elements/commit/65493026fbf356c5ab752ae6a14d961d4b256368))
74
+ * **categorize:** drag an answer choice elsewhere after it has been placed in a category-PD-1995 ([ade8720](https://github.com/pie-framework/pie-elements/commit/ade87201855c30f733e0ec3ed3c3336054409023))
75
+
76
+
77
+ ### Features
78
+
79
+ * **categorize:** add pretty printer-PD-1995 ([712200b](https://github.com/pie-framework/pie-elements/commit/712200bf642f990da8443d6266f4a0b8e08d4f71))
80
+ * **categorize:** add sanitt checks for choices-PD-1995 ([d4cd099](https://github.com/pie-framework/pie-elements/commit/d4cd099a3f0743015d42b6504580bfa4c17081b9))
81
+ * **categorize:** add sanity checks-PD-1995 ([33d88e7](https://github.com/pie-framework/pie-elements/commit/33d88e7688443098baf940ac1233e3fba68c2b81))
82
+ * **categorize:** define all propTypes-PD-1971 ([202030d](https://github.com/pie-framework/pie-elements/commit/202030dca780ee28871140cef0437c8a0a2632c2))
83
+ * **categorize:** name field for the new category should have focus after add new cat-PD-1971 ([9456f42](https://github.com/pie-framework/pie-elements/commit/9456f427d6775d99f24a1661f4eb5332e2ebe507))
84
+ * **categorize:** select text on focus-PD-1971 ([8be1949](https://github.com/pie-framework/pie-elements/commit/8be1949b8ebc60b2aefc21842a264900f0ddc4c1))
85
+ * **categorize:** solve conflicts-PD-1971 ([e56e7c0](https://github.com/pie-framework/pie-elements/commit/e56e7c01ad4806a822537416e8741784de12517c))
86
+ * **categorize:** update snapshot-PD-1971 ([c825e35](https://github.com/pie-framework/pie-elements/commit/c825e359a2561a3a6a39506d1838ef0e93ddd087))
87
+
88
+
89
+
90
+
91
+
92
+ # [6.4.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.3.0...@pie-element/categorize-configure@6.4.0) (2022-12-07)
93
+
94
+
95
+ ### Bug Fixes
96
+
97
+ * update libs ([441f403](https://github.com/pie-framework/pie-elements/commit/441f403870b7bec0d61fab58b8d93dbe0ead4c32))
98
+ * update libs for PD-2030 PD-2031 ([3174022](https://github.com/pie-framework/pie-elements/commit/3174022d45603ed217bbe8804a142b07084636a5))
99
+ * updated lib PD-1715 ([42e788d](https://github.com/pie-framework/pie-elements/commit/42e788db0c792838994e55001952da7701251a8e))
100
+ * updated libs ([c20de3a](https://github.com/pie-framework/pie-elements/commit/c20de3a6ba4499a090c809e18e52588d2a585fa0))
101
+ * updated libs ([0eed79a](https://github.com/pie-framework/pie-elements/commit/0eed79a32c3b777c16c8cabf201513fc1d2726a0))
102
+ * updated libs ([343c9ec](https://github.com/pie-framework/pie-elements/commit/343c9ec3dccba7f781e90ae2bd195cac6f78f467))
103
+
104
+
105
+ ### Features
106
+
107
+ * **categorize:** add Choice Possition to Settings Panel-PD-1980 ([4e40d37](https://github.com/pie-framework/pie-elements/commit/4e40d37c8f6f47a00ffdfbfcd9fc389dcce3d0f5))
108
+ * **categorize:** add sanity check for alternate and msg for category label-PD-1981 ([0ecbef7](https://github.com/pie-framework/pie-elements/commit/0ecbef7e92647afba746311d8dc3cb7de9992ea1))
109
+ * **categorize:** add spaces between operators-PD-1981 ([62b368f](https://github.com/pie-framework/pie-elements/commit/62b368f12f13e5e2223d6a5178c58b8f644ab6fd))
110
+ * **categorize:** add validate in configure for further testing-PD-1981 ([1b71edb](https://github.com/pie-framework/pie-elements/commit/1b71edb363ad1e906d3b90a0cbaad7ab4e151dd5))
111
+ * **categorize:** categories per accept values up to 6-PD-1983 ([5344780](https://github.com/pie-framework/pie-elements/commit/53447807bcd79b9af37bf1a1177417a8bbff85ef))
112
+ * **categorize:** Create validation function for Categorize-PD-1981 ([17e9023](https://github.com/pie-framework/pie-elements/commit/17e9023f38be8841ca83967b61e8a7f688a52075))
113
+ * **categorize:** duplicated alternate validation controller and ui-PD-1981 ([8435bd2](https://github.com/pie-framework/pie-elements/commit/8435bd24b309f7af9f8663f720a20b4ed3229d7d))
114
+ * **categorize:** Move Choices Position into Settings-PD-1980 ([84c89fa](https://github.com/pie-framework/pie-elements/commit/84c89fa1cc3c6f2d333ac21b9e9c1678e71cbadd))
115
+ * **categorize:** solve conflicts-PD-1981 ([ac4afa2](https://github.com/pie-framework/pie-elements/commit/ac4afa2bb8174ddd9ba2d3b1be50c8684c8f6999))
116
+ * **categorize:** ui validations added-PD-1981 ([a5f7c4f](https://github.com/pie-framework/pie-elements/commit/a5f7c4f0c0a3937793f679deae82ed5d797f4b72))
117
+ * **categorize:** update documentation with the niew config fields-PD-1983 ([c81c36b](https://github.com/pie-framework/pie-elements/commit/c81c36b8eb5067413d7993647ba6c5b1bcdb9f12))
118
+ * **categorize:** update propTypes for categorize-PD-1981 ([6e983b8](https://github.com/pie-framework/pie-elements/commit/6e983b86cc5e74b30194f5555269f54220041c57))
119
+ * **categorize:** update snapshots-PD-1981 ([256df44](https://github.com/pie-framework/pie-elements/commit/256df44f52ba128aa4045d76a1b8c3b6a1745812))
120
+
121
+
122
+
123
+
124
+
125
+ # [6.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.2.2...@pie-element/categorize-configure@6.3.0) (2022-11-15)
126
+
127
+
128
+ ### Bug Fixes
129
+
130
+ * **categorize:** move Lock Choice Order into settings - PD-1984 ([912b072](https://github.com/pie-framework/pie-elements/commit/912b072ea7c9555bba5ad2c18167326a7d82922e))
131
+
132
+
133
+ ### Features
134
+
135
+ * **categorize:** add constant for multiplePlacements choices-PD-1974 ([05462c9](https://github.com/pie-framework/pie-elements/commit/05462c9a4ae50c93d2ae980bc8fca8a58e986436))
136
+ * **categorize:** delete unnecessarry spaces and avoid choiceCount undefined:PD-1974 ([4fca67f](https://github.com/pie-framework/pie-elements/commit/4fca67f878c06e694a9553c76f5516b84116044b))
137
+ * **categorize:** simplify if condition - PD-1974 ([2f795cd](https://github.com/pie-framework/pie-elements/commit/2f795cd5c792d94b2d680e0a997dff11f0d8144a))
138
+ * **categorize:** solve conflicts: PD-1984 ([1d746f6](https://github.com/pie-framework/pie-elements/commit/1d746f622129656c676517408ae4fb75b918e0b2))
139
+ * **categorize:** update same line return method-PD-1984 ([1bbe4b3](https://github.com/pie-framework/pie-elements/commit/1bbe4b36143e6fd77a005e334a3b79fb4ba94519))
140
+ * **categorize:** updatel model from controller to be consistent with the one in configure-PD-1985 ([d7f6e3f](https://github.com/pie-framework/pie-elements/commit/d7f6e3f47c28f9e0d41738a70ecff49c9b72a6af))
141
+
142
+
143
+
144
+
145
+
146
+ ## [6.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.2.1...@pie-element/categorize-configure@6.2.2) (2022-11-11)
147
+
148
+
149
+ ### Bug Fixes
150
+
151
+ * add sanity checks ([1cfd187](https://github.com/pie-framework/pie-elements/commit/1cfd187d2c2bab2d589aa2d7b7563b1c69e3295e))
152
+
153
+
154
+
155
+
156
+
157
+ ## [6.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.2.0...@pie-element/categorize-configure@6.2.1) (2022-10-31)
158
+
159
+ **Note:** Version bump only for package @pie-element/categorize-configure
160
+
161
+
162
+
163
+
164
+
165
+ # [6.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.9...@pie-element/categorize-configure@6.2.0) (2022-10-17)
166
+
167
+
168
+ ### Features
169
+
170
+ * enable spanish and special characters in author PD-2120 ([85fd3dd](https://github.com/pie-framework/pie-elements/commit/85fd3dd0fc10da1a2dfd5a842809c625790f8ba9))
171
+ * set withRubric to false in item default configurations. Set rubricEnabled to true if it's enabled for drawing-response and extended-text-entry ([a209057](https://github.com/pie-framework/pie-elements/commit/a209057f5a3fa5438efc8595453c89c11959a8f5))
172
+ * update libs ([7e174fb](https://github.com/pie-framework/pie-elements/commit/7e174fba75e7ea668900ad5c103751cefe33e2af))
173
+ * **categorize:** add pie-api config PD-23 ([79a3424](https://github.com/pie-framework/pie-elements/commit/79a3424efbb4e32097028da0bada6c493ad4d0e5))
174
+ * **categorize:** add settings to enable rubric. Add withRubric prop to configuration and rubricEnabled prop to model PD-2019 ([fc719ea](https://github.com/pie-framework/pie-elements/commit/fc719ea36f0a3fd74829e4e550222d1d1a9b0df8))
175
+ * **categorize:** add uploadSoundSupport property PD-23-updated ([74eb10b](https://github.com/pie-framework/pie-elements/commit/74eb10b6187cdd5c068820e5079e88230246b0d4))
176
+ * **categorize:** fix tests with default val for `withRubric` PD-2093 ([0113d16](https://github.com/pie-framework/pie-elements/commit/0113d1676a65c8ace6ccb1fbfc1a8540e11e3da1))
177
+
178
+
179
+
180
+
181
+
182
+ ## [6.1.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.8...@pie-element/categorize-configure@6.1.9) (2022-09-29)
183
+
184
+ **Note:** Version bump only for package @pie-element/categorize-configure
185
+
186
+
187
+
188
+
189
+
190
+ ## [6.1.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.7...@pie-element/categorize-configure@6.1.8) (2022-09-14)
191
+
192
+ **Note:** Version bump only for package @pie-element/categorize-configure
193
+
194
+
195
+
196
+
197
+
198
+ ## [6.1.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.6...@pie-element/categorize-configure@6.1.7) (2022-08-31)
199
+
200
+
201
+ ### Bug Fixes
202
+
203
+ * **categorize:** filter choices to prevent crash of wrongly imported items PD-1982 ([05c5ead](https://github.com/pie-framework/pie-elements/commit/05c5eadd4275a6f29ec1cbde6ea699a8379b68d5))
204
+
205
+
206
+
207
+
208
+
209
+ ## [6.1.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.5...@pie-element/categorize-configure@6.1.6) (2022-08-16)
210
+
211
+ **Note:** Version bump only for package @pie-element/categorize-configure
212
+
213
+
214
+
215
+
216
+
217
+ ## [6.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.4...@pie-element/categorize-configure@6.1.5) (2022-08-08)
218
+
219
+ **Note:** Version bump only for package @pie-element/categorize-configure
220
+
221
+
222
+
223
+
224
+
225
+ ## [6.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.3...@pie-element/categorize-configure@6.1.4) (2022-08-02)
226
+
227
+ **Note:** Version bump only for package @pie-element/categorize-configure
228
+
229
+
230
+
231
+
232
+
233
+ ## [6.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.2...@pie-element/categorize-configure@6.1.3) (2022-07-22)
234
+
235
+ **Note:** Version bump only for package @pie-element/categorize-configure
236
+
237
+
238
+
239
+
240
+
241
+ ## [6.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.1...@pie-element/categorize-configure@6.1.2) (2022-07-20)
242
+
243
+ **Note:** Version bump only for package @pie-element/categorize-configure
244
+
245
+
246
+
247
+
248
+
249
+ ## [6.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.1.0...@pie-element/categorize-configure@6.1.1) (2022-07-19)
250
+
251
+ **Note:** Version bump only for package @pie-element/categorize-configure
252
+
253
+
254
+
255
+
256
+
257
+ # [6.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@6.0.0...@pie-element/categorize-configure@6.1.0) (2022-06-28)
258
+
259
+
260
+ ### Features
261
+
262
+ * **categorize:** add maxImageWidth and maxImageHeight props PD-1801 ([c438cea](https://github.com/pie-framework/pie-elements/commit/c438cea310e6e5cdfbd8c057fc9aadb36d53bb76))
263
+ * **categorize:** implement generate validation message method, add info tooltip PD-1740 ([b315f4e](https://github.com/pie-framework/pie-elements/commit/b315f4ea0bc1461da0a8469bd9df383bc98e78ca))
264
+ * **categorize:** implement ui/ux for validation PD-1740 ([0a05866](https://github.com/pie-framework/pie-elements/commit/0a05866af89b0123b8979ef3b4916af4b2a0cdf9))
265
+
266
+
267
+
268
+
269
+
270
+ # [6.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.25...@pie-element/categorize-configure@6.0.0) (2022-06-28)
271
+
272
+
273
+ ### chore
274
+
275
+ * Merge master with develop. ([cdca48a](https://github.com/pie-framework/pie-elements/commit/cdca48abaa1d4179e4a961e13d171e14b7ed2444))
276
+
277
+
278
+ ### BREAKING CHANGES
279
+
280
+ * Image percent buttons were removed from toolbar.
281
+ New properties maxImageWidth and maxImageHeight were added.
282
+
283
+
284
+
285
+
286
+
287
+ ## [5.4.25](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.24...@pie-element/categorize-configure@5.4.25) (2022-06-13)
288
+
289
+ **Note:** Version bump only for package @pie-element/categorize-configure
290
+
291
+
292
+
293
+
294
+
295
+ ## [5.4.24](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.23...@pie-element/categorize-configure@5.4.24) (2022-05-30)
296
+
297
+ **Note:** Version bump only for package @pie-element/categorize-configure
298
+
299
+
300
+
301
+
302
+
303
+ ## [5.4.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.22...@pie-element/categorize-configure@5.4.23) (2022-05-16)
304
+
305
+ **Note:** Version bump only for package @pie-element/categorize-configure
306
+
307
+
308
+
309
+
310
+
311
+ ## [5.4.22](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.21...@pie-element/categorize-configure@5.4.22) (2022-05-09)
312
+
313
+ **Note:** Version bump only for package @pie-element/categorize-configure
314
+
315
+
316
+
317
+
318
+
319
+ ## [5.4.21](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.20...@pie-element/categorize-configure@5.4.21) (2022-05-03)
320
+
321
+ **Note:** Version bump only for package @pie-element/categorize-configure
322
+
323
+
324
+
325
+
326
+
327
+ ## [5.4.20](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.19...@pie-element/categorize-configure@5.4.20) (2022-04-12)
328
+
329
+ **Note:** Version bump only for package @pie-element/categorize-configure
330
+
331
+
332
+
333
+
334
+
335
+ ## [5.4.19](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.18...@pie-element/categorize-configure@5.4.19) (2022-03-28)
336
+
337
+ **Note:** Version bump only for package @pie-element/categorize-configure
338
+
339
+
340
+
341
+
342
+
343
+ ## [5.4.18](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.17...@pie-element/categorize-configure@5.4.18) (2022-03-22)
344
+
345
+ **Note:** Version bump only for package @pie-element/categorize-configure
346
+
347
+
348
+
349
+
350
+
351
+ ## [5.4.17](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.16...@pie-element/categorize-configure@5.4.17) (2022-03-08)
352
+
353
+ **Note:** Version bump only for package @pie-element/categorize-configure
354
+
355
+
356
+
357
+
358
+
359
+ ## [5.4.16](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.15...@pie-element/categorize-configure@5.4.16) (2022-03-08)
360
+
361
+ **Note:** Version bump only for package @pie-element/categorize-configure
362
+
363
+
364
+
365
+
366
+
367
+ ## [5.4.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.14...@pie-element/categorize-configure@5.4.15) (2022-02-21)
368
+
369
+ **Note:** Version bump only for package @pie-element/categorize-configure
370
+
371
+
372
+
373
+
374
+
375
+ ## [5.4.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.13...@pie-element/categorize-configure@5.4.14) (2022-02-04)
376
+
377
+ **Note:** Version bump only for package @pie-element/categorize-configure
378
+
379
+
380
+
381
+
382
+
6
383
  ## [5.4.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/categorize-configure@5.4.12...@pie-element/categorize-configure@5.4.13) (2022-01-24)
7
384
 
8
385
  **Note:** Version bump only for package @pie-element/categorize-configure
@@ -4,13 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
8
+ var _utils = require("./utils");
9
+
7
10
  var _default = {
8
11
  model: {
9
12
  choices: [],
10
13
  choicesPosition: 'below',
11
14
  choicesLabel: '',
12
15
  lockChoiceOrder: true,
13
- removeTilesAfterPlacing: false,
16
+ allowMultiplePlacementsEnabled: _utils.multiplePlacements.enabled,
17
+ allowAlternateEnabled: false,
14
18
  categoriesPerRow: 2,
15
19
  categories: [],
16
20
  alternates: [],
@@ -25,15 +29,36 @@ var _default = {
25
29
  toolbarEditorPosition: 'bottom'
26
30
  },
27
31
  configuration: {
32
+ spellCheck: {
33
+ label: 'Spellcheck',
34
+ settings: false,
35
+ enabled: true
36
+ },
28
37
  feedback: {
29
38
  settings: true,
30
39
  label: 'Feedback',
31
40
  enabled: true
32
41
  },
33
42
  lockChoiceOrder: {
34
- settings: false,
43
+ settings: true,
35
44
  label: 'Lock Choice Order'
36
45
  },
46
+ choicesPosition: {
47
+ settings: true,
48
+ label: 'Choices Position'
49
+ },
50
+ allowMultiplePlacements: {
51
+ settings: true,
52
+ label: 'Allow Multiple Placements'
53
+ },
54
+ allowAlternate: {
55
+ settings: true,
56
+ label: 'Allow Alternate Correct Answers'
57
+ },
58
+ categoriesPerRow: {
59
+ settings: true,
60
+ label: 'Categories per row'
61
+ },
37
62
  partialScoring: {
38
63
  settings: false,
39
64
  label: 'Allow Partial Scoring'
@@ -50,6 +75,7 @@ var _default = {
50
75
  settings: false,
51
76
  label: 'Scoring Type'
52
77
  },
78
+ settingsPanelDisabled: false,
53
79
  studentInstructions: {
54
80
  settings: false,
55
81
  label: 'Student Instructions'
@@ -61,7 +87,28 @@ var _default = {
61
87
  toolbarEditorPosition: {
62
88
  settings: false,
63
89
  label: 'Toolbar Editor Position'
64
- }
90
+ },
91
+ maxImageWidth: {
92
+ teacherInstructions: 300,
93
+ prompt: 300,
94
+ rationale: 300,
95
+ rowLabel: 200,
96
+ categoryLabel: 260,
97
+ choices: 240
98
+ },
99
+ maxImageHeight: {
100
+ teacherInstructions: 300,
101
+ prompt: 300,
102
+ rationale: 300,
103
+ rowLabel: 100,
104
+ categoryLabel: 100,
105
+ choices: 150
106
+ },
107
+ withRubric: {
108
+ settings: false,
109
+ label: 'Add Rubric'
110
+ },
111
+ minCategoriesPerRow: 1
65
112
  }
66
113
  };
67
114
  exports["default"] = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","choices","choicesPosition","choicesLabel","lockChoiceOrder","removeTilesAfterPlacing","categoriesPerRow","categories","alternates","correctResponse","rowLabels","partialScoring","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","toolbarEditorPosition","configuration","feedback","settings","label","enabled","prompt","rationale","scoringType","studentInstructions","teacherInstructions"],"mappings":";;;;;;eA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,KAAK,EAAE;AAFI,KAtBA;AA0BbK,IAAAA,mBAAmB,EAAE;AACnBN,MAAAA,QAAQ,EAAE,KADS;AAEnBC,MAAAA,KAAK,EAAE;AAFY,KA1BR;AA8BbM,IAAAA,mBAAmB,EAAE;AACnBP,MAAAA,QAAQ,EAAE,IADS;AAEnBC,MAAAA,KAAK,EAAE;AAFY,KA9BR;AAkCbJ,IAAAA,qBAAqB,EAAC;AACpBG,MAAAA,QAAQ,EAAE,KADU;AAEpBC,MAAAA,KAAK,EAAE;AAFa;AAlCT;AApBF,C","sourcesContent":["export default {\n model: {\n choices: [],\n choicesPosition: 'below',\n choicesLabel: '',\n lockChoiceOrder: true,\n removeTilesAfterPlacing: false,\n categoriesPerRow: 2,\n categories: [],\n alternates: [],\n correctResponse: [],\n rowLabels: [''],\n partialScoring: true,\n feedbackEnabled: true,\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n feedback: {\n settings: true,\n label: 'Feedback',\n enabled: true\n },\n lockChoiceOrder: {\n settings: false,\n label: 'Lock Choice Order'\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n prompt: {\n settings: true,\n label: 'Prompt'\n },\n rationale: {\n settings: true,\n label: 'Rationale'\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions'\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions'\n },\n toolbarEditorPosition:{\n settings: false,\n label: 'Toolbar Editor Position'\n },\n }\n};\n"],"file":"defaults.js"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["model","choices","choicesPosition","choicesLabel","lockChoiceOrder","allowMultiplePlacementsEnabled","multiplePlacements","enabled","allowAlternateEnabled","categoriesPerRow","categories","alternates","correctResponse","rowLabels","partialScoring","feedbackEnabled","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","toolbarEditorPosition","configuration","spellCheck","label","settings","feedback","allowMultiplePlacements","allowAlternate","prompt","rationale","scoringType","settingsPanelDisabled","studentInstructions","teacherInstructions","maxImageWidth","rowLabel","categoryLabel","maxImageHeight","withRubric","minCategoriesPerRow"],"mappings":";;;;;;;AAAA;;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,EADJ;AAELC,IAAAA,eAAe,EAAE,OAFZ;AAGLC,IAAAA,YAAY,EAAE,EAHT;AAILC,IAAAA,eAAe,EAAE,IAJZ;AAKLC,IAAAA,8BAA8B,EAAEC,0BAAmBC,OAL9C;AAMLC,IAAAA,qBAAqB,EAAE,KANlB;AAOLC,IAAAA,gBAAgB,EAAE,CAPb;AAQLC,IAAAA,UAAU,EAAE,EARP;AASLC,IAAAA,UAAU,EAAE,EATP;AAULC,IAAAA,eAAe,EAAE,EAVZ;AAWLC,IAAAA,SAAS,EAAE,CAAC,EAAD,CAXN;AAYLC,IAAAA,cAAc,EAAE,IAZX;AAaLC,IAAAA,eAAe,EAAE,IAbZ;AAcLC,IAAAA,gBAAgB,EAAE,IAdb;AAeLC,IAAAA,aAAa,EAAE,IAfV;AAgBLC,IAAAA,0BAA0B,EAAE,IAhBvB;AAiBLC,IAAAA,0BAA0B,EAAE,IAjBvB;AAkBLC,IAAAA,qBAAqB,EAAE;AAlBlB,GADM;AAqBbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVC,MAAAA,KAAK,EAAE,YADG;AAEVC,MAAAA,QAAQ,EAAE,KAFA;AAGVjB,MAAAA,OAAO,EAAE;AAHC,KADC;AAMbkB,IAAAA,QAAQ,EAAE;AACRD,MAAAA,QAAQ,EAAE,IADF;AAERD,MAAAA,KAAK,EAAE,UAFC;AAGRhB,MAAAA,OAAO,EAAE;AAHD,KANG;AAWbH,IAAAA,eAAe,EAAE;AACfoB,MAAAA,QAAQ,EAAE,IADK;AAEfD,MAAAA,KAAK,EAAE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,MAAAA,MAAM,EAAE,GAFK;AAGbC,MAAAA,SAAS,EAAE,GAHE;AAIbM,MAAAA,QAAQ,EAAE,GAJG;AAKbC,MAAAA,aAAa,EAAE,GALF;AAMbnC,MAAAA,OAAO,EAAE;AANI,KA5DF;AAoEboC,IAAAA,cAAc,EAAE;AACdJ,MAAAA,mBAAmB,EAAE,GADP;AAEdL,MAAAA,MAAM,EAAE,GAFM;AAGdC,MAAAA,SAAS,EAAE,GAHG;AAIdM,MAAAA,QAAQ,EAAE,GAJI;AAKdC,MAAAA,aAAa,EAAE,GALD;AAMdnC,MAAAA,OAAO,EAAE;AANK,KApEH;AA4EbqC,IAAAA,UAAU,EAAE;AACVd,MAAAA,QAAQ,EAAE,KADA;AAEVD,MAAAA,KAAK,EAAE;AAFG,KA5EC;AAgFbgB,IAAAA,mBAAmB,EAAE;AAhFR;AArBF,C","sourcesContent":["import { multiplePlacements } from './utils';\n\nexport default {\n model: {\n choices: [],\n choicesPosition: 'below',\n choicesLabel: '',\n lockChoiceOrder: true,\n allowMultiplePlacementsEnabled: multiplePlacements.enabled,\n allowAlternateEnabled: false,\n categoriesPerRow: 2,\n categories: [],\n alternates: [],\n correctResponse: [],\n rowLabels: [''],\n partialScoring: true,\n feedbackEnabled: true,\n rationaleEnabled: true,\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n feedback: {\n settings: true,\n label: 'Feedback',\n enabled: true,\n },\n lockChoiceOrder: {\n settings: true,\n label: 'Lock Choice Order',\n },\n choicesPosition: {\n settings: true,\n label: 'Choices Position',\n },\n allowMultiplePlacements: {\n settings: true,\n label: 'Allow Multiple Placements',\n },\n allowAlternate: {\n settings: true,\n label: 'Allow Alternate Correct Answers',\n },\n categoriesPerRow: {\n settings: true,\n label: 'Categories per row',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n settingsPanelDisabled: false,\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n toolbarEditorPosition: {\n settings: false,\n label: 'Toolbar Editor Position',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n rowLabel: 200,\n categoryLabel: 260,\n choices: 240,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n rowLabel: 100,\n categoryLabel: 100,\n choices: 150,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n minCategoriesPerRow: 1,\n },\n};\n"],"file":"defaults.js"}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.buildAlternateResponses = exports.buildCategories = void 0;
8
+ exports.buildCategories = exports.buildAlternateResponses = void 0;
9
9
 
10
10
  var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
11
11
 
@@ -21,10 +21,13 @@ var buildCategories = function buildCategories(categories, choices, correctRespo
21
21
  var choice = choices.find(function (h) {
22
22
  return h.id === choiceId;
23
23
  });
24
- return Object.assign({}, {
25
- id: choice.id,
26
- content: choice.content
27
- });
24
+
25
+ if (choice) {
26
+ return Object.assign({}, {
27
+ id: choice.id,
28
+ content: choice.content
29
+ });
30
+ }
28
31
  });
29
32
  }
30
33
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/design/builder.js"],"names":["buildCategories","categories","choices","correctResponse","clonedCategories","map","category","cr","find","id","choiceId","choice","h","Object","assign","content","getChoices","cat","index","alternateResponses","length","alt","ch","buildAlternateResponses","mostAlternates","reduce","mostAlt","alternatesArray","Array","fill","val","catIndex","currentC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CAACM,IAAR,CAAa,UAAAc,EAAE;AAAA,aAAIA,EAAE,CAACb,EAAH,KAAUY,GAAd;AAAA,KAAf,CAAP;AACD,GAFM,CAAP;AAGD,CARD;;AAUO,IAAME,uBAAuB,GAAG,SAA1BA,uBAA0B,CAACtB,UAAD,EAAaC,OAAb,EAAsBC,eAAtB,EAA0C;AAC/E,MAAMqB,cAAc,GAAGrB,eAAe,CAACsB,MAAhB,CAAuB,UAACC,OAAD,EAAUT,GAAV,EAAkB;AAC9D,QAAIA,GAAG,CAACE,kBAAJ,IAA0BF,GAAG,CAACE,kBAAJ,CAAuBC,MAAvB,IAAiCM,OAA/D,EAAwE;AACtE,aAAOT,GAAG,CAACE,kBAAJ,CAAuBC,MAA9B;AACD;;AAED,WAAOM,OAAP;AACD,GANsB,EAMpB,CANoB,CAAvB;AAOA,MAAMC,eAAe,GAAI,IAAIC,KAAJ,CAAUJ,cAAV,CAAD,CAA4BK,IAA5B,CAAiC,CAAjC,CAAxB;AAEA,SAAOF,eAAe,CAACtB,GAAhB,CAAoB,UAACyB,GAAD,EAAMZ,KAAN,EAAgB;AACzC,WAAOf,eAAe,CAACE,GAAhB,CAAoB,UAACY,GAAD,EAAMc,QAAN,EAAmB;AAC5C,UAAMC,eAAe,GAAG/B,UAAU,CAAC8B,QAAD,CAAlC;AAEA,aAAO;AACLtB,QAAAA,EAAE,EAAEuB,eAAe,CAACvB,EADf;AAELwB,QAAAA,KAAK,EAAED,eAAe,CAACC,KAFlB;AAGL/B,QAAAA,OAAO,EAAEc,UAAU,CAACC,GAAD,EAAMf,OAAN,EAAegB,KAAf;AAHd,OAAP;AAKD,KARM,CAAP;AASD,GAVM,CAAP;AAWD,CArBM","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\n\nexport const buildCategories = (categories, choices, correctResponse) => {\n const clonedCategories = cloneDeep(categories);\n\n return clonedCategories.map(category => {\n const cr = correctResponse.find(cr => cr.category === category.id);\n\n if (cr) {\n category.choices = (cr.choices || []).map(choiceId => {\n const choice = choices.find(h => h.id === choiceId);\n return Object.assign({}, { id: choice.id, content: choice.content });\n });\n }\n\n return category;\n });\n};\n\nconst getChoices = (cat, choices, index) => {\n if (!cat.alternateResponses || cat.alternateResponses.length === 0) {\n return [];\n }\n\n return (cat.alternateResponses[index] || []).map(alt => {\n return choices.find(ch => ch.id === alt);\n });\n};\n\nexport const buildAlternateResponses = (categories, choices, correctResponse) => {\n const mostAlternates = correctResponse.reduce((mostAlt, cat) => {\n if (cat.alternateResponses && cat.alternateResponses.length >= mostAlt) {\n return cat.alternateResponses.length;\n }\n\n return mostAlt;\n }, 0);\n const alternatesArray = (new Array(mostAlternates)).fill(0);\n\n return alternatesArray.map((val, index) => {\n return correctResponse.map((cat, catIndex) => {\n const currentCategory = categories[catIndex];\n\n return {\n id: currentCategory.id,\n label: currentCategory.label,\n choices: getChoices(cat, choices, index)\n };\n });\n });\n};\n"],"file":"builder.js"}
1
+ {"version":3,"sources":["../../src/design/builder.js"],"names":["buildCategories","categories","choices","correctResponse","clonedCategories","map","category","cr","find","id","choiceId","choice","h","Object","assign","content","getChoices","cat","index","alternateResponses","length","alt","ch","buildAlternateResponses","mostAlternates","reduce","mostAlt","alternatesArray","Array","fill","val","catIndex","currentCategory","label"],"mappings":";;;;;;;;;AAAA;;AAEO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,UAAD,EAAaC,OAAb,EAAsBC,eAAtB,EAA0C;AACvE,MAAMC,gBAAgB,GAAG,2BAAUH,UAAV,CAAzB;AAEA,SAAOG,gBAAgB,CAACC,GAAjB,CAAqB,UAACC,QAAD,EAAc;AACxC,QAAMC,EAAE,GAAGJ,eAAe,CAACK,IAAhB,CAAqB,UAACD,EAAD;AAAA,aAAQA,EAAE,CAACD,QAAH,KAAgBA,QAAQ,CAACG,EAAjC;AAAA,KAArB,CAAX;;AAEA,QAAIF,EAAJ,EAAQ;AACND,MAAAA,QAAQ,CAACJ,OAAT,GAAmB,CAACK,EAAE,CAACL,OAAH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,CAAuBC,MAA9B;AACD;;AAED,WAAOM,OAAP;AACD,GANsB,EAMpB,CANoB,CAAvB;AAOA,MAAMC,eAAe,GAAG,IAAIC,KAAJ,CAAUJ,cAAV,EAA0BK,IAA1B,CAA+B,CAA/B,CAAxB;AAEA,SAAOF,eAAe,CAACtB,GAAhB,CAAoB,UAACyB,GAAD,EAAMZ,KAAN,EAAgB;AACzC,WAAOf,eAAe,CAACE,GAAhB,CAAoB,UAACY,GAAD,EAAMc,QAAN,EAAmB;AAC5C,UAAMC,eAAe,GAAG/B,UAAU,CAAC8B,QAAD,CAAlC;AAEA,aAAO;AACLtB,QAAAA,EAAE,EAAEuB,eAAe,CAACvB,EADf;AAELwB,QAAAA,KAAK,EAAED,eAAe,CAACC,KAFlB;AAGL/B,QAAAA,OAAO,EAAEc,UAAU,CAACC,GAAD,EAAMf,OAAN,EAAegB,KAAf;AAHd,OAAP;AAKD,KARM,CAAP;AASD,GAVM,CAAP;AAWD,CArBM","sourcesContent":["import cloneDeep from 'lodash/cloneDeep';\n\nexport const buildCategories = (categories, choices, correctResponse) => {\n const clonedCategories = cloneDeep(categories);\n\n return clonedCategories.map((category) => {\n const cr = correctResponse.find((cr) => cr.category === category.id);\n\n if (cr) {\n category.choices = (cr.choices || []).map((choiceId) => {\n const choice = choices.find((h) => h.id === choiceId);\n if (choice) {\n return Object.assign({}, { id: choice.id, content: choice.content });\n }\n });\n }\n\n return category;\n });\n};\n\nconst getChoices = (cat, choices, index) => {\n if (!cat.alternateResponses || cat.alternateResponses.length === 0) {\n return [];\n }\n\n return (cat.alternateResponses[index] || []).map((alt) => {\n return choices.find((ch) => ch.id === alt);\n });\n};\n\nexport const buildAlternateResponses = (categories, choices, correctResponse) => {\n const mostAlternates = correctResponse.reduce((mostAlt, cat) => {\n if (cat.alternateResponses && cat.alternateResponses.length >= mostAlt) {\n return cat.alternateResponses.length;\n }\n\n return mostAlt;\n }, 0);\n const alternatesArray = new Array(mostAlternates).fill(0);\n\n return alternatesArray.map((val, index) => {\n return correctResponse.map((cat, catIndex) => {\n const currentCategory = categories[catIndex];\n\n return {\n id: currentCategory.id,\n label: currentCategory.label,\n choices: getChoices(cat, choices, index),\n };\n });\n });\n};\n"],"file":"builder.js"}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Divider = exports.DeleteButton = exports.AddButton = exports.RawAddButton = void 0;
8
+ exports.RawAddButton = exports.Divider = exports.DeleteButton = exports.AddButton = void 0;
9
9
 
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
 
@@ -99,12 +99,14 @@ var DeleteButton = (0, _styles.withStyles)(function () {
99
99
  })(function (_ref) {
100
100
  var classes = _ref.classes,
101
101
  label = _ref.label,
102
- onClick = _ref.onClick;
102
+ onClick = _ref.onClick,
103
+ disabled = _ref.disabled;
103
104
  return /*#__PURE__*/_react["default"].createElement(_Button["default"], {
104
105
  className: classes.deleteButton,
105
106
  onClick: onClick,
106
107
  size: "small",
107
- color: "primary"
108
+ color: "primary",
109
+ disabled: disabled
108
110
  }, label);
109
111
  });
110
112
  exports.DeleteButton = DeleteButton;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/design/buttons.jsx"],"names":["RawAddButton","props","classes","className","label","onClick","disabled","addButton","React","Component","PropTypes","object","isRequired","string","func","bool","styles","theme","height","spacing","unit","AddButton","DeleteButton","deleteButton","margin","padding","Divider","divider","marginTop","marginBottom"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,Y;;;;;;;;;;;;WAaX,kBAAS;AACP,wBAAyD,KAAKC,KAA9D;AAAA,UAAQC,OAAR,eAAQA,OAAR;AAAA,UAAiBC,SAAjB,eAAiBA,SAAjB;AAAA,UAA4BC,KAA5B,eAA4BA,KAA5B;AAAA,UAAmCC,OAAnC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O,CAACqB,YADrB;AAEE,IAAA,OAAO,EAAElB,OAFX;AAGE,IAAA,IAAI,EAAC,OAHP;AAIE,IAAA,KAAK,EAAC;AAJR,KAMGD,KANH,CADE;AAAA,CALiB,CAArB;;AAgBA,IAAMsB,OAAO,GAAG,wBAAW,UAAAT,KAAK;AAAA,SAAK;AACnCU,IAAAA,OAAO,EAAE;AACPC,MAAAA,SAAS,EAAE,IAAIX,KAAK,CAACE,OAAN,CAAcC,IADtB;AAEPS,MAAAA,YAAY,EAAE,IAAIZ,KAAK,CAACE,OAAN,CAAcC;AAFzB;AAD0B,GAAL;AAAA,CAAhB,EAKZ;AAAA,MAAGlB,OAAH,SAAGA,OAAH;AAAA,sBAAiB,gCAAC,mBAAD;AAAY,IAAA,SAAS,EAAEA,OAAO,CAACyB;AAA/B,IAAjB;AAAA,CALY,CAAhB","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport MuiDivider from '@material-ui/core/Divider';\n\nexport class RawAddButton extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool\n };\n\n static defaultProps = {\n label: 'Add'\n };\n\n render() {\n const { classes, className, label, onClick, disabled } = this.props;\n return (\n <Button\n onClick={onClick}\n disabled={disabled}\n className={classNames(classes.addButton, className)}\n size=\"small\"\n variant=\"contained\"\n color=\"primary\"\n >\n {label}\n </Button>\n );\n }\n}\nconst styles = theme => ({\n addButton: {\n height: theme.spacing.unit * 4\n }\n});\n\nconst AddButton = withStyles(styles)(RawAddButton);\n\nconst DeleteButton = withStyles(() => ({\n deleteButton: {\n margin: 0,\n padding: 0\n }\n}))(({ classes, label, onClick }) => (\n <Button\n className={classes.deleteButton}\n onClick={onClick}\n size=\"small\"\n color=\"primary\"\n >\n {label}\n </Button>\n));\n\nconst Divider = withStyles(theme => ({\n divider: {\n marginTop: 2 * theme.spacing.unit,\n marginBottom: 2 * theme.spacing.unit\n }\n}))(({ classes }) => <MuiDivider className={classes.divider} />);\n\nexport { AddButton, DeleteButton, Divider };\n"],"file":"buttons.js"}
1
+ {"version":3,"sources":["../../src/design/buttons.jsx"],"names":["RawAddButton","props","classes","className","label","onClick","disabled","addButton","React","Component","PropTypes","object","isRequired","string","func","bool","styles","theme","height","spacing","unit","AddButton","DeleteButton","deleteButton","margin","padding","Divider","divider","marginTop","marginBottom"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;IAEaA,Y;;;;;;;;;;;;WAaX,kBAAS;AACP,wBAAyD,KAAKC,KAA9D;AAAA,UAAQC,OAAR,eAAQA,OAAR;AAAA,UAAiBC,SAAjB,eAAiBA,SAAjB;AAAA,UAA4BC,KAA5B,eAA4BA,KAA5B;AAAA,UAAmCC,OAAnC,eAAmCA,OAAnC;AAAA,UAA4CC,QAA5C,eAA4CA,QAA5C;AACA,0BACE,gCAAC,kBAAD;AACE,QAAA,OAAO,EAAED,OADX;AAEE,QAAA,QAAQ,EAAEC,QAFZ;AAGE,QAAA,SAAS,EAAE,4BAAWJ,OAAO,CAACK,SAAnB,EAA8BJ,SAA9B,CAHb;AAIE,QAAA,IAAI,EAAC,OAJP;AAKE,QAAA,OAAO,EAAC,WALV;AAME,QAAA,KAAK,EAAC;AANR,SAQGC,KARH,CADF;AAYD;;;EA3B+BI,kBAAMC,S;;;iCAA3BT,Y,eACQ;AACjBE,EAAAA,OAAO,EAAEQ,sBAAUC,MAAV,CAAiBC,UADT;AAEjBT,EAAAA,SAAS,EAAEO,sBAAUG,MAFJ;AAGjBT,EAAAA,KAAK,EAAEM,sBAAUG,MAHA;AAIjBR,EAAAA,OAAO,EAAEK,sBAAUI,IAJF;AAKjBR,EAAAA,QAAQ,EAAEI,sBAAUK;AALH,C;iCADRf,Y,kBASW;AACpBI,EAAAA,KAAK,EA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-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport Button from '@material-ui/core/Button';\nimport MuiDivider from '@material-ui/core/Divider';\n\nexport class RawAddButton extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n };\n\n static defaultProps = {\n label: 'Add',\n };\n\n render() {\n const { classes, className, label, onClick, disabled } = this.props;\n return (\n <Button\n onClick={onClick}\n disabled={disabled}\n className={classNames(classes.addButton, className)}\n size=\"small\"\n variant=\"contained\"\n color=\"primary\"\n >\n {label}\n </Button>\n );\n }\n}\nconst styles = (theme) => ({\n addButton: {\n height: theme.spacing.unit * 4,\n },\n});\n\nconst AddButton = withStyles(styles)(RawAddButton);\n\nconst DeleteButton = withStyles(() => ({\n deleteButton: {\n margin: 0,\n padding: 0,\n },\n}))(({ classes, label, onClick, disabled }) => (\n <Button className={classes.deleteButton} onClick={onClick} size=\"small\" color=\"primary\" disabled={disabled}>\n {label}\n </Button>\n));\n\nconst Divider = withStyles((theme) => ({\n divider: {\n marginTop: 2 * theme.spacing.unit,\n marginBottom: 2 * theme.spacing.unit,\n },\n}))(({ classes }) => <MuiDivider className={classes.divider} />);\n\nexport { AddButton, DeleteButton, Divider };\n"],"file":"buttons.js"}