From a88b69797f4998a9a64c83038a0fcdf54887eff8 Mon Sep 17 00:00:00 2001 From: Maxim Dolgolyov Date: Wed, 3 Jun 2026 16:18:51 +0300 Subject: [PATCH] =?UTF-8?q?feat(exam):=20Phase=205=20=E2=80=94=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?subtopic-=D1=84=D0=BE=D0=BB=D0=B1=D1=8D=D0=BA=D0=BE=D0=B2=20(05?= =?UTF-8?q?8=5Fexam=5Ftopics=5Ftextbook=5Ffix.sql)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alg-equations: §10(drobno) -> algebra-8-ch2 §8 (дискриминант, массовый тип) alg-inequalities: §13 -> algebra-8-ch3 §17 (квадратные/метод интервалов) alg-polynomials: algebra-9 -> algebra-7-ch2 §14 (разложение, основной тип) alg-numbers: algebra-9 hub -> math-6-ch4 (рациональные числа) alg-arithmetic: algebra-9 hub -> math-6-ch1 (десятичные дроби) alg-powers: algebra-9 hub -> algebra-7-ch1 §1 (натур. показатель) alg-word-problems: algebra-9 hub -> math-6-ch2 (проценты, массовый тип) geom-quadrilaterals: geometry-9-ch2 §9 -> geometry-8-ch1 §4 (параллелограмм) geom-circle: geometry-9-ch2 §7 -> geometry-8-ch4 §8 (центральный/вписанный угол) Co-Authored-By: Claude Opus 4.8 (1M context) --- .../058_exam_topics_textbook_fix.sql | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 backend/src/db/migrations/058_exam_topics_textbook_fix.sql diff --git a/backend/src/db/migrations/058_exam_topics_textbook_fix.sql b/backend/src/db/migrations/058_exam_topics_textbook_fix.sql new file mode 100644 index 0000000..e7626d1 --- /dev/null +++ b/backend/src/db/migrations/058_exam_topics_textbook_fix.sql @@ -0,0 +1,73 @@ +-- ═══════════════════════════════════════════════════════════════ +-- 058: Fix exam_topics textbook_slug/paragraph (subtopic-level fallback) +-- +-- Migration 028 set coarse fallback values. This migration corrects them +-- to align with the detailed per-subtopic maps from PLAN.md. +-- These values act as fallback when a task has no task-level textbook_slug +-- (e.g. theory-statements or newly added tasks not yet classified). +-- ═══════════════════════════════════════════════════════════════ + +-- ── Algebra subtopics (fix / improve) ────────────────────────── + +-- alg-numbers: rational numbers are in math-6-ch4 (better than algebra-9 hub) +UPDATE exam_topics SET textbook_slug = 'math-6-ch4', textbook_paragraph = NULL + WHERE slug = 'alg-numbers' AND exam_key = 'math9'; + +-- alg-arithmetic: basic arithmetic → math-6-ch1 (decimals, most common 5-6 topic) +UPDATE exam_topics SET textbook_slug = 'math-6-ch1', textbook_paragraph = NULL + WHERE slug = 'alg-arithmetic' AND exam_key = 'math9'; + +-- alg-powers: primary is natural exponent → algebra-7-ch1 §1 +UPDATE exam_topics SET textbook_slug = 'algebra-7-ch1', textbook_paragraph = 1 + WHERE slug = 'alg-powers' AND exam_key = 'math9'; + +-- alg-expressions: primary → algebra-9-ch1 §5 (rational expression transform) +-- (028 already set this correctly) + +-- alg-polynomials: primary → algebra-7-ch2 §14 (factoring, most tested) +UPDATE exam_topics SET textbook_slug = 'algebra-7-ch2', textbook_paragraph = 14 + WHERE slug = 'alg-polynomials' AND exam_key = 'math9'; + +-- alg-fractions: primary → algebra-9-ch1 §3 (add/subtract rational fractions) +-- (028 already set §3; keep it) + +-- alg-equations: primary → algebra-8-ch2 §8 (quadratic by discriminant, most common) +-- (028 had §10 from algebra-9-ch3 which is drobno-rational — fix to quadratic) +UPDATE exam_topics SET textbook_slug = 'algebra-8-ch2', textbook_paragraph = 8 + WHERE slug = 'alg-equations' AND exam_key = 'math9'; + +-- alg-inequalities: primary → algebra-8-ch3 §17 (quadratic inequalities, method of intervals) +-- (028 already set §13; fix to §17 which is the most common exam topic) +UPDATE exam_topics SET textbook_slug = 'algebra-8-ch3', textbook_paragraph = 17 + WHERE slug = 'alg-inequalities' AND exam_key = 'math9'; + +-- alg-functions: primary → algebra-9-ch2 §6 (function of numeric argument) +-- (028 already set §6; keep it) + +-- alg-progressions: primary → algebra-9-ch4 §15 (arithmetic progression) +-- (028 already set §15; keep it) + +-- alg-word-problems: primary → math-6-ch2 (percentages — most common type) +UPDATE exam_topics SET textbook_slug = 'math-6-ch2', textbook_paragraph = NULL + WHERE slug = 'alg-word-problems' AND exam_key = 'math9'; + +-- ── Geometry subtopics (fix / improve) ────────────────────────── + +-- geom-triangles: primary → geometry-9-ch1 §1 (trig in right triangle, most tested) +-- (028 had §1 of geometry-9-ch1; keep it) + +-- geom-quadrilaterals: primary → geometry-8-ch1 §4 (parallelogram, most common) +-- (028 had §9 of geometry-9-ch2 — too specific; fix to general parallelogram) +UPDATE exam_topics SET textbook_slug = 'geometry-8-ch1', textbook_paragraph = 4 + WHERE slug = 'geom-quadrilaterals' AND exam_key = 'math9'; + +-- geom-circle: primary → geometry-8-ch4 §8 (central angle / inscribed angle) +-- (028 had §7 of geometry-9-ch2; fix to geometry-8-ch4 §8) +UPDATE exam_topics SET textbook_slug = 'geometry-8-ch4', textbook_paragraph = 8 + WHERE slug = 'geom-circle' AND exam_key = 'math9'; + +-- geom-coordinates: primary → algebra-9-ch3 §12 (circle equation) +-- (028 already set §12; keep it) + +-- theory-statements: leave NULL — no single textbook home +-- (028 already left NULL; keep it)