@kensai/quiz-core 0.1.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -0
  3. package/dist/evaluate.d.ts +47 -0
  4. package/dist/evaluate.d.ts.map +1 -0
  5. package/dist/evaluate.js +149 -0
  6. package/dist/evaluate.js.map +1 -0
  7. package/dist/events.d.ts +10 -0
  8. package/dist/events.d.ts.map +1 -0
  9. package/dist/events.js +26 -0
  10. package/dist/events.js.map +1 -0
  11. package/dist/index.d.ts +26 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +19 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/load.d.ts +22 -0
  16. package/dist/load.d.ts.map +1 -0
  17. package/dist/load.js +31 -0
  18. package/dist/load.js.map +1 -0
  19. package/dist/resolve.d.ts +9 -0
  20. package/dist/resolve.d.ts.map +1 -0
  21. package/dist/resolve.js +22 -0
  22. package/dist/resolve.js.map +1 -0
  23. package/dist/runtime.d.ts +118 -0
  24. package/dist/runtime.d.ts.map +1 -0
  25. package/dist/runtime.js +245 -0
  26. package/dist/runtime.js.map +1 -0
  27. package/dist/schema.generated.d.ts +503 -0
  28. package/dist/schema.generated.d.ts.map +1 -0
  29. package/dist/schema.generated.js +626 -0
  30. package/dist/schema.generated.js.map +1 -0
  31. package/dist/settings.d.ts +19 -0
  32. package/dist/settings.d.ts.map +1 -0
  33. package/dist/settings.js +32 -0
  34. package/dist/settings.js.map +1 -0
  35. package/dist/stats.d.ts +33 -0
  36. package/dist/stats.d.ts.map +1 -0
  37. package/dist/stats.js +79 -0
  38. package/dist/stats.js.map +1 -0
  39. package/dist/text.d.ts +5 -0
  40. package/dist/text.d.ts.map +1 -0
  41. package/dist/text.js +11 -0
  42. package/dist/text.js.map +1 -0
  43. package/dist/types.d.ts +136 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +9 -0
  46. package/dist/types.js.map +1 -0
  47. package/dist/validate.d.ts +28 -0
  48. package/dist/validate.d.ts.map +1 -0
  49. package/dist/validate.js +170 -0
  50. package/dist/validate.js.map +1 -0
  51. package/package.json +60 -0
@@ -0,0 +1,626 @@
1
+ // AUTO-GENERATED FILE — do not edit by hand.
2
+ // Source: spec/quiz.schema.json (run `pnpm sync:schema` to regenerate).
3
+ export const quizSchema = {
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
+ "$id": "https://github.com/kensai/quiz-core/spec/quiz.schema.json",
6
+ "title": "Kensai Quiz",
7
+ "description": "Specification for a single, portable, AI-authorable quiz (schema version 0.1).",
8
+ "type": "object",
9
+ "required": [
10
+ "schema_version",
11
+ "metadata",
12
+ "questions"
13
+ ],
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "schema_version": {
17
+ "type": "string",
18
+ "const": "0.1",
19
+ "description": "Spec version this file targets. Enables backward compatibility."
20
+ },
21
+ "metadata": {
22
+ "$ref": "#/$defs/metadata"
23
+ },
24
+ "settings": {
25
+ "$ref": "#/$defs/settings"
26
+ },
27
+ "categories": {
28
+ "type": "array",
29
+ "description": "Optional registry of categories used for end-of-quiz statistics.",
30
+ "items": {
31
+ "$ref": "#/$defs/category"
32
+ }
33
+ },
34
+ "option_groups": {
35
+ "type": "object",
36
+ "description": "Reusable named option sets. Reference them from questions via `options_from` / `groups_from`.",
37
+ "additionalProperties": {
38
+ "type": "array",
39
+ "minItems": 1,
40
+ "items": {
41
+ "$ref": "#/$defs/option"
42
+ }
43
+ }
44
+ },
45
+ "questions": {
46
+ "type": "array",
47
+ "minItems": 1,
48
+ "items": {
49
+ "$ref": "#/$defs/question"
50
+ }
51
+ }
52
+ },
53
+ "$defs": {
54
+ "metadata": {
55
+ "type": "object",
56
+ "required": [
57
+ "title"
58
+ ],
59
+ "additionalProperties": false,
60
+ "properties": {
61
+ "id": {
62
+ "type": "string",
63
+ "description": "Optional stable slug."
64
+ },
65
+ "title": {
66
+ "type": "string",
67
+ "description": "Human title (Markdown)."
68
+ },
69
+ "path": {
70
+ "type": "string",
71
+ "description": "Study-path breadcrumb, e.g. 'English / Verb system / Present tenses'."
72
+ },
73
+ "description": {
74
+ "type": "string",
75
+ "description": "Optional overview (Markdown)."
76
+ },
77
+ "language": {
78
+ "type": "string",
79
+ "description": "BCP-47 content language tag, e.g. 'en', 'es'. Default: 'und'."
80
+ },
81
+ "author": {
82
+ "type": "string"
83
+ },
84
+ "tags": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "string"
88
+ }
89
+ }
90
+ }
91
+ },
92
+ "settings": {
93
+ "type": "object",
94
+ "description": "All fields optional. Author defaults; a player may override per attempt.",
95
+ "additionalProperties": false,
96
+ "properties": {
97
+ "navigation": {
98
+ "enum": [
99
+ "all",
100
+ "sequential"
101
+ ],
102
+ "default": "all",
103
+ "description": "'all' shows every question at once; 'sequential' advances one by one."
104
+ },
105
+ "order": {
106
+ "enum": [
107
+ "fixed",
108
+ "random"
109
+ ],
110
+ "default": "fixed",
111
+ "description": "Order in which questions are presented ('random' shuffles them)."
112
+ },
113
+ "feedback": {
114
+ "enum": [
115
+ "immediate",
116
+ "on_finish"
117
+ ],
118
+ "default": "on_finish",
119
+ "description": "Reveal correctness/explanation per question or only at the end."
120
+ },
121
+ "time_limit": {
122
+ "type": [
123
+ "number",
124
+ "null"
125
+ ],
126
+ "minimum": 1,
127
+ "default": null,
128
+ "description": "Seconds allowed. null or omitted = unlimited."
129
+ },
130
+ "shuffle_options": {
131
+ "type": "boolean",
132
+ "default": false,
133
+ "description": "Shuffle the answer-option order of choice questions, except those that set `shuffle_options: false`."
134
+ },
135
+ "passing_score": {
136
+ "type": "number",
137
+ "minimum": 0,
138
+ "maximum": 1,
139
+ "description": "Pass threshold as a fraction 0..1."
140
+ }
141
+ }
142
+ },
143
+ "category": {
144
+ "type": "object",
145
+ "required": [
146
+ "id",
147
+ "label"
148
+ ],
149
+ "additionalProperties": false,
150
+ "properties": {
151
+ "id": {
152
+ "type": "string"
153
+ },
154
+ "label": {
155
+ "type": "string",
156
+ "description": "Display label (Markdown)."
157
+ }
158
+ }
159
+ },
160
+ "option": {
161
+ "type": "object",
162
+ "required": [
163
+ "id",
164
+ "text"
165
+ ],
166
+ "additionalProperties": false,
167
+ "properties": {
168
+ "id": {
169
+ "type": "string",
170
+ "description": "Unique within its option list."
171
+ },
172
+ "text": {
173
+ "type": "string",
174
+ "description": "Option text (Markdown)."
175
+ }
176
+ }
177
+ },
178
+ "group": {
179
+ "type": "object",
180
+ "required": [
181
+ "id",
182
+ "label"
183
+ ],
184
+ "additionalProperties": false,
185
+ "properties": {
186
+ "id": {
187
+ "type": "string"
188
+ },
189
+ "label": {
190
+ "type": "string",
191
+ "description": "Bucket label (Markdown)."
192
+ }
193
+ }
194
+ },
195
+ "id_or_id_list": {
196
+ "description": "A single id or a list of ids.",
197
+ "oneOf": [
198
+ {
199
+ "type": "string"
200
+ },
201
+ {
202
+ "type": "array",
203
+ "minItems": 1,
204
+ "items": {
205
+ "type": "string"
206
+ }
207
+ }
208
+ ]
209
+ },
210
+ "question": {
211
+ "type": "object",
212
+ "required": [
213
+ "type",
214
+ "prompt"
215
+ ],
216
+ "properties": {
217
+ "id": {
218
+ "type": "string",
219
+ "description": "Recommended: stable id for stats/resume."
220
+ },
221
+ "type": {
222
+ "enum": [
223
+ "choice",
224
+ "true_false",
225
+ "fill_blank",
226
+ "classify",
227
+ "matching",
228
+ "ordering",
229
+ "short_answer"
230
+ ]
231
+ },
232
+ "category": {
233
+ "type": "string",
234
+ "description": "References a categories[].id, or a free-form string."
235
+ },
236
+ "points": {
237
+ "type": "number",
238
+ "minimum": 0,
239
+ "default": 1
240
+ },
241
+ "prompt": {
242
+ "type": "string",
243
+ "description": "Question text (Markdown)."
244
+ },
245
+ "explanation": {
246
+ "type": "string",
247
+ "description": "Optional rationale (Markdown)."
248
+ }
249
+ },
250
+ "oneOf": [
251
+ {
252
+ "$ref": "#/$defs/q_choice"
253
+ },
254
+ {
255
+ "$ref": "#/$defs/q_true_false"
256
+ },
257
+ {
258
+ "$ref": "#/$defs/q_fill_blank"
259
+ },
260
+ {
261
+ "$ref": "#/$defs/q_classify"
262
+ },
263
+ {
264
+ "$ref": "#/$defs/q_matching"
265
+ },
266
+ {
267
+ "$ref": "#/$defs/q_ordering"
268
+ },
269
+ {
270
+ "$ref": "#/$defs/q_short_answer"
271
+ }
272
+ ]
273
+ },
274
+ "q_choice": {
275
+ "properties": {
276
+ "type": {
277
+ "const": "choice"
278
+ },
279
+ "id": true,
280
+ "category": true,
281
+ "points": true,
282
+ "prompt": true,
283
+ "explanation": true,
284
+ "select": {
285
+ "enum": [
286
+ "single",
287
+ "multiple"
288
+ ],
289
+ "default": "single"
290
+ },
291
+ "options": {
292
+ "type": "array",
293
+ "minItems": 2,
294
+ "items": {
295
+ "$ref": "#/$defs/option"
296
+ }
297
+ },
298
+ "options_from": {
299
+ "type": "string",
300
+ "description": "Name of an entry in option_groups."
301
+ },
302
+ "answer": {
303
+ "$ref": "#/$defs/id_or_id_list"
304
+ },
305
+ "shuffle_options": {
306
+ "type": "boolean",
307
+ "default": true,
308
+ "description": "Whether these options may be reordered when the quiz enables option shuffling. Default true; set false to lock the order (e.g. an 'All of the above' option, or options like 'Both A and B')."
309
+ }
310
+ },
311
+ "required": [
312
+ "type",
313
+ "prompt",
314
+ "answer"
315
+ ],
316
+ "oneOf": [
317
+ {
318
+ "required": [
319
+ "options"
320
+ ],
321
+ "not": {
322
+ "required": [
323
+ "options_from"
324
+ ]
325
+ }
326
+ },
327
+ {
328
+ "required": [
329
+ "options_from"
330
+ ],
331
+ "not": {
332
+ "required": [
333
+ "options"
334
+ ]
335
+ }
336
+ }
337
+ ],
338
+ "additionalProperties": false
339
+ },
340
+ "q_true_false": {
341
+ "properties": {
342
+ "type": {
343
+ "const": "true_false"
344
+ },
345
+ "id": true,
346
+ "category": true,
347
+ "points": true,
348
+ "prompt": true,
349
+ "explanation": true,
350
+ "answer": {
351
+ "type": "boolean"
352
+ }
353
+ },
354
+ "required": [
355
+ "type",
356
+ "prompt",
357
+ "answer"
358
+ ],
359
+ "additionalProperties": false
360
+ },
361
+ "q_fill_blank": {
362
+ "properties": {
363
+ "type": {
364
+ "const": "fill_blank"
365
+ },
366
+ "id": true,
367
+ "category": true,
368
+ "points": true,
369
+ "prompt": true,
370
+ "explanation": true,
371
+ "blanks": {
372
+ "type": "object",
373
+ "minProperties": 1,
374
+ "description": "Map of placeholder id ({{id}} in prompt) to a blank definition.",
375
+ "additionalProperties": {
376
+ "$ref": "#/$defs/blank"
377
+ }
378
+ }
379
+ },
380
+ "required": [
381
+ "type",
382
+ "prompt",
383
+ "blanks"
384
+ ],
385
+ "additionalProperties": false
386
+ },
387
+ "blank": {
388
+ "type": "object",
389
+ "description": "A blank is either free-text (accept) or a per-blank choice (options + answer).",
390
+ "additionalProperties": false,
391
+ "properties": {
392
+ "accept": {
393
+ "type": "array",
394
+ "minItems": 1,
395
+ "items": {
396
+ "type": "string"
397
+ },
398
+ "description": "Accepted free-text answers (synonyms)."
399
+ },
400
+ "case_sensitive": {
401
+ "type": "boolean",
402
+ "default": false
403
+ },
404
+ "options": {
405
+ "type": "array",
406
+ "minItems": 2,
407
+ "items": {
408
+ "$ref": "#/$defs/option"
409
+ }
410
+ },
411
+ "answer": {
412
+ "type": "string",
413
+ "description": "Correct option id (choice-per-blank variant)."
414
+ }
415
+ },
416
+ "oneOf": [
417
+ {
418
+ "required": [
419
+ "accept"
420
+ ],
421
+ "not": {
422
+ "required": [
423
+ "options"
424
+ ]
425
+ }
426
+ },
427
+ {
428
+ "required": [
429
+ "options",
430
+ "answer"
431
+ ],
432
+ "not": {
433
+ "required": [
434
+ "accept"
435
+ ]
436
+ }
437
+ }
438
+ ]
439
+ },
440
+ "q_classify": {
441
+ "properties": {
442
+ "type": {
443
+ "const": "classify"
444
+ },
445
+ "id": true,
446
+ "category": true,
447
+ "points": true,
448
+ "prompt": true,
449
+ "explanation": true,
450
+ "groups": {
451
+ "type": "array",
452
+ "minItems": 2,
453
+ "items": {
454
+ "$ref": "#/$defs/group"
455
+ }
456
+ },
457
+ "groups_from": {
458
+ "type": "string",
459
+ "description": "Name of an entry in option_groups (its options act as buckets: id + text)."
460
+ },
461
+ "items": {
462
+ "type": "array",
463
+ "minItems": 1,
464
+ "items": {
465
+ "type": "object",
466
+ "required": [
467
+ "id",
468
+ "text",
469
+ "answer"
470
+ ],
471
+ "additionalProperties": false,
472
+ "properties": {
473
+ "id": {
474
+ "type": "string"
475
+ },
476
+ "text": {
477
+ "type": "string",
478
+ "description": "Item text (Markdown)."
479
+ },
480
+ "answer": {
481
+ "type": "string",
482
+ "description": "Target group id."
483
+ }
484
+ }
485
+ }
486
+ }
487
+ },
488
+ "required": [
489
+ "type",
490
+ "prompt",
491
+ "items"
492
+ ],
493
+ "oneOf": [
494
+ {
495
+ "required": [
496
+ "groups"
497
+ ],
498
+ "not": {
499
+ "required": [
500
+ "groups_from"
501
+ ]
502
+ }
503
+ },
504
+ {
505
+ "required": [
506
+ "groups_from"
507
+ ],
508
+ "not": {
509
+ "required": [
510
+ "groups"
511
+ ]
512
+ }
513
+ }
514
+ ],
515
+ "additionalProperties": false
516
+ },
517
+ "q_matching": {
518
+ "properties": {
519
+ "type": {
520
+ "const": "matching"
521
+ },
522
+ "id": true,
523
+ "category": true,
524
+ "points": true,
525
+ "prompt": true,
526
+ "explanation": true,
527
+ "left": {
528
+ "type": "array",
529
+ "minItems": 1,
530
+ "items": {
531
+ "$ref": "#/$defs/option"
532
+ }
533
+ },
534
+ "right": {
535
+ "type": "array",
536
+ "minItems": 1,
537
+ "items": {
538
+ "$ref": "#/$defs/option"
539
+ }
540
+ },
541
+ "answer": {
542
+ "type": "object",
543
+ "minProperties": 1,
544
+ "description": "Map of left id -> right id.",
545
+ "additionalProperties": {
546
+ "type": "string"
547
+ }
548
+ }
549
+ },
550
+ "required": [
551
+ "type",
552
+ "prompt",
553
+ "left",
554
+ "right",
555
+ "answer"
556
+ ],
557
+ "additionalProperties": false
558
+ },
559
+ "q_ordering": {
560
+ "properties": {
561
+ "type": {
562
+ "const": "ordering"
563
+ },
564
+ "id": true,
565
+ "category": true,
566
+ "points": true,
567
+ "prompt": true,
568
+ "explanation": true,
569
+ "items": {
570
+ "type": "array",
571
+ "minItems": 2,
572
+ "items": {
573
+ "$ref": "#/$defs/option"
574
+ }
575
+ },
576
+ "answer": {
577
+ "type": "array",
578
+ "minItems": 2,
579
+ "items": {
580
+ "type": "string"
581
+ },
582
+ "description": "Item ids in the correct order."
583
+ }
584
+ },
585
+ "required": [
586
+ "type",
587
+ "prompt",
588
+ "items",
589
+ "answer"
590
+ ],
591
+ "additionalProperties": false
592
+ },
593
+ "q_short_answer": {
594
+ "properties": {
595
+ "type": {
596
+ "const": "short_answer"
597
+ },
598
+ "id": true,
599
+ "category": true,
600
+ "points": true,
601
+ "prompt": true,
602
+ "explanation": true,
603
+ "accept": {
604
+ "type": "array",
605
+ "minItems": 1,
606
+ "items": {
607
+ "type": "string"
608
+ },
609
+ "description": "Accepted answers (synonyms)."
610
+ },
611
+ "case_sensitive": {
612
+ "type": "boolean",
613
+ "default": false
614
+ }
615
+ },
616
+ "required": [
617
+ "type",
618
+ "prompt",
619
+ "accept"
620
+ ],
621
+ "additionalProperties": false
622
+ }
623
+ }
624
+ };
625
+ export default quizSchema;
626
+ //# sourceMappingURL=schema.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.generated.js","sourceRoot":"","sources":["../src/schema.generated.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,yEAAyE;AAEzE,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,SAAS,EAAE,8CAA8C;IACzD,KAAK,EAAE,2DAA2D;IAClE,OAAO,EAAE,aAAa;IACtB,aAAa,EAAE,gFAAgF;IAC/F,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACV,gBAAgB;QAChB,UAAU;QACV,WAAW;KACZ;IACD,sBAAsB,EAAE,KAAK;IAC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AE;oBAChB,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,KAAK;iBACjB;aACF;YACD,UAAU,EAAE;gBACV,MAAM;gBACN,QAAQ;gBACR,QAAQ;aACT;YACD,sBAAsB,EAAE,KAAK;SAC9B;KACF;CACO,CAAC;AAEX,eAAe,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { FeedbackMode, NavigationMode, OrderMode, QuizSettings } from "./types.js";
2
+ /** A fully-resolved settings object, with every field present. */
3
+ export interface ResolvedSettings {
4
+ navigation: NavigationMode;
5
+ order: OrderMode;
6
+ feedback: FeedbackMode;
7
+ time_limit: number | null;
8
+ shuffle_options: boolean;
9
+ passing_score: number | null;
10
+ }
11
+ /** Defaults applied when `settings` (or a given field) is omitted. */
12
+ export declare const DEFAULT_SETTINGS: ResolvedSettings;
13
+ /**
14
+ * Merge authored settings and optional per-attempt overrides over the documented
15
+ * defaults. `undefined` fields are ignored (so partial overrides are safe);
16
+ * explicit `null` is kept (e.g. to clear a time limit).
17
+ */
18
+ export declare function resolveSettings(authored?: QuizSettings, overrides?: Partial<ResolvedSettings>): ResolvedSettings;
19
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,EAAE,gBAO9B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,CAAC,EAAE,YAAY,EACvB,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GACpC,gBAAgB,CAMlB"}