diff --git a/backend/app/services/extraction_modes.py b/backend/app/services/extraction_modes.py index 6525387..61ff1eb 100644 --- a/backend/app/services/extraction_modes.py +++ b/backend/app/services/extraction_modes.py @@ -459,7 +459,12 @@ Rules: - The CORRECT answer must be directly supported by the text — do not invent facts - Create 3 plausible but incorrect distractors using your medical knowledge - Questions should test understanding of concepts, not just exact word recall -- Prefer clinical application questions over pure recall when the content allows +- Split them evenly: about half clinical — a child in front of you, what to do + next, what the finding means — and about half mechanism, asking why the body + behaves as it does. Pathophysiology is what makes the clinical half stick, and + a set that is all vignettes teaches recognition without understanding +- Every question is paediatric: the patient is a child or a neonate, and the + ages, doses and norms are the ones that apply to them - Include a 1-2 sentence explanation that cites the key concept from the text - Spread questions across different parts of the text, not just the first section - Each option should be a complete, standalone phrase (not "A", "B" labels) @@ -604,7 +609,10 @@ Rules: - Mix question-style fronts ("What is the most common cause of...") and term-style fronts ("Hyperbilirubinemia") - FRONT should be concise — one sentence or a few words - BACK should be complete but not verbose — 1-3 sentences with the key facts -- Focus on high-yield facts: diagnostic criteria, treatment protocols, age-specific norms, pathophysiology +- Focus on high-yield facts: diagnostic criteria, treatment protocols, age-specific norms +- Split them evenly between the clinical — what to do, what a finding means — + and the mechanism, why the body behaves as it does. A deck that is all + protocol teaches recognition without understanding - Do NOT repeat the same concept in multiple cards - Spread cards across different parts of the text - Each card must be directly supported by the text — do not invent facts diff --git a/backend/tests/test_article_ai.py b/backend/tests/test_article_ai.py index 9a74704..94ec575 100644 --- a/backend/tests/test_article_ai.py +++ b/backend/tests/test_article_ai.py @@ -248,3 +248,24 @@ class DraftPromptTests(unittest.TestCase): finally: patch.stopall() self.bank.tearDown() + + +class GenerationBalanceTests(unittest.TestCase): + """Half the bedside, half the mechanism, and always a child. + + "Prefer clinical application questions over pure recall" produced sets of + vignettes: recognition without understanding. The user reads for + pathophysiology — how things work — so both generators are asked for an + even split rather than a preference, and the question generator is told + the patient is a child, which the prompt only implied in its opening line. + """ + + def test_questions_ask_for_both_halves(self): + from app.services.extraction_modes import GENERATE_PROMPT + self.assertIn("about half clinical", GENERATE_PROMPT) + self.assertIn("half mechanism", GENERATE_PROMPT) + self.assertIn("paediatric", GENERATE_PROMPT) + + def test_cards_ask_for_both_halves(self): + from app.services.extraction_modes import FLASHCARD_PROMPT + self.assertIn("Split them evenly", FLASHCARD_PROMPT)