feat(schema): 2.1 types, fragments, and JSON Schemas
Add the term, equation, value, and misconception registries (src/model/course/glossary.rs) and the new optional fields on objectives, targets, lectures, readings, bank options, and policy. Load registry entries from objective files, glossary.yaml, and course.yaml, with one definition site per id as for every other registry. Port every edit in docs/design/2.1/build_schemas.py into the hand-written schema builders, add glossary.schema.json, and test the generated schemas against the targets; the only differences are two 2.0 spellings the code already had. The 2.0 example fragments load and validate unchanged. The 2.1 example bank gains `status: draft`, which every coursebank item requires. tests/docs.rs skips docs/design/, which holds design records rather than guide pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
47 files changed
+10568
-55
No files matched your search
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"$id": "https://coursebank.dev/schema/lecture.schema.json",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"additionalProperties": false,
|
||||
"description": "One session: its readings, and the objectives it develops. A fragment of the course file, merged on load.",
|
||||
"properties": {
|
||||
"lectures": {
|
||||
"additionalProperties": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"date": {
|
||||
"description": "Date delivered.",
|
||||
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
||||
"type": "string"
|
||||
},
|
||||
"readings": {
|
||||
"description": "Readings assigned with this lecture, in the order you assign them. A plain string is the pre-schema form and still loads.",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"description": "The pre-schema form: a citation, unparsed.",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"focus": {
|
||||
"description": "What to take from it. This is the sentence a student report quotes.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"locator": {
|
||||
"description": "Where inside the work: §6.1, pp. 212-219, ch. 3.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"path": {
|
||||
"description": "Joined to the reference's base_url to reach this location.",
|
||||
"type": "string"
|
||||
},
|
||||
"ref": {
|
||||
"description": "Citation key into `references`.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"description": "supplemental means offered but not separately assessed.",
|
||||
"enum": [
|
||||
"assigned",
|
||||
"supplemental"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
"skip": {
|
||||
"description": "What to gloss, and why it is out of scope.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"summary": {
|
||||
"description": "What the section contains.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"targets": {
|
||||
"description": "Target ids this reading serves. A student who misses one of these is pointed here, so the list is what makes study guidance specific. Cite targets rather than objectives: a section of a book backs a specific performance, and a reading list resolved from an objective would send a student the same six sections whichever part of it they missed.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"text": {
|
||||
"description": "A pre-schema citation string, held unparsed.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"url": {
|
||||
"description": "Full URL, when base_url does not cover the location.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"ref"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"slides_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"teaches": {
|
||||
"description": "The objectives this session develops. Each named objective gains this lecture in its `lectures` list when the course is loaded, so the pair is declared once, here, while planning the lecture.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"title": {
|
||||
"description": "Lecture title.",
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"unit": {
|
||||
"description": "Unit id.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"title"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"description": "Keyed by lecture id, conventionally one entry per file.",
|
||||
"type": "object"
|
||||
},
|
||||
"schema_version": {
|
||||
"description": "Declared in course.yaml; fragments inherit it.",
|
||||
"type": [
|
||||
"string",
|
||||
"number"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"lectures"
|
||||
],
|
||||
"title": "coursebank lecture file",
|
||||
"type": "object"
|
||||
}
|
||||
Reference in new issue
Block a user