@altnovatrail/spec 0.9.16 → 0.10.1

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.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * The open view of each part of a module (format/README.md, section 6): the type of each struct the
5
5
  * open view of a part reaches, by the name it has in formatv0, with the fields marked x-open alone,
6
- * of version 0.3. An open view has no check, no template and no solver; a task's has its givens and
6
+ * of version 0.4. An open view has no check, no template and no solver; a task's has its givens and
7
7
  * its unknown. Strings, integers and enumerations are formatv0's.
8
8
  *
9
9
  * @packageDocumentation
@@ -312,6 +312,12 @@ export interface Step {
312
312
  * What the learner does in the step, in the module's explanation language.
313
313
  */
314
314
  readonly title: formatv0.Text;
315
+ /**
316
+ * How to go through the step, in the module's explanation language, which the learner's app shows
317
+ * beside its title. Every task of the module goes through the step, so the leak check searches it
318
+ * for the keys of every task.
319
+ */
320
+ readonly description?: formatv0.Text;
315
321
  /**
316
322
  * What of the task the step gives the learner: givens, the task's givens and unknown, which the
317
323
  * learner ticks; techniques, the task's techniques, which the server gives when the step begins.
@@ -447,8 +453,9 @@ export interface LinePart {
447
453
  * StatementPart is the open view of formatv0.StatementPart, the type of
448
454
  * common.schema.json#/$defs/statement_part: its fields marked x-open.
449
455
  *
450
- * A part of a text that the learner reads — a statement, a solution or an explanation: a paragraph,
451
- * or a picture with what it shows and its size.
456
+ * A part of a text that the learner reads — a statement, a solution, the statement of a worked
457
+ * example, or a paragraph or a picture of an explanation, which the lesson's own explanation_part
458
+ * repeats: a paragraph, or a picture with what it shows and its size.
452
459
  */
453
460
  export interface StatementPart {
454
461
  /**
@@ -456,9 +463,10 @@ export interface StatementPart {
456
463
  */
457
464
  readonly text?: formatv0.Text;
458
465
  /**
459
- * A picture, by its path from media/.
466
+ * A picture, by its path from media/; in a task, a template's may hold placeholders, and a
467
+ * lesson's holds none.
460
468
  */
461
- readonly picture?: formatv0.PicturePath;
469
+ readonly picture?: formatv0.TaskPicturePath;
462
470
  /**
463
471
  * What the picture shows, in words: a screen reader reads it, and it stands in the picture's
464
472
  * place until the picture comes. Empty for a picture that only decorates.
@@ -559,10 +567,10 @@ export interface Lesson {
559
567
  */
560
568
  export interface Segment {
561
569
  /**
562
- * An explanation: paragraphs and pictures that the learner reads, in order, in the module's
563
- * explanation language.
570
+ * An explanation: paragraphs, pictures and numbered lists that the learner reads, in order, in
571
+ * the module's explanation language.
564
572
  */
565
- readonly explanation?: readonly StatementPart[];
573
+ readonly explanation?: readonly ExplanationPart[];
566
574
  /**
567
575
  * A worked example: an example solved before the learner's eyes, on a handwriting sheet.
568
576
  */
@@ -573,11 +581,49 @@ export interface Segment {
573
581
  readonly task?: formatv0.TaskID;
574
582
  }
575
583
 
584
+ /**
585
+ * ExplanationPart is the open view of formatv0.ExplanationPart, the type of
586
+ * lesson.schema.json#/$defs/explanation_part: its fields marked x-open.
587
+ *
588
+ * A part of an explanation: a numbered list, or a paragraph or a picture with what it shows and its
589
+ * size, as a part of a task's statement is; a lesson's picture path holds no placeholder.
590
+ */
591
+ export interface ExplanationPart {
592
+ /**
593
+ * A paragraph, as plain text.
594
+ */
595
+ readonly text?: formatv0.Text;
596
+ /**
597
+ * A picture, by its path from media/: a lesson has no template, so its path holds no placeholder.
598
+ */
599
+ readonly picture?: formatv0.PicturePath;
600
+ /**
601
+ * What the picture shows, in words: a screen reader reads it, and it stands in the picture's
602
+ * place until the picture comes. Empty for a picture that only decorates.
603
+ */
604
+ readonly alt?: string;
605
+ /**
606
+ * The width the picture is shown at, in CSS px; narrower when the text it stands in is.
607
+ */
608
+ readonly width?: number;
609
+ /**
610
+ * The height the picture is shown at, in CSS px, in proportion to its width.
611
+ */
612
+ readonly height?: number;
613
+ /**
614
+ * A numbered list: its texts in order, such as the steps of a method, each a short text that does
615
+ * not begin with a number of its own, as 1. or 1) does. The learner's app draws the numbers, so
616
+ * the leak check reads none of them; it searches the texts as it searches the paragraphs.
617
+ */
618
+ readonly numbered_list?: readonly formatv0.Text[];
619
+ }
620
+
576
621
  /**
577
622
  * WorkedExample is the open view of formatv0.WorkedExample, the type of
578
623
  * lesson.schema.json#/$defs/worked_example: its fields marked x-open.
579
624
  *
580
- * A worked example of a lesson: no task, with no answer slots and no key.
625
+ * A worked example of a lesson: no task, with no answer slots and no key. On a handwriting sheet
626
+ * the demo shows pictures on the sheet; on a workbook it fills the boxes of the example's lines.
581
627
  */
582
628
  export interface WorkedExample {
583
629
  /**
@@ -585,10 +631,15 @@ export interface WorkedExample {
585
631
  */
586
632
  readonly statement: readonly StatementPart[];
587
633
  /**
588
- * The sheet that the author's demo is shown on: a handwriting sheet and its grid. The learner
589
- * does not write on it.
634
+ * What the author's demo is shown on: a handwriting sheet and its grid, or a workbook, the
635
+ * example's lines with their boxes. The learner does not write on it.
590
636
  */
591
637
  readonly canvas: Canvas;
638
+ /**
639
+ * On a workbook: the example's lines, each with its boxes and what they hold, laid out on the
640
+ * page as a task's lines are.
641
+ */
642
+ readonly lines?: readonly ExampleLine[];
592
643
  /**
593
644
  * The author's demo: the parts of how the example is solved, in order, which the learner opens
594
645
  * one at a time and may hide.
@@ -596,12 +647,46 @@ export interface WorkedExample {
596
647
  readonly demo: readonly DemoPart[];
597
648
  }
598
649
 
650
+ /**
651
+ * ExampleLine is the open view of formatv0.ExampleLine, the type of
652
+ * lesson.schema.json#/$defs/example_line: its fields marked x-open.
653
+ *
654
+ * A line of a worked example on a workbook.
655
+ */
656
+ export interface ExampleLine {
657
+ /**
658
+ * The pieces of the line, in order, a box among them at least.
659
+ */
660
+ readonly line: readonly ExampleLinePart[];
661
+ }
662
+
663
+ /**
664
+ * ExampleLinePart is the open view of formatv0.ExampleLinePart, the type of
665
+ * lesson.schema.json#/$defs/example_line_part: its fields marked x-open.
666
+ *
667
+ * A piece of a line of a worked example: a piece of text, or a box with what the demo writes in it.
668
+ */
669
+ export interface ExampleLinePart {
670
+ /**
671
+ * A piece of text of the line.
672
+ */
673
+ readonly text?: formatv0.Text;
674
+ /**
675
+ * A box of the line.
676
+ */
677
+ readonly binding?: string;
678
+ /**
679
+ * Of a box: what the demo writes in it when a part fills it.
680
+ */
681
+ readonly value?: formatv0.Text;
682
+ }
683
+
599
684
  /**
600
685
  * DemoPart is the open view of formatv0.DemoPart, the type of lesson.schema.json#/$defs/demo_part:
601
686
  * its fields marked x-open.
602
687
  *
603
688
  * A part of the author's demo: a paragraph; a picture beside the sheet, with what it shows and its
604
- * size; or a picture on the sheet, with what it shows and its area.
689
+ * size; a picture on the sheet, with what it shows and its area; or, on a workbook, a box filled.
605
690
  */
606
691
  export interface DemoPart {
607
692
  /**
@@ -630,4 +715,25 @@ export interface DemoPart {
630
715
  * of the author's demo.
631
716
  */
632
717
  readonly area?: SheetRectangle;
718
+ /**
719
+ * Of a worked example on a workbook: the box that this part of the demo fills with its value.
720
+ */
721
+ readonly fill?: DemoFill;
722
+ }
723
+
724
+ /**
725
+ * DemoFill is the open view of formatv0.DemoFill, the type of lesson.schema.json#/$defs/demo_fill:
726
+ * its fields marked x-open.
727
+ *
728
+ * A box of a worked example's lines, by its line and its place in it.
729
+ */
730
+ export interface DemoFill {
731
+ /**
732
+ * The line, by its place among the example's lines, from 1.
733
+ */
734
+ readonly line: number;
735
+ /**
736
+ * The box, by its place among the boxes of the line, from 1.
737
+ */
738
+ readonly box: number;
633
739
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@altnovatrail/spec",
3
- "version": "0.9.16",
4
- "description": "The types of NovaTrail's module format for TypeScript, generated from its schemas: the parts of a module and their open views, the canonical view, the inventory, the module index and the test vectors. And the types of the element <novatrail-canvas>, the contract of the canvas and the app. And the types of the admission table, which says which AI provider may serve which age category.",
3
+ "version": "0.10.1",
4
+ "description": "The types of NovaTrail's module format for TypeScript, generated from its schemas: the parts of a module and their open views, the canonical view, the inventory, the module index and the test vectors. And the types of the element <novatrail-canvas>, the contract of the canvas and the app. And the types of the admission table, which says which AI provider may serve which age category. And the numbers and widths of the workbook's page and its test vectors, as JSON, by which a canvas lays the page out.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -21,12 +21,15 @@
21
21
  "./admissionv0": {
22
22
  "types": "./admissionv0/index.d.ts"
23
23
  },
24
+ "./format/page.json": "./format/page.json",
25
+ "./format/vectors/pages/*.json": "./format/vectors/pages/*.json",
24
26
  "./package.json": "./package.json"
25
27
  },
26
28
  "files": [
27
29
  "formatv0",
28
30
  "canvas",
29
- "admissionv0"
31
+ "admissionv0",
32
+ "format"
30
33
  ],
31
34
  "sideEffects": false
32
35
  }