{
  "$id": "https://ara3dgen.com/schemas/educate-lesson.v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Ara Educate lesson, version 1",
  "description": "A lesson for Ara Educate: a teacher, a writing board, and steps in order (write, mark, show on the projector screen, point, talk), each with what the teacher says. Educate times it, lays it out and films it.",
  "type": "object",
  "required": [
    "kind",
    "version",
    "steps"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "description": "This schema's address, so editors check the file as you type."
    },
    "kind": {
      "const": "ara-lesson"
    },
    "version": {
      "const": 1
    },
    "title": {
      "type": "string",
      "maxLength": 80
    },
    "set": {
      "enum": [
        "classroom",
        "laboratory",
        "black-box",
        "office",
        "home-library"
      ],
      "default": "classroom",
      "description": "Where the lesson happens. The board hangs on the room's back wall; in every set but black-box, its walls and posters can be chosen (room)."
    },
    "board": {
      "type": "object",
      "additionalProperties": false,
      "description": "The board the teacher writes on. Slides, code and terminals go on a projector screen that comes down for them.",
      "properties": {
        "kind": {
          "enum": [
            "whiteboard",
            "chalkboard"
          ],
          "default": "whiteboard"
        },
        "font": {
          "enum": [
            "kalam",
            "caveat",
            "patrick-hand",
            "sans"
          ],
          "default": "kalam",
          "description": "The handwriting (\"sans\" is plain type)."
        }
      }
    },
    "teacher": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "preset": {
          "enum": [
            "The Resort Guest",
            "The Lifeguard",
            "The Paramedic",
            "The Nurse",
            "The Doctor",
            "The Lab Scientist",
            "The Chef",
            "The Photographer",
            "The Flight Attendant",
            "The Airline Pilot",
            "The Dispatch Rider",
            "The Road Worker",
            "The Street Racer",
            "The Police Officer (USA)",
            "The MMA Fighter",
            "The Mob Boss",
            "The Clown",
            "The Masked Robber",
            "The Getaway Driver",
            "The Security Guard",
            "The Motorcycle Cop",
            "The Army Medic",
            "The Bride",
            "The Covert Spy",
            "The Professional Hitman",
            "The Bodyguard",
            "The Corporate High-Flier",
            "The Priest",
            "The Female Executive",
            "The Arabian Oil Tycoon",
            "The Miami Dealer",
            "The Prison Escapee",
            "The Gangster",
            "The Beach Dude",
            "The Beach Girl",
            "Athletic man",
            "Athletic woman",
            "Businesswoman",
            "Heavy brute",
            "Elder",
            "Teen",
            "The Adventurer",
            "The Explorer",
            "The Basketball Player",
            "The Footballer",
            "The Gym Instructor",
            "The Powerlifter",
            "The DJ",
            "The Secret Agent",
            "The Soldier",
            "The Gamer",
            "The Schoolboy",
            "The Schoolgirl",
            "The Cool Kid",
            "The Cyberpunk Hacker",
            "The Wasteland Survivor",
            "The African Warrior",
            "The Yoruba Warrior",
            "The Maasai Warrior",
            "The Zulu Warrior",
            "The Dahomey Warrior",
            "The Police Officer (Nigeria)",
            "The FRSC Officer (Nigeria)",
            "The American Sheriff",
            "Detective"
          ],
          "default": "The Doctor",
          "description": "An Ara character preset. Carried items, weapons and sunglasses are left off for lessons."
        },
        "character": {
          "type": "string",
          "description": "A character code from the Ara builder (its share link's code), instead of a preset."
        }
      }
    },
    "student": {
      "type": "object",
      "required": [
        "voice"
      ],
      "additionalProperties": false,
      "description": "A student who asks and answers, standing at the front beside the board. Their lines are talk steps with \"by\": \"student\".",
      "properties": {
        "preset": {
          "enum": [
            "The Resort Guest",
            "The Lifeguard",
            "The Paramedic",
            "The Nurse",
            "The Doctor",
            "The Lab Scientist",
            "The Chef",
            "The Photographer",
            "The Flight Attendant",
            "The Airline Pilot",
            "The Dispatch Rider",
            "The Road Worker",
            "The Street Racer",
            "The Police Officer (USA)",
            "The MMA Fighter",
            "The Mob Boss",
            "The Clown",
            "The Masked Robber",
            "The Getaway Driver",
            "The Security Guard",
            "The Motorcycle Cop",
            "The Army Medic",
            "The Bride",
            "The Covert Spy",
            "The Professional Hitman",
            "The Bodyguard",
            "The Corporate High-Flier",
            "The Priest",
            "The Female Executive",
            "The Arabian Oil Tycoon",
            "The Miami Dealer",
            "The Prison Escapee",
            "The Gangster",
            "The Beach Dude",
            "The Beach Girl",
            "Athletic man",
            "Athletic woman",
            "Businesswoman",
            "Heavy brute",
            "Elder",
            "Teen",
            "The Adventurer",
            "The Explorer",
            "The Basketball Player",
            "The Footballer",
            "The Gym Instructor",
            "The Powerlifter",
            "The DJ",
            "The Secret Agent",
            "The Soldier",
            "The Gamer",
            "The Schoolboy",
            "The Schoolgirl",
            "The Cool Kid",
            "The Cyberpunk Hacker",
            "The Wasteland Survivor",
            "The African Warrior",
            "The Yoruba Warrior",
            "The Maasai Warrior",
            "The Zulu Warrior",
            "The Dahomey Warrior",
            "The Police Officer (Nigeria)",
            "The FRSC Officer (Nigeria)",
            "The American Sheriff",
            "Detective"
          ],
          "default": "The Schoolgirl",
          "description": "An Ara character preset."
        },
        "character": {
          "type": "string",
          "description": "A character code from the Ara builder, instead of a preset."
        },
        "voice": {
          "type": "string",
          "description": "The student's voice, as for the teacher: best a different one."
        }
      }
    },
    "voice": {
      "type": "string",
      "default": "M1",
      "description": "F1 to F5 (a woman's voice), M1 to M5 (a man's), made free in the browser; or a provider voice such as gemini/Kore, made with the person's own key. A line can start with <laugh> (voices F2, F5, M3) or <breath> (M2, M5)."
    },
    "captions": {
      "type": "boolean",
      "default": true,
      "description": "Show what the teacher says as captions."
    },
    "aspect": {
      "enum": [
        "landscape",
        "portrait"
      ],
      "default": "landscape"
    },
    "view": {
      "type": "object",
      "additionalProperties": false,
      "description": "A turn of the camera added to every shot.",
      "properties": {
        "azimuth": {
          "type": "number",
          "minimum": -180,
          "maximum": 180
        },
        "elevation": {
          "type": "number",
          "minimum": -30,
          "maximum": 50
        },
        "zoom": {
          "type": "number",
          "minimum": 0.5,
          "maximum": 2.5
        }
      }
    },
    "room": {
      "type": "object",
      "additionalProperties": false,
      "description": "In a set whose room can be chosen (classroom, laboratory, office, home-library): its wall colours and the posters on its walls.",
      "properties": {
        "walls": {
          "enum": [
            "classic",
            "sky",
            "sage",
            "sand",
            "sunny",
            "lilac",
            "stone"
          ],
          "description": "classic: slate blue; sky: sky blue; sage: sage green; sand: sand and terracotta; sunny: mustard and teal; lilac: lilac; stone: stone grey"
        },
        "posters": {
          "enum": [
            "general",
            "maths",
            "science",
            "coding",
            "languages",
            "art"
          ],
          "default": "general",
          "description": "Posters for a subject: general (learning), maths, science, coding, languages or art."
        }
      }
    },
    "language": {
      "enum": [
        "en",
        "ar",
        "bg",
        "hr",
        "cs",
        "da",
        "nl",
        "et",
        "fi",
        "fr",
        "de",
        "el",
        "hi",
        "hu",
        "id",
        "it",
        "ja",
        "ko",
        "lv",
        "lt",
        "pl",
        "pt",
        "ro",
        "ru",
        "sk",
        "sl",
        "es",
        "sv",
        "tr",
        "uk",
        "vi"
      ],
      "default": "en",
      "description": "The language the lesson is in (its steps written in it): Ara's free voices speak it. en: English, ar: Arabic, bg: Bulgarian, hr: Croatian, cs: Czech, da: Danish, nl: Dutch, et: Estonian, fi: Finnish, fr: French, de: German, el: Greek, hi: Hindi, hu: Hungarian, id: Indonesian, it: Italian, ja: Japanese, ko: Korean, lv: Latvian, lt: Lithuanian, pl: Polish, pt: Portuguese, ro: Romanian, ru: Russian, sk: Slovak, sl: Slovenian, es: Spanish, sv: Swedish, tr: Turkish, uk: Ukrainian, vi: Vietnamese."
    },
    "music": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "track"
      ],
      "description": "Music from Ara's library under the whole lesson: quiet, and quieter still while anyone speaks.",
      "properties": {
        "track": {
          "enum": [
            "adventure-trailer",
            "tropical-pop",
            "restaurant-jazz",
            "horror",
            "hip-hop-story",
            "spy-opening",
            "afrobeat-alone",
            "spy-mission",
            "happy-education",
            "playful-learning",
            "old-school-salsa"
          ],
          "description": "adventure-trailer: dramatic adventure and trailer music; tropical-pop: relaxed tropical pop for beaches, resorts and warm scenes; restaurant-jazz: restaurant jazz for cafés, dinners and conversations; horror: horror atmosphere for unsettling scenes; hip-hop-story: urban hip-hop beat for street scenes and character introductions; spy-opening: spy-film opening music for mysteries and investigations; afrobeat-alone: afrobeat instrumental for social scenes, city life and celebrations; spy-mission: spy and mission music for covert operations and action; happy-education: bright, happy background music for lessons and explainers; playful-learning: playful, whimsical classroom music for lessons for children; old-school-salsa: old-school salsa for dancing and lively social scenes"
        },
        "volume": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.2,
          "description": "How loud, from 0 to 1. Keep it low (0.1 to 0.3) so the teacher is easy to hear."
        }
      }
    },
    "images": {
      "type": "object",
      "description": "The images image steps use, by ID, as data: URLs (PNG, JPEG or WebP). Educate writes these when it saves a lesson.",
      "additionalProperties": {
        "type": "string",
        "pattern": "^data:image/(png|jpeg|webp);base64,"
      }
    },
    "steps": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
        "type": "object",
        "required": [
          "type"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,40}$"
          },
          "type": {
            "enum": [
              "write",
              "quiz",
              "diagram",
              "shape",
              "slide",
              "code",
              "terminal",
              "image",
              "clear",
              "point",
              "talk"
            ]
          },
          "by": {
            "const": "student",
            "description": "talk: the student says this line (the lesson needs a student)."
          },
          "say": {
            "type": "string",
            "maxLength": 600,
            "description": "What the teacher says during the step (the student, on a talk step with \"by\": \"student\"), written as it's said aloud."
          },
          "chapter": {
            "type": "string",
            "maxLength": 100,
            "description": "Starts a chapter of the video with this title, for YouTube's chapters. Left out on every step, chapters are worked out from the lesson."
          },
          "pause": {
            "type": "number",
            "minimum": 0,
            "maximum": 10,
            "description": "Seconds to wait after the step (default 0.4)."
          },
          "text": {
            "type": "string",
            "maxLength": 6000,
            "description": "write: the handwriting (short lines, \\n between them); code: the code; terminal: lines, commands starting with \"$ \"."
          },
          "diagram": {
            "enum": [
              "array",
              "stack",
              "queue",
              "list",
              "tree"
            ],
            "description": "diagram: which kind (default array); its values go in text."
          },
          "highlight": {
            "type": "string",
            "maxLength": 200,
            "description": "diagram: values to light up, separated by commas; [2] is the cell at position 2 of an array."
          },
          "pointers": {
            "type": "string",
            "maxLength": 200,
            "description": "diagram (array or list): named arrows, like i=0, j=3: a position in an array, a value in a list."
          },
          "answer": {
            "type": "string",
            "maxLength": 200,
            "description": "quiz: the answer, written in green and ticked after the countdown."
          },
          "wait": {
            "type": "number",
            "minimum": 2,
            "maximum": 30,
            "description": "quiz: seconds the countdown runs while the class thinks (default 5)."
          },
          "size": {
            "type": "number",
            "minimum": 24,
            "maximum": 160,
            "description": "write: the writing's size (left out, it's sized to read well and fit)."
          },
          "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}$",
            "description": "write or shape: the ink."
          },
          "shape": {
            "enum": [
              "line",
              "arrow",
              "underline",
              "box",
              "circle",
              "tick",
              "cross",
              "axes",
              "graph"
            ],
            "description": "shape: underline, circle, box, tick and cross mark the writing before it; line and arrow go from/to; axes and graph draw a plot."
          },
          "from": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "description": "[across, down], 0 to 1 of the board."
          },
          "to": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "description": "[across, down], 0 to 1 of the board."
          },
          "fn": {
            "type": "string",
            "maxLength": 200,
            "description": "graph: a formula in x, such as 2*x+1 or sin(x)."
          },
          "range": {
            "type": "array",
            "minItems": 4,
            "maxItems": 4,
            "items": {
              "type": "number"
            },
            "description": "graph: [xMin, xMax, yMin, yMax]."
          },
          "title": {
            "type": "string",
            "maxLength": 120,
            "description": "slide: its title."
          },
          "bullets": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "string",
              "maxLength": 160
            },
            "description": "slide: its points, shown one by one."
          },
          "lang": {
            "enum": [
              "javascript",
              "python",
              "html",
              "css",
              "sql",
              "text"
            ],
            "description": "code: the language, for its colours."
          },
          "fileName": {
            "type": "string",
            "maxLength": 60,
            "description": "code: the name on the editor's tab."
          },
          "highlights": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "type": "object",
              "required": [
                "from"
              ],
              "additionalProperties": false,
              "properties": {
                "from": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 40
                },
                "to": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 40
                },
                "at": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Seconds after the code is typed."
                }
              }
            }
          },
          "errors": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "type": "object",
              "required": [
                "line"
              ],
              "additionalProperties": false,
              "properties": {
                "line": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 40
                },
                "message": {
                  "type": "string",
                  "maxLength": 80
                },
                "fix": {
                  "type": "string",
                  "maxLength": 200,
                  "description": "The line, corrected: retyped a moment later."
                }
              }
            }
          },
          "before": {
            "type": "string",
            "maxLength": 6000,
            "description": "code: the code before a change; the step then shows the change to its text."
          },
          "image": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{1,64}$",
            "description": "image: the image's ID (in images)."
          },
          "on": {
            "enum": [
              "board",
              "projector"
            ],
            "description": "image: where it shows (the projector screen unless \"board\")."
          },
          "focus": {
            "type": "array",
            "maxItems": 12,
            "items": {
              "type": "object",
              "required": [
                "kind"
              ],
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "enum": [
                    "zoom",
                    "highlight",
                    "all"
                  ]
                },
                "region": {
                  "type": "array",
                  "minItems": 4,
                  "maxItems": 4,
                  "items": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "description": "[x, y, width, height], 0 to 1 of the image."
                }
              }
            },
            "description": "image: zooms and highlights, in order; \"all\" zooms back out."
          },
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      }
    }
  }
}
