Skip to content

feat: Anki deck import/export and Quizlet CSV import#60

Open
nymulinfoinlet wants to merge 2 commits intomainfrom
feat/anki-import
Open

feat: Anki deck import/export and Quizlet CSV import#60
nymulinfoinlet wants to merge 2 commits intomainfrom
feat/anki-import

Conversation

@nymulinfoinlet
Copy link
Copy Markdown
Contributor

Summary

  • Adds a new import-export module with full Anki .apkg import/export and CSV/TSV import/export (Quizlet compatible)
  • Anki import: extracts ZIP, reads SQLite notes table, parses \x1f-separated fields, strips HTML/media, creates flashcards via FlashcardsService.createBulk
  • Anki export: builds a minimal .apkg with proper Anki schema (col, notes, cards tables, Basic model template)
  • CSV import: auto-detects delimiter (tab/comma/semicolon), handles quoted fields, detects headers, configurable column mapping
  • CSV export: outputs front, back, tags columns

Endpoints

Method Path Description
POST /study-sets/:id/import/anki Import .apkg file
POST /study-sets/:id/import/csv Import CSV/TSV file
GET /study-sets/:id/export/anki Download as .apkg
GET /study-sets/:id/export/csv Download as CSV

Dependencies added

  • adm-zip + @types/adm-zip (ZIP extraction/creation)
  • better-sqlite3 + @types/better-sqlite3 (read/write Anki SQLite DB)

Closes #47

Test plan

  • Upload a real Anki .apkg deck and verify cards are imported with correct front/back/tags
  • Export a study set as .apkg and import it into Anki desktop to verify compatibility
  • Import a Quizlet TSV export and verify delimiter auto-detection works
  • Import a generic CSV with comma delimiter and header row
  • Export as CSV and verify the file opens correctly in a spreadsheet
  • Verify npx tsc --noEmit passes with 0 errors
  • Verify auth guard blocks unauthenticated requests
  • Verify ownership check prevents importing into another user's study set

🤖 Generated with Claude Code

nymulinfoinlet and others added 2 commits April 12, 2026 17:02
Expand the quiz system from 4 to 8 question types to support deeper
assessments. New types include partial credit scoring (matching, ordering),
auto-graded code execution via code-sandbox service (coding), and
AI-evaluated long-form answers with rubric-based feedback (essay).

Closes #46

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a new import-export module that enables students to bring in their
existing flashcard collections and export study sets for use in other tools.

- AnkiImportService: parses .apkg files (ZIP + SQLite), extracts notes
  with field separator parsing, strips HTML/media references, creates
  flashcards via existing FlashcardsService.createBulk
- AnkiExportService: generates minimal .apkg files with proper Anki
  schema (col, notes, cards tables), Basic model template, and media stub
- CsvImportService: handles CSV/TSV with auto-detected delimiters,
  quoted field parsing, header detection (Quizlet compatible)
- CsvExportService: exports study set as CSV with front, back, tags columns
- ImportExportController: four endpoints mounted on study-sets/:id
  (POST import/anki, POST import/csv, GET export/anki, GET export/csv)

Dependencies: adm-zip, better-sqlite3 (+ @types)

Closes #47

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(import-export): Anki deck import/export and Quizlet set import

1 participant