exam: capture sections + choice_groups + marks_confidence in extraction_meta (WS-2 R3)
Some checks failed
api-ci-deploy / test-build-deploy (push) Has been cancelled

Persist the paper's question-layout signals (A-level Section A/B, EITHER/OR choice
groups, marks confidence) onto exam_templates.extraction_meta so the setup UI can
show them. Data was carried by the contract but dropped at persistence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GruxHXxfdp4kZCgAMVFgvV
This commit is contained in:
Kevin Carter (via Claude) 2026-07-04 13:13:45 +00:00
parent 547836e04b
commit e48dd73fdf

View File

@ -802,6 +802,10 @@ def _run_service_extract_merge(ctx: ExamContext, template_id: str, pdf_bytes: by
updates: Dict[str, Any] = {"extraction_meta": {
"engine": "extract-service", "slug": slug, "audit": meta.get("audit") or {},
"counts": {k: len(v) for k, v in rows.items()},
# question-layout signals for the setup UI: paper sections (e.g. A-level Section A/B) + EITHER/OR choices
"sections": meta.get("sections") or [],
"choice_groups": meta.get("choice_groups") or [],
"marks_confidence": meta.get("marks_confidence"),
}}
n_pages = meta.get("n_pages") or meta.get("pages")
if n_pages: