GET /api/exam/corpus — read-only view over the seeded eb_specifications + eb_exams catalogue: board → subject → spec → papers grouped by paper_code+session, each showing which of QP/MS/ER exist AND are stored, with per-spec + global rollups (specs, papers, sessions, QP/MS/ER counts). Surfaces the collected exam bank so the app can display its state — e.g. AQA GCSE Physics 8463: 21 QP / 12 MS / 17 ER. Validated against the live catalogue (60 specs, 1178 docs, 535 papers) + a unit test (grouping, QP/MS/ER presence, stored-vs-catalogued). As-user (catalogue is public reference data). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
730 B
Python
21 lines
730 B
Python
"""Exam-marker API package (/api/exam/).
|
|
|
|
A clean top-level router group (R5.1/E5), deliberately NOT nested under /database/. Every
|
|
endpoint authenticates the JWT and calls Supabase as-the-user so the RLS in
|
|
volumes/db/cc/72-exam-marker.sql is enforced (spec E1/E2 fixes).
|
|
"""
|
|
from fastapi import APIRouter
|
|
|
|
from routers.exam.templates import router as templates_router
|
|
from routers.exam.batches import router as batches_router
|
|
from routers.exam.bank import router as bank_router
|
|
from routers.exam.corpus import router as corpus_router
|
|
|
|
router = APIRouter()
|
|
router.include_router(templates_router)
|
|
router.include_router(batches_router)
|
|
router.include_router(bank_router)
|
|
router.include_router(corpus_router)
|
|
|
|
__all__ = ["router"]
|