-- ═══════════════════════════════════════════════════════════════
-- 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;
