# Supported course card types

Course authors supply JSON, not JavaScript or Gleam. All examples below are complete
importable courses. Validate the course object with the [authoring API](api.md),
then preview it before submitting a proposal. Submission and approval do not publish.

Use `schemaVersion:1`. `equation-editor-v1` accepts equation cards;
`mixed-cards-v1` accepts the five supported authoring types below. Each card needs a stable `id`,
`title`, `prompt`, and positive `learningVersion`. The
[JSON Schema](../course.schema.json) defines exact required fields and bounds;
semantic validation also checks references and result-to-progress mappings.

| Type | Content | Complete example |
| --- | --- | --- |
| `equation` | `editor`, `answers`, optional `sequence`, and equation grading configuration | [Equation](example.json) |
| `verbatim` | Ordered `answer` text/formula references and `formulas` palette | [German recall](german-recall-example.json) |
| `self-review` | `noteId`, `front`, `back`, `frontLanguage`, `backLanguage`, `attribution` | [Self-review](self-review-example.json) |
| `diagram-labeling` | `diagram`, `labels`, `targets` with label references | [Diagram](diagram-example.json) |
| `cloze` | `parts` text/blank references and `blanks` with accepted `answers` | [Cloze](cloze-example.json) |

The [course content reference](content-reference.html) documents card fields, the
course/deck envelope, translations, progress mappings and settings. It is generated
from the same schemas used for validation. Semantic admission checks still apply.

`equation-practice` is used in our courses; not yet open for new authoring.
Existing courses remain supported. It is not part of the first author invitation.

## Behavior and limits

- Verbatim prose is case-insensitive, with built-in spelling aliases; matching is
  not semantic. Formula tokens retain their identity. Typing capsules are generated automatically from the answer. Legacy `vocabulary`
  and `vocabularyAlways` fields remain accepted; omit them in new content. See [verbatim fields](api.md#mixed-course-format).
- Self-review supports both same-language question/answer cards and translation cards.
  `frontLanguage` and `backLanguage` describe the text and may be identical.
  Deck previews show only the front. Self-review reveals the back, then records Again, Hard, Good or Easy and advances.
  These ratings do not enable an Anki spaced-repetition scheduler.
- Diagrams use bounded line/circle data or an embedded PNG, not arbitrary SVG/HTML
  or remote images. Targets use percentage coordinates; line/circle coordinates
  use a 600 × 360 viewBox (the structural coordinate bounds are 0–600). The learner selects a label and assigns it to a target.
- Cloze `parts` contain strings or `{ "blank": "id" }`; each blank declares its
  accessible `label` and one or more accepted answer strings. Keep IDs consistent.

For self-review, diagram and cloze courses, start with the example's `progress`
configuration. It declares ordered color categories and `outcomeCategories`.
When mixing types, map every outcome declared by the included types; a missing
mapping fails validation. Presentation colors do not change the recorded evidence.

Local imported courses and their practice stay in that browser; sign-in does not
make them cloud-synced. Keep the source JSON and attribution. Examples are small
schema demonstrations, not a claim that mechanical validation proves content quality.

## Progress mappings

A card reports an outcome such as `easy` or `solved`. Your course maps that outcome
to a named progress category with a label and color. The category ID on the right
of each `outcomeCategories` entry must exist in `categories`. Several outcomes may
share one category; this changes their display, not how answers are graded.

For example, in a self-review course, `"easy": "confident"` routes Easy ratings to
`{"id":"confident","label":"Confident","color":"#c83e78"}`. You must also map
`good`, `hard` and `again`. Start from the complete self-review example rather than
copying this partial fragment as a course.

When mixing types, cover the union of their outcomes. The
[generated outcome list](content-reference.html#progress-outcomes) names them for
each supported type. Keep category order consistent with the order you want in the
legend. Omit legacy `historyLength`; cards determine their history depth.

## Course settings

For the first author invitation, omit `settingsEditors`. The registered
`practice-mode` widget currently controls `equation-practice`, which is not yet
supported for new authoring. Adding that widget does not turn ordinary equation
cards into solve/recall cards. The settings schemas in the reference describe the
registered payloads, not a promise that every card supports them.

Presentation settings such as left-handed layout are handled by the app and the
cards that support them. Authors do not need to supply learner preferences in
course JSON. Do not copy internal settings from a published course without checking
that the chosen card type supports them.

## Adding an implementation

A JSON course can use registered types only. A new card interaction or grader
requires reviewed code integrated into the app; proposals cannot upload executable
plugins. See the [card-type implementation guide](implementing-card-types.md) for
provider-owned contracts, lifecycle endpoints, registration and verification.
A new scheduler is a separate app extension, not a card-content field.

## Shared card metadata

All card types share `id`, `type`, `title`, `prompt`, and `learningVersion`, plus
optional `retired` (boolean) and `weight` (positive safe integer, at most 9,007,199,254,740,991). New files should always
include `type`. Older equation files may omit it; imports normalize that omission
and new exports make it explicit. The generated [header schema](card-header.schema.json)
and [content reference](content-reference.html) describe the constraints.
Retired cards remain authored members of their decks and retain history, but are
excluded from practice. Weight changes affect future tries, never recorded tries.

`weight` changes progress credit, not grading. Equation cards may set
`slipAllowance` (0–3, default 0): how many light errors still count as solved.
Verbatim cards may set `gradingScale` (1–4, default derived from answer length):
the scale used by their warning/reveal formula. For example, `weight: 4` with
`slipAllowance: 0` gives an equation four progress credits with strict grading.

Legacy `multiplier` is accepted as the default for both weight and grading
(equation allowance = multiplier minus one). Explicit fields override those
defaults independently. Prefer the separate fields for new content. Titles are
limited to 500 code points and prompts to 5,000; oversized text is rejected.
