@pie-element/math-templated 2.18.0 → 2.19.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.
@@ -1,29 +1,180 @@
1
- Pie Model Object for @pie-elements/boilerplate-item-type
1
+ Model for the @pie-elements/math-templated
2
2
 
3
3
  The schema defines the following properties:
4
4
 
5
+ # `markup` (string, required)
6
+
7
+ Indicates markup value
8
+
5
9
  # `prompt` (string, required)
6
10
 
7
- The user prompt/item stem
11
+ Indicates prompt value
8
12
 
9
- # `promptEnabled` (boolean)
13
+ # `promptEnabled` (boolean, required)
10
14
 
11
- Determines if prompt should show
15
+ Indicates if Prompt is enabled
12
16
 
13
- # `id` (string, required)
17
+ # `teacherInstructionsEnabled` (boolean, required)
14
18
 
15
- Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
19
+ Indicates if Teacher Instructions are enabled
20
+
21
+ # `rationale` (string, required)
22
+
23
+ Indicates rationale value
24
+
25
+ # `rationaleEnabled` (boolean, required)
26
+
27
+ Indicates if Rationale is enabled
28
+
29
+ # `spellCheckEnabled` (boolean, required)
30
+
31
+ Indicates if Spell Check is enabled
32
+
33
+ # `playerSpellCheckEnabled` (boolean, required)
34
+
35
+ Indicates if Player Spell Check is enabled
36
+
37
+ # `responses` (array, required)
38
+
39
+ Array of all responses
40
+
41
+ The object is an array with all elements of the type `object`.
42
+
43
+ The array object has the following properties:
44
+
45
+ ## `allowTrailingZeros` (boolean, required)
46
+
47
+ Indicates the allowance of trailing zeros in expressions
48
+
49
+ Default: `"is false"`
50
+
51
+ ## `answer` (string, required)
52
+
53
+ The value for the response's answer
54
+
55
+ ## `id` (string, required)
56
+
57
+ The id for the response
58
+
59
+ ## `validation` (string, enum, required)
60
+
61
+ Indicates what type of validation should be applied on the response
62
+
63
+ This element must be one of the following enum values:
64
+
65
+ * `literal`
66
+ * `symbolic`
67
+
68
+ Default: `"is literal"`
69
+
70
+ ## `ignoreOrder` (boolean, required)
71
+
72
+ Indicates if the order of expression elements in literal validation can be ignore
73
+
74
+ Default: `"is false"`
75
+
76
+ ## `alternates` (object, required)
77
+
78
+ For validation type = literal, alternates represents
79
+ an object with some alternatives for the correct answers
16
80
 
17
81
  # `element` (string, required)
18
82
 
19
83
  The html Element tag name
20
84
 
85
+ # `equationEditor` (, enum, required)
86
+
87
+ Indicates what type of editor should be displayed for all the possible responses
88
+ 1 for Grade 1 - 2
89
+ 3 for Grade 3 - 5
90
+ 6 for Grade 6 - 7
91
+ 8 for Grade 8 - HS
92
+ non-negative-integers
93
+ integers
94
+ decimals
95
+ fractions
96
+ geometry
97
+ advanced-algebra
98
+ statistics
99
+
100
+ This element must be one of the following enum values:
101
+
102
+ * `1`
103
+ * `3`
104
+ * `6`
105
+ * `8`
106
+ * `advanced-algebra`
107
+ * `decimals`
108
+ * `fractions`
109
+ * `geometry`
110
+ * `integers`
111
+ * `item-authoring`
112
+ * `non-negative-integers`
113
+ * `statistics`
114
+
115
+ Default: `"- item-authoring"`
116
+
117
+ # `ignoreOrderDefault` (boolean, required)
118
+
119
+ Indicates the default value for ignoreOrder, in case that it's not set
120
+
121
+ Default: `"is false"`
122
+
123
+ # `allowTrailingZerosDefault` (boolean, required)
124
+
125
+ Indicates the default value for allowTrailingZeros, in case that it's not set
126
+
127
+ Default: `"is false"`
128
+
129
+ # `toolbarEditorPosition` (string, enum)
130
+
131
+ Indicates the editor's toolbar position which can be 'bottom' or 'top'
132
+
133
+ This element must be one of the following enum values:
134
+
135
+ * `bottom`
136
+ * `top`
137
+
138
+ Default: `": 'bottom'"`
139
+
140
+ # `validationDefault` (string, enum, required)
141
+
142
+ Indicates what type of validation should be applied on the response
143
+
144
+ This element must be one of the following enum values:
145
+
146
+ * `literal`
147
+ * `symbolic`
148
+
149
+ Default: `"is literal"`
150
+
151
+ # `id` (string, required)
152
+
153
+ Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
154
+
21
155
  ---
22
156
 
23
157
  # Sub Schemas
24
158
 
25
159
  The schema defines the following additional types:
26
160
 
161
+ ## `ConfigurePropWithEnabled` (object)
162
+
163
+ Properties of the `ConfigurePropWithEnabled` object:
164
+
165
+ ### `enabled` (boolean)
166
+
167
+ Indicates the value of the item if it affects config-ui
168
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
169
+
170
+ ### `settings` (boolean)
171
+
172
+ Indicates if the item has to be displayed in the Settings Panel
173
+
174
+ ### `label` (string)
175
+
176
+ Indicates the label for the item that has to be displayed in the Settings Panel
177
+
27
178
  ## `ConfigureProp` (object)
28
179
 
29
180
  Properties of the `ConfigureProp` object:
@@ -34,4 +185,398 @@ Indicates if the item has to be displayed in the Settings Panel
34
185
 
35
186
  ### `label` (string)
36
187
 
37
- Indicates the label for the item that has to be displayed in the Settings Panel
188
+ Indicates the label for the item that has to be displayed in the Settings Panel
189
+
190
+ ## `EditableHtmlConfigureProp` (object)
191
+
192
+ Properties of the `EditableHtmlConfigureProp` object:
193
+
194
+ ### `math` (object)
195
+
196
+ Properties of the `math` object:
197
+
198
+ #### `disabled` (boolean)
199
+
200
+ Indicates if the plugin is disabled or not
201
+
202
+ ### `audio` (object)
203
+
204
+ Properties of the `audio` object:
205
+
206
+ #### `disabled` (boolean)
207
+
208
+ Indicates if the plugin is disabled or not
209
+
210
+ ### `video` (object)
211
+
212
+ Properties of the `video` object:
213
+
214
+ #### `disabled` (boolean)
215
+
216
+ Indicates if the plugin is disabled or not
217
+
218
+ ### `image` (object)
219
+
220
+ Properties of the `image` object:
221
+
222
+ #### `disabled` (boolean)
223
+
224
+ Indicates if the plugin is disabled or not
225
+
226
+ ### `customPlugins` (array)
227
+
228
+ An array of objects that determine custom plugins.
229
+ A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when button gets pressed (event).
230
+ Example can be found at https://github.com/pie-framework/pie-lib/blob/develop/packages/demo/pages/editable-html.js#L425.
231
+
232
+ The object is an array with all elements of the type `object`.
233
+
234
+ The array object has the following properties:
235
+
236
+ #### `event` (string, required)
237
+
238
+ The name of the custom event. It needs to be valid (only letters, numbers and "_" can be used).
239
+ PIE will emit the event prefixed with "PIE-".
240
+ Eg: event = 'client_custom_event_A' => the emitted event will be "PIE-client_custom_event_A"
241
+
242
+ #### `iconAlt` (string, required)
243
+
244
+ The alt for the custom button icon
245
+
246
+ #### `iconType` (string, required)
247
+
248
+ The icon type.
249
+ Currently, only "SVG" is supported.
250
+
251
+ #### `icon` (string, required)
252
+
253
+ The icon string. Currently, only "SVG" is supported, so it needs to be a valid svg.
254
+
255
+ ### `blockquote` (object)
256
+
257
+ Properties of the `blockquote` object:
258
+
259
+ #### `disabled` (boolean)
260
+
261
+ Indicates if the plugin is disabled or not
262
+
263
+ ### `h3` (object)
264
+
265
+ Properties of the `h3` object:
266
+
267
+ #### `disabled` (boolean)
268
+
269
+ Indicates if the plugin is disabled or not
270
+
271
+ ## `EditableHtmlButtonConfigure` (object)
272
+
273
+ Properties of the `EditableHtmlButtonConfigure` object:
274
+
275
+ ### `disabled` (boolean)
276
+
277
+ Indicates if the plugin is disabled or not
278
+
279
+ ## `CustomPlugin` (object)
280
+
281
+ Properties of the `CustomPlugin` object:
282
+
283
+ ### `event` (string, required)
284
+
285
+ The name of the custom event. It needs to be valid (only letters, numbers and "_" can be used).
286
+ PIE will emit the event prefixed with "PIE-".
287
+ Eg: event = 'client_custom_event_A' => the emitted event will be "PIE-client_custom_event_A"
288
+
289
+ ### `iconAlt` (string, required)
290
+
291
+ The alt for the custom button icon
292
+
293
+ ### `iconType` (string, required)
294
+
295
+ The icon type.
296
+ Currently, only "SVG" is supported.
297
+
298
+ ### `icon` (string, required)
299
+
300
+ The icon string. Currently, only "SVG" is supported, so it needs to be a valid svg.
301
+
302
+ ## `EditableHtmlPluginConfigureRequired` (object)
303
+
304
+ Properties of the `EditableHtmlPluginConfigureRequired` object:
305
+
306
+ ### `inputConfiguration` (object)
307
+
308
+ Properties of the `inputConfiguration` object:
309
+
310
+ #### `math` (object)
311
+
312
+ Properties of the `math` object:
313
+
314
+ ##### `disabled` (boolean)
315
+
316
+ Indicates if the plugin is disabled or not
317
+
318
+ #### `audio` (object)
319
+
320
+ Properties of the `audio` object:
321
+
322
+ ##### `disabled` (boolean)
323
+
324
+ Indicates if the plugin is disabled or not
325
+
326
+ #### `video` (object)
327
+
328
+ Properties of the `video` object:
329
+
330
+ ##### `disabled` (boolean)
331
+
332
+ Indicates if the plugin is disabled or not
333
+
334
+ #### `image` (object)
335
+
336
+ Properties of the `image` object:
337
+
338
+ ##### `disabled` (boolean)
339
+
340
+ Indicates if the plugin is disabled or not
341
+
342
+ #### `customPlugins` (array)
343
+
344
+ An array of objects that determine custom plugins.
345
+ A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when button gets pressed (event).
346
+ Example can be found at https://github.com/pie-framework/pie-lib/blob/develop/packages/demo/pages/editable-html.js#L425.
347
+
348
+ The object is an array with all elements of the type `object`.
349
+
350
+ The array object has the following properties:
351
+
352
+ ##### `event` (string, required)
353
+
354
+ The name of the custom event. It needs to be valid (only letters, numbers and "_" can be used).
355
+ PIE will emit the event prefixed with "PIE-".
356
+ Eg: event = 'client_custom_event_A' => the emitted event will be "PIE-client_custom_event_A"
357
+
358
+ ##### `iconAlt` (string, required)
359
+
360
+ The alt for the custom button icon
361
+
362
+ ##### `iconType` (string, required)
363
+
364
+ The icon type.
365
+ Currently, only "SVG" is supported.
366
+
367
+ ##### `icon` (string, required)
368
+
369
+ The icon string. Currently, only "SVG" is supported, so it needs to be a valid svg.
370
+
371
+ #### `blockquote` (object)
372
+
373
+ Properties of the `blockquote` object:
374
+
375
+ ##### `disabled` (boolean)
376
+
377
+ Indicates if the plugin is disabled or not
378
+
379
+ #### `h3` (object)
380
+
381
+ Properties of the `h3` object:
382
+
383
+ ##### `disabled` (boolean)
384
+
385
+ Indicates if the plugin is disabled or not
386
+
387
+ ### `required` (boolean)
388
+
389
+ Indicates if the item is required and the value cannot be empty
390
+
391
+ ### `settings` (boolean)
392
+
393
+ Indicates if the item has to be displayed in the Settings Panel
394
+
395
+ ### `label` (string)
396
+
397
+ Indicates the label for the item that has to be displayed in the Settings Panel
398
+
399
+ ## `EditableHtmlPluginConfigure` (object)
400
+
401
+ Properties of the `EditableHtmlPluginConfigure` object:
402
+
403
+ ### `inputConfiguration` (object)
404
+
405
+ Properties of the `inputConfiguration` object:
406
+
407
+ #### `math` (object)
408
+
409
+ Properties of the `math` object:
410
+
411
+ ##### `disabled` (boolean)
412
+
413
+ Indicates if the plugin is disabled or not
414
+
415
+ #### `audio` (object)
416
+
417
+ Properties of the `audio` object:
418
+
419
+ ##### `disabled` (boolean)
420
+
421
+ Indicates if the plugin is disabled or not
422
+
423
+ #### `video` (object)
424
+
425
+ Properties of the `video` object:
426
+
427
+ ##### `disabled` (boolean)
428
+
429
+ Indicates if the plugin is disabled or not
430
+
431
+ #### `image` (object)
432
+
433
+ Properties of the `image` object:
434
+
435
+ ##### `disabled` (boolean)
436
+
437
+ Indicates if the plugin is disabled or not
438
+
439
+ #### `customPlugins` (array)
440
+
441
+ An array of objects that determine custom plugins.
442
+ A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when button gets pressed (event).
443
+ Example can be found at https://github.com/pie-framework/pie-lib/blob/develop/packages/demo/pages/editable-html.js#L425.
444
+
445
+ The object is an array with all elements of the type `object`.
446
+
447
+ The array object has the following properties:
448
+
449
+ ##### `event` (string, required)
450
+
451
+ The name of the custom event. It needs to be valid (only letters, numbers and "_" can be used).
452
+ PIE will emit the event prefixed with "PIE-".
453
+ Eg: event = 'client_custom_event_A' => the emitted event will be "PIE-client_custom_event_A"
454
+
455
+ ##### `iconAlt` (string, required)
456
+
457
+ The alt for the custom button icon
458
+
459
+ ##### `iconType` (string, required)
460
+
461
+ The icon type.
462
+ Currently, only "SVG" is supported.
463
+
464
+ ##### `icon` (string, required)
465
+
466
+ The icon string. Currently, only "SVG" is supported, so it needs to be a valid svg.
467
+
468
+ #### `blockquote` (object)
469
+
470
+ Properties of the `blockquote` object:
471
+
472
+ ##### `disabled` (boolean)
473
+
474
+ Indicates if the plugin is disabled or not
475
+
476
+ #### `h3` (object)
477
+
478
+ Properties of the `h3` object:
479
+
480
+ ##### `disabled` (boolean)
481
+
482
+ Indicates if the plugin is disabled or not
483
+
484
+ ### `settings` (boolean)
485
+
486
+ Indicates if the item has to be displayed in the Settings Panel
487
+
488
+ ### `label` (string)
489
+
490
+ Indicates the label for the item that has to be displayed in the Settings Panel
491
+
492
+ ## `ConfigureMaxImageDimensionsProp` (object)
493
+
494
+ Properties of the `ConfigureMaxImageDimensionsProp` object:
495
+
496
+ ### `teacherInstructions` (number)
497
+
498
+ Indicates the max dimension for images in teacher instructions
499
+
500
+ ### `prompt` (number)
501
+
502
+ Indicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified
503
+
504
+ ### `rationale` (number)
505
+
506
+ Indicates the max dimension for images in rationale
507
+
508
+ ## `ConfigureMathMLProp` (object)
509
+
510
+ Properties of the `ConfigureMathMLProp` object:
511
+
512
+ ### `mmlOutput` (number)
513
+
514
+ Indicates if model should have mathML output instead of latex
515
+
516
+ ### `mmlEditing` (number)
517
+
518
+ Indicates if mathML that's already in model should be editable
519
+
520
+ ## `ConfigureLanguageOptionsProp` (object)
521
+
522
+ Properties of the `ConfigureLanguageOptionsProp` object:
523
+
524
+ ### `value` (string, required)
525
+
526
+ Value of the language option
527
+
528
+ ### `label` (string, required)
529
+
530
+ Label of the language option
531
+
532
+ ## `Response` (object)
533
+
534
+ Properties of the `Response` object:
535
+
536
+ ### `allowTrailingZeros` (boolean, required)
537
+
538
+ Indicates the allowance of trailing zeros in expressions
539
+
540
+ Default: `"is false"`
541
+
542
+ ### `answer` (string, required)
543
+
544
+ The value for the response's answer
545
+
546
+ ### `id` (string, required)
547
+
548
+ The id for the response
549
+
550
+ ### `validation` (string, enum, required)
551
+
552
+ Indicates what type of validation should be applied on the response
553
+
554
+ This element must be one of the following enum values:
555
+
556
+ * `literal`
557
+ * `symbolic`
558
+
559
+ Default: `"is literal"`
560
+
561
+ ### `ignoreOrder` (boolean, required)
562
+
563
+ Indicates if the order of expression elements in literal validation can be ignore
564
+
565
+ Default: `"is false"`
566
+
567
+ ### `alternates` (object, required)
568
+
569
+ For validation type = literal, alternates represents
570
+ an object with some alternatives for the correct answers
571
+
572
+ ## `Alternate` (object)
573
+
574
+ Properties of the `Alternate` object:
575
+
576
+ ### `id` (number, required)
577
+
578
+ The id for the alternative response
579
+
580
+ ### `answer` (string, required)
581
+
582
+ The value for the alternative response
@@ -22792,6 +22792,8 @@ var _controllerUtils = controllerUtils;
22792
22792
  }(controllerUtils$1));
22793
22793
 
22794
22794
  const { translator } = Translator;
22795
+
22796
+ const getFeedback = value => value ? 'correct' : 'incorrect';
22795
22797
  const getContent = (html) => (html || '').replace(/(<(?!img|iframe)([^>]+)>)/gi, '');
22796
22798
 
22797
22799
  const getIsAnswerCorrect = (correctResponse, answerItem) => {
@@ -22838,7 +22840,6 @@ const getResponseCorrectness = (question, sessionResponse) => {
22838
22840
  } else {
22839
22841
  let correctAnswers = 0;
22840
22842
  let score = 0;
22841
- let correct = false;
22842
22843
  const correctResponsesCount = Object.keys(correctResponses || {}).length;
22843
22844
 
22844
22845
  Object.keys(correctResponses).forEach((responseId) => {
@@ -22858,9 +22859,9 @@ const getResponseCorrectness = (question, sessionResponse) => {
22858
22859
  score = (correctAnswers / Object.keys(correctResponses).length).toFixed(2);
22859
22860
 
22860
22861
  return {
22861
- correctness: fullyCorrect ? 'correct' : 'incorrect',
22862
+ correctness: getFeedback(fullyCorrect),
22862
22863
  score: correctAnswers > 0 ? score : 0,
22863
- correct
22864
+ correct: fullyCorrect
22864
22865
  };
22865
22866
  }
22866
22867
  };
@@ -22888,7 +22889,6 @@ const outcome = (question, session, env) =>
22888
22889
  resolve({ score: 0, empty: true });
22889
22890
  }
22890
22891
  const partialScoringEnabled = controllerUtils$1.partialScoring.enabled(question, env);
22891
- console.log('partialScoringEnabled: ', partialScoringEnabled);
22892
22892
  session = normalizeSession(session);
22893
22893
 
22894
22894
  if (env.mode !== 'evaluate') {
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-templated@2.17.0</title>
5
+ <title>@pie-element/math-templated@2.18.0</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/math-templated@2.17.0</title>
5
+ <title>@pie-element/math-templated@2.18.0</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "2.18.0",
7
+ "version": "2.19.0",
8
8
  "description": "",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "author": "",
18
18
  "license": "ISC",
19
- "gitHead": "66edb2a98e91aa6079ac9ee2ab11be96f8ec8167",
19
+ "gitHead": "1ef97b238096c35e6ecf747f015c0faaea69792f",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },