@webwriter/quiz 1.1.3 → 2.0.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 (167) hide show
  1. package/.github/workflows/publish.yml +8 -0
  2. package/LICENSE +6 -6
  3. package/README.md +778 -0
  4. package/assets/icons/grip-horizontal.svg +8 -0
  5. package/assets/icons/grip-vertical.svg +8 -0
  6. package/assets/icons/truefalse.svg +6 -0
  7. package/custom-elements.json +2779 -0
  8. package/custom.d.ts +180 -176
  9. package/dist/api/index.d.ts +27 -0
  10. package/dist/api/index.js +40 -0
  11. package/dist/migrate.js +1434 -0
  12. package/dist/widgets/webwriter-choice-item.js +4036 -3895
  13. package/dist/widgets/webwriter-choice.js +2269 -5821
  14. package/dist/widgets/webwriter-gap-item.js +3987 -0
  15. package/dist/widgets/webwriter-gap.js +2908 -0
  16. package/dist/widgets/webwriter-mark.js +4335 -3489
  17. package/dist/widgets/webwriter-order-item.js +4014 -3306
  18. package/dist/widgets/webwriter-order.js +2944 -4386
  19. package/dist/widgets/webwriter-pairing-item.js +1058 -2421
  20. package/dist/widgets/webwriter-pairing.js +2993 -4383
  21. package/dist/widgets/webwriter-quiz-hint.js +2469 -0
  22. package/dist/widgets/webwriter-quiz.js +4933 -6099
  23. package/dist/widgets/webwriter-speech.js +6077 -5230
  24. package/dist/widgets/webwriter-task-prompt.js +4775 -2165
  25. package/dist/widgets/webwriter-task.js +2364 -8382
  26. package/dist/widgets/webwriter-text.js +4169 -4337
  27. package/dist/widgets/webwriter-true-false.js +4674 -0
  28. package/editing-config.json +106 -0
  29. package/lit-localize.json +21 -15
  30. package/localization/de.xlf +407 -74
  31. package/localization/es.xlf +407 -69
  32. package/localization/fr.xlf +407 -69
  33. package/localization/generated/de.ts +112 -29
  34. package/localization/generated/es.ts +112 -29
  35. package/localization/generated/fr.ts +112 -29
  36. package/localization/generated/index.d.ts +5 -0
  37. package/localization/generated/index.js +2 -2
  38. package/localization/generated/it.ts +112 -29
  39. package/localization/generated/locale-codes.js +31 -79
  40. package/localization/generated/nl.ts +112 -29
  41. package/localization/it.xlf +407 -69
  42. package/localization/nl.xlf +407 -69
  43. package/package.json +119 -252
  44. package/scripts/apply-translations.mjs +97 -0
  45. package/src/api/index.ts +72 -0
  46. package/src/lib/artboard.ts +686 -0
  47. package/src/lib/draggable-grid.ts +432 -0
  48. package/src/lib/encrypted-property.ts +202 -0
  49. package/src/lib/hint-popup.ts +152 -0
  50. package/src/lib/utils.ts +97 -0
  51. package/src/lib/webwriter-quirks.ts +121 -0
  52. package/src/migrate/index.ts +622 -0
  53. package/src/migrate/legacy-solution.ts +362 -0
  54. package/src/snippets/order.html +9 -8
  55. package/src/widgets/choice/webwriter-choice-item.ts +316 -0
  56. package/src/widgets/choice/webwriter-choice.ts +328 -0
  57. package/src/widgets/choice/webwriter-true-false.ts +113 -0
  58. package/src/widgets/dnd/webwriter-dnd-draggable.ts +28 -0
  59. package/src/widgets/dnd/webwriter-dnd-dropzone.ts +9 -0
  60. package/src/widgets/dnd/webwriter-dnd.ts +36 -0
  61. package/src/widgets/gap/webwriter-gap-item.ts +250 -0
  62. package/src/widgets/gap/webwriter-gap.ts +447 -0
  63. package/src/widgets/order/webwriter-order-item.ts +243 -0
  64. package/src/widgets/order/webwriter-order.ts +282 -0
  65. package/src/widgets/pairing/webwriter-pairing-item.ts +46 -0
  66. package/src/widgets/pairing/webwriter-pairing.ts +934 -0
  67. package/src/widgets/speech/audio-player.ts +325 -0
  68. package/src/widgets/speech/audio-recorder.ts +285 -0
  69. package/src/widgets/speech/waveform.ts +113 -0
  70. package/src/widgets/speech/webwriter-speech.ts +87 -0
  71. package/src/widgets/webwriter-mark.ts +374 -432
  72. package/src/widgets/webwriter-quiz-hint.ts +36 -0
  73. package/src/widgets/webwriter-quiz.ts +320 -282
  74. package/src/widgets/webwriter-task-prompt.ts +49 -24
  75. package/src/widgets/webwriter-task.ts +216 -547
  76. package/src/widgets/webwriter-text.ts +291 -156
  77. package/tsconfig.api.json +12 -0
  78. package/tsconfig.json +8 -7
  79. package/dist/widgets/webwriter-choice.css +0 -444
  80. package/dist/widgets/webwriter-cloze-gap.css +0 -444
  81. package/dist/widgets/webwriter-cloze-gap.js +0 -5866
  82. package/dist/widgets/webwriter-cloze.css +0 -444
  83. package/dist/widgets/webwriter-cloze.js +0 -3786
  84. package/dist/widgets/webwriter-mark.css +0 -444
  85. package/dist/widgets/webwriter-order.css +0 -444
  86. package/dist/widgets/webwriter-pairing-item.css +0 -444
  87. package/dist/widgets/webwriter-pairing.css +0 -444
  88. package/dist/widgets/webwriter-quiz.css +0 -444
  89. package/dist/widgets/webwriter-task-explainer.css +0 -444
  90. package/dist/widgets/webwriter-task-explainer.js +0 -2872
  91. package/dist/widgets/webwriter-task-hint.css +0 -444
  92. package/dist/widgets/webwriter-task-hint.js +0 -2811
  93. package/dist/widgets/webwriter-task.css +0 -444
  94. package/dist/widgets/webwriter-text.css +0 -444
  95. package/localization/bg.xlf +0 -69
  96. package/localization/cs.xlf +0 -69
  97. package/localization/da.xlf +0 -69
  98. package/localization/el.xlf +0 -69
  99. package/localization/et.xlf +0 -69
  100. package/localization/fi.xlf +0 -69
  101. package/localization/generated/bg.ts +0 -30
  102. package/localization/generated/cs.ts +0 -30
  103. package/localization/generated/da.ts +0 -30
  104. package/localization/generated/el.ts +0 -30
  105. package/localization/generated/et.ts +0 -30
  106. package/localization/generated/fi.ts +0 -30
  107. package/localization/generated/hu.ts +0 -30
  108. package/localization/generated/id.ts +0 -30
  109. package/localization/generated/ja.ts +0 -30
  110. package/localization/generated/ko.ts +0 -30
  111. package/localization/generated/lt.ts +0 -30
  112. package/localization/generated/lv.ts +0 -30
  113. package/localization/generated/nb.ts +0 -30
  114. package/localization/generated/pl.ts +0 -30
  115. package/localization/generated/pt-BR.ts +0 -30
  116. package/localization/generated/pt-PT.ts +0 -30
  117. package/localization/generated/ro.ts +0 -30
  118. package/localization/generated/ru.ts +0 -30
  119. package/localization/generated/sk.ts +0 -30
  120. package/localization/generated/sl.ts +0 -30
  121. package/localization/generated/sv.ts +0 -30
  122. package/localization/generated/tr.ts +0 -30
  123. package/localization/generated/uk.ts +0 -30
  124. package/localization/generated/zh-hans.ts +0 -30
  125. package/localization/hu.xlf +0 -69
  126. package/localization/id.xlf +0 -69
  127. package/localization/ja.xlf +0 -69
  128. package/localization/ko.xlf +0 -69
  129. package/localization/lt.xlf +0 -69
  130. package/localization/lv.xlf +0 -69
  131. package/localization/nb.xlf +0 -69
  132. package/localization/pl.xlf +0 -69
  133. package/localization/pt-BR.xlf +0 -69
  134. package/localization/pt-PT.xlf +0 -69
  135. package/localization/ro.xlf +0 -69
  136. package/localization/ru.xlf +0 -69
  137. package/localization/sk.xlf +0 -69
  138. package/localization/sl.xlf +0 -69
  139. package/localization/sv.xlf +0 -69
  140. package/localization/tr.xlf +0 -69
  141. package/localization/uk.xlf +0 -69
  142. package/localization/zh-hans.xlf +0 -69
  143. package/src/lib/combobox.ts +0 -456
  144. package/src/lib/highlighter-fill.svg +0 -6
  145. package/src/snippets/Beispiel-Choice.html +0 -57
  146. package/src/snippets/Beispiel-Mark.html +0 -14
  147. package/src/snippets/Beispiel-Order.html +0 -52
  148. package/src/snippets/Beispiel-Text.html +0 -20
  149. package/src/snippets/blank.html +0 -1
  150. package/src/snippets/choice.html +0 -8
  151. package/src/snippets/cloze.html +0 -4
  152. package/src/snippets/mark.html +0 -4
  153. package/src/snippets/pairing.html +0 -10
  154. package/src/snippets/speech.html +0 -4
  155. package/src/snippets/text.html +0 -4
  156. package/src/snippets/wordsearch.html +0 -4
  157. package/src/widgets/webwriter-choice-item.ts +0 -254
  158. package/src/widgets/webwriter-choice.ts +0 -353
  159. package/src/widgets/webwriter-cloze-gap.ts +0 -216
  160. package/src/widgets/webwriter-cloze.ts +0 -136
  161. package/src/widgets/webwriter-order-item.ts +0 -441
  162. package/src/widgets/webwriter-order.ts +0 -327
  163. package/src/widgets/webwriter-pairing-item.ts +0 -161
  164. package/src/widgets/webwriter-pairing.ts +0 -193
  165. package/src/widgets/webwriter-speech.ts +0 -273
  166. package/src/widgets/webwriter-task-explainer.ts +0 -43
  167. package/src/widgets/webwriter-task-hint.ts +0 -23
@@ -0,0 +1,2779 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/widgets/webwriter-mark.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "class",
11
+ "description": "An answer where learners mark the words of a text that fit the question.\n\nThe text must be assigned to the default slot; the element itself must be\nassigned to the default slot of a `<webwriter-task>`.",
12
+ "name": "WebWriterMark",
13
+ "members": [
14
+ {
15
+ "kind": "field",
16
+ "name": "segmenter",
17
+ "privacy": "private",
18
+ "static": true,
19
+ "default": "new Intl.Segmenter(undefined, { granularity: \"word\" })"
20
+ },
21
+ {
22
+ "kind": "field",
23
+ "name": "highlights",
24
+ "type": {
25
+ "text": "Record<HighlightGroup, Highlight>"
26
+ },
27
+ "privacy": "private",
28
+ "static": true,
29
+ "default": "{ marked: new Highlight(), correct: new Highlight(), missed: new Highlight(), wrong: new Highlight(), }"
30
+ },
31
+ {
32
+ "kind": "field",
33
+ "name": "gradingMethod",
34
+ "type": {
35
+ "text": "MarkGradingMethod"
36
+ },
37
+ "default": "\"pass-fail\"",
38
+ "description": "How the score of this answer is calculated.\n\n- `pass-fail`: Full score only if exactly the correct words are marked.\n- `partial`: Correctly marked words earn credit, wrong ones subtract from it.",
39
+ "attribute": "grading-method",
40
+ "reflects": true
41
+ },
42
+ {
43
+ "kind": "field",
44
+ "name": "solution",
45
+ "type": {
46
+ "text": "number[]"
47
+ },
48
+ "default": "[]",
49
+ "description": "The indices of the word-like segments counting as correct. It is obfuscated in the markup so that learners cannot read it directly.",
50
+ "attribute": "solution",
51
+ "reflects": true
52
+ },
53
+ {
54
+ "kind": "field",
55
+ "name": "currentAnswer",
56
+ "type": {
57
+ "text": "number[]"
58
+ },
59
+ "privacy": "private",
60
+ "default": "[]"
61
+ },
62
+ {
63
+ "kind": "field",
64
+ "name": "graded",
65
+ "type": {
66
+ "text": "boolean"
67
+ },
68
+ "privacy": "private",
69
+ "default": "false"
70
+ },
71
+ {
72
+ "kind": "field",
73
+ "name": "detailedFeedback",
74
+ "type": {
75
+ "text": "boolean"
76
+ },
77
+ "privacy": "private",
78
+ "default": "false"
79
+ },
80
+ {
81
+ "kind": "field",
82
+ "name": "renderedRanges",
83
+ "type": {
84
+ "text": "Record<HighlightGroup, Range[]>"
85
+ },
86
+ "privacy": "private",
87
+ "default": "{ marked: [], correct: [], missed: [], wrong: [], }"
88
+ },
89
+ {
90
+ "kind": "field",
91
+ "name": "observer",
92
+ "privacy": "private",
93
+ "default": "new MutationObserver(records => this.handleMutation(records))"
94
+ },
95
+ {
96
+ "kind": "field",
97
+ "name": "enterTooltipRef",
98
+ "privacy": "private"
99
+ },
100
+ {
101
+ "kind": "field",
102
+ "name": "enterAnchorRef",
103
+ "privacy": "private"
104
+ },
105
+ {
106
+ "kind": "method",
107
+ "name": "getWordSegments",
108
+ "privacy": "private",
109
+ "return": {
110
+ "type": {
111
+ "text": "WordSegment[]"
112
+ }
113
+ }
114
+ },
115
+ {
116
+ "kind": "method",
117
+ "name": "toRange",
118
+ "privacy": "private",
119
+ "return": {
120
+ "type": {
121
+ "text": "Range"
122
+ }
123
+ },
124
+ "parameters": [
125
+ {
126
+ "name": "{ node, start, end }",
127
+ "type": {
128
+ "text": "WordSegment"
129
+ }
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "kind": "method",
135
+ "name": "setHighlight",
136
+ "privacy": "private",
137
+ "parameters": [
138
+ {
139
+ "name": "group",
140
+ "type": {
141
+ "text": "HighlightGroup"
142
+ }
143
+ },
144
+ {
145
+ "name": "ranges",
146
+ "type": {
147
+ "text": "Range[]"
148
+ }
149
+ }
150
+ ]
151
+ },
152
+ {
153
+ "kind": "method",
154
+ "name": "renderHighlights",
155
+ "privacy": "private"
156
+ },
157
+ {
158
+ "kind": "method",
159
+ "name": "handleMutation",
160
+ "privacy": "private",
161
+ "parameters": [
162
+ {
163
+ "name": "records",
164
+ "type": {
165
+ "text": "MutationRecord[]"
166
+ }
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "kind": "method",
172
+ "name": "toggleIndices",
173
+ "privacy": "private",
174
+ "return": {
175
+ "type": {
176
+ "text": "number[]"
177
+ }
178
+ },
179
+ "parameters": [
180
+ {
181
+ "name": "current",
182
+ "type": {
183
+ "text": "number[]"
184
+ }
185
+ },
186
+ {
187
+ "name": "indices",
188
+ "type": {
189
+ "text": "number[]"
190
+ }
191
+ }
192
+ ]
193
+ },
194
+ {
195
+ "kind": "method",
196
+ "name": "toggleSolutionMarking",
197
+ "privacy": "private",
198
+ "return": {
199
+ "type": {
200
+ "text": "boolean"
201
+ }
202
+ },
203
+ "parameters": [
204
+ {
205
+ "name": "point",
206
+ "type": {
207
+ "text": "CaretPosition | null"
208
+ }
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "kind": "method",
214
+ "name": "handleContextMenu",
215
+ "privacy": "private",
216
+ "parameters": [
217
+ {
218
+ "name": "event",
219
+ "type": {
220
+ "text": "MouseEvent"
221
+ }
222
+ }
223
+ ]
224
+ },
225
+ {
226
+ "kind": "method",
227
+ "name": "handleClick",
228
+ "privacy": "private",
229
+ "parameters": [
230
+ {
231
+ "name": "event",
232
+ "type": {
233
+ "text": "MouseEvent"
234
+ }
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "kind": "field",
240
+ "name": "handleKeyDown",
241
+ "privacy": "private"
242
+ },
243
+ {
244
+ "kind": "field",
245
+ "name": "handleSelectionChange",
246
+ "privacy": "private"
247
+ },
248
+ {
249
+ "kind": "method",
250
+ "name": "checkValidity",
251
+ "return": {
252
+ "type": {
253
+ "text": "boolean"
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "kind": "method",
259
+ "name": "checkAnswer",
260
+ "return": {
261
+ "type": {
262
+ "text": "number"
263
+ }
264
+ },
265
+ "parameters": [
266
+ {
267
+ "name": "detailedFeedback",
268
+ "type": {
269
+ "text": "boolean"
270
+ }
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ "kind": "method",
276
+ "name": "reset",
277
+ "return": {
278
+ "type": {
279
+ "text": "void"
280
+ }
281
+ }
282
+ }
283
+ ],
284
+ "attributes": [
285
+ {
286
+ "name": "grading-method",
287
+ "type": {
288
+ "text": "MarkGradingMethod"
289
+ },
290
+ "default": "\"pass-fail\"",
291
+ "description": "How the score of this answer is calculated.\n\n- `pass-fail`: Full score only if exactly the correct words are marked.\n- `partial`: Correctly marked words earn credit, wrong ones subtract from it.",
292
+ "fieldName": "gradingMethod"
293
+ },
294
+ {
295
+ "name": "solution",
296
+ "type": {
297
+ "text": "number[]"
298
+ },
299
+ "default": "[]",
300
+ "description": "The indices of the word-like segments counting as correct. It is obfuscated in the markup so that learners cannot read it directly.",
301
+ "fieldName": "solution"
302
+ }
303
+ ],
304
+ "superclass": {
305
+ "name": "LitElementWw",
306
+ "package": "@webwriter/lit"
307
+ },
308
+ "tagName": "webwriter-mark",
309
+ "customElement": true,
310
+ "modulePath": "src/widgets/webwriter-mark.ts",
311
+ "definitionPath": "src/widgets/webwriter-mark.ts"
312
+ }
313
+ ],
314
+ "exports": [
315
+ {
316
+ "kind": "js",
317
+ "name": "WebWriterMark",
318
+ "declaration": {
319
+ "name": "WebWriterMark",
320
+ "module": "src/widgets/webwriter-mark.ts"
321
+ }
322
+ },
323
+ {
324
+ "kind": "custom-element-definition",
325
+ "name": "webwriter-mark",
326
+ "declaration": {
327
+ "name": "WebWriterMark",
328
+ "module": "src/widgets/webwriter-mark.ts"
329
+ }
330
+ }
331
+ ]
332
+ },
333
+ {
334
+ "kind": "javascript-module",
335
+ "path": "src/widgets/webwriter-quiz-hint.ts",
336
+ "declarations": [
337
+ {
338
+ "kind": "class",
339
+ "description": "A generic hint element that can be used inside a variety of elements that\nexplicitly mention it in their documentation, such as `<webwriter-task>`.\n\nUnless otherwise specified, it should be assigned to the `hint` slot of its\nparent element.",
340
+ "name": "WebwriterQuizHint",
341
+ "members": [],
342
+ "superclass": {
343
+ "name": "LitElementWw",
344
+ "package": "@webwriter/lit"
345
+ },
346
+ "tagName": "webwriter-quiz-hint",
347
+ "customElement": true,
348
+ "modulePath": "src/widgets/webwriter-quiz-hint.ts",
349
+ "definitionPath": "src/widgets/webwriter-quiz-hint.ts"
350
+ }
351
+ ],
352
+ "exports": [
353
+ {
354
+ "kind": "js",
355
+ "name": "WebwriterQuizHint",
356
+ "declaration": {
357
+ "name": "WebwriterQuizHint",
358
+ "module": "src/widgets/webwriter-quiz-hint.ts"
359
+ }
360
+ },
361
+ {
362
+ "kind": "custom-element-definition",
363
+ "name": "webwriter-quiz-hint",
364
+ "declaration": {
365
+ "name": "WebwriterQuizHint",
366
+ "module": "src/widgets/webwriter-quiz-hint.ts"
367
+ }
368
+ }
369
+ ]
370
+ },
371
+ {
372
+ "kind": "javascript-module",
373
+ "path": "src/widgets/webwriter-quiz.ts",
374
+ "declarations": [
375
+ {
376
+ "kind": "class",
377
+ "description": "A quiz groups multiple `<webwriter-task>` elements into one exercise that is\nsubmitted, graded and reset as a whole.\n\nThe tasks must be assigned to the default slot.",
378
+ "name": "WebwriterQuiz",
379
+ "members": [
380
+ {
381
+ "kind": "field",
382
+ "name": "detailedFeedback",
383
+ "type": {
384
+ "text": "boolean"
385
+ },
386
+ "default": "false",
387
+ "description": "Whether learners see per-answer feedback and the solution after submitting.",
388
+ "attribute": "detailed-feedback",
389
+ "reflects": true
390
+ },
391
+ {
392
+ "kind": "field",
393
+ "name": "confirmSubmit",
394
+ "type": {
395
+ "text": "boolean"
396
+ },
397
+ "default": "false",
398
+ "description": "Whether learners have to confirm a dialog before submitting.",
399
+ "attribute": "confirm-submit",
400
+ "reflects": true
401
+ },
402
+ {
403
+ "kind": "field",
404
+ "name": "confirmReset",
405
+ "type": {
406
+ "text": "boolean"
407
+ },
408
+ "default": "false",
409
+ "description": "Whether learners have to confirm a dialog before resetting.",
410
+ "attribute": "confirm-reset",
411
+ "reflects": true
412
+ },
413
+ {
414
+ "kind": "field",
415
+ "name": "hidePoints",
416
+ "type": {
417
+ "text": "boolean"
418
+ },
419
+ "default": "false",
420
+ "description": "Whether the points of each task and the total score are hidden.",
421
+ "attribute": "hide-points",
422
+ "reflects": true
423
+ },
424
+ {
425
+ "kind": "field",
426
+ "name": "quizTypes",
427
+ "type": {
428
+ "text": "readonly QuizType[]"
429
+ },
430
+ "privacy": "private"
431
+ },
432
+ {
433
+ "kind": "field",
434
+ "name": "totalResult",
435
+ "type": {
436
+ "text": "{ score: number; maximum: number } | undefined"
437
+ },
438
+ "privacy": "private"
439
+ },
440
+ {
441
+ "kind": "field",
442
+ "name": "confirmationAction",
443
+ "type": {
444
+ "text": "\"submit\" | \"reset\" | undefined"
445
+ },
446
+ "privacy": "private"
447
+ },
448
+ {
449
+ "kind": "field",
450
+ "name": "unsubscribe",
451
+ "type": {
452
+ "text": "() => void | undefined"
453
+ },
454
+ "privacy": "private"
455
+ },
456
+ {
457
+ "kind": "field",
458
+ "name": "addQuestionDropdownRef",
459
+ "privacy": "private"
460
+ },
461
+ {
462
+ "kind": "method",
463
+ "name": "insertQuizType",
464
+ "privacy": "private",
465
+ "parameters": [
466
+ {
467
+ "name": "quizType",
468
+ "type": {
469
+ "text": "QuizType"
470
+ }
471
+ }
472
+ ]
473
+ },
474
+ {
475
+ "kind": "method",
476
+ "name": "InsertQuestionGrid",
477
+ "privacy": "private"
478
+ },
479
+ {
480
+ "kind": "method",
481
+ "name": "getTasks",
482
+ "privacy": "private"
483
+ },
484
+ {
485
+ "kind": "method",
486
+ "name": "getTaskApi",
487
+ "privacy": "private",
488
+ "return": {
489
+ "type": {
490
+ "text": "IWebWriterQuizType | undefined"
491
+ }
492
+ },
493
+ "parameters": [
494
+ {
495
+ "name": "task",
496
+ "type": {
497
+ "text": "WebwriterTask"
498
+ }
499
+ }
500
+ ]
501
+ },
502
+ {
503
+ "kind": "method",
504
+ "name": "getTaskPoints",
505
+ "privacy": "private",
506
+ "parameters": [
507
+ {
508
+ "name": "task",
509
+ "type": {
510
+ "text": "WebwriterTask"
511
+ }
512
+ }
513
+ ]
514
+ },
515
+ {
516
+ "kind": "method",
517
+ "name": "formatScore",
518
+ "privacy": "private",
519
+ "parameters": [
520
+ {
521
+ "name": "score",
522
+ "type": {
523
+ "text": "number"
524
+ }
525
+ }
526
+ ]
527
+ },
528
+ {
529
+ "kind": "method",
530
+ "name": "getResultPercentage",
531
+ "privacy": "private",
532
+ "parameters": [
533
+ {
534
+ "name": "result",
535
+ "type": {
536
+ "text": "{ score: number; maximum: number }"
537
+ }
538
+ }
539
+ ]
540
+ },
541
+ {
542
+ "kind": "method",
543
+ "name": "resetAnswers",
544
+ "privacy": "private"
545
+ },
546
+ {
547
+ "kind": "method",
548
+ "name": "submit",
549
+ "privacy": "private"
550
+ },
551
+ {
552
+ "kind": "method",
553
+ "name": "ConfirmationDialog",
554
+ "privacy": "private"
555
+ }
556
+ ],
557
+ "attributes": [
558
+ {
559
+ "name": "detailed-feedback",
560
+ "type": {
561
+ "text": "boolean"
562
+ },
563
+ "default": "false",
564
+ "description": "Whether learners see per-answer feedback and the solution after submitting.",
565
+ "fieldName": "detailedFeedback"
566
+ },
567
+ {
568
+ "name": "confirm-submit",
569
+ "type": {
570
+ "text": "boolean"
571
+ },
572
+ "default": "false",
573
+ "description": "Whether learners have to confirm a dialog before submitting.",
574
+ "fieldName": "confirmSubmit"
575
+ },
576
+ {
577
+ "name": "confirm-reset",
578
+ "type": {
579
+ "text": "boolean"
580
+ },
581
+ "default": "false",
582
+ "description": "Whether learners have to confirm a dialog before resetting.",
583
+ "fieldName": "confirmReset"
584
+ },
585
+ {
586
+ "name": "hide-points",
587
+ "type": {
588
+ "text": "boolean"
589
+ },
590
+ "default": "false",
591
+ "description": "Whether the points of each task and the total score are hidden.",
592
+ "fieldName": "hidePoints"
593
+ }
594
+ ],
595
+ "superclass": {
596
+ "name": "LitElementWw",
597
+ "package": "@webwriter/lit"
598
+ },
599
+ "tagName": "webwriter-quiz",
600
+ "customElement": true,
601
+ "modulePath": "src/widgets/webwriter-quiz.ts",
602
+ "definitionPath": "src/widgets/webwriter-quiz.ts"
603
+ }
604
+ ],
605
+ "exports": [
606
+ {
607
+ "kind": "js",
608
+ "name": "WebwriterQuiz",
609
+ "declaration": {
610
+ "name": "WebwriterQuiz",
611
+ "module": "src/widgets/webwriter-quiz.ts"
612
+ }
613
+ },
614
+ {
615
+ "kind": "custom-element-definition",
616
+ "name": "webwriter-quiz",
617
+ "declaration": {
618
+ "name": "WebwriterQuiz",
619
+ "module": "src/widgets/webwriter-quiz.ts"
620
+ }
621
+ }
622
+ ]
623
+ },
624
+ {
625
+ "kind": "javascript-module",
626
+ "path": "src/widgets/webwriter-task-prompt.ts",
627
+ "declarations": [
628
+ {
629
+ "kind": "class",
630
+ "description": "The question text of a `<webwriter-task>`.\n\nIt must be assigned to the `prompt` slot of its parent element. An optional\n`<webwriter-quiz-hint>` may be assigned to its `hint` slot.",
631
+ "name": "WebwriterTaskPrompt",
632
+ "members": [],
633
+ "superclass": {
634
+ "name": "LitElementWw",
635
+ "package": "@webwriter/lit"
636
+ },
637
+ "tagName": "webwriter-task-prompt",
638
+ "customElement": true,
639
+ "modulePath": "src/widgets/webwriter-task-prompt.ts",
640
+ "definitionPath": "src/widgets/webwriter-task-prompt.ts"
641
+ }
642
+ ],
643
+ "exports": [
644
+ {
645
+ "kind": "js",
646
+ "name": "WebwriterTaskPrompt",
647
+ "declaration": {
648
+ "name": "WebwriterTaskPrompt",
649
+ "module": "src/widgets/webwriter-task-prompt.ts"
650
+ }
651
+ },
652
+ {
653
+ "kind": "custom-element-definition",
654
+ "name": "webwriter-task-prompt",
655
+ "declaration": {
656
+ "name": "WebwriterTaskPrompt",
657
+ "module": "src/widgets/webwriter-task-prompt.ts"
658
+ }
659
+ }
660
+ ]
661
+ },
662
+ {
663
+ "kind": "javascript-module",
664
+ "path": "src/widgets/webwriter-task.ts",
665
+ "declarations": [
666
+ {
667
+ "kind": "class",
668
+ "description": "A task describes a single quiz question, which consists of a\n`<webwriter-task-prompt>`, an optional `<webwriter-quiz-hint>` and an answer\nof a certain type, such as `<webwriter-choice>`.\n\nThe `<webwriter-task-prompt>` must be assigned to the `prompt` slot, the\n`<webwriter-quiz-hint>` must be assigned to the `hint` slot and the answer\nmust be assigned to the default slot.",
669
+ "name": "WebwriterTask",
670
+ "members": [
671
+ {
672
+ "kind": "field",
673
+ "name": "points",
674
+ "type": {
675
+ "text": "number"
676
+ },
677
+ "privacy": "private",
678
+ "default": "1",
679
+ "attribute": "points",
680
+ "reflects": true
681
+ },
682
+ {
683
+ "kind": "field",
684
+ "name": "requiredWarning",
685
+ "type": {
686
+ "text": "boolean"
687
+ },
688
+ "privacy": "private",
689
+ "default": "false"
690
+ },
691
+ {
692
+ "kind": "field",
693
+ "name": "score",
694
+ "type": {
695
+ "text": "number | undefined"
696
+ },
697
+ "privacy": "private"
698
+ },
699
+ {
700
+ "kind": "field",
701
+ "name": "gradable",
702
+ "type": {
703
+ "text": "boolean"
704
+ },
705
+ "privacy": "private",
706
+ "default": "false"
707
+ },
708
+ {
709
+ "kind": "field",
710
+ "name": "gradabilityUpdate",
711
+ "type": {
712
+ "text": "number"
713
+ },
714
+ "privacy": "private",
715
+ "default": "0"
716
+ },
717
+ {
718
+ "kind": "method",
719
+ "name": "formatScore",
720
+ "privacy": "private",
721
+ "parameters": [
722
+ {
723
+ "name": "score",
724
+ "type": {
725
+ "text": "number"
726
+ }
727
+ }
728
+ ]
729
+ },
730
+ {
731
+ "kind": "method",
732
+ "name": "updateGradability",
733
+ "privacy": "private"
734
+ },
735
+ {
736
+ "kind": "method",
737
+ "name": "QuizHeader",
738
+ "privacy": "private"
739
+ },
740
+ {
741
+ "kind": "method",
742
+ "name": "TaskResult",
743
+ "privacy": "private",
744
+ "parameters": [
745
+ {
746
+ "name": "quiz",
747
+ "type": {
748
+ "text": "WebwriterQuiz"
749
+ }
750
+ }
751
+ ]
752
+ }
753
+ ],
754
+ "attributes": [
755
+ {
756
+ "name": "points",
757
+ "type": {
758
+ "text": "number"
759
+ },
760
+ "default": "1",
761
+ "fieldName": "points"
762
+ }
763
+ ],
764
+ "superclass": {
765
+ "name": "LitElementWw",
766
+ "package": "@webwriter/lit"
767
+ },
768
+ "tagName": "webwriter-task",
769
+ "customElement": true,
770
+ "modulePath": "src/widgets/webwriter-task.ts",
771
+ "definitionPath": "src/widgets/webwriter-task.ts"
772
+ }
773
+ ],
774
+ "exports": [
775
+ {
776
+ "kind": "js",
777
+ "name": "WebwriterTask",
778
+ "declaration": {
779
+ "name": "WebwriterTask",
780
+ "module": "src/widgets/webwriter-task.ts"
781
+ }
782
+ },
783
+ {
784
+ "kind": "custom-element-definition",
785
+ "name": "webwriter-task",
786
+ "declaration": {
787
+ "name": "WebwriterTask",
788
+ "module": "src/widgets/webwriter-task.ts"
789
+ }
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "kind": "javascript-module",
795
+ "path": "src/widgets/webwriter-text.ts",
796
+ "declarations": [
797
+ {
798
+ "kind": "class",
799
+ "description": "An answer where learners type a value into an input field.\n\nIt must be assigned to the default slot of a `<webwriter-task>`.",
800
+ "name": "WebwriterText",
801
+ "members": [
802
+ {
803
+ "kind": "field",
804
+ "name": "type",
805
+ "type": {
806
+ "text": "TextType"
807
+ },
808
+ "default": "\"long-text\"",
809
+ "description": "The kind of input field learners answer in.\n\n- `long-text`: A multi-line text area.\n- `text`: A single-line text field.\n- `number`: A number field.\n- `date`: A date picker.\n- `time`: A time picker.\n- `datetime-local`: A combined date and time picker.",
810
+ "attribute": "type",
811
+ "reflects": true
812
+ },
813
+ {
814
+ "kind": "field",
815
+ "name": "placeholder",
816
+ "type": {
817
+ "text": "string"
818
+ },
819
+ "default": "\"\"",
820
+ "description": "The placeholder shown while the field is empty.",
821
+ "attribute": "placeholder",
822
+ "reflects": true
823
+ },
824
+ {
825
+ "kind": "field",
826
+ "name": "freeText",
827
+ "type": {
828
+ "text": "boolean"
829
+ },
830
+ "default": "false",
831
+ "description": "Whether any non-empty answer counts as correct, without comparing it to the solution.",
832
+ "attribute": "free-text",
833
+ "reflects": true
834
+ },
835
+ {
836
+ "kind": "field",
837
+ "name": "ignoreCase",
838
+ "type": {
839
+ "text": "boolean"
840
+ },
841
+ "default": "false",
842
+ "description": "Whether the answer is compared to the solution case-insensitively.",
843
+ "attribute": "ignore-case",
844
+ "reflects": true
845
+ },
846
+ {
847
+ "kind": "field",
848
+ "name": "correctMessage",
849
+ "type": {
850
+ "text": "string"
851
+ },
852
+ "default": "\"\"",
853
+ "description": "The feedback shown after submitting if the answer is correct.",
854
+ "attribute": "correct-message",
855
+ "reflects": true
856
+ },
857
+ {
858
+ "kind": "field",
859
+ "name": "wrongMessage",
860
+ "type": {
861
+ "text": "string"
862
+ },
863
+ "default": "\"\"",
864
+ "description": "The feedback shown after submitting if the answer is wrong.",
865
+ "attribute": "wrong-message",
866
+ "reflects": true
867
+ },
868
+ {
869
+ "kind": "field",
870
+ "name": "solution",
871
+ "type": {
872
+ "text": "string"
873
+ },
874
+ "default": "\"\"",
875
+ "description": "The value counting as correct. It is obfuscated in the markup so that learners cannot read it directly.",
876
+ "attribute": "solution",
877
+ "reflects": true
878
+ },
879
+ {
880
+ "kind": "field",
881
+ "name": "currentAnswer",
882
+ "type": {
883
+ "text": "string | undefined"
884
+ },
885
+ "privacy": "private"
886
+ },
887
+ {
888
+ "kind": "field",
889
+ "name": "graded",
890
+ "type": {
891
+ "text": "boolean"
892
+ },
893
+ "privacy": "private",
894
+ "default": "false"
895
+ },
896
+ {
897
+ "kind": "field",
898
+ "name": "detailedFeedback",
899
+ "type": {
900
+ "text": "boolean"
901
+ },
902
+ "privacy": "private",
903
+ "default": "false"
904
+ },
905
+ {
906
+ "kind": "field",
907
+ "name": "input",
908
+ "type": {
909
+ "text": "SlTextarea | SlInput"
910
+ },
911
+ "privacy": "private"
912
+ },
913
+ {
914
+ "kind": "field",
915
+ "name": "value",
916
+ "type": {
917
+ "text": "string"
918
+ },
919
+ "privacy": "private"
920
+ },
921
+ {
922
+ "kind": "method",
923
+ "name": "isCorrect",
924
+ "privacy": "private",
925
+ "return": {
926
+ "type": {
927
+ "text": "boolean"
928
+ }
929
+ }
930
+ },
931
+ {
932
+ "kind": "method",
933
+ "name": "focus"
934
+ },
935
+ {
936
+ "kind": "method",
937
+ "name": "checkValidity",
938
+ "return": {
939
+ "type": {
940
+ "text": "boolean"
941
+ }
942
+ }
943
+ },
944
+ {
945
+ "kind": "method",
946
+ "name": "reset"
947
+ },
948
+ {
949
+ "kind": "method",
950
+ "name": "checkAnswer",
951
+ "return": {
952
+ "type": {
953
+ "text": "number"
954
+ }
955
+ },
956
+ "parameters": [
957
+ {
958
+ "name": "detailedFeedback",
959
+ "type": {
960
+ "text": "boolean"
961
+ }
962
+ }
963
+ ]
964
+ },
965
+ {
966
+ "kind": "field",
967
+ "name": "handleChange",
968
+ "privacy": "private"
969
+ },
970
+ {
971
+ "kind": "field",
972
+ "name": "feedbackState",
973
+ "type": {
974
+ "text": "\"correct\" | \"incorrect\" | undefined"
975
+ },
976
+ "privacy": "private",
977
+ "readonly": true
978
+ }
979
+ ],
980
+ "attributes": [
981
+ {
982
+ "name": "type",
983
+ "type": {
984
+ "text": "TextType"
985
+ },
986
+ "default": "\"long-text\"",
987
+ "description": "The kind of input field learners answer in.\n\n- `long-text`: A multi-line text area.\n- `text`: A single-line text field.\n- `number`: A number field.\n- `date`: A date picker.\n- `time`: A time picker.\n- `datetime-local`: A combined date and time picker.",
988
+ "fieldName": "type"
989
+ },
990
+ {
991
+ "name": "placeholder",
992
+ "type": {
993
+ "text": "string"
994
+ },
995
+ "default": "\"\"",
996
+ "description": "The placeholder shown while the field is empty.",
997
+ "fieldName": "placeholder"
998
+ },
999
+ {
1000
+ "name": "free-text",
1001
+ "type": {
1002
+ "text": "boolean"
1003
+ },
1004
+ "default": "false",
1005
+ "description": "Whether any non-empty answer counts as correct, without comparing it to the solution.",
1006
+ "fieldName": "freeText"
1007
+ },
1008
+ {
1009
+ "name": "ignore-case",
1010
+ "type": {
1011
+ "text": "boolean"
1012
+ },
1013
+ "default": "false",
1014
+ "description": "Whether the answer is compared to the solution case-insensitively.",
1015
+ "fieldName": "ignoreCase"
1016
+ },
1017
+ {
1018
+ "name": "correct-message",
1019
+ "type": {
1020
+ "text": "string"
1021
+ },
1022
+ "default": "\"\"",
1023
+ "description": "The feedback shown after submitting if the answer is correct.",
1024
+ "fieldName": "correctMessage"
1025
+ },
1026
+ {
1027
+ "name": "wrong-message",
1028
+ "type": {
1029
+ "text": "string"
1030
+ },
1031
+ "default": "\"\"",
1032
+ "description": "The feedback shown after submitting if the answer is wrong.",
1033
+ "fieldName": "wrongMessage"
1034
+ },
1035
+ {
1036
+ "name": "solution",
1037
+ "type": {
1038
+ "text": "string"
1039
+ },
1040
+ "default": "\"\"",
1041
+ "description": "The value counting as correct. It is obfuscated in the markup so that learners cannot read it directly.",
1042
+ "fieldName": "solution"
1043
+ }
1044
+ ],
1045
+ "superclass": {
1046
+ "name": "LitElementWw",
1047
+ "package": "@webwriter/lit"
1048
+ },
1049
+ "tagName": "webwriter-text",
1050
+ "customElement": true,
1051
+ "modulePath": "src/widgets/webwriter-text.ts",
1052
+ "definitionPath": "src/widgets/webwriter-text.ts"
1053
+ }
1054
+ ],
1055
+ "exports": [
1056
+ {
1057
+ "kind": "js",
1058
+ "name": "WebwriterText",
1059
+ "declaration": {
1060
+ "name": "WebwriterText",
1061
+ "module": "src/widgets/webwriter-text.ts"
1062
+ }
1063
+ },
1064
+ {
1065
+ "kind": "custom-element-definition",
1066
+ "name": "webwriter-text",
1067
+ "declaration": {
1068
+ "name": "WebwriterText",
1069
+ "module": "src/widgets/webwriter-text.ts"
1070
+ }
1071
+ }
1072
+ ]
1073
+ },
1074
+ {
1075
+ "kind": "javascript-module",
1076
+ "path": "src/widgets/choice/webwriter-choice-item.ts",
1077
+ "declarations": [
1078
+ {
1079
+ "kind": "class",
1080
+ "description": "A single option of a `<webwriter-choice>`.\n\nIt must be assigned to the default slot of its parent element. An optional\n`<webwriter-quiz-hint>` may be assigned to its `hint` slot.",
1081
+ "name": "WebwriterChoiceItem",
1082
+ "members": [
1083
+ {
1084
+ "kind": "field",
1085
+ "name": "feedbackSelected",
1086
+ "type": {
1087
+ "text": "string"
1088
+ },
1089
+ "default": "\"\"",
1090
+ "description": "The feedback shown after submitting if learners selected this option.",
1091
+ "attribute": "feedback-selected",
1092
+ "reflects": true
1093
+ },
1094
+ {
1095
+ "kind": "field",
1096
+ "name": "feedbackNotSelected",
1097
+ "type": {
1098
+ "text": "string"
1099
+ },
1100
+ "default": "\"\"",
1101
+ "description": "The feedback shown after submitting if learners did not select this option.",
1102
+ "attribute": "feedback-not-selected",
1103
+ "reflects": true
1104
+ },
1105
+ {
1106
+ "kind": "method",
1107
+ "name": "dispatchSelectEvent",
1108
+ "privacy": "private"
1109
+ },
1110
+ {
1111
+ "kind": "method",
1112
+ "name": "handleClick",
1113
+ "privacy": "private"
1114
+ }
1115
+ ],
1116
+ "attributes": [
1117
+ {
1118
+ "name": "feedback-selected",
1119
+ "type": {
1120
+ "text": "string"
1121
+ },
1122
+ "default": "\"\"",
1123
+ "description": "The feedback shown after submitting if learners selected this option.",
1124
+ "fieldName": "feedbackSelected"
1125
+ },
1126
+ {
1127
+ "name": "feedback-not-selected",
1128
+ "type": {
1129
+ "text": "string"
1130
+ },
1131
+ "default": "\"\"",
1132
+ "description": "The feedback shown after submitting if learners did not select this option.",
1133
+ "fieldName": "feedbackNotSelected"
1134
+ }
1135
+ ],
1136
+ "superclass": {
1137
+ "name": "LitElementWw",
1138
+ "package": "@webwriter/lit"
1139
+ },
1140
+ "tagName": "webwriter-choice-item",
1141
+ "customElement": true,
1142
+ "modulePath": "src/widgets/choice/webwriter-choice-item.ts",
1143
+ "definitionPath": "src/widgets/choice/webwriter-choice-item.ts"
1144
+ }
1145
+ ],
1146
+ "exports": [
1147
+ {
1148
+ "kind": "js",
1149
+ "name": "WebwriterChoiceItem",
1150
+ "declaration": {
1151
+ "name": "WebwriterChoiceItem",
1152
+ "module": "src/widgets/choice/webwriter-choice-item.ts"
1153
+ }
1154
+ },
1155
+ {
1156
+ "kind": "custom-element-definition",
1157
+ "name": "webwriter-choice-item",
1158
+ "declaration": {
1159
+ "name": "WebwriterChoiceItem",
1160
+ "module": "src/widgets/choice/webwriter-choice-item.ts"
1161
+ }
1162
+ }
1163
+ ]
1164
+ },
1165
+ {
1166
+ "kind": "javascript-module",
1167
+ "path": "src/widgets/choice/webwriter-choice.ts",
1168
+ "declarations": [
1169
+ {
1170
+ "kind": "class",
1171
+ "description": "An answer where learners pick one or more options.\n\nThe options must be `<webwriter-choice-item>` elements assigned to the\ndefault slot.",
1172
+ "name": "WebwriterChoice",
1173
+ "members": [
1174
+ {
1175
+ "kind": "field",
1176
+ "name": "mode",
1177
+ "type": {
1178
+ "text": "ChoiceMode"
1179
+ },
1180
+ "default": "\"single\"",
1181
+ "description": "How many options learners may select.\n\n- `single`: Exactly one option can be selected.\n- `multiple`: Any number of options can be selected.",
1182
+ "attribute": "mode",
1183
+ "reflects": true
1184
+ },
1185
+ {
1186
+ "kind": "field",
1187
+ "name": "layout",
1188
+ "type": {
1189
+ "text": "ChoiceLayout"
1190
+ },
1191
+ "default": "\"list\"",
1192
+ "description": "How the options are arranged.\n\n- `list`: One option per row.\n- `tiles`: A responsive grid of equally sized tiles.",
1193
+ "attribute": "layout",
1194
+ "reflects": true
1195
+ },
1196
+ {
1197
+ "kind": "field",
1198
+ "name": "randomizeOrder",
1199
+ "type": {
1200
+ "text": "boolean"
1201
+ },
1202
+ "privacy": "private",
1203
+ "default": "false",
1204
+ "description": "If true, the order of options will be randomized for learners.\n\nNote: Randomization occurs only during the first render, so changing this property dynamically will not have any effect.",
1205
+ "attribute": "randomize-order",
1206
+ "reflects": true
1207
+ },
1208
+ {
1209
+ "kind": "field",
1210
+ "name": "gradingMethod",
1211
+ "type": {
1212
+ "text": "ChoiceGradingMethod"
1213
+ },
1214
+ "default": "\"pass-fail\"",
1215
+ "description": "How the score of this answer is calculated.\n\n- `pass-fail`: Full score only if exactly the correct options are selected.\n- `partial`: Correct selections earn credit, wrong ones subtract from it.",
1216
+ "attribute": "grading-method",
1217
+ "reflects": true
1218
+ },
1219
+ {
1220
+ "kind": "field",
1221
+ "name": "solution",
1222
+ "type": {
1223
+ "text": "ChoiceSolution"
1224
+ },
1225
+ "default": "{}",
1226
+ "description": "The options counting as correct, as a map from option ID to whether it has to be selected.\nIt is obfuscated in the markup so that learners cannot read it directly.",
1227
+ "attribute": "solution",
1228
+ "reflects": true
1229
+ },
1230
+ {
1231
+ "kind": "field",
1232
+ "name": "currentAnswer",
1233
+ "type": {
1234
+ "text": "ChoiceSolution"
1235
+ },
1236
+ "privacy": "private",
1237
+ "default": "{}"
1238
+ },
1239
+ {
1240
+ "kind": "field",
1241
+ "name": "graded",
1242
+ "type": {
1243
+ "text": "boolean"
1244
+ },
1245
+ "privacy": "private",
1246
+ "default": "false"
1247
+ },
1248
+ {
1249
+ "kind": "field",
1250
+ "name": "detailedFeedback",
1251
+ "type": {
1252
+ "text": "boolean"
1253
+ },
1254
+ "privacy": "private",
1255
+ "default": "false"
1256
+ },
1257
+ {
1258
+ "kind": "field",
1259
+ "name": "items",
1260
+ "type": {
1261
+ "text": "WebwriterChoiceItem[]"
1262
+ },
1263
+ "privacy": "private"
1264
+ },
1265
+ {
1266
+ "kind": "method",
1267
+ "name": "syncSolutionWithItems",
1268
+ "privacy": "private"
1269
+ },
1270
+ {
1271
+ "kind": "method",
1272
+ "name": "randomizeItems",
1273
+ "privacy": "private"
1274
+ },
1275
+ {
1276
+ "kind": "field",
1277
+ "name": "selected",
1278
+ "type": {
1279
+ "text": "ChoiceSolution"
1280
+ },
1281
+ "privacy": "private"
1282
+ },
1283
+ {
1284
+ "kind": "method",
1285
+ "name": "handleReorder",
1286
+ "privacy": "private",
1287
+ "parameters": [
1288
+ {
1289
+ "name": "{ detail }",
1290
+ "type": {
1291
+ "text": "DraggableGridReorderEvent"
1292
+ }
1293
+ }
1294
+ ]
1295
+ },
1296
+ {
1297
+ "kind": "method",
1298
+ "name": "handleSelect",
1299
+ "privacy": "private",
1300
+ "parameters": [
1301
+ {
1302
+ "name": "event",
1303
+ "type": {
1304
+ "text": "CustomEvent"
1305
+ }
1306
+ }
1307
+ ]
1308
+ },
1309
+ {
1310
+ "kind": "method",
1311
+ "name": "addOption",
1312
+ "privacy": "private"
1313
+ },
1314
+ {
1315
+ "kind": "method",
1316
+ "name": "checkValidity",
1317
+ "return": {
1318
+ "type": {
1319
+ "text": "boolean"
1320
+ }
1321
+ }
1322
+ },
1323
+ {
1324
+ "kind": "method",
1325
+ "name": "checkAnswer",
1326
+ "return": {
1327
+ "type": {
1328
+ "text": "number"
1329
+ }
1330
+ },
1331
+ "parameters": [
1332
+ {
1333
+ "name": "detailedFeedback",
1334
+ "type": {
1335
+ "text": "boolean"
1336
+ }
1337
+ }
1338
+ ]
1339
+ },
1340
+ {
1341
+ "kind": "method",
1342
+ "name": "reset"
1343
+ },
1344
+ {
1345
+ "kind": "method",
1346
+ "name": "AddOptionButton",
1347
+ "privacy": "private"
1348
+ }
1349
+ ],
1350
+ "attributes": [
1351
+ {
1352
+ "name": "mode",
1353
+ "type": {
1354
+ "text": "ChoiceMode"
1355
+ },
1356
+ "default": "\"single\"",
1357
+ "description": "How many options learners may select.\n\n- `single`: Exactly one option can be selected.\n- `multiple`: Any number of options can be selected.",
1358
+ "fieldName": "mode"
1359
+ },
1360
+ {
1361
+ "name": "layout",
1362
+ "type": {
1363
+ "text": "ChoiceLayout"
1364
+ },
1365
+ "default": "\"list\"",
1366
+ "description": "How the options are arranged.\n\n- `list`: One option per row.\n- `tiles`: A responsive grid of equally sized tiles.",
1367
+ "fieldName": "layout"
1368
+ },
1369
+ {
1370
+ "name": "randomize-order",
1371
+ "type": {
1372
+ "text": "boolean"
1373
+ },
1374
+ "default": "false",
1375
+ "description": "If true, the order of options will be randomized for learners.\n\nNote: Randomization occurs only during the first render, so changing this property dynamically will not have any effect.",
1376
+ "fieldName": "randomizeOrder"
1377
+ },
1378
+ {
1379
+ "name": "grading-method",
1380
+ "type": {
1381
+ "text": "ChoiceGradingMethod"
1382
+ },
1383
+ "default": "\"pass-fail\"",
1384
+ "description": "How the score of this answer is calculated.\n\n- `pass-fail`: Full score only if exactly the correct options are selected.\n- `partial`: Correct selections earn credit, wrong ones subtract from it.",
1385
+ "fieldName": "gradingMethod"
1386
+ },
1387
+ {
1388
+ "name": "solution",
1389
+ "type": {
1390
+ "text": "ChoiceSolution"
1391
+ },
1392
+ "default": "{}",
1393
+ "description": "The options counting as correct, as a map from option ID to whether it has to be selected.\nIt is obfuscated in the markup so that learners cannot read it directly.",
1394
+ "fieldName": "solution"
1395
+ }
1396
+ ],
1397
+ "superclass": {
1398
+ "name": "LitElementWw",
1399
+ "package": "@webwriter/lit"
1400
+ },
1401
+ "tagName": "webwriter-choice",
1402
+ "customElement": true,
1403
+ "modulePath": "src/widgets/choice/webwriter-choice.ts",
1404
+ "definitionPath": "src/widgets/choice/webwriter-choice.ts"
1405
+ }
1406
+ ],
1407
+ "exports": [
1408
+ {
1409
+ "kind": "js",
1410
+ "name": "WebwriterChoice",
1411
+ "declaration": {
1412
+ "name": "WebwriterChoice",
1413
+ "module": "src/widgets/choice/webwriter-choice.ts"
1414
+ }
1415
+ },
1416
+ {
1417
+ "kind": "custom-element-definition",
1418
+ "name": "webwriter-choice",
1419
+ "declaration": {
1420
+ "name": "WebwriterChoice",
1421
+ "module": "src/widgets/choice/webwriter-choice.ts"
1422
+ }
1423
+ }
1424
+ ]
1425
+ },
1426
+ {
1427
+ "kind": "javascript-module",
1428
+ "path": "src/widgets/choice/webwriter-true-false.ts",
1429
+ "declarations": [
1430
+ {
1431
+ "kind": "class",
1432
+ "description": "An answer where learners decide whether a statement is true or false.\n\nIt must be assigned to the default slot of a `<webwriter-task>`.",
1433
+ "name": "WebwriterTrueFalse",
1434
+ "members": [
1435
+ {
1436
+ "kind": "field",
1437
+ "name": "solution",
1438
+ "type": {
1439
+ "text": "TrueFalse"
1440
+ },
1441
+ "default": "\"true\"",
1442
+ "description": "The value counting as correct.\n\n- `true`: The statement is true.\n- `false`: The statement is false.",
1443
+ "attribute": "solution",
1444
+ "reflects": true
1445
+ },
1446
+ {
1447
+ "kind": "field",
1448
+ "name": "currentAnswer",
1449
+ "type": {
1450
+ "text": "TrueFalse | undefined"
1451
+ },
1452
+ "privacy": "private"
1453
+ },
1454
+ {
1455
+ "kind": "field",
1456
+ "name": "graded",
1457
+ "type": {
1458
+ "text": "boolean"
1459
+ },
1460
+ "privacy": "private",
1461
+ "default": "false"
1462
+ },
1463
+ {
1464
+ "kind": "field",
1465
+ "name": "showFeedback",
1466
+ "type": {
1467
+ "text": "boolean"
1468
+ },
1469
+ "privacy": "private",
1470
+ "default": "false"
1471
+ },
1472
+ {
1473
+ "kind": "method",
1474
+ "name": "checkValidity"
1475
+ },
1476
+ {
1477
+ "kind": "method",
1478
+ "name": "reset"
1479
+ },
1480
+ {
1481
+ "kind": "method",
1482
+ "name": "checkAnswer",
1483
+ "parameters": [
1484
+ {
1485
+ "name": "detailedFeedback",
1486
+ "type": {
1487
+ "text": "boolean"
1488
+ }
1489
+ }
1490
+ ]
1491
+ },
1492
+ {
1493
+ "kind": "field",
1494
+ "name": "selected",
1495
+ "privacy": "private"
1496
+ },
1497
+ {
1498
+ "kind": "method",
1499
+ "name": "Button",
1500
+ "privacy": "private",
1501
+ "parameters": [
1502
+ {
1503
+ "name": "choice",
1504
+ "type": {
1505
+ "text": "TrueFalse"
1506
+ }
1507
+ },
1508
+ {
1509
+ "name": "label",
1510
+ "type": {
1511
+ "text": "string"
1512
+ }
1513
+ }
1514
+ ]
1515
+ }
1516
+ ],
1517
+ "attributes": [
1518
+ {
1519
+ "name": "solution",
1520
+ "type": {
1521
+ "text": "TrueFalse"
1522
+ },
1523
+ "default": "\"true\"",
1524
+ "description": "The value counting as correct.\n\n- `true`: The statement is true.\n- `false`: The statement is false.",
1525
+ "fieldName": "solution"
1526
+ }
1527
+ ],
1528
+ "superclass": {
1529
+ "name": "LitElementWw",
1530
+ "package": "@webwriter/lit"
1531
+ },
1532
+ "tagName": "webwriter-true-false",
1533
+ "customElement": true,
1534
+ "modulePath": "src/widgets/choice/webwriter-true-false.ts",
1535
+ "definitionPath": "src/widgets/choice/webwriter-true-false.ts"
1536
+ }
1537
+ ],
1538
+ "exports": [
1539
+ {
1540
+ "kind": "js",
1541
+ "name": "WebwriterTrueFalse",
1542
+ "declaration": {
1543
+ "name": "WebwriterTrueFalse",
1544
+ "module": "src/widgets/choice/webwriter-true-false.ts"
1545
+ }
1546
+ },
1547
+ {
1548
+ "kind": "custom-element-definition",
1549
+ "name": "webwriter-true-false",
1550
+ "declaration": {
1551
+ "name": "WebwriterTrueFalse",
1552
+ "module": "src/widgets/choice/webwriter-true-false.ts"
1553
+ }
1554
+ }
1555
+ ]
1556
+ },
1557
+ {
1558
+ "kind": "javascript-module",
1559
+ "path": "src/widgets/gap/webwriter-gap-item.ts",
1560
+ "declarations": [
1561
+ {
1562
+ "kind": "class",
1563
+ "description": "A single gap of a `<webwriter-gap>`, whose content is the correct answer.\n\nIt must be placed inside the text assigned to the default slot of its parent\nelement.",
1564
+ "name": "WebwriterGapItem",
1565
+ "members": [
1566
+ {
1567
+ "kind": "field",
1568
+ "name": "slotRef",
1569
+ "privacy": "private"
1570
+ },
1571
+ {
1572
+ "kind": "field",
1573
+ "name": "placeholder",
1574
+ "type": {
1575
+ "text": "string"
1576
+ },
1577
+ "default": "\"\"",
1578
+ "description": "The placeholder shown while the gap is empty. Only applies in `input` mode.",
1579
+ "attribute": "placeholder",
1580
+ "reflects": true
1581
+ },
1582
+ {
1583
+ "kind": "method",
1584
+ "name": "renderEditable",
1585
+ "privacy": "private"
1586
+ },
1587
+ {
1588
+ "kind": "method",
1589
+ "name": "renderInput",
1590
+ "privacy": "private"
1591
+ },
1592
+ {
1593
+ "kind": "method",
1594
+ "name": "renderDragAndDrop",
1595
+ "privacy": "private"
1596
+ }
1597
+ ],
1598
+ "attributes": [
1599
+ {
1600
+ "name": "placeholder",
1601
+ "type": {
1602
+ "text": "string"
1603
+ },
1604
+ "default": "\"\"",
1605
+ "description": "The placeholder shown while the gap is empty. Only applies in `input` mode.",
1606
+ "fieldName": "placeholder"
1607
+ }
1608
+ ],
1609
+ "superclass": {
1610
+ "name": "LitElementWw",
1611
+ "package": "@webwriter/lit"
1612
+ },
1613
+ "tagName": "webwriter-gap-item",
1614
+ "customElement": true,
1615
+ "modulePath": "src/widgets/gap/webwriter-gap-item.ts",
1616
+ "definitionPath": "src/widgets/gap/webwriter-gap-item.ts"
1617
+ }
1618
+ ],
1619
+ "exports": [
1620
+ {
1621
+ "kind": "js",
1622
+ "name": "WebwriterGapItem",
1623
+ "declaration": {
1624
+ "name": "WebwriterGapItem",
1625
+ "module": "src/widgets/gap/webwriter-gap-item.ts"
1626
+ }
1627
+ },
1628
+ {
1629
+ "kind": "custom-element-definition",
1630
+ "name": "webwriter-gap-item",
1631
+ "declaration": {
1632
+ "name": "WebwriterGapItem",
1633
+ "module": "src/widgets/gap/webwriter-gap-item.ts"
1634
+ }
1635
+ }
1636
+ ]
1637
+ },
1638
+ {
1639
+ "kind": "javascript-module",
1640
+ "path": "src/widgets/gap/webwriter-gap.ts",
1641
+ "declarations": [
1642
+ {
1643
+ "kind": "class",
1644
+ "description": "An answer where learners fill the gaps in a text.\n\nThe text must be assigned to the default slot, with a `<webwriter-gap-item>`\nin place of each gap.",
1645
+ "name": "WebwriterGap",
1646
+ "members": [
1647
+ {
1648
+ "kind": "field",
1649
+ "name": "mode",
1650
+ "type": {
1651
+ "text": "GapMode"
1652
+ },
1653
+ "default": "\"input\"",
1654
+ "description": "How learners fill the gaps.\n\n- `input`: Each gap is a text field learners type into.\n- `drag-and-drop`: The gaps are filled from a shared pool of draggable answers.",
1655
+ "attribute": "mode",
1656
+ "reflects": true
1657
+ },
1658
+ {
1659
+ "kind": "field",
1660
+ "name": "ignoreCase",
1661
+ "type": {
1662
+ "text": "boolean"
1663
+ },
1664
+ "default": "false",
1665
+ "description": "Whether answers are compared to the solution case-insensitively. Only applies in `input` mode.",
1666
+ "attribute": "ignore-case",
1667
+ "reflects": true
1668
+ },
1669
+ {
1670
+ "kind": "field",
1671
+ "name": "graded",
1672
+ "type": {
1673
+ "text": "boolean"
1674
+ },
1675
+ "privacy": "private",
1676
+ "default": "false"
1677
+ },
1678
+ {
1679
+ "kind": "field",
1680
+ "name": "items",
1681
+ "type": {
1682
+ "text": "WebwriterGapItem[]"
1683
+ },
1684
+ "privacy": "private",
1685
+ "default": "[]"
1686
+ },
1687
+ {
1688
+ "kind": "field",
1689
+ "name": "choices",
1690
+ "type": {
1691
+ "text": "WebwriterGapItem[]"
1692
+ },
1693
+ "privacy": "private",
1694
+ "default": "[]"
1695
+ },
1696
+ {
1697
+ "kind": "field",
1698
+ "name": "placements",
1699
+ "privacy": "private",
1700
+ "default": "new Map<WebwriterGapItem, WebwriterGapItem>()"
1701
+ },
1702
+ {
1703
+ "kind": "field",
1704
+ "name": "selected",
1705
+ "type": {
1706
+ "text": "WebwriterGapItem | null"
1707
+ },
1708
+ "privacy": "private",
1709
+ "default": "null"
1710
+ },
1711
+ {
1712
+ "kind": "field",
1713
+ "name": "observer",
1714
+ "privacy": "private",
1715
+ "default": "new MutationObserver(() => this.syncItems())"
1716
+ },
1717
+ {
1718
+ "kind": "field",
1719
+ "name": "drag",
1720
+ "type": {
1721
+ "text": "{\n\t\tchoice: WebwriterGapItem;\n\t\tpointerId: number;\n\t\tx: number;\n\t\ty: number;\n\t\toffsetX: number;\n\t\toffsetY: number;\n\t\tghost: HTMLElement;\n\t\tmoved: boolean;\n\t} | null"
1722
+ },
1723
+ "privacy": "private",
1724
+ "default": "null"
1725
+ },
1726
+ {
1727
+ "kind": "field",
1728
+ "name": "suppressClick",
1729
+ "type": {
1730
+ "text": "boolean"
1731
+ },
1732
+ "privacy": "private",
1733
+ "default": "false"
1734
+ },
1735
+ {
1736
+ "kind": "field",
1737
+ "name": "syncItems",
1738
+ "privacy": "private"
1739
+ },
1740
+ {
1741
+ "kind": "method",
1742
+ "name": "place",
1743
+ "privacy": "private",
1744
+ "parameters": [
1745
+ {
1746
+ "name": "choice",
1747
+ "type": {
1748
+ "text": "WebwriterGapItem"
1749
+ }
1750
+ },
1751
+ {
1752
+ "name": "target",
1753
+ "type": {
1754
+ "text": "WebwriterGapItem | null"
1755
+ }
1756
+ }
1757
+ ],
1758
+ "description": "Moves `choice` into the gap `target`, or back into the tray of choices for `null`."
1759
+ },
1760
+ {
1761
+ "kind": "method",
1762
+ "name": "startDrag",
1763
+ "privacy": "private",
1764
+ "parameters": [
1765
+ {
1766
+ "name": "event",
1767
+ "type": {
1768
+ "text": "PointerEvent"
1769
+ }
1770
+ },
1771
+ {
1772
+ "name": "choice",
1773
+ "type": {
1774
+ "text": "WebwriterGapItem"
1775
+ }
1776
+ }
1777
+ ]
1778
+ },
1779
+ {
1780
+ "kind": "method",
1781
+ "name": "targetAt",
1782
+ "privacy": "private",
1783
+ "parameters": [
1784
+ {
1785
+ "name": "x",
1786
+ "type": {
1787
+ "text": "number"
1788
+ }
1789
+ },
1790
+ {
1791
+ "name": "y",
1792
+ "type": {
1793
+ "text": "number"
1794
+ }
1795
+ }
1796
+ ],
1797
+ "description": "The gap under the given point, if it belongs to this element. The ghost does not take\npointer events, so it never hides the gap underneath it."
1798
+ },
1799
+ {
1800
+ "kind": "method",
1801
+ "name": "overTray",
1802
+ "privacy": "private",
1803
+ "parameters": [
1804
+ {
1805
+ "name": "x",
1806
+ "type": {
1807
+ "text": "number"
1808
+ }
1809
+ },
1810
+ {
1811
+ "name": "y",
1812
+ "type": {
1813
+ "text": "number"
1814
+ }
1815
+ }
1816
+ ]
1817
+ },
1818
+ {
1819
+ "kind": "field",
1820
+ "name": "moveDrag",
1821
+ "privacy": "private"
1822
+ },
1823
+ {
1824
+ "kind": "field",
1825
+ "name": "endDrag",
1826
+ "privacy": "private"
1827
+ },
1828
+ {
1829
+ "kind": "field",
1830
+ "name": "cancelOnEscape",
1831
+ "privacy": "private"
1832
+ },
1833
+ {
1834
+ "kind": "field",
1835
+ "name": "cancelDrag",
1836
+ "privacy": "private"
1837
+ },
1838
+ {
1839
+ "kind": "field",
1840
+ "name": "preventProseMirrorLineBreaks",
1841
+ "privacy": "private"
1842
+ },
1843
+ {
1844
+ "kind": "field",
1845
+ "name": "popupPosition",
1846
+ "type": {
1847
+ "text": "({ left: string } & ({ top: string } | { bottom: string })) | null"
1848
+ },
1849
+ "privacy": "private",
1850
+ "default": "null"
1851
+ },
1852
+ {
1853
+ "kind": "method",
1854
+ "name": "getGapSelectionAndRange",
1855
+ "privacy": "private",
1856
+ "return": {
1857
+ "type": {
1858
+ "text": "[Selection, Range] | []"
1859
+ }
1860
+ }
1861
+ },
1862
+ {
1863
+ "kind": "method",
1864
+ "name": "insertGapAtSelection",
1865
+ "privacy": "private"
1866
+ },
1867
+ {
1868
+ "kind": "field",
1869
+ "name": "insertGapOnKeyDown",
1870
+ "privacy": "private"
1871
+ },
1872
+ {
1873
+ "kind": "method",
1874
+ "name": "checkValidity",
1875
+ "return": {
1876
+ "type": {
1877
+ "text": "boolean"
1878
+ }
1879
+ }
1880
+ },
1881
+ {
1882
+ "kind": "method",
1883
+ "name": "reset",
1884
+ "return": {
1885
+ "type": {
1886
+ "text": "void"
1887
+ }
1888
+ }
1889
+ },
1890
+ {
1891
+ "kind": "method",
1892
+ "name": "checkAnswer",
1893
+ "return": {
1894
+ "type": {
1895
+ "text": "number"
1896
+ }
1897
+ },
1898
+ "parameters": [
1899
+ {
1900
+ "name": "detailedFeedback",
1901
+ "type": {
1902
+ "text": "boolean"
1903
+ }
1904
+ }
1905
+ ]
1906
+ }
1907
+ ],
1908
+ "events": [
1909
+ {
1910
+ "name": "change",
1911
+ "type": {
1912
+ "text": "Event"
1913
+ },
1914
+ "description": "Dispatched when learners move an answer into or out of a gap. Only in `drag-and-drop` mode."
1915
+ }
1916
+ ],
1917
+ "attributes": [
1918
+ {
1919
+ "name": "mode",
1920
+ "type": {
1921
+ "text": "GapMode"
1922
+ },
1923
+ "default": "\"input\"",
1924
+ "description": "How learners fill the gaps.\n\n- `input`: Each gap is a text field learners type into.\n- `drag-and-drop`: The gaps are filled from a shared pool of draggable answers.",
1925
+ "fieldName": "mode"
1926
+ },
1927
+ {
1928
+ "name": "ignore-case",
1929
+ "type": {
1930
+ "text": "boolean"
1931
+ },
1932
+ "default": "false",
1933
+ "description": "Whether answers are compared to the solution case-insensitively. Only applies in `input` mode.",
1934
+ "fieldName": "ignoreCase"
1935
+ }
1936
+ ],
1937
+ "superclass": {
1938
+ "name": "LitElementWw",
1939
+ "package": "@webwriter/lit"
1940
+ },
1941
+ "tagName": "webwriter-gap",
1942
+ "customElement": true,
1943
+ "modulePath": "src/widgets/gap/webwriter-gap.ts",
1944
+ "definitionPath": "src/widgets/gap/webwriter-gap.ts"
1945
+ }
1946
+ ],
1947
+ "exports": [
1948
+ {
1949
+ "kind": "js",
1950
+ "name": "WebwriterGap",
1951
+ "declaration": {
1952
+ "name": "WebwriterGap",
1953
+ "module": "src/widgets/gap/webwriter-gap.ts"
1954
+ }
1955
+ },
1956
+ {
1957
+ "kind": "custom-element-definition",
1958
+ "name": "webwriter-gap",
1959
+ "declaration": {
1960
+ "name": "WebwriterGap",
1961
+ "module": "src/widgets/gap/webwriter-gap.ts"
1962
+ }
1963
+ }
1964
+ ]
1965
+ },
1966
+ {
1967
+ "kind": "javascript-module",
1968
+ "path": "src/widgets/order/webwriter-order-item.ts",
1969
+ "declarations": [
1970
+ {
1971
+ "kind": "class",
1972
+ "description": "A single item of a `<webwriter-order>`.\n\nIt must be assigned to the default slot of its parent element. An optional\n`<webwriter-quiz-hint>` may be assigned to its `hint` slot.",
1973
+ "name": "WebwriterOrderItem",
1974
+ "members": [],
1975
+ "superclass": {
1976
+ "name": "LitElementWw",
1977
+ "package": "@webwriter/lit"
1978
+ },
1979
+ "tagName": "webwriter-order-item",
1980
+ "customElement": true,
1981
+ "modulePath": "src/widgets/order/webwriter-order-item.ts",
1982
+ "definitionPath": "src/widgets/order/webwriter-order-item.ts"
1983
+ }
1984
+ ],
1985
+ "exports": [
1986
+ {
1987
+ "kind": "js",
1988
+ "name": "WebwriterOrderItem",
1989
+ "declaration": {
1990
+ "name": "WebwriterOrderItem",
1991
+ "module": "src/widgets/order/webwriter-order-item.ts"
1992
+ }
1993
+ },
1994
+ {
1995
+ "kind": "custom-element-definition",
1996
+ "name": "webwriter-order-item",
1997
+ "declaration": {
1998
+ "name": "WebwriterOrderItem",
1999
+ "module": "src/widgets/order/webwriter-order-item.ts"
2000
+ }
2001
+ }
2002
+ ]
2003
+ },
2004
+ {
2005
+ "kind": "javascript-module",
2006
+ "path": "src/widgets/order/webwriter-order.ts",
2007
+ "declarations": [
2008
+ {
2009
+ "kind": "class",
2010
+ "description": "An answer where learners drag items into the correct order.\n\nThe items must be `<webwriter-order-item>` elements assigned to the default\nslot.",
2011
+ "name": "WebwriterOrder",
2012
+ "members": [
2013
+ {
2014
+ "kind": "field",
2015
+ "name": "layout",
2016
+ "type": {
2017
+ "text": "OrderLayout"
2018
+ },
2019
+ "default": "\"list\"",
2020
+ "description": "How the items are arranged.\n\n- `list`: One item per row.\n- `tiles`: A responsive grid of equally sized tiles.",
2021
+ "attribute": "layout",
2022
+ "reflects": true
2023
+ },
2024
+ {
2025
+ "kind": "field",
2026
+ "name": "direction",
2027
+ "type": {
2028
+ "text": "OrderDirection"
2029
+ },
2030
+ "default": "\"ascending\"",
2031
+ "description": "The direction in which the items are numbered.\n\n- `ascending`: The first item carries the lowest position.\n- `descending`: The first item carries the highest position.",
2032
+ "attribute": "direction",
2033
+ "reflects": true
2034
+ },
2035
+ {
2036
+ "kind": "field",
2037
+ "name": "numberingStyle",
2038
+ "type": {
2039
+ "text": "OrderNumberingStyle"
2040
+ },
2041
+ "default": "\"numeric\"",
2042
+ "description": "How the position of each item is labelled.\n\n- `none`: No position is shown.\n- `numeric`: Arabic numerals (1., 2., 3., ...).\n- `alphabetic`: Latin letters (A., B., C., ...).\n- `roman`: Roman numerals (I., II., III., ...).",
2043
+ "attribute": "numbering-style",
2044
+ "reflects": true
2045
+ },
2046
+ {
2047
+ "kind": "field",
2048
+ "name": "gradingMethod",
2049
+ "type": {
2050
+ "text": "OrderGradingMethod"
2051
+ },
2052
+ "default": "\"pass-fail\"",
2053
+ "description": "How the score of this answer is calculated.\n\n- `pass-fail`: Full score only if every item is in its correct position.\n- `partial-position`: Credit for each item in its correct position.\n- `partial-sequence`: Credit for each pair of adjacent items in the correct order.",
2054
+ "attribute": "grading-method",
2055
+ "reflects": true
2056
+ },
2057
+ {
2058
+ "kind": "field",
2059
+ "name": "solution",
2060
+ "type": {
2061
+ "text": "OrderSolution"
2062
+ },
2063
+ "default": "[]",
2064
+ "description": "The IDs of the items in their correct order. It is obfuscated in the markup so that learners cannot read it directly.",
2065
+ "attribute": "solution",
2066
+ "reflects": true
2067
+ },
2068
+ {
2069
+ "kind": "method",
2070
+ "name": "randomizeItems",
2071
+ "privacy": "private"
2072
+ },
2073
+ {
2074
+ "kind": "method",
2075
+ "name": "checkValidity",
2076
+ "return": {
2077
+ "type": {
2078
+ "text": "boolean"
2079
+ }
2080
+ }
2081
+ },
2082
+ {
2083
+ "kind": "method",
2084
+ "name": "reset",
2085
+ "return": {
2086
+ "type": {
2087
+ "text": "void"
2088
+ }
2089
+ }
2090
+ },
2091
+ {
2092
+ "kind": "method",
2093
+ "name": "checkAnswer",
2094
+ "return": {
2095
+ "type": {
2096
+ "text": "number"
2097
+ }
2098
+ },
2099
+ "parameters": [
2100
+ {
2101
+ "name": "detailedFeedback",
2102
+ "type": {
2103
+ "text": "boolean"
2104
+ }
2105
+ }
2106
+ ]
2107
+ },
2108
+ {
2109
+ "kind": "method",
2110
+ "name": "refreshItems",
2111
+ "privacy": "private"
2112
+ },
2113
+ {
2114
+ "kind": "method",
2115
+ "name": "handleReorder",
2116
+ "privacy": "private",
2117
+ "parameters": [
2118
+ {
2119
+ "name": "{ detail }",
2120
+ "type": {
2121
+ "text": "DraggableGridReorderEvent"
2122
+ }
2123
+ }
2124
+ ]
2125
+ },
2126
+ {
2127
+ "kind": "method",
2128
+ "name": "addOption",
2129
+ "privacy": "private"
2130
+ },
2131
+ {
2132
+ "kind": "method",
2133
+ "name": "AddOptionButton",
2134
+ "privacy": "private"
2135
+ }
2136
+ ],
2137
+ "attributes": [
2138
+ {
2139
+ "name": "layout",
2140
+ "type": {
2141
+ "text": "OrderLayout"
2142
+ },
2143
+ "default": "\"list\"",
2144
+ "description": "How the items are arranged.\n\n- `list`: One item per row.\n- `tiles`: A responsive grid of equally sized tiles.",
2145
+ "fieldName": "layout"
2146
+ },
2147
+ {
2148
+ "name": "direction",
2149
+ "type": {
2150
+ "text": "OrderDirection"
2151
+ },
2152
+ "default": "\"ascending\"",
2153
+ "description": "The direction in which the items are numbered.\n\n- `ascending`: The first item carries the lowest position.\n- `descending`: The first item carries the highest position.",
2154
+ "fieldName": "direction"
2155
+ },
2156
+ {
2157
+ "name": "numbering-style",
2158
+ "type": {
2159
+ "text": "OrderNumberingStyle"
2160
+ },
2161
+ "default": "\"numeric\"",
2162
+ "description": "How the position of each item is labelled.\n\n- `none`: No position is shown.\n- `numeric`: Arabic numerals (1., 2., 3., ...).\n- `alphabetic`: Latin letters (A., B., C., ...).\n- `roman`: Roman numerals (I., II., III., ...).",
2163
+ "fieldName": "numberingStyle"
2164
+ },
2165
+ {
2166
+ "name": "grading-method",
2167
+ "type": {
2168
+ "text": "OrderGradingMethod"
2169
+ },
2170
+ "default": "\"pass-fail\"",
2171
+ "description": "How the score of this answer is calculated.\n\n- `pass-fail`: Full score only if every item is in its correct position.\n- `partial-position`: Credit for each item in its correct position.\n- `partial-sequence`: Credit for each pair of adjacent items in the correct order.",
2172
+ "fieldName": "gradingMethod"
2173
+ },
2174
+ {
2175
+ "name": "solution",
2176
+ "type": {
2177
+ "text": "OrderSolution"
2178
+ },
2179
+ "default": "[]",
2180
+ "description": "The IDs of the items in their correct order. It is obfuscated in the markup so that learners cannot read it directly.",
2181
+ "fieldName": "solution"
2182
+ }
2183
+ ],
2184
+ "superclass": {
2185
+ "name": "LitElementWw",
2186
+ "package": "@webwriter/lit"
2187
+ },
2188
+ "tagName": "webwriter-order",
2189
+ "customElement": true,
2190
+ "modulePath": "src/widgets/order/webwriter-order.ts",
2191
+ "definitionPath": "src/widgets/order/webwriter-order.ts"
2192
+ }
2193
+ ],
2194
+ "exports": [
2195
+ {
2196
+ "kind": "js",
2197
+ "name": "WebwriterOrder",
2198
+ "declaration": {
2199
+ "name": "WebwriterOrder",
2200
+ "module": "src/widgets/order/webwriter-order.ts"
2201
+ }
2202
+ },
2203
+ {
2204
+ "kind": "custom-element-definition",
2205
+ "name": "webwriter-order",
2206
+ "declaration": {
2207
+ "name": "WebwriterOrder",
2208
+ "module": "src/widgets/order/webwriter-order.ts"
2209
+ }
2210
+ }
2211
+ ]
2212
+ },
2213
+ {
2214
+ "kind": "javascript-module",
2215
+ "path": "src/widgets/pairing/webwriter-pairing-item.ts",
2216
+ "declarations": [
2217
+ {
2218
+ "kind": "class",
2219
+ "description": "A single item of a `<webwriter-pairing>`.\n\nIt must be a child of its parent element.",
2220
+ "name": "WebwriterPairing",
2221
+ "members": [],
2222
+ "superclass": {
2223
+ "name": "LitElementWw",
2224
+ "package": "@webwriter/lit"
2225
+ },
2226
+ "tagName": "webwriter-pairing-item",
2227
+ "customElement": true,
2228
+ "modulePath": "src/widgets/pairing/webwriter-pairing-item.ts",
2229
+ "definitionPath": "src/widgets/pairing/webwriter-pairing.ts"
2230
+ }
2231
+ ],
2232
+ "exports": [
2233
+ {
2234
+ "kind": "js",
2235
+ "name": "WebwriterPairing",
2236
+ "declaration": {
2237
+ "name": "WebwriterPairing",
2238
+ "module": "src/widgets/pairing/webwriter-pairing-item.ts"
2239
+ }
2240
+ },
2241
+ {
2242
+ "kind": "custom-element-definition",
2243
+ "name": "webwriter-pairing-item",
2244
+ "declaration": {
2245
+ "name": "WebwriterPairing",
2246
+ "module": "src/widgets/pairing/webwriter-pairing-item.ts"
2247
+ }
2248
+ }
2249
+ ]
2250
+ },
2251
+ {
2252
+ "kind": "javascript-module",
2253
+ "path": "src/widgets/pairing/webwriter-pairing.ts",
2254
+ "declarations": [
2255
+ {
2256
+ "kind": "class",
2257
+ "description": "An answer where learners match items into pairs.\n\nThe items must be `<webwriter-pairing-item>` children of this element.",
2258
+ "name": "WebwriterPairing",
2259
+ "members": [
2260
+ {
2261
+ "kind": "field",
2262
+ "name": "mode",
2263
+ "type": {
2264
+ "text": "PairingMode"
2265
+ },
2266
+ "default": "\"pairing\"",
2267
+ "description": "How learners match the items.\n\n- `pairing`: All items are visible and learners drag them together.\n- `memory`: The items are face down and learners uncover two at a time.",
2268
+ "attribute": "mode",
2269
+ "reflects": true
2270
+ },
2271
+ {
2272
+ "kind": "field",
2273
+ "name": "solution",
2274
+ "type": {
2275
+ "text": "[string, string][]"
2276
+ },
2277
+ "default": "[]",
2278
+ "description": "The pairs counting as correct, as tuples of the two item IDs. It is obfuscated in the markup so that learners cannot read it directly.",
2279
+ "attribute": "solution",
2280
+ "reflects": true
2281
+ },
2282
+ {
2283
+ "kind": "field",
2284
+ "name": "graded",
2285
+ "type": {
2286
+ "text": "boolean"
2287
+ },
2288
+ "privacy": "private",
2289
+ "default": "false"
2290
+ },
2291
+ {
2292
+ "kind": "field",
2293
+ "name": "detailedFeedback",
2294
+ "type": {
2295
+ "text": "boolean"
2296
+ },
2297
+ "privacy": "private",
2298
+ "default": "false"
2299
+ },
2300
+ {
2301
+ "kind": "field",
2302
+ "name": "showFeedback",
2303
+ "privacy": "private",
2304
+ "readonly": true
2305
+ },
2306
+ {
2307
+ "kind": "method",
2308
+ "name": "pairIndex",
2309
+ "privacy": "private",
2310
+ "parameters": [
2311
+ {
2312
+ "name": "itemId",
2313
+ "type": {
2314
+ "text": "string"
2315
+ }
2316
+ }
2317
+ ],
2318
+ "description": "Index of the pair an item belongs to, or -1 if it belongs to none."
2319
+ },
2320
+ {
2321
+ "kind": "method",
2322
+ "name": "addPair",
2323
+ "privacy": "private"
2324
+ },
2325
+ {
2326
+ "kind": "method",
2327
+ "name": "removePair",
2328
+ "privacy": "private",
2329
+ "parameters": [
2330
+ {
2331
+ "name": "a",
2332
+ "type": {
2333
+ "text": "string"
2334
+ }
2335
+ },
2336
+ {
2337
+ "name": "b",
2338
+ "type": {
2339
+ "text": "string"
2340
+ }
2341
+ }
2342
+ ]
2343
+ },
2344
+ {
2345
+ "kind": "method",
2346
+ "name": "renderAuthoringView",
2347
+ "privacy": "private"
2348
+ },
2349
+ {
2350
+ "kind": "field",
2351
+ "name": "pairingQuiz",
2352
+ "type": {
2353
+ "text": "PairingQuizState | null"
2354
+ },
2355
+ "privacy": "private",
2356
+ "default": "null"
2357
+ },
2358
+ {
2359
+ "kind": "field",
2360
+ "name": "pairingDragState",
2361
+ "type": {
2362
+ "text": "PairingDragState | null"
2363
+ },
2364
+ "privacy": "private",
2365
+ "default": "null"
2366
+ },
2367
+ {
2368
+ "kind": "field",
2369
+ "name": "pairingSettleTimeout",
2370
+ "type": {
2371
+ "text": "ReturnType<typeof setTimeout> | undefined"
2372
+ },
2373
+ "privacy": "private"
2374
+ },
2375
+ {
2376
+ "kind": "method",
2377
+ "name": "resetPairingQuiz",
2378
+ "privacy": "private"
2379
+ },
2380
+ {
2381
+ "kind": "method",
2382
+ "name": "renderPairingView",
2383
+ "privacy": "private"
2384
+ },
2385
+ {
2386
+ "kind": "method",
2387
+ "name": "renderPairingCard",
2388
+ "privacy": "private",
2389
+ "parameters": [
2390
+ {
2391
+ "name": "id",
2392
+ "type": {
2393
+ "text": "string"
2394
+ }
2395
+ },
2396
+ {
2397
+ "name": "variant",
2398
+ "default": "\"\""
2399
+ },
2400
+ {
2401
+ "name": "draggable",
2402
+ "default": "true"
2403
+ }
2404
+ ]
2405
+ },
2406
+ {
2407
+ "kind": "field",
2408
+ "name": "pairingCards",
2409
+ "privacy": "private",
2410
+ "readonly": true
2411
+ },
2412
+ {
2413
+ "kind": "method",
2414
+ "name": "animatePairingCard",
2415
+ "privacy": "private",
2416
+ "parameters": [
2417
+ {
2418
+ "name": "card",
2419
+ "type": {
2420
+ "text": "HTMLElement"
2421
+ }
2422
+ },
2423
+ {
2424
+ "name": "from",
2425
+ "type": {
2426
+ "text": "DOMRect"
2427
+ }
2428
+ },
2429
+ {
2430
+ "name": "duration",
2431
+ "default": "PAIRING_SETTLE_MS"
2432
+ }
2433
+ ]
2434
+ },
2435
+ {
2436
+ "kind": "method",
2437
+ "name": "flipPairingCards",
2438
+ "privacy": "private",
2439
+ "parameters": [
2440
+ {
2441
+ "name": "from",
2442
+ "type": {
2443
+ "text": "Map<string, DOMRect>"
2444
+ }
2445
+ },
2446
+ {
2447
+ "name": "droppedCardId",
2448
+ "type": {
2449
+ "text": "string"
2450
+ }
2451
+ }
2452
+ ]
2453
+ },
2454
+ {
2455
+ "kind": "method",
2456
+ "name": "finishPairingSettle",
2457
+ "privacy": "private"
2458
+ },
2459
+ {
2460
+ "kind": "method",
2461
+ "name": "pairingDropCell",
2462
+ "privacy": "private",
2463
+ "parameters": [
2464
+ {
2465
+ "name": "state",
2466
+ "type": {
2467
+ "text": "PairingDragState"
2468
+ }
2469
+ },
2470
+ {
2471
+ "name": "clientX",
2472
+ "type": {
2473
+ "text": "number"
2474
+ }
2475
+ },
2476
+ {
2477
+ "name": "clientY",
2478
+ "type": {
2479
+ "text": "number"
2480
+ }
2481
+ }
2482
+ ]
2483
+ },
2484
+ {
2485
+ "kind": "method",
2486
+ "name": "applyPairingDrop",
2487
+ "privacy": "private",
2488
+ "parameters": [
2489
+ {
2490
+ "name": "state",
2491
+ "type": {
2492
+ "text": "PairingDragState"
2493
+ }
2494
+ },
2495
+ {
2496
+ "name": "cell",
2497
+ "type": {
2498
+ "text": "HTMLElement"
2499
+ }
2500
+ }
2501
+ ]
2502
+ },
2503
+ {
2504
+ "kind": "method",
2505
+ "name": "requestPairingAnimationFrame",
2506
+ "privacy": "private"
2507
+ },
2508
+ {
2509
+ "kind": "method",
2510
+ "name": "autoScrollPairing",
2511
+ "privacy": "private",
2512
+ "parameters": [
2513
+ {
2514
+ "name": "state",
2515
+ "type": {
2516
+ "text": "PairingDragState"
2517
+ }
2518
+ },
2519
+ {
2520
+ "name": "deltaTime",
2521
+ "type": {
2522
+ "text": "number"
2523
+ }
2524
+ }
2525
+ ]
2526
+ },
2527
+ {
2528
+ "kind": "method",
2529
+ "name": "onPairingAnimationFrame",
2530
+ "privacy": "private",
2531
+ "parameters": [
2532
+ {
2533
+ "name": "time",
2534
+ "type": {
2535
+ "text": "number"
2536
+ }
2537
+ }
2538
+ ]
2539
+ },
2540
+ {
2541
+ "kind": "method",
2542
+ "name": "onPairingPointerDown",
2543
+ "privacy": "private",
2544
+ "parameters": [
2545
+ {
2546
+ "name": "event",
2547
+ "type": {
2548
+ "text": "PointerEvent"
2549
+ }
2550
+ }
2551
+ ]
2552
+ },
2553
+ {
2554
+ "kind": "method",
2555
+ "name": "onPairingPointerMove",
2556
+ "privacy": "private",
2557
+ "parameters": [
2558
+ {
2559
+ "name": "event",
2560
+ "type": {
2561
+ "text": "PointerEvent"
2562
+ }
2563
+ }
2564
+ ]
2565
+ },
2566
+ {
2567
+ "kind": "method",
2568
+ "name": "onPairingPointerEnd",
2569
+ "privacy": "private",
2570
+ "parameters": [
2571
+ {
2572
+ "name": "event",
2573
+ "type": {
2574
+ "text": "PointerEvent"
2575
+ }
2576
+ }
2577
+ ]
2578
+ },
2579
+ {
2580
+ "kind": "field",
2581
+ "name": "memoryGame",
2582
+ "type": {
2583
+ "text": "MemoryGameState | null"
2584
+ },
2585
+ "privacy": "private",
2586
+ "default": "null"
2587
+ },
2588
+ {
2589
+ "kind": "field",
2590
+ "name": "flipBackTimeout",
2591
+ "type": {
2592
+ "text": "ReturnType<typeof setTimeout> | undefined"
2593
+ },
2594
+ "privacy": "private"
2595
+ },
2596
+ {
2597
+ "kind": "method",
2598
+ "name": "resetMemoryGame",
2599
+ "privacy": "private"
2600
+ },
2601
+ {
2602
+ "kind": "method",
2603
+ "name": "flipMemoryItem",
2604
+ "privacy": "private",
2605
+ "parameters": [
2606
+ {
2607
+ "name": "id",
2608
+ "type": {
2609
+ "text": "string"
2610
+ }
2611
+ }
2612
+ ]
2613
+ },
2614
+ {
2615
+ "kind": "method",
2616
+ "name": "renderMemoryGame",
2617
+ "privacy": "private"
2618
+ },
2619
+ {
2620
+ "kind": "method",
2621
+ "name": "checkValidity",
2622
+ "return": {
2623
+ "type": {
2624
+ "text": "boolean"
2625
+ }
2626
+ }
2627
+ },
2628
+ {
2629
+ "kind": "method",
2630
+ "name": "checkAnswer",
2631
+ "return": {
2632
+ "type": {
2633
+ "text": "number"
2634
+ }
2635
+ },
2636
+ "parameters": [
2637
+ {
2638
+ "name": "detailedFeedback",
2639
+ "type": {
2640
+ "text": "boolean"
2641
+ }
2642
+ }
2643
+ ]
2644
+ },
2645
+ {
2646
+ "kind": "method",
2647
+ "name": "reset",
2648
+ "return": {
2649
+ "type": {
2650
+ "text": "void"
2651
+ }
2652
+ }
2653
+ }
2654
+ ],
2655
+ "attributes": [
2656
+ {
2657
+ "name": "mode",
2658
+ "type": {
2659
+ "text": "PairingMode"
2660
+ },
2661
+ "default": "\"pairing\"",
2662
+ "description": "How learners match the items.\n\n- `pairing`: All items are visible and learners drag them together.\n- `memory`: The items are face down and learners uncover two at a time.",
2663
+ "fieldName": "mode"
2664
+ },
2665
+ {
2666
+ "name": "solution",
2667
+ "type": {
2668
+ "text": "[string, string][]"
2669
+ },
2670
+ "default": "[]",
2671
+ "description": "The pairs counting as correct, as tuples of the two item IDs. It is obfuscated in the markup so that learners cannot read it directly.",
2672
+ "fieldName": "solution"
2673
+ }
2674
+ ],
2675
+ "superclass": {
2676
+ "name": "LitElementWw",
2677
+ "package": "@webwriter/lit"
2678
+ },
2679
+ "tagName": "webwriter-pairing-item",
2680
+ "customElement": true,
2681
+ "modulePath": "src/widgets/pairing/webwriter-pairing.ts",
2682
+ "definitionPath": "src/widgets/pairing/webwriter-pairing.ts"
2683
+ }
2684
+ ],
2685
+ "exports": [
2686
+ {
2687
+ "kind": "js",
2688
+ "name": "WebwriterPairing",
2689
+ "declaration": {
2690
+ "name": "WebwriterPairing",
2691
+ "module": "src/widgets/pairing/webwriter-pairing.ts"
2692
+ }
2693
+ },
2694
+ {
2695
+ "kind": "custom-element-definition",
2696
+ "name": "webwriter-pairing",
2697
+ "declaration": {
2698
+ "name": "WebwriterPairing",
2699
+ "module": "src/widgets/pairing/webwriter-pairing.ts"
2700
+ }
2701
+ }
2702
+ ]
2703
+ },
2704
+ {
2705
+ "kind": "javascript-module",
2706
+ "path": "src/widgets/speech/webwriter-speech.ts",
2707
+ "declarations": [
2708
+ {
2709
+ "kind": "class",
2710
+ "description": "An answer where learners record a spoken response.\n\nIt must be assigned to the default slot of a `<webwriter-task>`.",
2711
+ "name": "WebwriterSpeech",
2712
+ "members": [
2713
+ {
2714
+ "kind": "field",
2715
+ "name": "src",
2716
+ "type": {
2717
+ "text": "string | null"
2718
+ },
2719
+ "default": "null",
2720
+ "description": "The recording of the learner as a data URL, or `null` if nothing was recorded yet.",
2721
+ "attribute": "src",
2722
+ "reflects": true
2723
+ },
2724
+ {
2725
+ "kind": "method",
2726
+ "name": "reset"
2727
+ },
2728
+ {
2729
+ "kind": "method",
2730
+ "name": "checkValidity",
2731
+ "return": {
2732
+ "type": {
2733
+ "text": "boolean"
2734
+ }
2735
+ }
2736
+ }
2737
+ ],
2738
+ "attributes": [
2739
+ {
2740
+ "name": "src",
2741
+ "type": {
2742
+ "text": "string | null"
2743
+ },
2744
+ "default": "null",
2745
+ "description": "The recording of the learner as a data URL, or `null` if nothing was recorded yet.",
2746
+ "fieldName": "src"
2747
+ }
2748
+ ],
2749
+ "superclass": {
2750
+ "name": "LitElementWw",
2751
+ "package": "@webwriter/lit"
2752
+ },
2753
+ "tagName": "webwriter-speech",
2754
+ "customElement": true,
2755
+ "modulePath": "src/widgets/speech/webwriter-speech.ts",
2756
+ "definitionPath": "src/widgets/speech/webwriter-speech.ts"
2757
+ }
2758
+ ],
2759
+ "exports": [
2760
+ {
2761
+ "kind": "js",
2762
+ "name": "WebwriterSpeech",
2763
+ "declaration": {
2764
+ "name": "WebwriterSpeech",
2765
+ "module": "src/widgets/speech/webwriter-speech.ts"
2766
+ }
2767
+ },
2768
+ {
2769
+ "kind": "custom-element-definition",
2770
+ "name": "webwriter-speech",
2771
+ "declaration": {
2772
+ "name": "WebwriterSpeech",
2773
+ "module": "src/widgets/speech/webwriter-speech.ts"
2774
+ }
2775
+ }
2776
+ ]
2777
+ }
2778
+ ]
2779
+ }