-
Notifications
You must be signed in to change notification settings - Fork 0
CSV Import Format
Decks can be bulk-populated by importing a CSV file (CsvImporter). Two header layouts are supported and auto-detected based on which columns are present — you don't need to declare which one you're using.
Every row needs, at minimum:
| Column | Aliases | Notes |
|---|---|---|
front |
prompt |
The question text. |
back |
answer |
The correct answer. |
If neither front/prompt or back/answer is found in the header, the whole import is rejected with an error. Rows where front or back is blank are silently skipped.
| Column | Notes |
|---|---|
type |
One of FLASHCARD, MATH, MCQ, LANGUAGE (case-insensitive). Defaults to FLASHCARD if missing or unrecognized. |
hint |
Free text, shown to the user when hints are allowed by the deck's failure policy. |
id, category, image
|
Accepted (Format A) but currently ignored on import. |
Distractors can be supplied in either of two shapes — pick whichever is easier to generate:
id,front,back,type,category,distractors,hint,image
1,"What is the capital of France?","Paris",MCQ,geography,"[""London"",""Berlin"",""Madrid""]",,
- Column name:
distractors - Value: a JSON array of strings, e.g.
["London","Berlin","Madrid"] - Must start with
[to be recognized as JSON — otherwise it's ignored.
front,back,type,hint,distractor1,distractor2,distractor3
What is the capital of France?,Paris,MCQ,Starts with P,London,Berlin,Madrid
- Columns:
distractor1,distractor2,distractor3 - Blank distractor cells are dropped (you can supply fewer than 3).
If neither shape is present, the question is imported with an empty distractor list (fine for FLASHCARD type).
front,back
What is the powerhouse of the cell?,Mitochondria
2 + 2,4
type defaults to FLASHCARD and no distractors are needed for plain flashcards.
- The first row is always treated as the header; header names are matched case-insensitively after trimming whitespace.
- Rows with fewer columns than required (missing
front/backcells) are skipped and reported inerrors. - Each imported question gets a freshly generated ID — any
idcolumn in the CSV is not reused. - The importer returns a count of successfully imported questions, a
skippedcount, and a list of per-line error messages, so a bad row won't abort the whole import.
Files are read as UTF-8. Save your CSV as UTF-8 (not UTF-16 or a legacy codepage) to avoid mangled characters, especially for non-English content.