@pie-element/categorize 11.0.5-esm.1 → 11.2.0-mui-update.0

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 (81) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/configure/CHANGELOG.md +74 -0
  3. package/configure/lib/defaults.js +2 -5
  4. package/configure/lib/defaults.js.map +1 -1
  5. package/configure/lib/design/builder.js +15 -33
  6. package/configure/lib/design/builder.js.map +1 -1
  7. package/configure/lib/design/buttons.js +44 -95
  8. package/configure/lib/design/buttons.js.map +1 -1
  9. package/configure/lib/design/categories/RowLabel.js +32 -45
  10. package/configure/lib/design/categories/RowLabel.js.map +1 -1
  11. package/configure/lib/design/categories/alternateResponses.js +102 -251
  12. package/configure/lib/design/categories/alternateResponses.js.map +1 -1
  13. package/configure/lib/design/categories/category.js +138 -208
  14. package/configure/lib/design/categories/category.js.map +1 -1
  15. package/configure/lib/design/categories/choice-preview.js +59 -126
  16. package/configure/lib/design/categories/choice-preview.js.map +1 -1
  17. package/configure/lib/design/categories/droppable-placeholder.js +76 -165
  18. package/configure/lib/design/categories/droppable-placeholder.js.map +1 -1
  19. package/configure/lib/design/categories/index.js +199 -384
  20. package/configure/lib/design/categories/index.js.map +1 -1
  21. package/configure/lib/design/choices/choice.js +160 -263
  22. package/configure/lib/design/choices/choice.js.map +1 -1
  23. package/configure/lib/design/choices/config.js +46 -98
  24. package/configure/lib/design/choices/config.js.map +1 -1
  25. package/configure/lib/design/choices/index.js +152 -236
  26. package/configure/lib/design/choices/index.js.map +1 -1
  27. package/configure/lib/design/header.js +62 -111
  28. package/configure/lib/design/header.js.map +1 -1
  29. package/configure/lib/design/index.js +632 -476
  30. package/configure/lib/design/index.js.map +1 -1
  31. package/configure/lib/design/input-header.js +97 -149
  32. package/configure/lib/design/input-header.js.map +1 -1
  33. package/configure/lib/design/utils.js +4 -15
  34. package/configure/lib/design/utils.js.map +1 -1
  35. package/configure/lib/index.js +120 -183
  36. package/configure/lib/index.js.map +1 -1
  37. package/configure/lib/main.js +31 -74
  38. package/configure/lib/main.js.map +1 -1
  39. package/configure/lib/utils.js +22 -32
  40. package/configure/lib/utils.js.map +1 -1
  41. package/configure/package.json +15 -14
  42. package/controller/CHANGELOG.md +62 -0
  43. package/controller/lib/defaults.js +2 -5
  44. package/controller/lib/defaults.js.map +1 -1
  45. package/controller/lib/index.js +238 -315
  46. package/controller/lib/index.js.map +1 -1
  47. package/controller/lib/utils.js +40 -31
  48. package/controller/lib/utils.js.map +1 -1
  49. package/controller/package.json +5 -5
  50. package/lib/categorize/categories.js +110 -164
  51. package/lib/categorize/categories.js.map +1 -1
  52. package/lib/categorize/category.js +72 -122
  53. package/lib/categorize/category.js.map +1 -1
  54. package/lib/categorize/choice.js +116 -245
  55. package/lib/categorize/choice.js.map +1 -1
  56. package/lib/categorize/choices.js +66 -131
  57. package/lib/categorize/choices.js.map +1 -1
  58. package/lib/categorize/droppable-placeholder.js +49 -103
  59. package/lib/categorize/droppable-placeholder.js.map +1 -1
  60. package/lib/categorize/grid-content.js +39 -87
  61. package/lib/categorize/grid-content.js.map +1 -1
  62. package/lib/categorize/index.js +341 -316
  63. package/lib/categorize/index.js.map +1 -1
  64. package/lib/index.js +286 -271
  65. package/lib/index.js.map +1 -1
  66. package/package.json +17 -31
  67. package/LICENSE.md +0 -5
  68. package/esm/configure.js +0 -5025
  69. package/esm/configure.js.map +0 -1
  70. package/esm/controller.js +0 -456
  71. package/esm/controller.js.map +0 -1
  72. package/esm/element.js +0 -3118
  73. package/esm/element.js.map +0 -1
  74. package/module/configure.js +0 -1
  75. package/module/controller.js +0 -6076
  76. package/module/demo.js +0 -382
  77. package/module/element.js +0 -1
  78. package/module/index.html +0 -21
  79. package/module/manifest.json +0 -22
  80. package/module/print-demo.js +0 -420
  81. package/module/print.html +0 -18
package/module/demo.js DELETED
@@ -1,382 +0,0 @@
1
- import Configure from './configure.js';
2
- import Element from './element.js';
3
- import * as controller from './controller.js';
4
-
5
- var generate = {};
6
-
7
- /* const E234 = {
8
- choicesPosition: 'below',
9
- lockChoiceOrder: false,
10
- choices: [
11
- {
12
- content: 'built on board',
13
- id: '0',
14
- categoryCount: 1,
15
- },
16
- {
17
- content: 'shipped from Earth',
18
- id: '1',
19
- categoryCount: 1,
20
- },
21
- {
22
- id: '2',
23
- categoryCount: 1,
24
- content: 'carried on board',
25
- },
26
- {
27
- categoryCount: 1,
28
- content: 'rebuilt when lost or broken',
29
- id: '3',
30
- },
31
- ],
32
- categories: [
33
- {
34
- id: '0',
35
- label: 'Traditional Equipment',
36
- },
37
- {
38
- id: '1',
39
- label: '3D-Printed Equipment',
40
- },
41
- ],
42
- categoriesPerRow: 2,
43
- rationale:
44
- '<p>Traditional equipment must be carried on board or shipped from Earth. 3D-printed equipment can be built on demand or rebuilt if it gets lost or broken.</p>',
45
- prompt: '<p>Drag <span class="relative-emphasis">two</span> phrases into each of the categories.</p>',
46
- partialScoring: true,
47
- correctResponse: [
48
- {
49
- choices: ['1', '2'],
50
- category: '0',
51
- },
52
- {
53
- choices: ['0', '3'],
54
- category: '1',
55
- },
56
- ],
57
- }; */
58
-
59
- // const E236 = {
60
- // choices: [
61
- // {
62
- // id: '0',
63
- // categoryCount: 1,
64
- // content: '3 pizzas cost $30.75',
65
- // },
66
- // {
67
- // categoryCount: 1,
68
- // content: '4 pizzas cost $39.00',
69
- // id: '1',
70
- // },
71
- // {
72
- // categoryCount: 1,
73
- // content: '5 pizzas cost $57.50',
74
- // id: '2',
75
- // },
76
- // {
77
- // categoryCount: 1,
78
- // content: '6 pizzas cost $69.00',
79
- // id: '3',
80
- // },
81
- // {
82
- // id: '4',
83
- // categoryCount: 1,
84
- // content: '7 pizzas cost $71.75',
85
- // },
86
- // {
87
- // content: '8 pizzas cost $78.00',
88
- // id: '5',
89
- // categoryCount: 1,
90
- // },
91
- // ],
92
- // categories: [
93
- // {
94
- // id: '0',
95
- // label: 'Roma',
96
- // },
97
- // {
98
- // id: '1',
99
- // label: 'Pizza Plus',
100
- // },
101
- // {
102
- // id: '2',
103
- // label: 'Umberto\'s',
104
- // },
105
- // ],
106
- // categoriesPerRow: 3,
107
- // rationale:
108
- // '<p>Find the unit price for each bill&#160;by dividing the total charged by the number of pizzas ordered.</p><p>3 pizzas for $30.75 is a unit price of $30.75/3 = $10.25 - Roma</p><p>4 pizzas for $39.00 is a unit price of $39.00/4 = $9.75 - Umberto&#39;s</p><p>5 pizzas for $57.50 is a unit price of $57.50/5 = $11.50 - Pizza Plus</p><p>6 pizzas for $69.00 is a unit price of $69.00/6 = $11.50 - Pizza Plus</p><p>7 pizzas for $71.75 is a unit price of $71.75/7 = $10.25 - Roma</p><p>8 pizzas for $78.00 is a unit price of $78.00/8 = $9.75 - Umberto&#39;s</p><p></p>',
109
- // prompt:
110
- // '<p>The prices for one regular pizza at three different pizzerias are shown in the table.</p><p><img alt="image dc3a3208bce04d0398af01b84816de4e" id="dc3a3208bce04d0398af01b84816de4e" src="https://storage.googleapis.com/pie-prod-221718-assets/image/90749ad9-968c-4c80-95fe-a83f8a1647cd"></p><p>Six different pizza orders and costs are shown below. Drag and drop each order and cost to&#160;the correct pizzeria.</p>',
111
- // partialScoring: true,
112
- // correctResponse: [
113
- // {
114
- // choices: ['0', '4'],
115
- // category: '0',
116
- // },
117
- // {
118
- // choices: ['2', '3'],
119
- // category: '1',
120
- // },
121
- // {
122
- // choices: ['1', '5'],
123
- // category: '2',
124
- // },
125
- // ],
126
- // choicesPosition: 'below',
127
- // lockChoiceOrder: false,
128
- // };
129
- // const E216 = {
130
- // choices: [
131
- // {
132
- // categoryCount: 1,
133
- // content: 'to present limitations of the theory',
134
- // id: '0',
135
- // },
136
- // {
137
- // categoryCount: 1,
138
- // content: 'to state the theory',
139
- // id: '1',
140
- // },
141
- // {
142
- // categoryCount: 1,
143
- // content: 'to give evidence that the theory is correct',
144
- // id: '2',
145
- // },
146
- // {
147
- // id: '3',
148
- // categoryCount: 1,
149
- // content: 'to explain the purpose of the paragraph',
150
- // },
151
- // {
152
- // categoryCount: 1,
153
- // content: 'to explain how the theory was reached',
154
- // id: '4',
155
- // },
156
- // {
157
- // categoryCount: 1,
158
- // content: 'to explain the science behind the theory',
159
- // id: '5',
160
- // },
161
- // ],
162
- // categories: [
163
- // {
164
- // id: '0',
165
- // label: 'Purpose of the Sentence',
166
- // },
167
- // {
168
- // id: '1',
169
- // label: '',
170
- // },
171
- // {
172
- // id: '2',
173
- // label: '',
174
- // },
175
- // {
176
- // id: '3',
177
- // label: '',
178
- // },
179
- // {
180
- // id: '4',
181
- // label: '',
182
- // },
183
- // {
184
- // id: '5',
185
- // label: '',
186
- // },
187
- // ],
188
- // categoriesPerRow: 1,
189
- // rationale:
190
- // '<p>Each sentence in the paragraph serves a purpose in the paragraph&#39;s development:</p><p>Sentence 1 explains the purpose of the paragraph, to describe a theory on which kind of nap is best.</p><p>Sentence 2 states the theory, that people should take a 15-minute nap.</p><p>Sentence 3 explains the science behind the theory, that memory is turned off when the brain is sleepy.</p><p>Sentence 4 explains how the theory was reached, as a deduction based on the experiment.</p><p>Sentence 5 presents limitations of the theory.</p><p>Sentence 6 gives evidence that the theory is correct.</p>',
191
- // prompt:
192
- // '<p>Drag the purpose of each sentence to its correct classification box. Show the role each sentence serves in developing the paragraph.</p><p>1 What kind of nap is best? 2 Social psychologist and sleep expert James Maas argued that people should take a 15-minute nap when they feel sluggish. 3 By measuring electricity in the brain, he found that when a person is excessively tired, his memory is turned off even when he is awake. 4 Maas deduced that a 15-minute nap would restore the brain&#8217;s full function, including memory. 5 However, a longer 30-minute nap would put a person into Delta&#8212;a deep sleep that leaves a person groggy upon awakening. 6 Over the years, he has found that regular naps improve workers&#8217; health and reaction time, and companies&#39; productivity increases.</p><p></p><p></p>',
193
- // rowLabels: ['1', '2', '3', '4', '5', '6'],
194
- // partialScoring: true,
195
- // correctResponse: [
196
- // {
197
- // choices: ['3'],
198
- // category: '0',
199
- // },
200
- // {
201
- // choices: ['1'],
202
- // category: '1',
203
- // },
204
- // {
205
- // choices: ['5'],
206
- // category: '2',
207
- // },
208
- // {
209
- // choices: ['4'],
210
- // category: '3',
211
- // },
212
- // {
213
- // choices: ['0'],
214
- // category: '4',
215
- // },
216
- // {
217
- // category: '5',
218
- // choices: ['2'],
219
- // },
220
- // ],
221
- // choicesPosition: 'below',
222
- // lockChoiceOrder: false,
223
- // };
224
- // const E215 = {
225
- // rationale:
226
- // '<p>The function is increasing over <span class="variable">x</span>-values where the graph is rising from left to right. This occurs for <span class="variable">x</span>-values less than&#160;&#8211;1, between&#160;&#8211;1 and 3, and <span class="variable">x</span>-values larger than 8.&#160;The function is decreasing over <span class="variable">x</span>-values where the graph is falling from left to right. This occurs for <span class="variable">x</span>-values between 3&#160;and 8.</p>',
227
- // prompt:
228
- // '<p>Consider the function <span class="variable">f</span>(<span class="variable">x</span>) graphed below.</p><p><img alt="image fa651e86bf6e4ad3b521aa4679941fc0" id="fa651e86bf6e4ad3b521aa4679941fc0" src="https://storage.googleapis.com/pie-prod-221718-assets/image/918fff4d-efeb-4971-9afa-c0a1f2eba825"></p><p>Each inequality represents a range of <span class="variable">x</span>-values over which <span class="variable">f</span>(<span class="variable">x</span>) is defined. Drag and drop the correct statement into each box to classify the behavior of the function over the given range of <span class="variable">x</span>-values.</p>',
229
- // partialScoring: true,
230
- // correctResponse: [
231
- // {
232
- // category: '0',
233
- // choices: ['0'],
234
- // },
235
- // {
236
- // category: '1',
237
- // choices: ['0'],
238
- // },
239
- // {
240
- // choices: ['1'],
241
- // category: '2',
242
- // },
243
- // {
244
- // choices: ['0'],
245
- // category: '3',
246
- // },
247
- // ],
248
- // choicesPosition: 'below',
249
- // lockChoiceOrder: false,
250
- // choices: [
251
- // {
252
- // content: '<em>f</em>(<em>x</em>) is increasing',
253
- // id: '0',
254
- // },
255
- // {
256
- // id: '1',
257
- // content: '<span><em>f</em>(<em>x</em>) is decreasing</span>',
258
- // },
259
- // {
260
- // content: '<em>f</em>(<em>x</em>)<em> </em>is constant',
261
- // id: '2',
262
- // },
263
- // ],
264
- // categories: [
265
- // {
266
- // id: '0',
267
- // label: '<em>x</em> &lt; &#8722; 1',
268
- // },
269
- // {
270
- // id: '1',
271
- // label: '&#8722; 1 &lt; <em>x</em> &lt; 3',
272
- // },
273
- // {
274
- // id: '2',
275
- // label: '3 &lt; <em>x</em> &lt; 8',
276
- // },
277
- // {
278
- // id: '3',
279
- // label: '<em>x</em> &gt; 8',
280
- // },
281
- // ],
282
- // categoriesPerRow: 4,
283
- // };
284
-
285
- generate.model = (id, element) => ({
286
- id,
287
- element,
288
- 'teacherInstructions': '',
289
- 'promptEnabled': true,
290
- 'prompt': '<p><audio controls="" controlslist="nodownload" id="2ad0337f-904c-4cd6-b6d3-399c08db8642.mp3" xmlns="http://www.w3.org/1999/html"><source src="https://assets.pie-api.com/assets/c9946808-ab26-45d9-bd98-f430c97f09fc/audio/mpeg/6ab9652e-7277-4a12-8f7a-a2bfb76f127c" type="audio/mpeg">Your browser does not support the audio element.</audio></p><p>Move the equations to tell whether they are true or false.</p>',
291
- 'categories': [
292
- {
293
- 'id': '0',
294
- 'label': '<img height="150" src="https://assets.pie-api.com/assets/c9946808-ab26-45d9-bd98-f430c97f09fc/image/svg xml/ab759120-d9b0-4f6f-b755-f4f83f6bc0f7" width="265">'
295
- },
296
- {
297
- 'id': '1',
298
- 'label': '<img height="150" src="https://assets.pie-api.com/assets/c9946808-ab26-45d9-bd98-f430c97f09fc/image/svg xml/9f2a6102-7acb-43cb-8651-d75d4aece3ae" width="265">'
299
- }
300
- ],
301
- 'categoriesPerRow': 2,
302
- 'allowMaxChoicesPerCategory': false,
303
- 'maxChoicesPerCategory': 0,
304
- 'rowLabels': [],
305
- 'choices': [
306
- {
307
- 'id': '0',
308
- 'content': '\\(6+3=9-2\\)',
309
- 'categoryCount': 1,
310
- 'correctResponseCount': 1
311
- },
312
- {
313
- 'id': '1',
314
- 'content': '\\(10-4=9-5\\)',
315
- 'categoryCount': 1,
316
- 'correctResponseCount': 1
317
- },
318
- {
319
- 'id': '2',
320
- 'content': '\\(17-9=9+17\\)',
321
- 'categoryCount': 1,
322
- 'correctResponseCount': 1
323
- },
324
- {
325
- 'id': '3',
326
- 'content': '\\(11+9=10+10\\)',
327
- 'categoryCount': 1,
328
- 'correctResponseCount': 1
329
- },
330
- {
331
- 'id': '4',
332
- 'content': '\\(14-4=5+5\\)',
333
- 'categoryCount': 1,
334
- 'correctResponseCount': 1
335
- }
336
- ],
337
- 'choicesPosition': 'above',
338
- 'choicesLabel': '',
339
- 'lockChoiceOrder': true,
340
- 'allowMultiplePlacementsEnabled': 'No',
341
- 'correctResponse': [
342
- {
343
- 'category': '0',
344
- 'choices': [
345
- '3',
346
- '4'
347
- ]
348
- },
349
- {
350
- 'category': '1',
351
- 'choices': [
352
- '0',
353
- '1',
354
- '2'
355
- ]
356
- }
357
- ],
358
- 'allowAlternateEnabled': false,
359
- 'alternates': [],
360
- 'partialScoring': true,
361
- 'minRowHeight': '175px',
362
- 'fontSizeFactor': 1.3
363
- });
364
-
365
- const { model } = generate;
366
-
367
- var config = {
368
- elements: {
369
- 'categorize-element': '../..',
370
- },
371
- models: [model('1', 'categorize-element')],
372
- };
373
-
374
- //Note: demo-el is a custom element loaded in the markup.
375
- customElements.whenDefined("demo-el").then(() => {
376
- config.models.forEach((m) => {
377
- const de = document.createElement("demo-el");
378
- document.body.appendChild(de);
379
- de.def = { tagName: m.element, Element, Configure, controller };
380
- de.model = m;
381
- });
382
- });