From c7cfd72e7fb288026c078d5e5d7e73e8030305f1 Mon Sep 17 00:00:00 2001 From: Maxim Dolgolyov Date: Wed, 3 Jun 2026 16:18:22 +0300 Subject: [PATCH] =?UTF-8?q?feat(exam):=20Phase=202=20=E2=80=94=20=D1=81?= =?UTF-8?q?=D1=85=D0=B5=D0=BC=D0=B0=20per-task=20textbook=20link=20(057=5F?= =?UTF-8?q?exam=5Ftask=5Ftextbook.sql)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ALTER TABLE exam_tasks ADD COLUMN textbook_slug TEXT; ALTER TABLE exam_tasks ADD COLUMN textbook_paragraph INTEGER; Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/db/migrations/057_exam_task_textbook.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backend/src/db/migrations/057_exam_task_textbook.sql diff --git a/backend/src/db/migrations/057_exam_task_textbook.sql b/backend/src/db/migrations/057_exam_task_textbook.sql new file mode 100644 index 0000000..43d4012 --- /dev/null +++ b/backend/src/db/migrations/057_exam_task_textbook.sql @@ -0,0 +1,14 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 057: Per-task textbook link for exam_tasks +-- +-- Adds two columns to exam_tasks: +-- textbook_slug — textbook chapter slug (e.g. 'algebra-8-ch2') +-- textbook_paragraph — paragraph number inside that chapter (pN → N as integer) +-- +-- These are populated by backend/scripts/tag-exam-textbook.js. +-- The controller (exam-prep.js) prefers these task-level values +-- over the subtopic-level fallback from exam_topics. +-- ═══════════════════════════════════════════════════════════════ + +ALTER TABLE exam_tasks ADD COLUMN textbook_slug TEXT; +ALTER TABLE exam_tasks ADD COLUMN textbook_paragraph INTEGER;