combine everything give correct answers for these questions and explain for finals preparation highlight the repeated and important questions
python3 -c " from docx import Document files = { 'human_body_new': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/human body new.docx', 'human_body_old': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/human body old versions.docx', 'anatomy_answers': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/anatomy_final_numbered_answers.docx', 'histo_final': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/histo_final.docx', 'physiology_finals': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/physiology_finals.docx', } for name, path in files.items(): print(f'\\n========== {name} ==========') try: doc = Document(path) for p in doc.paragraphs: if p.text.strip(): print(p.text) except Exception as e: print(f'ERROR: {e}') " 2>&1 | head -500
python3 -c " from docx import Document files = { 'human_body_old': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/human body old versions.docx', 'anatomy_answers': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/anatomy_final_numbered_answers.docx', 'histo_final': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/histo_final.docx', 'physiology_finals': '/tmp/workspace/attachments/ae0f22f5-32f2-4d27-ba42-e068b40cac73/physiology_finals.docx', } for name, path in files.items(): print(f'\\n========== {name} ==========') try: doc = Document(path) for p in doc.paragraphs: if p.text.strip(): print(p.text) except Exception as e: print(f'ERROR: {e}') " 2>&1
mkdir -p /tmp/workspace/finals-study-guide && ls /tmp/workspace/finals-study-guide/
cat << 'PYEOF' > /tmp/workspace/finals-study-guide/generate_guide.py from docx import Document from docx.shared import Pt, RGBColor, Inches from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.oxml.ns import qn from docx.oxml import OxmlElement doc = Document() # Styles normal_style = doc.styles['Normal'] normal_style.font.name = 'Arial' normal_style.font.size = Pt(11) def set_cell_bg(cell, hex_color): tc = cell._tc tcPr = tc.get_or_add_tcPr() shd = OxmlElement('w:shd') shd.set(qn('w:val'), 'clear') shd.set(qn('w:color'), 'auto') shd.set(qn('w:fill'), hex_color) tcPr.append(shd) def add_title(doc, text): p = doc.add_heading(text, level=1) p.runs[0].font.color.rgb = RGBColor(0x1a, 0x53, 0x76) p.runs[0].font.size = Pt(16) def add_section(doc, text): p = doc.add_heading(text, level=2) p.runs[0].font.color.rgb = RGBColor(0x00, 0x70, 0xC0) p.runs[0].font.size = Pt(13) def add_q(doc, qnum, question, answer, explanation, is_repeated=False, is_important=False): # Question paragraph p = doc.add_paragraph() p.paragraph_format.space_before = Pt(8) p.paragraph_format.space_after = Pt(2) # Badge prefix = "" if is_repeated: prefix += "⭐ REPEATED " if is_important: prefix += "🔑 IMPORTANT " run_num = p.add_run(f"Q{qnum}. ") run_num.bold = True run_num.font.size = Pt(11) run_num.font.color.rgb = RGBColor(0x1a, 0x53, 0x76) if prefix: run_badge = p.add_run(prefix) run_badge.bold = True run_badge.font.size = Pt(10) run_badge.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) run_q = p.add_run(question) run_q.font.size = Pt(11) # Answer p2 = doc.add_paragraph() p2.paragraph_format.space_before = Pt(1) p2.paragraph_format.space_after = Pt(1) run_ans_label = p2.add_run("✔ Answer: ") run_ans_label.bold = True run_ans_label.font.color.rgb = RGBColor(0x37, 0x86, 0x10) run_ans_label.font.size = Pt(11) run_ans = p2.add_run(answer) run_ans.bold = True run_ans.font.size = Pt(11) run_ans.font.color.rgb = RGBColor(0x37, 0x86, 0x10) # Explanation if explanation: p3 = doc.add_paragraph() p3.paragraph_format.space_before = Pt(1) p3.paragraph_format.space_after = Pt(6) run_exp_label = p3.add_run(" Explanation: ") run_exp_label.bold = True run_exp_label.font.size = Pt(10) run_exp_label.font.color.rgb = RGBColor(0x7F, 0x7F, 0x7F) run_exp = p3.add_run(explanation) run_exp.font.size = Pt(10) run_exp.font.color.rgb = RGBColor(0x40, 0x40, 0x40) run_exp.italic = True # ============================================= # TITLE PAGE # ============================================= p = doc.add_paragraph() p.alignment = WD_ALIGN_PARAGRAPH.CENTER run = p.add_run("HUMAN BODY SYSTEMS") run.bold = True run.font.size = Pt(24) run.font.color.rgb = RGBColor(0x1a, 0x53, 0x76) p2 = doc.add_paragraph() p2.alignment = WD_ALIGN_PARAGRAPH.CENTER run2 = p2.add_run("FINALS PREPARATION GUIDE") run2.bold = True run2.font.size = Pt(18) run2.font.color.rgb = RGBColor(0x00, 0x70, 0xC0) p3 = doc.add_paragraph() p3.alignment = WD_ALIGN_PARAGRAPH.CENTER run3 = p3.add_run("Anatomy | Histology | Physiology") run3.font.size = Pt(14) run3.italic = True p4 = doc.add_paragraph() p4.alignment = WD_ALIGN_PARAGRAPH.CENTER run4 = p4.add_run("Combined from all exam versions • Correct answers with explanations • Repeated questions highlighted") run4.font.size = Pt(11) run4.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) doc.add_paragraph() # ============================================= # LEGEND # ============================================= p_leg = doc.add_paragraph() run_l = p_leg.add_run("LEGEND: ") run_l.bold = True run_l.font.size = Pt(11) run_l.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) run_l2 = p_leg.add_run("⭐ REPEATED = appeared in multiple exam versions (very likely to appear again!) | 🔑 IMPORTANT = high-yield exam topic") run_l2.font.size = Pt(11) doc.add_page_break() # ============================================= # SECTION 1: ANATOMY # ============================================= add_title(doc, "SECTION 1: ANATOMY") doc.add_paragraph("Topics covered: Heart structure, mediastinum, blood vessels, lungs, larynx, trachea, abdominal vessels, upper & lower limb vessels") add_section(doc, "1A. HEART STRUCTURE & VALVES") anatomy_q = [ # (num, question, answer, explanation, is_repeated, is_important) (1, "Blood leaving the left ventricle goes through which valve?", "Aortic semilunar valve", "The left ventricle pumps oxygenated blood into the aorta through the aortic semilunar valve. The bicuspid (mitral) valve is between the left atrium and left ventricle. Common wrong answer: bicuspid.", True, True), (2, "The 'skeleton' of the heart:", "Provides internal support for cardiac chambers (fibrous skeleton = fibrous rings, trigones, membranous septa)", "The cardiac/fibrous skeleton electrically isolates the atria from ventricles and provides structural support. It is NOT the fibrous pericardium. It prevents overdilation of valve openings.", True, True), (3, "The atria are electrically isolated from the ventricles by the:", "Cardiac fibrous skeleton (fibrous annuli / annulus fibrosus)", "The cardiac skeleton (NOT Purkinje fibers) electrically isolates atria from ventricles. The only electrical connection is through the AV bundle (Bundle of His).", False, True), (4, "Inflammation of the heart's pericardium is called:", "Pericarditis", "Pericarditis = inflammation of the pericardium. Classic feature: pain relieved by sitting forward (leaning forward). This distinguishes it from MI (which is not relieved by posture).", True, True), (5, "The sequence of pericardial layers from superficial to deep:", "Fibrous pericardium → Parietal pericardium (serous) → Pericardial cavity → Visceral pericardium (epicardium)", "Fibrous is outermost. Serous pericardium has parietal (outer) and visceral (inner = epicardium) layers. The pericardial cavity lies between parietal and visceral layers.", True, True), (6, "The epicardium is the same as:", "Visceral layer of serous pericardium", "Epicardium = visceral pericardium. It is the innermost layer of the pericardium directly covering the heart muscle. It is a simple squamous mesothelium on connective tissue.", True, True), (7, "The pericardial cavity lies between:", "The parietal pericardium and the visceral pericardium", "The narrow space between the two serous layers is the pericardial cavity. It contains a small amount of serous fluid to reduce friction.", False, True), (8, "Tricuspid valve (right AV valve) has 3 cusps. Name them:", "Anterior, septal, and posterior cusps", "The right AV valve has 3 cusps. The LEFT AV valve (mitral/bicuspid) has only 2 cusps (anterior and posterior). Chordae tendineae attach cusps to papillary muscles, preventing inversion during systole.", True, True), (9, "The cusps of the pulmonary valve are named:", "Left, right, and anterior cusps", "Pulmonary valve (semilunar) = 3 cusps: left, right, anterior. Aortic valve (semilunar) = 3 cusps: left, right, posterior (non-coronary).", True, True), (10, "The AV valves cannot be inverted because of attachment of:", "Chordae tendineae (tendinous cords)", "Chordae tendineae connect valve cusps to papillary muscles. They prevent the AV valves from prolapsing (inverting) into the atria during ventricular systole. The fibrous skeleton prevents overdilation of valve openings.", True, True), (11, "The fibrous skeleton of the heart prevents:", "Overdilation of valve openings", "The cardiac skeleton provides structural support and prevents valve overdilation. It also electrically isolates atria from ventricles.", False, True), (12, "Which of the following veins does NOT drain into the coronary sinus?", "Anterior cardiac veins", "The anterior cardiac veins drain directly into the RIGHT ATRIUM, not the coronary sinus. The coronary sinus receives: great cardiac vein, middle cardiac vein, small cardiac vein, oblique vein, and posterior vein of left ventricle.", True, True), (13, "Blood flows from the right atrium to the right ventricle through the _____ valve:", "Tricuspid valve (right AV valve)", "Right side: RA → Tricuspid valve → RV → Pulmonary valve → Pulmonary artery. Left side: LA → Mitral (bicuspid) valve → LV → Aortic valve → Aorta.", True, True), (14, "Which structure is NOT found in the left ventricle?", "Pectinate muscles (also: Tricuspid valve, trabeculae carneae is present)", "Pectinate muscles are found in the ATRIA (right and left), NOT in the ventricles. The left ventricle contains trabeculae carneae and papillary muscles.", False, True), (15, "The right atrium receives blood from the SVC, IVC, and:", "Coronary sinus", "The right atrium receives: (1) Superior vena cava, (2) Inferior vena cava, and (3) Coronary sinus. The SA node is located in the right atrium near the SVC opening.", False, True), (16, "Which valve is bicuspid?", "Mitral valve (left AV valve)", "The mitral valve has 2 cusps (anterior and posterior). It prevents backflow from LV to LA. The right AV valve (tricuspid) has 3 cusps.", True, True), (17, "Mitral valve is located between:", "Left atrium and left ventricle", "Mitral = bicuspid = left AV valve. Located between LA and LV. Murmurs heard at apex (5th ICS, left midclavicular line).", True, True), (18, "What is Tetralogy of Fallot? Name the 4 abnormalities:", "1) Ventricular Septal Defect (VSD), 2) Pulmonary stenosis, 3) Overriding (dextroposed) aorta, 4) Right Ventricular hypertrophy", "Classic cyanotic congenital heart defect. Pulmonary stenosis causes RV hypertrophy. Overriding aorta sits above VSD receiving blood from both ventricles. Results in cyanosis (blue baby).", True, True), (19, "Coronary sinus is located in the:", "Coronary sulcus on the posterior surface of the heart", "The coronary sinus lies in the posterior atrioventricular groove (coronary sulcus). It collects venous blood from most cardiac veins and drains into the RIGHT ATRIUM.", False, True), (20, "The coronary sulcus separates:", "Atria from the ventricles", "The coronary (atrioventricular) sulcus runs around the heart separating atria (above) from ventricles (below). It contains: right coronary artery, circumflex branch of left coronary, coronary sinus, small cardiac vein.", False, True), ] for q in anatomy_q: add_q(doc, q[0], q[1], q[2], q[3], q[4], q[5]) add_section(doc, "1B. MEDIASTINUM") mediastinum_q = [ (1, "Which structure is NOT found in the middle mediastinum?", "Thymus (and Lungs)", "Middle mediastinum contains: heart + pericardium, ascending aorta, pulmonary trunk, superior/inferior vena cava, pulmonary veins, phrenic nerves. The THYMUS is in the ANTERIOR mediastinum. LUNGS are outside the mediastinum.", True, True), (2, "The middle mediastinum is primarily occupied by:", "Heart with pericardium", "Middle mediastinum = heart + pericardium. Bordered superiorly by transverse thoracic plane, inferiorly by diaphragm. Common wrong answers: aorta, trachea.", True, True), (3, "The anterior mediastinum is:", "Posterior to the body of the sternum and anterior to the pericardial sac", "Anterior mediastinum contains: thymus (major structure in children), fatty tissue, lymph nodes. The major structure is the THYMUS (NOT thyroid gland).", True, True), (4, "The posterior mediastinum is:", "Anterior to the body of thoracic vertebrae and posterior to the pericardial sac", "Posterior mediastinum contains: descending thoracic aorta, thoracic duct, esophagus, azygos/hemiazygos veins, sympathetic trunks, vagus nerves. A tumor here can compress the descending aorta or esophagus.", True, True), (5, "A 45-year-old woman has a tumor in the posterior mediastinum. What could be compressed?", "Descending aorta (also: esophagus, azygos vein, thoracic duct, sympathetic trunks)", "The posterior mediastinum is behind the pericardium. Structures that can be compressed: descending thoracic aorta, esophagus, thoracic duct, azygos vein. NOT the phrenic nerve (that's in middle mediastinum).", True, True), (6, "Which vessel courses across the mediastinum in an almost horizontal fashion?", "Left brachiocephalic vein", "The LEFT brachiocephalic vein crosses horizontally from left to right to join the right brachiocephalic vein, forming the SVC. The right brachiocephalic is short and vertical.", False, True), (7, "All structures seen in the superior mediastinum EXCEPT:", "Right recurrent laryngeal nerve (it originates in the thorax but hooks around the right subclavian artery at the root of the neck)", "Superior mediastinum contains: thymus, left brachiocephalic vein, SVC, aortic arch and branches, trachea, esophagus, thoracic duct, vagus nerves, LEFT recurrent laryngeal nerve, phrenic nerves.", True, True), (8, "Which posterior mediastinal structure is most closely applied to the posterior surface of the pericardial sac?", "Esophagus", "The esophagus lies directly posterior to the left atrium/pericardial sac. This is why transesophageal echocardiography (TEE) provides excellent views of the left atrium.", True, True), (9, "The thoracic duct extends from vertebra _____ to the root of the neck:", "T12 (TXII) — begins at cisterna chyli at L1-L2", "The thoracic duct begins at cisterna chyli (L1-L2), passes through aortic hiatus of diaphragm at T12, ascends through posterior mediastinum, empties into the junction of left subclavian and left internal jugular vein.", True, True), (10, "In the middle region of the thorax, the thoracic duct lies immediately posterior to:", "Esophagus", "In the thorax: thoracic duct is between the azygos vein (right) and descending aorta (left), posterior to the esophagus.", True, True), ] for i, q in enumerate(mediastinum_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "1C. TRACHEA, BRONCHI & LUNGS") trachea_q = [ (1, "Trachea extends approximately between levels of:", "C6 (CVI) to T4 (TIV)", "Trachea starts at C6 (below cricoid cartilage) and bifurcates at T4/T5 level (sternal angle / carina). Tracheal rings are C-shaped HYALINE cartilage.", True, True), (2, "The trachea bifurcates at level:", "T4/T5 (sternal angle, angle of Louis)", "Tracheal bifurcation at T4-T5 is at the level of the sternal angle (angle of Louis). This creates the left and right main bronchi. The carina is the ridge at the bifurcation.", True, True), (3, "The tracheal rings comprise _____ cartilage:", "Hyaline cartilage (C-shaped rings, incomplete posteriorly)", "Trachea has 16-20 C-shaped rings of hyaline cartilage. The posterior gap is bridged by smooth muscle (trachealis). Elastin fibers allow adaptation during breathing.", True, True), (4, "The left main bronchus is typically _____ than the right main bronchus:", "Longer and more horizontal (narrower)", "Left bronchus: longer, more horizontal (~45° angle), narrower. Right bronchus: shorter, more vertical (~25° angle), wider. Because right is wider + vertical, foreign bodies more often go RIGHT.", True, True), (5, "Which of the following is TRUE about the main bronchi?", "Right main bronchus is wider and has a more vertical course than left", "Right is wider (wider than left) and more vertical. This means aspirated objects more commonly lodge in the right bronchus. Left is longer and more horizontal.", True, True), (6, "The bronchi that directly conduct air in and out of lung's bronchopulmonary segments are called:", "Tertiary (segmental) bronchi", "Bronchi hierarchy: Primary (main) → Secondary (lobar) → Tertiary (segmental). Each tertiary bronchus serves one bronchopulmonary segment. Tertiary bronchi have broken plates of hyaline cartilage.", False, True), (7, "Tertiary bronchi are characterized by:", "Broken (irregular) plates of hyaline cartilage", "As bronchi branch: primary = complete C-rings, secondary = plates, tertiary = broken/irregular plates of hyaline cartilage. Bronchioles have NO cartilage.", False, True), (8, "Ciliated pseudostratified columnar epithelium is found in bronchioles:", "FALSE — bronchioles have simple columnar or cuboidal epithelium (with Clara/Club cells)", "Ciliated pseudostratified columnar epithelium (respiratory epithelium) is found in the TRACHEA and larger BRONCHI, NOT in bronchioles. Bronchioles contain Club (Clara) cells.", True, True), (9, "Which cells are found in large numbers in terminal bronchioles?", "Clara (Club) cells", "Clara cells (Club cells) are found in terminal bronchioles. They secrete surfactant components, detoxify inhaled substances, and act as stem cells for bronchiolar epithelium.", True, True), (10, "Right lung has _____ lobes; left lung has _____ lobes:", "Right = 3 lobes (upper, middle, lower); Left = 2 lobes (upper, lower — with lingula)", "Right lung: 3 lobes separated by oblique and horizontal fissures. Left lung: 2 lobes separated by oblique fissure only. The left upper lobe has a lingula (tongue-like projection).", True, True), (11, "The horizontal fissure separates:", "Middle lobe from the upper/superior lobe (right lung only)", "RIGHT lung only has a horizontal fissure (separating upper from middle). Both lungs have an oblique fissure (separating lower from upper+middle). Left lung has NO horizontal fissure.", True, True), (12, "During quiet respiration in midaxillary line, inferior margin of lung crosses rib:", "Rib VIII (8th rib)", "Lung margins: midclavicular = rib VI, midaxillary = rib VIII, paravertebral = rib X (vertebra T10). Pleural reflection: midclavicular = rib VIII, midaxillary = rib X (T10).", False, True), (13, "The space between visceral and parietal pleura is known as the _____ cavity:", "Pleural cavity", "The pleural cavity is a potential space between the visceral pleura (covers lung) and parietal pleura (lines thoracic wall). Normally contains a tiny amount of fluid. Air entry = pneumothorax.", True, True), (14, "The visceral pleura that covers each lung is a layer of:", "Thin connective tissue and mesothelium (TRUE)", "Visceral pleura directly covers the lung surface. It cannot be separated from the lung without damaging it. It is continuous with parietal pleura at the hilum.", True, True), (15, "Surfactant prevents alveolar collapse by:", "DECREASING surface tension (not increasing — that is FALSE)", "Surfactant (produced by Type II pneumocytes) REDUCES/DECREASES surface tension of the fluid lining alveoli. Deficiency causes RDS (respiratory distress syndrome) in premature babies. Without surfactant, alveoli would collapse.", True, True), (16, "From the midclavicular line to vertebral column, inferior boundary of visceral pleura runs between:", "Rib VI (midclavicular) → Rib VIII (midaxillary) → T10/TX (paravertebral)", "This is a key anatomical border. The LUNG margin is 2 ribs ABOVE the PLEURAL reflection.", True, True), ] for i, q in enumerate(trachea_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "1D. LARYNX") larynx_q = [ (1, "The _____ is the space between the vocal cords critical for sound production:", "Rima glottidis (glottis)", "The rima glottidis is the opening between the vocal cords. Sound is produced when air passes through and vibrates the vocal cords. The glottis is the entire region including vocal cords.", True, True), (2, "The _____ covers the laryngeal inlet during swallowing to prevent aspiration:", "Epiglottis", "The epiglottis is a leaf-shaped elastic cartilage that folds down over the laryngeal inlet during swallowing. It is attached to the thyroid cartilage by the thyroepiglottic ligament.", True, True), (3, "What type of tissue makes up the epiglottis?", "Elastic cartilage", "The epiglottis is made of ELASTIC cartilage (not hyaline). The thyroid cartilage, cricoid cartilage, and the lower arytenoid cartilage are made of hyaline. The epiglottis and corniculate/cuneiform cartilages are elastic.", True, True), (4, "The largest cartilage in the larynx:", "Thyroid cartilage", "Thyroid cartilage is the largest laryngeal cartilage. It forms the 'Adam's apple' (laryngeal prominence). The thyroid angle is more acute in males (~90°) and more obtuse in females (~120°).", True, True), (5, "The larynx is located between the _____ and the trachea:", "Pharynx", "Larynx = C3-C6. It lies between the pharynx (above) and trachea (below). It is attached to the hyoid bone superiorly.", True, True), (6, "Which cartilage of the larynx has muscular process and vocal process?", "Arytenoid cartilage", "Arytenoid cartilages are paired, pyramid-shaped. Each has: (1) vocal process — attachment of vocal cord, (2) muscular process — attachment of intrinsic laryngeal muscles. Vocal cords attach to arytenoids.", True, True), (7, "The epithelium in the vocal cords:", "Non-keratinized stratified squamous epithelium", "Vocal cords experience mechanical stress so they are covered by NON-KERATINIZED STRATIFIED SQUAMOUS epithelium. Above and below the cords: respiratory epithelium (ciliated pseudostratified columnar).", True, True), (8, "The nasal cavities are separated from the oral cavity by the:", "Hard palate (anteriorly) and soft palate (posteriorly)", "The palate separates nasal from oral cavities. The hard palate is the anterior bony part; the soft palate is the posterior muscular part. The nasopalatine nerve passes through the incisive canal.", True, True), (9, "The roof of the nasal cavities and the superior conchae are covered by _____ epithelium:", "Olfactory epithelium (pseudostratified columnar)", "The olfactory mucosa covers the roof of nasal cavity and superior conchae. It contains olfactory receptor cells (bipolar neurons). Basal cells replace olfactory neurons every 1-2 months.", True, True), (10, "The Choanae are:", "Oval-shaped openings between the nasal cavity and nasopharynx", "The choanae (posterior nasal apertures) are the two openings that connect the nasal cavities to the nasopharynx posteriorly.", False, False), ] for i, q in enumerate(larynx_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "1E. GREAT VESSELS OF THE THORAX") vessels_q = [ (1, "The left brachiocephalic vein is formed by the confluence of which two veins?", "Left subclavian vein + Left internal jugular vein", "Both left and right brachiocephalic veins are formed by subclavian + internal jugular. The RIGHT brachiocephalic is short and descends vertically. The LEFT crosses the superior mediastinum horizontally and is LONGER.", True, True), (2, "Which vein does NOT drain into the coronary sinus?", "Anterior cardiac veins — they drain directly into the right atrium", "Anterior cardiac veins bypass the coronary sinus and empty directly into the right atrium. All other major cardiac veins drain into the coronary sinus.", True, True), (3, "The azygos vein terminates by draining into the:", "Superior vena cava (SVC)", "The azygos vein ascends on the RIGHT side of the vertebral column, arches over the right main bronchus at T4, and drains into the SVC. It drains the thoracic wall.", True, True), (4, "Which veins drain directly into the azygos vein?", "Hemiazygos vein (and accessory hemiazygos, posterior intercostal veins)", "Hemiazygos (left lower thorax) and accessory hemiazygos (left upper thorax) both cross the midline to drain into the azygos. The hemiazygos drains the left lower thoracic wall.", True, True), (5, "The hemiazygos vein drains blood from which region?", "Left lower part of the thoracic wall (lower 4-5 left posterior intercostal spaces)", "Hemiazygos drains LEFT side lower thorax. Accessory hemiazygos drains LEFT side upper thorax. Both drain into azygos (right side) by crossing midline.", True, True), (6, "Superior vena cava may receive all of the following, EXCEPT:", "Internal thoracic vein (which drains into brachiocephalic veins, not directly into SVC)", "SVC receives: azygos vein, brachiocephalic veins, occasionally pericardial and mediastinal veins. The internal thoracic vein drains into the brachiocephalic veins, not directly into SVC.", True, True), (7, "Brachiocephalic vein is formed by junction of:", "Subclavian vein + Internal jugular vein (on each side)", "Both left and right brachiocephalic veins = subclavian + IJV. The left is longer and crosses the mediastinum. The right subclavian artery arises from the brachiocephalic TRUNK (NOT directly from aorta).", True, True), (8, "The right subclavian artery arises directly from the aorta — TRUE or FALSE?", "FALSE — it arises from the brachiocephalic trunk", "Brachiocephalic trunk (from aortic arch) → right subclavian + right common carotid. LEFT subclavian and LEFT common carotid arise directly from the aortic arch.", True, True), (9, "What is the name of condition when aortic intima is split from media?", "Aortic dissection", "Aortic dissection = tear in the intima allows blood to enter the aortic wall, splitting intima from media. Stanford Type A involves ascending aorta (surgical emergency); Type B does not.", True, True), (10, "The thoracic duct drains lymph to:", "Junction of left subclavian and left internal jugular vein", "The thoracic duct is the main lymphatic vessel. It drains ALL lymph from below the diaphragm + left side of thorax/head/neck/arm. The right lymphatic duct drains the right upper body.", True, True), ] for i, q in enumerate(vessels_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "1F. ABDOMINAL & PELVIC VESSELS") abdominal_q = [ (1, "Which of the following is NOT a branch of the inferior mesenteric artery?", "Right colic artery (that is a branch of SUPERIOR mesenteric artery)", "IMA branches: left colic artery, sigmoid arteries, superior rectal artery. SMA branches: ileocolic, right colic, middle colic, intestinal arteries. Remember: IMA = left side of large bowel (descending colon + sigmoid + rectum).", True, True), (2, "Which of the following is NOT a single visceral branch of the abdominal aorta?", "Renal artery (paired, bilateral) — also: celiac trunk question is tricky", "Single (unpaired) visceral branches: celiac trunk, SMA, IMA. PAIRED branches: inferior phrenic, middle suprarenal, renal, gonadal arteries.", True, True), (3, "The celiac trunk branches into three major arteries. Which is one of them?", "Left gastric artery, Splenic artery, Common hepatic artery (these are the 3 branches — NOT inferior mesenteric)", "Celiac trunk = 3 branches: (1) Left gastric, (2) Splenic, (3) Common hepatic. The inferior mesenteric artery is a SEPARATE branch of the abdominal aorta.", True, True), (4, "The inferior mesenteric artery originates at vertebra:", "L3", "IMA arises at L3. It supplies hindgut derivatives: descending colon, sigmoid colon, rectum. Celiac trunk arises at T12. SMA arises at L1.", False, True), (5, "The hindgut is supplied by the:", "Inferior mesenteric artery (IMA)", "Foregut = celiac trunk. Midgut = SMA. Hindgut = IMA. Hindgut = descending colon, sigmoid colon, rectum, upper anal canal.", True, True), (6, "Which artery supplies the diaphragm and is an anterior branch of the abdominal aorta?", "Inferior phrenic artery", "Inferior phrenic arteries are the FIRST branches of the abdominal aorta (at T12-L1). They are paired. They also supply the suprarenal (adrenal) glands.", True, True), (7, "The internal iliac artery has several branches, including the _____ artery, which supplies the uterus:", "Uterine artery", "Uterine artery arises from the anterior division of the internal iliac. It crosses the ureter ('water under the bridge') and supplies the uterus. Key surgical landmark in hysterectomy.", True, True), (8, "Which artery exits from pelvic cavity ABOVE the piriformis muscle?", "Superior gluteal artery", "Superior gluteal artery exits through greater sciatic foramen ABOVE piriformis. Inferior gluteal artery, internal pudendal, and sciatic nerve exit BELOW piriformis through greater sciatic foramen.", True, True), (9, "All arteries are branches of anterior trunk of internal iliac artery EXCEPT:", "Lateral sacral artery (from POSTERIOR trunk)", "Internal iliac POSTERIOR trunk: iliolumbar, lateral sacral, superior gluteal arteries. ANTERIOR trunk: all other visceral and parietal branches.", False, True), (10, "The inferior vena cava is formed when two common iliac veins come together at the level of vertebra:", "L5 (LV)", "The two common iliac veins unite at L5 on the right side of the vertebral column to form the IVC. The IVC ascends on the RIGHT side of the abdominal aorta.", False, True), (11, "The portal vein is formed at the level of vertebra:", "L2 (LII) — posterior to the neck of the pancreas, formed by SMV + splenic vein", "Portal vein = superior mesenteric vein + splenic vein, at the level of L2, behind the neck of the pancreas. The inferior mesenteric vein usually drains into the splenic vein.", False, True), ] for i, q in enumerate(abdominal_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "1G. UPPER & LOWER LIMB VESSELS") limb_q = [ (1, "The brachial artery typically bifurcates into radial and ulnar arteries at the level of:", "TRUE — it bifurcates at the level of the elbow (apex of cubital fossa)", "The brachial artery is in the ANTERIOR compartment of the arm. At the cubital fossa, it divides into radial (lateral) and ulnar (medial) arteries. Its pulse is auscultated when measuring BP.", True, True), (2, "The basilic vein is considered a deep vein of the upper limb — TRUE or FALSE?", "FALSE — it is a SUPERFICIAL vein", "The basilic vein is a superficial vein on the MEDIAL side of the forearm/arm. The cephalic vein is on the LATERAL side. Both are superficial. Deep veins: brachial, axillary.", True, True), (3, "Which artery courses through the anatomical snuffbox?", "Radial artery", "The radial artery passes through the anatomical snuffbox (floor = scaphoid and trapezium). The radial pulse is felt on the lateral aspect of the wrist. Allen test checks patency of radial and ulnar arteries.", True, True), (4, "In fracture of the midshaft of the humerus, which artery is most likely injured?", "Profunda brachii (deep brachial artery)", "The profunda brachii artery (largest branch of brachial artery) and radial nerve travel together in the radial groove of the humerus. Midshaft humerus fracture → radial nerve + profunda brachii injury.", True, True), (5, "In fracture of surgical neck of the humerus, which artery may be injured?", "Posterior circumflex humeral artery (and axillary nerve)", "Surgical neck fractures injure the axillary nerve and posterior circumflex humeral artery (both pass through the quadrangular space).", True, True), (6, "The perforating arteries are branches of the _____ and supply the posterior compartment of the thigh:", "Deep femoral artery (profunda femoris) — TRUE", "Perforating arteries pierce the adductor magnus muscle to supply the posterior thigh muscles. The deep femoral artery also gives medial and lateral femoral circumflex arteries.", True, True), (7, "The medial femoral circumflex artery supplies blood to:", "Femoral head and neck (NOT gluteal muscles)", "Medial femoral circumflex artery is the main blood supply to the femoral head. Disruption in femoral neck fractures can cause avascular necrosis of the femoral head.", True, True), (8, "The femoral artery enters the popliteal fossa through the:", "Adductor hiatus (opening in adductor magnus muscle)", "The femoral artery passes through the adductor hiatus to become the popliteal artery. The femoral pulse is felt in the femoral triangle.", False, True), (9, "The subclavian artery becomes the axillary artery at:", "Lateral border of the first rib — TRUE", "Subclavian → axillary (at lateral border of 1st rib) → brachial (at lower border of teres major) → radial + ulnar (at elbow). The axillary artery is divided into 3 parts by pectoralis MINOR.", True, True), (10, "Superficial palmar arch is mainly created by:", "Ulnar artery", "Superficial palmar arch = mainly ULNAR + superficial branch of radial. Deep palmar arch = mainly RADIAL + deep branch of ulnar. Superficial arch is more distal.", False, True), ] for i, q in enumerate(limb_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) doc.add_page_break() # ============================================= # SECTION 2: HISTOLOGY & EMBRYOLOGY # ============================================= add_title(doc, "SECTION 2: HISTOLOGY & EMBRYOLOGY") doc.add_paragraph("Topics: Cardiac embryology, vascular histology, blood cells, respiratory development, placenta") add_section(doc, "2A. CARDIAC & VASCULAR EMBRYOLOGY") histo_q = [ (1, "The cardiovascular system begins to develop during:", "Third week (week 3) — TRUE", "The cardiovascular system is one of the FIRST body systems to develop. The heart begins to beat around day 21. The primitive heart tube forms at week 3 from splanchnic mesoderm.", True, True), (2, "The primitive heart is partitioned into four separate chambers during the fourth week — TRUE or FALSE?", "FALSE — partitioning occurs between the 5th-8th weeks (completed end of 8th week)", "The primitive heart tube forms in week 3. Folding occurs week 3-4. SEPTATION (partitioning into 4 chambers) occurs weeks 5-8. Do not confuse tube formation (wk 3-4) with septation (wk 5-8).", True, True), (3, "Which two parts of the primitive heart tube form the outflow tract?", "Bulbus cordis and Truncus arteriosus", "Primitive heart tube (cranial to caudal): Truncus arteriosus → Bulbus cordis → Primitive ventricle → Primitive atrium → Sinus venosus. Outflow = Bulbus cordis + Truncus arteriosus.", True, True), (4, "The fetal left atrium is mainly derived from the:", "Primitive pulmonary vein", "The left atrium is mainly formed by incorporation of the primitive pulmonary vein and its branches. The sinus venosus contributes to the right atrium.", True, True), (5, "What is the name of the shunt that exists between the aorta and pulmonary artery in fetal circulation?", "Ductus arteriosus", "Ductus arteriosus connects pulmonary trunk to aortic arch (directs blood away from fetal lungs). After birth it closes and becomes the LIGAMENTUM ARTERIOSUM. Its embryonic origin = 6th arch artery.", True, True), (6, "The ductus venosus becomes once it has closed:", "Ligamentum venosum", "Fetal shunts → adult remnants: (1) Ductus arteriosus → Ligamentum arteriosum. (2) Ductus venosus → Ligamentum venosum. (3) Umbilical arteries → Medial umbilical ligaments. (4) Umbilical vein → Ligamentum teres hepatis.", True, True), (7, "What is the name of the hole formed when septum secundum grows downwards during atrial separation?", "Foramen ovale", "The foramen ovale allows oxygenated blood from the IVC in the right atrium to pass to the left atrium in the fetus. It is kept open by the pressure difference. After birth, increased left atrial pressure closes it → Fossa ovalis.", True, True), (8, "The embryonic origin of the ligamentum arteriosum:", "Sixth arch artery (6th pharyngeal arch artery = ductus arteriosus)", "Left 6th arch = ductus arteriosus → ligamentum arteriosum. Right 6th arch = right pulmonary artery. Left 4th arch = arch of aorta. Right 4th arch = right subclavian artery.", True, True), (9, "What does the fourth aortic arch develop into on the left and right side?", "Left = arch of the aorta (adult aortic arch); Right = right subclavian artery", "Aortic arch arteries and their adult derivatives: 1st → maxillary artery, 2nd → hyoid and stapedial, 3rd → common carotid and ICA, 4th left → aortic arch, 4th right → right subclavian, 6th left → ductus arteriosus.", True, True), (10, "The changes that normally occur shortly after birth include (what is the umbilical arteries' fate)?", "Umbilical arteries become medial umbilical ligaments", "At birth: (1) Ductus arteriosus closes → lig. arteriosum. (2) Foramen ovale closes → fossa ovalis. (3) Ductus venosus closes → lig. venosum. (4) Umbilical arteries → medial umbilical lig. (5) Umbilical vein → lig. teres hepatis.", True, True), (11, "Each of the following statements are correctly paired EXCEPT: Right umbilical vein – definitive umbilical vein", "This pairing is INCORRECT — the LEFT umbilical vein is the definitive umbilical vein (right regresses)", "In fetal circulation: the RIGHT umbilical vein REGRESSES early. Only the LEFT umbilical vein persists to carry oxygenated blood from the placenta to the fetus. After birth: left umbilical vein → ligamentum teres hepatis.", True, True), (12, "The heart is derived from:", "Splanchnic mesoderm (specifically cardiogenic mesoderm in the cardiogenic plate)", "The heart develops from splanchnic (lateral plate) mesoderm. The neural crest contributes to the outflow tract septation and aortic arch arteries.", False, True), (13, "What is the foramen ovale? What leads to its closure?", "Pressure in the left atrium exceeding that in the right atrium (after birth, when pulmonary circulation opens)", "The foramen ovale closes functionally at birth as left atrial pressure rises (due to lungs opening). Anatomical closure (fusion) takes weeks to months. Probe patent FO exists in ~25% of adults.", True, True), ] for i, q in enumerate(histo_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "2B. VASCULAR HISTOLOGY") vasc_histo_q = [ (1, "The internal surface of all components of the cardiovascular system is lined by:", "Simple squamous epithelium (endothelium) — TRUE", "The endothelium is a monolayer of simple squamous cells lining all blood vessels, lymphatics, and heart chambers. It functions as a barrier, regulates vasomotor tone, prevents thrombosis.", True, True), (2, "What are the long cytoplasmic processes of mesenchymal cells found along continuous capillaries called?", "Pericytes", "Pericytes are perivascular cells that wrap around capillaries and postcapillary venules. They have contractile function, help regulate capillary diameter, and contribute to wound healing/angiogenesis.", True, True), (3, "Pericytes are found in the wall of ALL blood vessels — TRUE or FALSE?", "FALSE — pericytes are found mainly in CAPILLARIES and postcapillary venules, NOT in all vessels", "Pericytes are associated specifically with capillaries and venules. Larger vessels have smooth muscle cells in their tunica media instead.", True, True), (4, "Capillaries are composed of a simple layer of _____ cells:", "Endothelial cells", "Capillary walls = single layer of endothelial cells + basement membrane. No smooth muscle or connective tissue layers in capillaries themselves. Pericytes surround them.", True, True), (5, "What is the thickest layer of the wall of ARTERIES?", "Tunica media (middle layer, mainly smooth muscle + elastic fibers)", "Arteries: thickest layer = tunica MEDIA (smooth muscle). Veins: thickest layer = tunica ADVENTITIA. Capillaries: only tunica intima (endothelium + basement membrane).", True, True), (6, "Which is the thickest layer for VEINS?", "Tunica adventitia (outer layer, connective tissue)", "Veins have thicker adventitia compared to media. Arteries have thicker media. The venous wall is overall THINNER than arterial wall of same diameter.", True, True), (7, "The lining of lymphatic vessels is composed of which cell type?", "Simple squamous epithelium (same as blood vessels)", "Lymphatic vessels are lined by a single layer of simple squamous endothelial cells (like blood capillaries). They have NO basement membrane, making them more permeable. Common distractor: stratified squamous.", True, True), (8, "Granulocytes possess _____ major types of abundant cytoplasmic granules:", "3 types: (1) Azurophilic (primary/nonspecific) granules — found in all granulocytes. (2) Specific (secondary) granules — neutrophil-specific. (3) Type varies by cell", "The correct answer in most sources: 3 types for all granulocytes (azurophilic + 2 specific). Specifically: Neutrophils = azurophilic + specific (secondary) + tertiary. Eosinophils = large eosinophilic granules with MBP. Basophils = large basophilic granules with histamine.", True, True), (9, "The most immature recognizable cell in the myeloid series:", "Myeloblast", "Myeloid development: Myeloblast → Promyelocyte → Myelocyte → Metamyelocyte → Band cell → Mature granulocyte. The myeloblast is the most immature RECOGNIZABLE cell (stem cells are earlier but not recognizable by morphology).", True, True), (10, "Valves of the veins consist of thin, paired folds of:", "Tunica intima", "Venous valves are folds of tunica intima (inner layer). They prevent backflow of blood in veins. They are paired (bicuspid) and their free edges point toward the heart.", True, True), (11, "Small vessels that supply blood to the walls of large blood vessels are called:", "Vasa vasorum", "Vasa vasorum are small nutrient vessels that supply the walls of large arteries and veins (the outer tunica media and adventitia). The inner layers get nutrients by diffusion from the lumen.", False, True), ] for i, q in enumerate(vasc_histo_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "2C. RESPIRATORY DEVELOPMENT & HISTOLOGY") resp_dev_q = [ (1, "The laryngotracheal diverticulum maintains communication with _____ through the primordial laryngeal inlet:", "Primordial pharynx", "The laryngotracheal diverticulum grows from the ventral wall of the primordial pharynx (foregut). It maintains communication through the laryngeal inlet. The tracheoesophageal septum separates it from the esophagus.", True, True), (2, "The cranial portion of the foregut is divided by the tracheoesophageal septum into:", "Ventral: larynx, trachea, bronchi, and lungs (primordium); Dorsal: esophagus", "The tracheoesophageal septum divides the foregut into ventral (respiratory) and dorsal (digestive) portions. Failure of separation → tracheoesophageal fistula (TEF).", True, True), (3, "The connective tissue of the trachea is derived from:", "Splanchnic mesenchyme (splanchnic mesoderm)", "The epithelium of the trachea = endodermal. The cartilage and connective tissue = splanchnic mesenchyme.", True, True), (4, "Which type of fiber helps the trachea adapt its shape during inspiration and expiration?", "Elastin (elastic) fibers", "Elastic fibers in the tracheal wall allow the trachea to elongate during inspiration and return during expiration. The hyaline cartilage C-rings provide structural support and keep the airway open.", True, True), (5, "The connection of each bronchial bud with the trachea enlarges to form the primordia of:", "Main (primary) bronchi", "At week 5, the two lung buds (bronchial buds) develop connections with the trachea. These connections enlarge to form the PRIMARY (main) bronchi. By week 7, secondary and tertiary bronchi start forming.", True, True), (6, "Pulmonary surfactant begins to form in the fetus at about:", "20-22 weeks (produced by Type II pneumocytes, also called septal cells)", "Surfactant production starts ~20-22 weeks, increases greatly at ~28-30 weeks. Babies born before 28 weeks are at high risk for RDS. Glucocorticoids are given to mother to accelerate surfactant production in premature labor.", True, True), (7, "Surfactant counteracts surface tension of terminal sacs by preventing alveolar collapse — TRUE or FALSE?", "TRUE — surfactant REDUCES surface tension", "Surfactant (dipalmitoyl phosphatidylcholine = DPPC) is produced by Type II pneumocytes. It reduces surface tension, preventing alveolar collapse. Deficiency = RDS (hyaline membrane disease).", True, True), (8, "Before birth, the primordial alveoli appear as small bulges on the walls of:", "Respiratory bronchioles (NOT terminal bronchioles — that is FALSE)", "The primordial alveoli appear on the walls of respiratory bronchioles and alveolar sacs in the alveolar period (36 weeks to birth). After birth, alveoli multiply rapidly (from ~50 million at birth to 300 million in adults).", True, True), (9, "Which cells are found in large numbers in the terminal bronchioles?", "Clara (Club) cells", "Terminal bronchioles contain Club cells (formerly Clara cells). They are non-ciliated, dome-shaped, and produce: surfactant components, detoxifying enzymes. They serve as progenitor cells for bronchiolar epithelium.", True, True), (10, "Basal cells are responsible for replacing olfactory neurons every:", "1-2 months (approximately 30-60 days)", "Olfactory neurons are replaced by basal (stem) cells every 1-2 months throughout life. This is one of the few areas of neurogenesis in adults.", True, True), ] for i, q in enumerate(resp_dev_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) doc.add_page_break() # ============================================= # SECTION 3: PHYSIOLOGY # ============================================= add_title(doc, "SECTION 3: PHYSIOLOGY") doc.add_paragraph("Topics: Cardiac cycle, conduction, ECG, cardiac output, blood pressure regulation, vessels, lymphatics, respiration") add_section(doc, "3A. CARDIAC CYCLE & MECHANICS") cardiac_q = [ (1, "Why does the left ventricle have a thicker wall than the right ventricle?", "It ejects blood against a higher pressure (systemic circulation)", "The LV wall is 3× thicker than RV because it must generate enough pressure to overcome systemic vascular resistance (~120 mmHg). RV only needs ~25 mmHg for pulmonary circulation.", True, True), (2, "What does the phonocardiogram represent?", "Heart sounds produced by valves", "A phonocardiogram records and amplifies heart sounds. S1 (lub) = closure of AV valves (mitral + tricuspid) at START of systole. S2 (dub) = closure of semilunar valves (aortic + pulmonary) at START of diastole.", True, True), (3, "The first heart sound 'lub' is associated with closure of which valves?", "Atrioventricular (AV) valves — mitral and tricuspid — at the beginning of systole", "S1 = mitral + tricuspid closure. S2 = aortic + pulmonary closure. S1 marks start of systole. S2 marks end of systole / start of diastole.", True, True), (4, "What happens to stroke volume when EDV increases and ESV decreases?", "Stroke volume INCREASES (SV = EDV - ESV)", "SV = End-Diastolic Volume - End-Systolic Volume. If EDV↑ and ESV↓, then SV↑. Ejection fraction = SV/EDV × 100 (normal 55-70%).", True, True), (5, "How does the duration of the cardiac cycle change with an increase in heart rate?", "DECREASES (duration is shortened, mainly at the expense of diastole)", "Cardiac cycle = 60/HR. If HR↑, cycle duration↓. Diastole is shortened much more than systole. This limits ventricular filling time (important in tachyarrhythmias).", True, True), (6, "During isovolumetric relaxation time (IVRT):", "ALL valves are CLOSED (mitral and aortic valves both closed)", "IVRT = period between aortic valve closure and mitral valve opening. Ventricular pressure drops rapidly but volume stays constant (no valves open). Ventricular pressure must drop below atrial pressure before mitral opens.", True, True), (7, "Which phase of diastole is most effective to direct blood from atrium to ventricle?", "Rapid filling phase (early diastole)", "Ventricular filling has 3 phases: (1) Rapid filling (most important, ~70% of filling), (2) Slow filling (diastasis), (3) Atrial contraction (contributes ~30%). The 'a' wave on atrial pressure curve = atrial contraction.", True, True), (8, "The 'a' wave on the atrial pressure curve is caused by:", "Atrial contraction", "JVP/atrial pressure waves: 'a' = atrial contraction, 'c' = tricuspid closure/bulging, 'x' = atrial relaxation, 'v' = venous filling during ventricular systole, 'y' = tricuspid opening.", True, True), (9, "Cardiac weakness can be caused by deficiency of _____ in the extracellular fluid:", "Calcium (Ca²⁺)", "Calcium is essential for cardiac muscle contraction. Most calcium for cardiac muscle comes from the EXTRACELLULAR space (unlike skeletal muscle which uses SR calcium). Hypocalcemia → reduced cardiac contractility.", True, True), (10, "What is preload? (all these are right for preload EXCEPT:)", "INCORRECT: Preload is right atrial pressure. CORRECT definitions: end-diastolic fiber length, end-diastolic volume (EDV), ventricular wall stress at end of diastole", "Preload = stretch of ventricular muscle before contraction = EDV. Afterload = resistance ventricle pumps against = aortic pressure for LV. Frank-Starling: increased preload → increased SV.", True, True), (11, "What is the Frank-Starling law?", "Increased venous return → increased EDV → more myocardial stretch → stronger contraction → increased SV", "The Frank-Starling mechanism: the heart pumps whatever amount of blood it receives. More stretch = more force. This matches cardiac output to venous return. Applies within physiological limits.", True, True), (12, "Coronary blood flow mostly occurs during:", "DIASTOLE (not systole)", "The left coronary artery flow mainly occurs in DIASTOLE because the myocardium compresses coronary vessels during systole. The right coronary has continuous flow during both phases. This is why increased HR (reduced diastole time) can cause ischemia.", True, True), (13, "The afterload for the left ventricle is:", "Aortic pressure (systemic vascular resistance)", "Afterload = resistance against which the ventricle must pump. LV afterload = aortic pressure/SVR. RV afterload = pulmonary artery pressure. Increased afterload → reduced stroke volume (if preload/contractility unchanged).", True, True), (14, "Cardiac tamponade:", "DECREASES cardiac output (not increases)", "Cardiac tamponade = fluid accumulation in the pericardial sac → compresses the heart → reduced filling → decreased CO. Beck's triad: hypotension, muffled heart sounds, distended neck veins.", True, True), (15, "Collateral flow can damage the myocardium — TRUE or FALSE?", "FALSE — collateral flow PROTECTS the myocardium by providing alternative blood supply", "Collateral circulation provides alternative pathways when coronary arteries are occluded. It PROTECTS the myocardium. Ischemia occurs when collateral flow is insufficient.", True, True), ] for i, q in enumerate(cardiac_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "3B. CARDIAC CONDUCTION & ECG") ecg_q = [ (1, "The correct order of the cardiac conduction system:", "SA node → AV node → Bundle of His → Bundle branches → Purkinje fibers → Ventricles", "SA node (pacemaker, 60-100 bpm) → Atrial conduction → AV node (delays 0.1 sec) → Bundle of His → Left + Right bundle branches → Purkinje fibers (fastest, 1-4 m/s) → Ventricles.", True, True), (2, "Which part of the cardiac conduction system is responsible for distributing electrical impulses throughout the ventricles?", "Purkinje fibers (Bundle branches + Purkinje fibers)", "The Purkinje fibers spread the impulse rapidly throughout the ventricular myocardium, ensuring coordinated contraction. They conduct at 1-4 m/s (fastest in heart). AV node is the slowest (relay/delay station).", True, True), (3, "Why is the AV node particularly sensitive to ischemic damage?", "Its slow conduction, fewer gap junctions, and limited/single blood supply (right coronary artery)", "The AV node relies primarily on the RCA (posterior interventricular artery). Its slow conduction allows atrial contraction before ventricular systole.", True, True), (4, "What ion channels are primarily responsible for initiating depolarization of the SA node?", "Funny channels (If) — slow inward Na+ current — for the pacemaker potential. Then L-type and T-type Ca²⁺ channels for the upstroke.", "SA node pacemaker potential: (1) If (funny) channels open → slow Na+ influx → gradual depolarization. (2) T-type then L-type Ca²⁺ channels open → action potential upstroke. (3) K+ channels open → repolarization.", True, True), (5, "Acetylcholine causes _____ of the SA node:", "Hyperpolarization (slowing of depolarization → decreased heart rate)", "ACh (parasympathetic/vagal) → opens K+ channels (IKACh) → hyperpolarizes SA node → slower rate. Norepinephrine (sympathetic) → opens Ca²⁺ channels → faster rate.", True, True), (6, "In terms of vagal stimulation on the SA node, what is correct?", "It increases potassium permeability → slower depolarization → decreased heart rate", "Vagal stimulation releases ACh → muscarinic M2 receptors → ↑K+ permeability → hyperpolarization → slower HR. Common wrong answer: 'increases Na+ permeability (faster depolarization)' - that's wrong.", True, True), (7, "A pacemaker elsewhere than the sinus node is called:", "Ectopic pacemaker", "An ectopic pacemaker fires from an abnormal location (not SA node). Typical ectopic rates: AV node = 40-60 bpm, Purkinje/ventricles = 20-40 bpm. Example: WPW syndrome has an accessory pathway.", True, True), (8, "What does the PR (PQ) interval on ECG represent?", "AV nodal conduction time (onset of atrial depolarization to onset of ventricular depolarization)", "PR interval = time from start of P wave to start of QRS = AV conduction time (0.12-0.20 sec). Prolonged PR = first-degree AV block. Short PR = WPW or Lown-Ganong-Levine syndrome.", True, True), (9, "What does the P wave on ECG represent?", "Atrial depolarization", "ECG waves: P = atrial depolarization (SA node fires, atria contract). QRS = ventricular depolarization (ventricles contract). T = ventricular repolarization. Atrial repolarization is hidden within QRS.", True, True), (10, "The T wave in a normal ECG represents:", "Ventricular repolarization", "T wave = ventricular repolarization. T wave abnormalities (peaked T = hyperkalemia; flat/inverted T = ischemia). QT interval = ventricular depolarization + repolarization time. Prolonged QT → risk of Torsades de Pointes.", True, True), (11, "Norepinephrine stimulates _____ receptors, which mediate effects on heart rate:", "Beta-1 adrenergic receptors (β1)", "β1 receptors are in the heart. NE/epinephrine → β1 → ↑HR (chronotropy), ↑contractility (inotropy), ↑conduction speed. Vagal/ACh → opposite. Remember: β1 = heart (1 heart), β2 = lungs/vessels (2 lungs).", True, True), (12, "Calcium ions play a crucial role in heart muscle contraction, while _____ ions maintain resting membrane potential and repolarization:", "Potassium (K+) ions", "Ca²⁺ triggers contraction in cardiac muscle (released by calcium-induced calcium release from SR, plus extracellular Ca²⁺ entry via L-type channels). K+ channels are responsible for repolarization (returning membrane to resting potential).", True, True), ] for i, q in enumerate(ecg_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) add_section(doc, "3C. BLOOD PRESSURE & VASCULAR PHYSIOLOGY") bp_q = [ (1, "When calculating cardiac output (CO), which equation is correct?", "CO = Heart Rate × Stroke Volume", "CO = HR × SV. Normal CO ≈ 5 L/min (70 bpm × 70 mL). Cardiac index = CO/BSA. Ejection fraction = SV/EDV × 100%.", True, True), (2, "What effect would vasodilation in systemic arterioles have on blood pressure and resistance?", "Decrease in blood pressure AND decrease in resistance", "Vasodilation → ↓resistance → ↓blood pressure. Vasodilation also increases blood flow to the tissue. MAP = CO × SVR. If SVR↓, MAP↓.", True, True), (3, "The velocity of blood flow is highest in:", "Aorta (large arteries) — NOT arterioles or veins", "Velocity is inversely proportional to total cross-sectional area. Aorta has smallest CSA → highest velocity. Capillaries have largest total CSA → slowest velocity. This allows maximum time for exchange.", True, True), (4, "Which blood vessel is responsible for controlling blood flow to specific tissues by constricting or dilating?", "Arterioles (resistance vessels)", "Arterioles control blood distribution to capillary beds. They have the highest resistance in the circulatory system. Precapillary sphincters control individual capillary beds.", True, True), (5, "How does the structure of veins differ from that of arteries?", "Veins have thinner walls but LARGER lumens; arteries have thicker walls (more muscle/elastic tissue)", "Arteries: thicker wall, smaller lumen, higher pressure, more elastic/muscular. Veins: thinner wall, larger lumen, lower pressure, have valves. Veins contain ~64% of total blood volume (capacitance vessels).", True, True), (6, "The normal right atrial pressure is about:", "0 mmHg (0 mm Hg)", "Normal pressures: RA = 0-5 mmHg, RV systolic = 25 mmHg, PA systolic = 25 mmHg, LA = 5-10 mmHg, LV systolic = 120 mmHg, Aorta = 120/80 mmHg.", True, True), (7, "Factors that create arterial pressure are:", "Cardiac output AND Total peripheral resistance (SVR)", "MAP = CO × SVR. Blood pressure is maintained by: (1) cardiac output (HR × SV) and (2) total peripheral resistance (mainly arterioles). Long-term regulation: kidneys (RAAS, fluid balance).", True, True), (8, "_____ are called capacitance vessels or blood reservoirs:", "Veins (and venules)", "Veins are capacitance vessels. They contain ~64% of total blood volume. They have high compliance (stretchable). Arteries are pressure vessels. Capillaries are exchange vessels. Arterioles are resistance vessels.", True, True), (9, "The velocity of blood flow is LOWEST in capillaries because:", "They have the largest total cross-sectional area in the circulatory system", "Total CSA: capillaries > veins > arteries > aorta. Velocity (v) = Flow/CSA. Largest CSA → lowest velocity. Slow flow in capillaries allows maximum time for gas/nutrient exchange.", True, True), (10, "According to Poiseuille's law, which factor has the GREATEST impact on resistance?", "Vessel RADIUS (r⁴ — to the 4th power): R = 8ηL/πr⁴", "Resistance (R) = 8ηL/πr⁴. Halving the radius increases resistance 16-fold (2⁴=16). Doubling the radius decreases resistance to 1/16. This is why small changes in vessel diameter dramatically affect blood flow.", True, True), (11, "The difference between systolic and diastolic blood pressure is known as:", "Pulse pressure", "Pulse pressure = Systolic - Diastolic (normally 120-80 = 40 mmHg). MAP = Diastolic + (Pulse pressure/3) ≈ 93 mmHg. Pulse pressure is higher in LARGE ARTERIES.", True, True), (12, "Structure which can open and close the entrance to the capillary is called:", "Precapillary sphincter", "Precapillary sphincters regulate blood flow into individual capillary beds. The most important factor for their opening/closing is the tissue concentration of OXYGEN (low O2 → sphincters open).", True, True), (13, "Active hyperemia occurs when tissue _____ rate increases:", "Metabolic rate", "Active (functional) hyperemia: increased tissue metabolic activity → local vasodilation → increased blood flow. The vasodilatory metabolites include: CO2, adenosine, K+, H+, low O2. Examples: exercise-induced hyperemia.", True, True), (14, "Reactive and active _____ are examples of metabolic control of local blood flow:", "Hyperemia", "Reactive hyperemia = increased flow after temporary occlusion (repayment of 'oxygen debt'). Active hyperemia = increased flow during increased tissue activity. Both are forms of local metabolic autoregulation.", True, True), (15, "Excess production of which substance would most likely result in chronic hypertension?", "Angiotensin II", "Angiotensin II: vasoconstriction (raises SVR), stimulates aldosterone release (Na+/water retention), increases sympathetic activity. Chronic excess → hypertension. ACE inhibitors and ARBs treat this.", True, True), (16, "Renin is secreted by:", "Juxtaglomerular (JG) cells (granular cells) of the afferent arteriole in the kidney", "Renin → cleaves angiotensinogen → angiotensin I. ACE converts AI → AII. Renin is released in response to: ↓renal perfusion pressure, ↓Na+ delivery to macula densa, sympathetic stimulation.", False, True), (17, "Edema may be caused by:", "All of the above: increased capillary hydrostatic pressure, decreased plasma oncotic pressure, lymphatic obstruction, increased capillary permeability", "Starling forces: filtration occurs when capillary hydrostatic pressure > oncotic pressure. Edema causes: (1) ↑hydrostatic pressure (heart failure), (2) ↓oncotic pressure (low albumin), (3) lymphatic blockage, (4) ↑permeability.", True, True), (18, "Flow of fluid through lymphatic vessels will be DECREASED if there is an increase in:", "Capillary oncotic pressure (higher oncotic pressure pulls fluid back into capillaries, reducing lymph formation)", "Increased capillary oncotic pressure → more fluid reabsorbed into capillaries → less fluid enters lymphatics → decreased lymph flow. Increased capillary hydrostatic pressure → more filtration → more lymph.", True, True), (19, "Lymph capillaries differ from systemic blood capillaries in that they:", "Are absent in the CNS (also: have no basement membrane, have larger intercellular gaps, are blind-ended)", "Lymph capillaries are absent in: CNS, bone marrow, and avascular tissues (cornea, cartilage). They are blind-ended, more permeable than blood capillaries, and lack a continuous basement membrane.", True, True), (20, "Accumulation of fluid in the interstitium is called:", "Edema", "Edema = excess fluid in interstitial space. Pitting edema (leaves pits when pressed) vs. non-pitting. In left heart failure: pulmonary edema. In right heart failure: peripheral edema.", True, True), ) for i, q in enumerate(bp_q): add_q(doc, i+1, q[1], q[2], q[3], q[4], q[5]) doc.add_page_break() # ============================================= # SECTION 4: MOST REPEATED QUESTIONS SUMMARY # ============================================= add_title(doc, "SECTION 4: ⭐ MOST REPEATED & HIGHEST YIELD QUESTIONS") p = doc.add_paragraph() run = p.add_run("These questions appeared in MULTIPLE exam versions and are MOST LIKELY to appear on your final exam.") run.bold = True run.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) repeated_table_data = [ ("TOPIC", "QUESTION", "ANSWER"), ("Heart Valves", "What valve does blood pass through leaving LV?", "Aortic semilunar valve"), ("Heart Valves", "Tricuspid valve cusps", "Anterior, septal, posterior"), ("Heart Valves", "Pulmonary valve cusps", "Left, right, anterior"), ("Pericardium", "Epicardium = same as?", "Visceral layer of serous pericardium"), ("Pericardium", "Pericardial layers (superficial → deep)", "Fibrous → Parietal → Pericardial cavity → Visceral"), ("Pericardium", "Inflammation of pericardium", "Pericarditis"), ("Coronary Veins", "Vein NOT draining into coronary sinus", "Anterior cardiac veins → right atrium"), ("Mediastinum", "Structure NOT in middle mediastinum", "Thymus"), ("Mediastinum", "Posterior mediastinal structure near pericardium", "Esophagus"), ("Mediastinum", "All structures seen in superior mediastinum EXCEPT", "Right recurrent laryngeal nerve"), ("Trachea/Bronchi", "Trachea extends between", "C6-T4"), ("Trachea/Bronchi", "Trachea bifurcates at", "T4/T5"), ("Trachea/Bronchi", "Left vs Right bronchus", "Left: longer, narrower, more horizontal"), ("Trachea/Bronchi", "Ciliated pseudostratified epithelium in bronchioles?", "FALSE — bronchioles have simple/cuboidal"), ("Trachea/Bronchi", "Cells in terminal bronchioles", "Clara (Club) cells"), ("Larynx", "Space between vocal cords", "Rima glottidis (glottis)"), ("Larynx", "Covers laryngeal inlet during swallowing", "Epiglottis"), ("Larynx", "Largest laryngeal cartilage", "Thyroid cartilage"), ("Larynx", "Epiglottis tissue type", "Elastic cartilage"), ("Larynx", "Vocal cord epithelium", "Non-keratinized stratified squamous"), ("Blood Vessels", "Left brachiocephalic vein formed by", "Left subclavian + left IJV"), ("Blood Vessels", "Right subclavian origin", "Brachiocephalic trunk (NOT aorta)"), ("Blood Vessels", "Azygos vein drains into", "SVC"), ("Blood Vessels", "Hemiazygos drains", "Left lower thoracic wall"), ("Blood Vessels", "Aortic intima split from media", "Aortic dissection"), ("Abdominal Vessels", "IMA NOT a branch of", "Right colic artery (that's SMA)"), ("Abdominal Vessels", "Celiac trunk branches", "Left gastric, splenic, common hepatic"), ("Abdominal Vessels", "Hindgut supply", "IMA"), ("Abdominal Vessels", "Uterine artery from", "Internal iliac artery"), ("Limb Vessels", "Brachial artery bifurcates at", "Level of elbow"), ("Limb Vessels", "Basilic vein type", "Superficial (NOT deep)"), ("Limb Vessels", "Radial artery passes through", "Anatomical snuffbox"), ("Limb Vessels", "Midshaft humerus fracture artery", "Profunda brachii"), ("Cardiac Embryo", "CV system development starts", "Third week"), ("Cardiac Embryo", "Heart chambers partitioned (NOT week 4)", "Week 5-8"), ("Cardiac Embryo", "Outflow tract formed by", "Bulbus cordis + truncus arteriosus"), ("Cardiac Embryo", "Left atrium derived from", "Primitive pulmonary vein"), ("Cardiac Embryo", "Fetal shunt: aorta-pulmonary", "Ductus arteriosus"), ("Cardiac Embryo", "Ductus venosus becomes", "Ligamentum venosum"), ("Cardiac Embryo", "Left umbilical vein fate", "Ligamentum teres hepatis (right regresses)"), ("Cardiac Embryo", "Foramen ovale = what hole?", "Hole formed by septum secundum growing down"), ("Cardiac Embryo", "4th aortic arch left/right", "Left = aortic arch; Right = right subclavian"), ("Histology", "CV system lining", "Simple squamous (endothelium)"), ("Histology", "Pericytes found where?", "Capillaries and venules (NOT all vessels)"), ("Histology", "Thickest artery layer", "Tunica media"), ("Histology", "Thickest vein layer", "Tunica adventitia"), ("Histology", "Lymphatic vessel lining", "Simple squamous"), ("Histology", "Myeloid series most immature", "Myeloblast"), ("Histology", "Surfactant effect", "DECREASES surface tension (prevents collapse)"), ("Histology", "Tracheal cartilage type", "Hyaline cartilage"), ("Physiology", "CO equation", "CO = HR × SV"), ("Physiology", "Cardiac conduction order", "SA → AV → His → Branches → Purkinje"), ("Physiology", "Acetylcholine on SA node", "Hyperpolarization (slows HR)"), ("Physiology", "Cardiac weakness ECF deficiency", "Calcium"), ("Physiology", "Pre-capillary sphincter opens based on", "O2 concentration (low O2 → opens)"), ("Physiology", "Active hyperemia trigger", "Increased metabolic rate"), ("Physiology", "Capacitance vessels", "Veins"), ("Physiology", "Arterial pressure factors", "CO × Total peripheral resistance"), ("Physiology", "Pulse pressure higher in", "Large arteries"), ("Physiology", "Edema causes", "All: ↑hydrostatic, ↓oncotic, lymphatic block, ↑permeability"), ("Physiology", "Isovolumetric relaxation: valves?", "ALL valves closed"), ("Physiology", "Frank-Starling law", "↑venous return → ↑stretch → ↑SV"), ("Physiology", "Coronary flow mainly in", "Diastole"), ("Physiology", "Ectopic pacemaker = ?", "Pacemaker other than SA node"), ("Physiology", "Collateral flow damages myocardium?", "FALSE — protects it"), ("Physiology", "Normal BP reading for adults", "120/80 mmHg"), ("Physiology", "Right atrial pressure", "~0 mmHg"), ("Physiology", "Cardiac pain radiation", "Back, left arm (or right arm), jaw"), ] table = doc.add_table(rows=len(repeated_table_data), cols=3) table.style = 'Table Grid' widths = [Inches(1.2), Inches(2.8), Inches(2.2)] for i, row_data in enumerate(repeated_table_data): row = table.rows[i] for j, cell_text in enumerate(row_data): row.cells[j].text = cell_text run_cell = row.cells[j].paragraphs[0].runs[0] run_cell.font.size = Pt(9) if i == 0: run_cell.bold = True set_cell_bg(row.cells[j], '1A5376') run_cell.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) elif i % 2 == 0: set_cell_bg(row.cells[j], 'E8F4FD') else: set_cell_bg(row.cells[j], 'FFFFFF') doc.add_page_break() # ============================================= # SECTION 5: QUICK REFERENCE TRUE/FALSE ANSWERS # ============================================= add_title(doc, "SECTION 5: IMPORTANT TRUE/FALSE STATEMENTS") tf_q = [ "TRUE: The cardiovascular system begins to develop during the third week", "FALSE: The primitive heart is partitioned into four chambers during the FOURTH week → actually 5th-8th week", "TRUE: Ciliated pseudostratified columnar epithelium is NOT found in bronchioles (False statement = answer 0)", "TRUE: The visceral pleura is a layer of thin connective tissue and mesothelium", "FALSE: The pulmonary surfactant DECREASES surface tension (it does NOT increase it)", "TRUE: Capillaries of pulmonary alveoli are larger in diameter than average systemic capillaries", "TRUE: The right subclavian artery does NOT arise directly from the aorta (it comes from brachiocephalic trunk)", "FALSE: The axillary artery does NOT terminate as radial and ulnar (brachial artery does)", "FALSE: The basilic vein is NOT a deep vein (it is superficial)", "TRUE: Median sacral artery passes over anterior surface of lower lumbar vertebrae and sacrum/coccyx", "FALSE: The posterior branches of abdominal aorta are INFERIOR phrenic (not superior), lumbar, and median sacral", "TRUE: The brachial artery bifurcates into radial and ulnar at the level of the elbow", "FALSE: The left subclavian artery does NOT originate from the brachiocephalic trunk (it arises directly from aortic arch)", "TRUE: The subclavian artery becomes axillary artery at the lateral border of the first rib", "TRUE: The thyrocervical trunk is a branch of the subclavian artery", "FALSE: The cephalic vein is NOT on the medial side (it is on the LATERAL side)", "TRUE: The superior gluteal artery is a parietal branch of the internal iliac supplying the gluteal region", "FALSE: The inferior gluteal artery does NOT primarily supply pelvic organs (it supplies gluteal region + hip)", "TRUE: The liver and gallbladder are in the right upper quadrant", "FALSE: The stomach and spleen are in the LEFT UPPER quadrant (not lower)", "TRUE: Vitelline veins carry POORLY oxygenated blood (not well-oxygenated) — FALSE statement = answer 0", "TRUE: In normal fetal circulation, blood bypasses liver via ductus venosus", "TRUE: During neonatal period, the ductus venosus closes", "FALSE: Lung development is NOT divided into 3 stages (it has 5 stages: embryonic, pseudoglandular, canalicular, saccular, alveolar)", "FALSE: The umbilical cord has 2 arteries and 1 vein (NOT 1 artery and 2 veins)", "TRUE: The peripheral chemoreceptors are located in the carotid body and aortic bodies (NOT carotid sinus — sinus is a baroreceptor)", "TRUE: Vagal stimulation of SA node does NOT increase Ca2+ influx (it increases K+ permeability)", "TRUE: Collateral flow does NOT damage myocardium (FALSE statement = answer 0)", "TRUE: The smaller the alveolus, the greater the alveolar pressure from surface tension (Law of Laplace)", "TRUE: Cardiac pain can be irradiated to back, right arm, jaw", "TRUE: Cardiac tamponade does NOT increase cardiac output (it decreases CO)", "TRUE: Severe hyperventilation (low CO2) CAN lead to loss of consciousness", "TRUE: For long-term survival, fluid intake and output must be precisely balanced", "FALSE: V5, V6 on ECG represent LATERAL wall (not anterior)", "FALSE: The physiological dead space is NOT always greater than anatomical dead space", "TRUE: The residual volume is the volume of air remaining after most forceful expiration", "TRUE: The ischemic effect on vasomotor activity can greatly elevate mean arterial pressure", "FALSE: Cardiac muscle does NOT use anaerobic energy sources significantly (primarily aerobic)", "TRUE: Diastole IS shortened when HR is increased", "FALSE: Arteries are NOT more compliant than veins (VEINS are more compliant)", "TRUE: Diffusion coefficient is highest for CO2", "TRUE: Nitric oxide has mainly a local action (paracrine vasodilator)", "TRUE: Surfactant reduces surface tension of the fluid lining the alveoli", "TRUE: The resistance of the pulmonary circulation is lower than systemic circulation", "FALSE: Pericytes are NOT found in the wall of ALL blood vessels (only capillaries/venules)", "FALSE: Muscular arteries are NOT conducting arteries (elastic arteries are conducting; muscular = distributing)", "TRUE: The fibrous cardiac skeleton electrically isolates atria from ventricles", "FALSE: Central chemoreceptors do NOT sense O2 tension (they sense CO2/H+; peripheral sense O2)", "TRUE: The azygos vein arises opposite vertebra L1 or L2 (from right ascending lumbar + right subcostal veins)", "FALSE: The most common congenital heart defect is VSD (ventricular septal defect)", "TRUE: Most commonly, the RIGHT coronary artery is DOMINANT (not left)", ] for i, statement in enumerate(tf_q): p = doc.add_paragraph() p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) if statement.startswith("TRUE:"): run = p.add_run("✓ " + statement) run.font.color.rgb = RGBColor(0x37, 0x86, 0x10) run.font.size = Pt(10) else: run = p.add_run("✗ " + statement) run.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) run.font.size = Pt(10) # Save output_path = '/tmp/workspace/finals-study-guide/FINALS_STUDY_GUIDE.docx' doc.save(output_path) print(f"Saved: {output_path}") PYEOF echo "Script written"
cd /tmp/workspace/finals-study-guide && python3 generate_guide.py 2>&1
sed -n '920,930p' /tmp/workspace/finals-study-guide/generate_guide.py
~/finals-study-guide/generate_guide.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/finals-study-guide/generate_guide.py'
cd /tmp/workspace/finals-study-guide && python3 generate_guide.py 2>&1
FINALS STUDY GUIDE
Word Document · DOCX
Create a quick review PDF flashcard deck from these high-yield topics
ls /tmp/workspace/finals-study-guide/
~/finals-study-guide/make_flashcards.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.pdfgen import canvas
from reportlab.platypus import BaseDocTemplate, Frame, PageTemplate
import textwrap
OUTPUT = '/tmp/workspace/finals-study-guide/FLASHCARD_DECK.pdf'
# ── palette ──────────────────────────────────────────────────────────────────
C_NAVY = colors.HexColor('#1A3F6F')
C_BLUE = colors.HexColor('#1E6BB8')
C_SKY = colors.HexColor('#E8F4FD')
C_GREEN = colors.HexColor('#1F6B2E')
C_LIME = colors.HexColor('#EBF8EE')
C_RED = colors.HexColor('#B30000')
C_ORANGE = colors.HexColor('#E65C00')
C_YELLOW = colors.HexColor('#FFF9E6')
C_PINK = colors.HexColor('#FFF0F0')
C_PURPLE = colors.HexColor('#4B0082')
C_LAVENDER= colors.HexColor('#F3EEFF')
C_GREY = colors.HexColor('#F5F5F5')
C_DARK = colors.HexColor('#222222')
C_MID = colors.HexColor('#555555')
C_LITE = colors.HexColor('#EEEEEE')
C_WHITE = colors.white
C_STAR = colors.HexColor('#FFD700')
C_TEAL = colors.HexColor('#00766C')
C_TEAL_LT = colors.HexColor('#E0F5F3')
PAGE_W, PAGE_H = A4 # 595 x 842 pt
MARGIN = 1.5*cm
# ── styles ────────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
base = kw.pop('parent', 'Normal')
s = ParagraphStyle(name, parent=styles[base], **kw)
return s
sTitle = S('sTitle', fontSize=28, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=34, spaceAfter=4)
sSub = S('sSub', fontSize=13, textColor=colors.HexColor('#BDD9F2'),
fontName='Helvetica', alignment=TA_CENTER, leading=16, spaceAfter=0)
sSection= S('sSection',fontSize=15, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=19)
sTag = S('sTag', fontSize=8, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=10, spaceBefore=0, spaceAfter=0)
sTagDark= S('sTagDark',fontSize=8, textColor=C_NAVY, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=10)
sCardQ = S('sCardQ', fontSize=12, textColor=C_NAVY, fontName='Helvetica-Bold',
leading=16, spaceAfter=4)
sCardA = S('sCardA', fontSize=12, textColor=C_GREEN, fontName='Helvetica-Bold',
leading=16, spaceAfter=4)
sCardExp= S('sCardExp',fontSize=9.5,textColor=C_DARK, fontName='Helvetica',
leading=13, spaceAfter=0)
sCardWrong= S('sCardWrong', fontSize=9.5, textColor=C_RED, fontName='Helvetica-Oblique',
leading=13, spaceAfter=0)
sTF_T = S('sTF_T', fontSize=11, textColor=C_GREEN, fontName='Helvetica-Bold', leading=15)
sTF_F = S('sTF_F', fontSize=11, textColor=C_RED, fontName='Helvetica-Bold', leading=15)
sSmall = S('sSmall', fontSize=8, textColor=C_MID, fontName='Helvetica',
leading=10, alignment=TA_RIGHT)
sNum = S('sNum', fontSize=20, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=24)
sRepeat = S('sRepeat', fontSize=7.5,textColor=C_STAR, fontName='Helvetica-Bold',
alignment=TA_LEFT, leading=9, spaceBefore=0, spaceAfter=0)
sSysSub = S('sSysSub', fontSize=10, textColor=C_BLUE, fontName='Helvetica-Bold',
alignment=TA_LEFT, leading=13)
# ── flashcard data ─────────────────────────────────────────────────────────────
# Format: (category_color, tag_label, question, answer, explanation, wrong_answer_note, is_repeated)
# category_color options: 'anatomy','histo','physio','emb'
CARDS = [
# ══════ ANATOMY ══════
('anatomy', '⭐ REPEATED', 'Blood leaving the LEFT VENTRICLE passes through which valve?',
'Aortic semilunar valve',
'The LV pumps oxygenated blood into the AORTA via the AORTIC valve. The bicuspid (mitral) valve sits between LA and LV — it does NOT receive blood leaving the LV.',
'Common wrong answer: Bicuspid valve', True),
('anatomy', '⭐ REPEATED', 'The "skeleton" of the heart:',
'Provides internal support for cardiac chambers (annulus fibrosus)',
'The fibrous skeleton electrically ISOLATES atria from ventricles and prevents overdilation of valve openings. It is NOT the fibrous pericardium.',
'Wrong: "fibrous pericardium" or "Purkinje fibers"', True),
('anatomy', '⭐ REPEATED', 'Tricuspid valve has 3 cusps. Name them:',
'Anterior, Septal, Posterior cusps',
'Right AV valve = tricuspid = 3 cusps. Left AV valve = mitral/bicuspid = 2 cusps (anterior + posterior). Chordae tendineae prevent inversion into atria during systole.',
'', True),
('anatomy', '⭐ REPEATED', 'Cusps of the PULMONARY valve are named:',
'Left, Right, and Anterior cusps',
'Pulmonary valve (semilunar) = left, right, anterior. Aortic valve (semilunar) = left, right, posterior (non-coronary). Both have 3 cusps.',
'', True),
('anatomy', 'ANATOMY', 'Epicardium is the same as:',
'Visceral layer of serous pericardium',
'Pericardium layers (outside → in): Fibrous → Parietal serous → Pericardial cavity → Visceral serous = EPICARDIUM (covers heart directly). Common exam trap!',
'Wrong: Parietal pericardium', True),
('anatomy', 'ANATOMY', 'AV valves cannot be inverted because of attachment of:',
'Chordae tendineae (tendinous cords)',
'Chordae tendineae connect AV valve cusps to papillary muscles, preventing prolapse into the atria during ventricular systole. The fibrous skeleton prevents valve OVERDILATION.',
'Wrong: interventricular ligament', True),
('anatomy', 'ANATOMY', 'Inflammation of the heart\'s pericardium is called:',
'Pericarditis',
'Pericarditis: key feature = chest pain RELIEVED by sitting/leaning forward. This distinguishes it from MI. The pericardial friction rub is the classic auscultatory finding.',
'', True),
('anatomy', '⭐ REPEATED', 'Which vein does NOT drain into the coronary sinus?',
'Anterior cardiac veins',
'Anterior cardiac veins drain DIRECTLY into the RIGHT ATRIUM — bypassing the coronary sinus. The coronary sinus receives: great, middle, small cardiac veins + oblique vein.',
'Wrong answer in old version: "Great cardiac vein"', True),
('anatomy', '⭐ REPEATED', 'Trachea extends approximately between levels of:',
'C6 (CVI) to T4 (TIV)',
'Trachea: starts below cricoid cartilage at C6, bifurcates at T4/T5 (sternal angle = angle of Louis). Tracheal rings = C-shaped HYALINE cartilage (16-20 rings).',
'', True),
('anatomy', '⭐ REPEATED', 'The trachea bifurcates at level:',
'T4/T5 (TIV/TV) — at the sternal angle (angle of Louis)',
'The carina is the internal ridge at the bifurcation. In midclavicular line, the inferior lung margin crosses rib VI; in midaxillary line, rib VIII; paravertebral, rib X.',
'Common wrong: TIV/I or TII', True),
('anatomy', '⭐ REPEATED', 'The LEFT main bronchus compared to the RIGHT:',
'Longer, narrower, and MORE HORIZONTAL',
'Right bronchus: shorter, wider, more vertical (~25°) → foreign bodies lodge here more often. Left bronchus: longer, narrower, more horizontal (~45°). Left crosses the midline.',
'', True),
('anatomy', '⭐ REPEATED', 'Ciliated pseudostratified columnar epithelium is found in bronchioles — TRUE or FALSE?',
'FALSE ✗',
'Ciliated pseudostratified columnar epithelium is found in TRACHEA and larger BRONCHI — NOT bronchioles. Bronchioles have simple columnar/cuboidal + CLARA (Club) cells. No cartilage in bronchioles.',
'This was answered WRONG in multiple exam versions', True),
('anatomy', '⭐ REPEATED', 'The space between visceral and parietal pleura is the _____ cavity:',
'Pleural cavity',
'Visceral pleura covers the lung directly. Parietal pleura lines the thoracic wall. The pleural cavity (potential space) contains a small amount of serous fluid. Air entry = PNEUMOTHORAX.',
'', True),
('anatomy', 'ANATOMY', 'The rima glottidis is:',
'The space between the vocal cords — critical for sound production',
'The rima glottidis is the opening between the vocal cords. The epiglottis (elastic cartilage) covers the laryngeal inlet during swallowing. Vocal cords covered by NON-KERATINIZED STRATIFIED SQUAMOUS epithelium.',
'', True),
('anatomy', '⭐ REPEATED', 'The largest cartilage of the larynx:',
'Thyroid cartilage',
'Thyroid = largest. Forms the "Adam\'s apple." Angle more ACUTE in males (~90°), more OBTUSE in females (~120°). Epiglottis = elastic cartilage. Cricoid = complete ring below thyroid.',
'', True),
('anatomy', '⭐ REPEATED', 'Structure NOT found in the MIDDLE mediastinum:',
'Thymus (and lungs)',
'Middle = heart + pericardium, SVC, IVC, ascending aorta, pulmonary trunk/veins, phrenic nerves. THYMUS is in ANTERIOR mediastinum. LUNGS are outside mediastinum entirely.',
'Wrong: said "aorta" in old version exam', True),
('anatomy', '⭐ REPEATED', 'Posterior mediastinal structure closest to the posterior surface of the pericardial sac:',
'Esophagus',
'The esophagus lies directly behind the LA/pericardial sac. This is why TEE (transesophageal echo) gives excellent views of the LA. A tumor in the posterior mediastinum → can compress esophagus or descending aorta.',
'', True),
('anatomy', '⭐ REPEATED', 'All structures seen in superior mediastinum EXCEPT:',
'Right recurrent laryngeal nerve',
'The RIGHT RLN hooks around the right subclavian artery at the ROOT OF THE NECK — it does NOT descend into the superior mediastinum. The LEFT RLN hooks under the aortic arch IN the superior mediastinum.',
'', True),
('anatomy', 'ANATOMY', 'The thoracic duct lies immediately posterior to (in mid-thorax):',
'Esophagus',
'Thoracic duct path: begins at cisterna chyli (L1-L2) → enters thorax at T12 → ascends posterior to esophagus → drains into LEFT subclavian + left IJV junction. Drains ALL lymph except right upper body.',
'', True),
('anatomy', '⭐ REPEATED', 'Left brachiocephalic vein is formed by confluence of:',
'Left subclavian vein + Left internal jugular vein',
'Both left and right brachiocephalic veins = subclavian + IJV on each side. The LEFT brachiocephalic crosses the superior mediastinum HORIZONTALLY (longer). The right is short and nearly vertical.',
'Wrong answer in old version: "right subclavian + right IJV"', True),
('anatomy', '⭐ REPEATED', 'Right subclavian artery arises from: (TRUE or FALSE: arises directly from aorta)',
'FALSE — right subclavian arises from the BRACHIOCEPHALIC TRUNK',
'Brachiocephalic trunk (from aortic arch) gives: right subclavian + right common carotid. Aortic arch directly gives: brachiocephalic trunk, left CCA, left subclavian (L→R: think "BALD").',
'', True),
('anatomy', '⭐ REPEATED', 'Aortic intima is split from media — what condition is this?',
'Aortic dissection',
'Aortic dissection = tear in intima → blood enters aortic wall, splitting intima from media. Stanford A: ascending aorta (surgical emergency). Stanford B: descending (medical management). Risk: Marfan, hypertension.',
'', True),
('anatomy', '⭐ REPEATED', 'Which is NOT a branch of the inferior mesenteric artery (IMA)?',
'Right colic artery — that is a branch of the SUPERIOR mesenteric artery (SMA)',
'IMA branches: left colic, sigmoid arteries, superior rectal. SMA branches: ileocolic, right colic, MIDDLE colic, intestinal arteries. IMA = hindgut supply (descending colon → upper anal canal).',
'', True),
('anatomy', '⭐ REPEATED', 'Celiac trunk branches into THREE arteries — which are they?',
'Left gastric artery, Splenic artery, Common hepatic artery',
'Remember: "Left Sideshow Comic Hero" or just LEFT GASTRIC + SPLENIC + COMMON HEPATIC. These supply the FOREGUT. IMA is a SEPARATE aortic branch supplying hindgut — it is NOT a celiac branch.',
'Wrong: "inferior mesenteric artery"', True),
('anatomy', '⭐ REPEATED', 'The internal iliac artery branch that supplies the UTERUS:',
'Uterine artery',
'Uterine artery from anterior division of internal iliac. It crosses the ureter ("water under the bridge") — key landmark in hysterectomy. The superior gluteal exits ABOVE piriformis; inferior gluteal BELOW.',
'', True),
('anatomy', 'ANATOMY', 'Brachial artery bifurcates into radial and ulnar arteries at:',
'Level of the ELBOW (apex of cubital fossa) — TRUE',
'The brachial artery is in the ANTERIOR compartment of the arm (NOT posterior). Its pulse is auscultated for BP measurement. It bifurcates at the cubital fossa into radial (lateral) and ulnar (medial).',
'', True),
('anatomy', 'ANATOMY', 'Basilic vein — deep or superficial?',
'SUPERFICIAL vein (on MEDIAL side of forearm/arm)',
'Superficial veins of arm: BASILIC (medial) + CEPHALIC (lateral). They connect at the MEDIAN CUBITAL vein in the cubital fossa (used for venipuncture). Deep veins: brachial, axillary.',
'This was answered wrong as "deep vein" in multiple exam versions', True),
('anatomy', 'ANATOMY', 'Which artery courses through the ANATOMICAL SNUFFBOX?',
'Radial artery',
'The anatomical snuffbox is bounded by: abductor pollicis longus, extensor pollicis brevis (anterior), extensor pollicis longus (posterior). Floor = scaphoid + trapezium. Radial pulse felt here.',
'', True),
# ══════ HISTOLOGY & EMBRYOLOGY ══════
('histo', '⭐ REPEATED', 'The cardiovascular system begins to develop during:',
'Third week (Week 3) — TRUE',
'CV system is one of the FIRST organ systems to develop. Heart tube forms at ~day 18-19 from splanchnic mesoderm. The heart begins to beat at ~day 21 (3 weeks). The brain develops later.',
'', True),
('histo', '⭐ REPEATED', 'Primitive heart is partitioned into 4 chambers during the FOURTH week — TRUE or FALSE?',
'FALSE ✗ — partitioning occurs weeks 5-8 (completed at end of 8th week)',
'The heart TUBE forms in week 3-4. LOOPING occurs week 4. SEPTATION (creating 4 chambers) occurs weeks 5-8. Do NOT confuse tube formation with chamber septation!',
'This FALSE statement appeared as TRUE in wrong answer versions', True),
('histo', '⭐ REPEATED', 'The two parts of the primitive heart tube that form the OUTFLOW TRACT:',
'Bulbus cordis + Truncus arteriosus',
'Primitive heart tube (cranio-caudal): Truncus arteriosus → Bulbus cordis → Primitive ventricle → Primitive atrium → Sinus venosus. Spiral septation of truncus/bulbus → aorta and pulmonary trunk.',
'Wrong: "Bulbus cordis and primitive ventricles"', True),
('histo', '⭐ REPEATED', 'The fetal LEFT ATRIUM is mainly derived from:',
'Primitive pulmonary vein',
'The LA is incorporated with the primitive pulmonary vein and its branches during development. The RIGHT ATRIUM is mainly from the right horn of the sinus venosus.',
'', True),
('histo', '⭐ REPEATED', 'Fetal shunt between the aorta and pulmonary artery:',
'Ductus arteriosus',
'Ductus arteriosus = connects pulmonary trunk to aortic arch → bypasses lungs (fetal lungs not yet functional). Closes after birth → becomes LIGAMENTUM ARTERIOSUM. Origin = 6th pharyngeal arch artery.',
'Wrong: "Foramen ovale" (that is the atrial shunt)', True),
('histo', '⭐ REPEATED', 'The ductus venosus becomes after it closes:',
'Ligamentum venosum',
'Fetal remnants: ductus arteriosus → lig. arteriosum | ductus venosus → lig. venosum | umbilical arteries → medial umbilical ligaments | umbilical vein → lig. teres hepatis (in falciform ligament).',
'Wrong: "Ligamentum arteriosum"', True),
('histo', '⭐ REPEATED', 'The foramen ovale: what is it? What leads to its closure?',
'Hole between atria. Closes when LEFT atrial pressure EXCEEDS right atrial pressure (at birth)',
'FO allows oxygenated blood from IVC to bypass right ventricle → go directly to LA. At birth: lungs open → LA pressure rises → FO closes functionally. Probe patent FO exists in ~25% of adults.',
'', True),
('histo', '⭐ REPEATED', 'Changes after birth — umbilical arteries become:',
'Medial umbilical ligaments',
'At birth ALL shunts close: (1) DA → lig. arteriosum (2) DV → lig. venosum (3) FO → fossa ovalis (4) Umbilical arteries → medial umbilical ligaments (5) Umbilical vein → lig. teres hepatis.',
'Wrong: "umbilical vein becomes ligamentum venosum"', True),
('histo', '⭐ REPEATED', 'Each statement correctly paired EXCEPT: Right umbilical vein – definitive umbilical vein',
'INCORRECT pairing — LEFT umbilical vein is definitive (right regresses early)',
'The RIGHT umbilical vein DEGRESSES during development. Only the LEFT persists as the definitive umbilical vein carrying oxygenated blood from placenta to fetus.',
'', True),
('histo', '⭐ REPEATED', '4th aortic arch develops into (left vs right):',
'Left 4th = ARCH OF THE AORTA | Right 4th = RIGHT SUBCLAVIAN ARTERY',
'Pharyngeal arch arteries: 1st → maxillary, 2nd → stapedial/hyoid, 3rd → common carotid+ICA, 4th left → aortic arch, 4th right → right subclavian, 6th left → ductus arteriosus.',
'', True),
('histo', '⭐ REPEATED', 'Internal surface of all CV system components is lined by:',
'Simple squamous epithelium (endothelium) — TRUE',
'Endothelium = monolayer of simple squamous cells. Functions: barrier, vasomotor regulation, anti-thrombosis, inflammation control. Found in ALL vessels and heart chambers.',
'', True),
('histo', '⭐ REPEATED', 'Pericytes — TRUE or FALSE: found in wall of ALL blood vessels?',
'FALSE — pericytes are found only in CAPILLARIES and postcapillary venules',
'Pericytes are mesenchymal cells that wrap around capillaries/venules. They regulate capillary diameter, support the endothelium, and participate in angiogenesis. Larger vessels have smooth muscle instead.',
'This was answered TRUE (wrong) in multiple versions', True),
('histo', 'HISTO', 'Thickest layer in ARTERIES vs VEINS:',
'Arteries = Tunica MEDIA (smooth muscle) | Veins = Tunica ADVENTITIA (connective tissue)',
'Arteries withstand high pressure → thick media with smooth muscle + elastic. Veins carry low-pressure blood → thick adventitia. Capillaries = only intima (endothelium + basement membrane).',
'', True),
('histo', '⭐ REPEATED', 'Lining of lymphatic vessels is composed of:',
'Simple squamous epithelium (same as blood vessel endothelium)',
'Lymphatic capillaries are lined by simple squamous endothelium with NO continuous basement membrane. They are more permeable than blood capillaries (have open intercellular junctions). Absent in CNS.',
'Wrong answers in exam: "stratified squamous" or "simple columnar"', True),
('histo', 'HISTO', 'Most immature recognizable cell in the MYELOID series:',
'Myeloblast',
'Myeloid series: Myeloblast → Promyelocyte → Myelocyte → Metamyelocyte → Band → Mature granulocyte. Granulocytes have 3 types of granules. Lymphoblast is for lymphoid series.',
'', True),
('histo', '⭐ REPEATED', 'Surfactant — what does it do to surface tension?',
'DECREASES surface tension — prevents alveolar collapse',
'Surfactant (DPPC = dipalmitoyl phosphatidylcholine) produced by TYPE II PNEUMOCYTES (septal cells). Reduces surface tension → prevents alveoli from collapsing at end of expiration. Starts forming at ~20-22 wk gestation.',
'CRITICAL: Surfactant DECREASES (not increases) surface tension', True),
('histo', '⭐ REPEATED', 'Cells found in large numbers in terminal bronchioles:',
'Clara (Club) cells',
'Club cells (formerly Clara cells): non-ciliated, dome-shaped cells in terminal bronchioles. They produce surfactant components, detoxify inhaled substances, and serve as stem cells for bronchiolar epithelium.',
'', True),
('histo', 'HISTO', 'Connective tissue of the trachea is derived from:',
'Splanchnic mesenchyme',
'Tracheal EPITHELIUM = endodermal origin. CARTILAGE and CONNECTIVE TISSUE = splanchnic mesenchyme. The trachea has C-shaped hyaline cartilage rings, incomplete posteriorly (trachealis muscle bridges the gap).',
'', True),
('histo', '⭐ REPEATED', 'Laryngotracheal diverticulum maintains communication with _____ through primordial laryngeal inlet:',
'Primordial pharynx',
'The laryngotracheal diverticulum grows from the ventral wall of the pharynx. It communicates with the pharynx through the laryngeal inlet. The tracheoesophageal septum separates it from the esophagus.',
'Wrong: "pharyngeal cavity and primordial cavity"', True),
('histo', 'HISTO', 'Primordial alveoli appear as small bulges on walls of TERMINAL bronchioles — TRUE or FALSE?',
'FALSE — they appear on walls of RESPIRATORY BRONCHIOLES and alveolar sacs',
'Terminal bronchioles → respiratory bronchioles → alveolar ducts → alveolar sacs → alveoli. Primordial alveoli appear at the alveolar stage (~36 wks to birth). After birth: ~50 million → 300 million alveoli.',
'', True),
('histo', 'HISTO', 'Olfactory neurons are replaced by basal cells every:',
'1-2 months',
'Olfactory epithelium is one of the rare sites of ongoing neurogenesis in adults. Basal (stem) cells replenish olfactory receptor neurons approximately every 1-2 months throughout life.',
'', False),
# ══════ PHYSIOLOGY ══════
('physio', '⭐ REPEATED', 'Cardiac Output (CO) formula:',
'CO = Heart Rate × Stroke Volume',
'Normal CO ≈ 5 L/min (70 bpm × 70 mL). Ejection fraction = SV/EDV × 100% (normal 55-70%). Cardiac index = CO / body surface area. Frank-Starling: ↑EDV → ↑SV → ↑CO.',
'', True),
('physio', '⭐ REPEATED', 'Cardiac conduction system — correct order:',
'SA node → AV node → Bundle of His → Bundle Branches → Purkinje fibers → Ventricles',
'SA node = pacemaker (60-100 bpm), right atrium near SVC. AV node: delays impulse 0.1s (allows atrial emptying). Bundle of His → L+R branches → Purkinje fibers (fastest: 1-4 m/s).',
'Wrong order appeared multiple times in exams', True),
('physio', '⭐ REPEATED', 'Acetylcholine causes _____ of the SA node:',
'Hyperpolarization (slows heart rate)',
'ACh (parasympathetic/vagal) → M2 receptors → opens IKACh (K+ channels) → hyperpolarization → slower pacemaker rate. Opposite effect: NE/sympathetic → opens Ca²⁺ channels → faster HR.',
'Wrong: "repolarization" or "depolarization"', True),
('physio', '⭐ REPEATED', 'Cardiac weakness is caused by deficiency of _____ in the extracellular fluid:',
'Calcium (Ca²⁺)',
'Ca²⁺ is essential for cardiac muscle contraction. Most calcium for cardiac muscle comes from the EXTRACELLULAR space (unlike skeletal muscle which mainly uses SR). Hypocalcemia → reduced contractility → weakness.',
'', True),
('physio', '⭐ REPEATED', 'Active hyperemia occurs when tissue _____ rate increases:',
'Metabolic rate',
'Active (functional) hyperemia: ↑metabolism → local vasodilatory metabolites (CO₂, adenosine, K⁺, H⁺, ↓O₂) → vasodilation → ↑blood flow. Examples: exercise-induced, post-meal GI hyperemia.',
'', True),
('physio', '⭐ REPEATED', 'Reactive and active _____ are examples of metabolic control of local blood flow:',
'Hyperemia',
'Active hyperemia = ↑flow during activity. Reactive hyperemia = ↑flow AFTER temporary occlusion (repaying oxygen debt). Both are autoregulatory. The most important factor for precapillary sphincter = oxygen level.',
'', True),
('physio', '⭐ REPEATED', 'The _____ are called capacitance vessels or blood reservoirs:',
'Veins (and venules)',
'Veins contain ~64% of total blood volume. They are highly compliant (distensible). Arteries = pressure vessels. Capillaries = exchange vessels. Arterioles = resistance vessels (control distribution).',
'', True),
('physio', '⭐ REPEATED', 'Factors that create arterial pressure:',
'Cardiac output AND Total peripheral resistance',
'MAP = CO × SVR. BP is controlled by: (1) cardiac output (HR × SV), (2) total peripheral resistance (arterioles), (3) blood volume (kidneys/RAAS). Long-term: kidneys dominate.',
'', True),
('physio', 'PHYSIO', 'According to Poiseuille\'s law, which factor has the GREATEST impact on resistance?',
'Vessel RADIUS — to the 4th power (R = 8ηL / πr⁴)',
'Halving vessel radius increases resistance 16-fold (2⁴=16). This is why small changes in arteriole diameter dramatically affect blood flow. Arterioles are the MAJOR site of resistance.',
'', True),
('physio', '⭐ REPEATED', 'Structure that opens and closes the entrance to the capillary:',
'Precapillary sphincter',
'Precapillary sphincters regulate entry of blood into individual capillary beds. Most important factor controlling them = tissue O₂ concentration (↓O₂ → sphincters open → more blood flow).',
'', True),
('physio', '⭐ REPEATED', 'During isovolumetric relaxation time (IVRT) — what state are the valves?',
'ALL valves are CLOSED (mitral AND aortic both closed)',
'IVRT = from aortic valve closure to mitral valve opening. Ventricular pressure drops rapidly but volume stays constant. Once ventricular pressure < atrial pressure, mitral opens → rapid filling begins.',
'Wrong: "mitral opens, aortic closed"', True),
('physio', '⭐ REPEATED', 'The "a" wave on atrial pressure curve is caused by:',
'Atrial contraction',
'JVP/atrial pressure waves: "a" = atrial contraction | "c" = tricuspid bulging | "x" = atrial relaxation | "v" = venous filling during ventricular systole | "y" = tricuspid valve opening.',
'', True),
('physio', '⭐ REPEATED', 'Frank-Starling law — explain:',
'Increased venous return → more EDV → more stretch → stronger contraction → increased SV',
'The heart automatically pumps whatever amount of blood it receives. Greater ventricular filling → greater stretch → greater force (up to a limit). This matches cardiac output to venous return without needing neural input.',
'', True),
('physio', '⭐ REPEATED', 'Coronary blood flow mostly occurs during:',
'DIASTOLE',
'Left coronary flow is mainly in DIASTOLE because the contracting myocardium compresses left coronary vessels during systole. Right coronary has continuous flow (less wall tension). High HR reduces diastolic time → risk of ischemia.',
'Wrong: systole', True),
('physio', '⭐ REPEATED', 'The afterload for the left ventricle equals:',
'Aortic pressure (= systemic vascular resistance)',
'Afterload = resistance against which the ventricle pumps. LV afterload = aortic pressure. RV afterload = pulmonary artery pressure. Increased afterload → ↓SV (unless contractility or preload compensates).',
'', True),
('physio', '⭐ REPEATED', 'Cardiac tamponade — does it increase cardiac output?',
'FALSE — tamponade DECREASES cardiac output',
'Pericardial fluid accumulation → compresses heart → impaired filling → ↓CO. Beck\'s triad: (1) hypotension, (2) muffled heart sounds, (3) JVD. Treatment: pericardiocentesis.',
'', True),
('physio', '⭐ REPEATED', 'Collateral flow can damage the myocardium — TRUE or FALSE?',
'FALSE — collateral flow PROTECTS the myocardium',
'Collateral vessels provide alternative pathways around blocked coronary arteries. They PROTECT the myocardium from ischemia. The more developed the collaterals, the smaller the infarct.',
'This wrong answer appeared in 4+ exam versions', True),
('physio', 'PHYSIO', 'Pulse pressure: what is it? Where is it highest?',
'Pulse pressure = Systolic – Diastolic BP. Highest in LARGE ARTERIES',
'Normal pulse pressure ≈ 40 mmHg (120-80). MAP = DBP + (PP/3) ≈ 93 mmHg. Pulse pressure dampens as blood moves peripherally (capillaries and veins have no pulsatile flow).',
'', True),
('physio', 'PHYSIO', 'What are the normal right atrial pressure values?',
'~0 mmHg (range: 0-5 mmHg)',
'Normal pressures: RA ≈ 0 mmHg | RV systolic = 25 mmHg | PA systolic = 25 mmHg | LA = 5-10 mmHg | LV systolic = 120 mmHg | Aorta = 120/80 mmHg.',
'Wrong answers: 9 mmHg, 20 mmHg', True),
('physio', '⭐ REPEATED', 'Edema may be caused by:',
'All: ↑capillary hydrostatic pressure + ↓oncotic pressure + lymphatic obstruction + ↑capillary permeability',
'Starling forces: edema when filtration > reabsorption. Causes: (1) heart failure → ↑hydrostatic P, (2) hypoalbuminemia → ↓oncotic P, (3) lymphedema, (4) inflammation → ↑permeability.',
'', True),
('physio', '⭐ REPEATED', 'Lymph capillaries differ from systemic blood capillaries in that they:',
'Are absent in the CNS (also: no basement membrane, blind-ended, more permeable)',
'Lymph capillaries are absent in: CNS, bone marrow, cartilage, cornea. They are blind-ended tubes that pick up excess interstitial fluid and return it to circulation.',
'', True),
('physio', 'PHYSIO', 'What does the PR interval on ECG represent?',
'AV nodal conduction time (onset of atrial depolarization to onset of ventricular depolarization)',
'Normal PR = 0.12-0.20 sec. Prolonged PR = 1st degree AV block (AV node damage). Short PR = WPW syndrome (accessory pathway bypasses AV node). PR interval prolonged by vagal stimulation.',
'', True),
('physio', 'PHYSIO', 'Vagal stimulation of the SA node — what happens to Ca²⁺ influx?',
'FALSE — vagal stimulation DECREASES Ca²⁺ influx (and increases K⁺ permeability → slows HR)',
'Parasympathetic → ACh → M2 receptors → ↑K⁺ permeability → hyperpolarization → slows SA node. Sympathetic → NE → β1 → ↑Ca²⁺/funny channel activity → faster HR.',
'Wrong: "increases Ca²⁺ influx"', True),
('physio', 'PHYSIO', 'Norepinephrine stimulates _____ receptors to affect heart rate:',
'Beta-1 (β1) adrenergic receptors',
'β1 in heart: NE/Epi → ↑HR (chronotropy), ↑contractility (inotropy), ↑conduction (dromotropy). β2 in lungs/vessels: bronchodilation, vasodilation. α1 in vessels: vasoconstriction.',
'Wrong: "alpha-1, alpha-2" or "chemoreceptors"', True),
('physio', 'PHYSIO', 'Velocity of blood flow is SLOWEST in:',
'Capillaries (because they have the LARGEST total cross-sectional area)',
'Velocity ∝ 1/cross-sectional area. Aorta = smallest CSA → fastest. Capillaries = largest total CSA → slowest. Slow capillary flow = maximum time for gas and nutrient exchange.',
'', True),
('physio', '⭐ REPEATED', 'Peripheral chemoreceptors are located in the carotid SINUS and aortic arch — TRUE or FALSE?',
'FALSE — they are in the CAROTID BODY (not sinus) and AORTIC BODIES',
'Peripheral chemoreceptors (O₂ sensors): carotid BODY and aortic BODIES. Carotid SINUS = BARORECEPTOR (senses pressure). Central chemoreceptors = brainstem, sense CO₂/pH (not O₂).',
'', True),
('physio', 'PHYSIO', 'The smaller the alveolus, the _____ the alveolar pressure from surface tension:',
'GREATER (Law of Laplace: P = 2T/r — smaller radius = greater pressure)',
'By Laplace\'s law, smaller alveoli would collapse into larger ones without surfactant. Surfactant reduces surface tension MORE in smaller alveoli (it concentrates more), stabilizing alveolar size.',
'', True),
('physio', 'PHYSIO', 'Most CO₂ (~70%) is removed from tissues as:',
'Bicarbonate ions (HCO₃⁻)',
'CO₂ transport: 70% as HCO₃⁻ (CO₂ + H₂O → H₂CO₃ → H⁺ + HCO₃⁻, catalyzed by carbonic anhydrase), 23% bound to hemoglobin (carbaminohemoglobin), 7% dissolved in plasma.',
'', True),
('physio', 'PHYSIO', 'How to distinguish pericarditis from MI?',
'Pericarditis pain is RELIEVED by sitting/leaning FORWARD. MI pain is not.',
'Pericarditis: sharp, pleuritic pain, worse lying flat, relieved leaning forward. MI: crushing, pressure-like, radiates to L arm/jaw. Pericarditis has friction rub; MI has no friction rub.',
'', True),
('physio', 'PHYSIO', 'Cardiac pain can irradiate to:',
'Back, left arm (or right arm), jaw',
'Referred cardiac pain follows dermatomes T1-T4. It can radiate to: left arm (most classic), jaw, neck, back, right arm. This is due to convergence of visceral and somatic afferent fibers in the spinal cord.',
'', True),
]
# ── colour mapping ────────────────────────────────────────────────────────────
def card_colors(cat):
if cat == 'anatomy':
return C_NAVY, C_SKY, C_BLUE, 'ANATOMY'
elif cat == 'histo':
return C_PURPLE, C_LAVENDER, C_PURPLE, 'HISTO / EMBRYO'
elif cat == 'physio':
return C_TEAL, C_TEAL_LT, C_TEAL, 'PHYSIOLOGY'
else:
return C_ORANGE, C_YELLOW, C_ORANGE, 'MIXED'
# ── PDF build ─────────────────────────────────────────────────────────────────
def make_pdf(cards, out_path):
doc = SimpleDocTemplate(
out_path, pagesize=A4,
leftMargin=MARGIN, rightMargin=MARGIN,
topMargin=MARGIN, bottomMargin=MARGIN,
title='Human Body Finals — Flashcard Deck',
author='Orris AI'
)
story = []
# ── COVER ────────────────────────────────────────────────────────────────
cover_bg = colors.HexColor('#0D2B4E')
cover_acc = colors.HexColor('#1E6BB8')
cover_tab = Table(
[[Paragraph('🃏 HUMAN BODY SYSTEMS', sTitle)],
[Paragraph('FINALS FLASHCARD DECK', S('cSub', fontSize=18, textColor=colors.HexColor('#90CAF9'),
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=22))],
[Spacer(1, 0.3*cm)],
[Paragraph('Anatomy • Histology & Embryology • Physiology', sSub)],
[Spacer(1, 0.2*cm)],
[Paragraph(f'{len(cards)} High-Yield Flashcards • ⭐ = Repeated on multiple exams', sSub)],
[Spacer(1, 0.5*cm)],
[Paragraph('📋 HOW TO USE', S('htuH', fontSize=12, textColor=C_STAR, fontName='Helvetica-Bold', alignment=TA_CENTER, leading=16))],
[Paragraph('Read the QUESTION, cover the answer, test yourself.\nGreen box = Answer • Grey box = Explanation\n⭐ REPEATED cards are highest priority for finals!',
S('htuB', fontSize=10, textColor=colors.HexColor('#B0C8E8'), fontName='Helvetica', alignment=TA_CENTER, leading=14))],
],
colWidths=[PAGE_W - 2*MARGIN],
)
cover_tab.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), cover_bg),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 20),
('RIGHTPADDING', (0,0), (-1,-1), 20),
('ROUNDEDCORNERS', (0,0), (-1,-1), [8,8,8,8]),
('LINEABOVE', (0,1),(0,1), 1, cover_acc),
('LINEABOVE', (0,7),(0,7), 1, cover_acc),
]))
story.append(cover_tab)
story.append(Spacer(1, 0.4*cm))
# colour legend
legend_data = [
[Paragraph('🟦 ANATOMY', S('la', fontSize=9, textColor=C_NAVY, fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph('🟪 HISTO / EMBRYO', S('lh', fontSize=9, textColor=C_PURPLE, fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph('🟩 PHYSIOLOGY', S('lp', fontSize=9, textColor=C_TEAL, fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph('⭐ = Repeated exam question', S('lr', fontSize=9, textColor=C_ORANGE, fontName='Helvetica-Bold', alignment=TA_CENTER))],
]
leg_tab = Table(legend_data, colWidths=[(PAGE_W-2*MARGIN)/4]*4)
leg_tab.setStyle(TableStyle([
('BACKGROUND', (0,0),(0,0), C_SKY),
('BACKGROUND', (1,0),(1,0), C_LAVENDER),
('BACKGROUND', (2,0),(2,0), C_TEAL_LT),
('BACKGROUND', (3,0),(3,0), C_YELLOW),
('BOX', (0,0),(-1,-1), 0.5, C_LITE),
('INNERGRID', (0,0),(-1,-1), 0.5, C_LITE),
('TOPPADDING', (0,0),(-1,-1), 5),
('BOTTOMPADDING', (0,0),(-1,-1), 5),
]))
story.append(leg_tab)
story.append(PageBreak())
# ── CARDS ────────────────────────────────────────────────────────────────
CARDS_PER_PAGE = 3
card_w = PAGE_W - 2*MARGIN
for i, (cat, tag, question, answer, explanation, wrong, repeated) in enumerate(cards):
hdr_c, bg_c, acc_c, cat_label = card_colors(cat)
# ── card number badge ─────────────────────────────────────────────
num_cell = Table([[Paragraph(f'{i+1}', sNum)]], colWidths=[1.1*cm], rowHeights=[1.1*cm])
num_cell.setStyle(TableStyle([
('BACKGROUND', (0,0),(-1,-1), hdr_c),
('VALIGN', (0,0),(-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0),(-1,-1), 0),
('BOTTOMPADDING', (0,0),(-1,-1), 0),
('ROUNDEDCORNERS', (0,0),(-1,-1), [6,6,0,0]),
]))
# ── category tag ───────────────────────────────────────────────────
tag_text = f'{tag}' if repeated else cat_label
tag_style = sTag if tag.startswith('⭐') else S(f'tagS{i}', fontSize=8, textColor=hdr_c,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=10)
tag_bg = hdr_c if tag.startswith('⭐') else bg_c
tag_cell = Table([[Paragraph(tag_text, sTag if tag.startswith('⭐') else sTagDark)]],
colWidths=[card_w - 1.1*cm - 0.2*cm])
tag_cell.setStyle(TableStyle([
('BACKGROUND', (0,0),(-1,-1), hdr_c if tag.startswith('⭐') else bg_c),
('TOPPADDING', (0,0),(-1,-1), 4),
('BOTTOMPADDING', (0,0),(-1,-1), 4),
('ROUNDEDCORNERS', (0,0),(-1,-1), [0,6,0,0]),
]))
header_row = Table([[num_cell, Spacer(0.2*cm, 1), tag_cell]],
colWidths=[1.1*cm, 0.2*cm, card_w - 1.3*cm])
header_row.setStyle(TableStyle([
('VALIGN', (0,0),(-1,-1), 'TOP'),
('LEFTPADDING', (0,0),(-1,-1), 0),
('RIGHTPADDING', (0,0),(-1,-1), 0),
('TOPPADDING', (0,0),(-1,-1), 0),
('BOTTOMPADDING', (0,0),(-1,-1), 0),
]))
# ── question ──────────────────────────────────────────────────────
q_para = Paragraph(f'<b>Q:</b> {question}', sCardQ)
q_cell = Table([[q_para]], colWidths=[card_w])
q_cell.setStyle(TableStyle([
('BACKGROUND', (0,0),(-1,-1), C_WHITE),
('TOPPADDING', (0,0),(-1,-1), 8),
('BOTTOMPADDING', (0,0),(-1,-1), 8),
('LEFTPADDING', (0,0),(-1,-1), 10),
('RIGHTPADDING', (0,0),(-1,-1), 10),
('LINEBELOW', (0,0),(-1,-1), 1.5, acc_c),
]))
# ── answer ────────────────────────────────────────────────────────
a_para = Paragraph(f'<b>✔ {answer}</b>', sCardA)
a_rows = [[a_para]]
if wrong:
a_rows.append([Paragraph(f'✗ {wrong}', sCardWrong)])
if explanation:
a_rows.append([Spacer(1, 2)])
a_rows.append([Paragraph(explanation, sCardExp)])
a_cell = Table(a_rows, colWidths=[card_w])
a_cell.setStyle(TableStyle([
('BACKGROUND', (0,0),(-1,-1), C_LIME if cat != 'physio' else C_TEAL_LT),
('TOPPADDING', (0,0),(-1,-1), 7),
('BOTTOMPADDING', (0,0),(-1,-1), 7),
('LEFTPADDING', (0,0),(-1,-1), 10),
('RIGHTPADDING', (0,0),(-1,-1), 10),
]))
# ── assemble card ─────────────────────────────────────────────────
card = Table(
[[header_row], [q_cell], [a_cell]],
colWidths=[card_w],
)
card.setStyle(TableStyle([
('BOX', (0,0),(-1,-1), 1.5, acc_c),
('TOPPADDING', (0,0),(-1,-1), 0),
('BOTTOMPADDING', (0,0),(-1,-1), 0),
('LEFTPADDING', (0,0),(-1,-1), 0),
('RIGHTPADDING', (0,0),(-1,-1), 0),
('ROUNDEDCORNERS', (0,0),(-1,-1), [8,8,8,8]),
]))
story.append(KeepTogether([card]))
story.append(Spacer(1, 0.55*cm))
# ── BACK COVER ────────────────────────────────────────────────────────────
story.append(PageBreak())
back = Table(
[[Paragraph('🏁 STUDY TIPS FOR FINALS', S('bT', fontSize=16, textColor=C_WHITE,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=20))],
[Paragraph('''
<b>⭐ Highest priority cards:</b> Any card with ⭐ REPEATED appeared in 3–4 exam versions. Master these first.<br/><br/>
<b>🔑 Common traps to avoid:</b><br/>
• Surfactant <b>DECREASES</b> (NOT increases) surface tension<br/>
• Heart chambers partition in weeks <b>5–8</b> (NOT week 4)<br/>
• Anterior cardiac veins drain into <b>right atrium</b> (NOT coronary sinus)<br/>
• Basilic vein is <b>superficial</b> (NOT deep)<br/>
• Right subclavian arises from <b>brachiocephalic trunk</b> (NOT aorta directly)<br/>
• Pericytes are only in <b>capillaries/venules</b> (NOT all vessels)<br/>
• Collateral flow <b>PROTECTS</b> the myocardium (does NOT damage it)<br/>
• Left bronchus: <b>longer, narrower, more horizontal</b> (right = wider, more vertical)<br/>
• Ciliated pseudostratified epithelium in bronchioles = <b>FALSE</b><br/>
• Peripheral chemoreceptors = carotid <b>BODY</b> (not sinus — sinus is a baroreceptor!)<br/>
• Cardiac tamponade <b>DECREASES</b> cardiac output (not increases)<br/>
• IMA branches: left colic, sigmoid, superior rectal — <b>NOT</b> right colic (that's SMA)<br/><br/>
<b>🩺 Murmurs quick ref:</b><br/>
Mitral: <b>apex, 5th ICS, midclavicular</b> | Aortic: <b>2nd ICS right sternal border</b><br/>
Pericarditis pain: relieved by <b>sitting/leaning forward</b><br/><br/>
<b>📐 Numbers to remember:</b><br/>
Normal BP = <b>120/80</b> | Right atrial pressure = <b>~0 mmHg</b> | RV systolic = <b>25 mmHg</b><br/>
Trachea = C6–T4 | Bifurcation = T4/T5 | Thoracic duct from = T12/L2<br/>
Lung lobes: Right = <b>3</b>, Left = <b>2</b>
''', S('bB', fontSize=9.5, textColor=colors.HexColor('#D0E8FF'),
fontName='Helvetica', alignment=TA_LEFT, leading=14, spaceBefore=0, spaceAfter=0))],
],
colWidths=[PAGE_W - 2*MARGIN],
)
back.setStyle(TableStyle([
('BACKGROUND', (0,0),(-1,-1), colors.HexColor('#0D2B4E')),
('TOPPADDING', (0,0),(-1,-1), 12),
('BOTTOMPADDING', (0,0),(-1,-1), 12),
('LEFTPADDING', (0,0),(-1,-1), 20),
('RIGHTPADDING', (0,0),(-1,-1), 20),
('LINEBELOW', (0,0),(0,0), 1, colors.HexColor('#1E6BB8')),
('ROUNDEDCORNERS', (0,0),(-1,-1), [8,8,8,8]),
]))
story.append(back)
doc.build(story)
print(f'Done: {out_path}')
make_pdf(CARDS, OUTPUT)
cd /tmp/workspace/finals-study-guide && python3 make_flashcards.py 2>&1
ls -lh /tmp/workspace/finals-study-guide/FLASHCARD_DECK.pdf
FLASHCARD DECK
PDF Document · PDF
| Colour | Subject | Cards |
|---|---|---|
| 🟦 Navy/Blue | Anatomy | 28 cards |
| 🟪 Purple/Lavender | Histology & Embryology | 20 cards |
| 🟩 Teal/Green | Physiology | 17 cards |
Generate a practice exam quiz with the highest-yield questions in random order
ls /tmp/workspace/finals-study-guide/
~/finals-study-guide/make_exam.py
import random
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, KeepTogether, HRFlowable
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT, TA_JUSTIFY
OUTPUT_EXAM = '/tmp/workspace/finals-study-guide/PRACTICE_EXAM.pdf'
PAGE_W, PAGE_H = A4
MARGIN = 1.8*cm
random.seed(42) # reproducible shuffle
# ── palette ──────────────────────────────────────────────────────────────────
C_NAVY = colors.HexColor('#1A3F6F')
C_BLUE = colors.HexColor('#1E6BB8')
C_SKY = colors.HexColor('#DFF0FF')
C_GREEN = colors.HexColor('#1F6B2E')
C_LIME = colors.HexColor('#EBF8EE')
C_RED = colors.HexColor('#B30000')
C_PINK = colors.HexColor('#FFF0F0')
C_ORANGE = colors.HexColor('#C05000')
C_YELLOW = colors.HexColor('#FFF8DC')
C_PURPLE = colors.HexColor('#4A007A')
C_LAV = colors.HexColor('#F3EEFF')
C_TEAL = colors.HexColor('#005F58')
C_TEAL_L = colors.HexColor('#E0F5F3')
C_GREY = colors.HexColor('#F5F5F5')
C_DARK = colors.HexColor('#1A1A1A')
C_MID = colors.HexColor('#555555')
C_LITE = colors.HexColor('#DDDDDD')
C_WHITE = colors.white
C_GOLD = colors.HexColor('#B8860B')
def S(name, **kw):
s = ParagraphStyle(name, parent=getSampleStyleSheet()['Normal'], **kw)
return s
# subject tag colours
SUBJ_COLORS = {
'A': (C_NAVY, C_SKY, 'ANATOMY'),
'H': (C_PURPLE, C_LAV, 'HISTO/EMB'),
'P': (C_TEAL, C_TEAL_L,'PHYSIOLOGY'),
}
# ── QUESTION BANK ─────────────────────────────────────────────────────────────
# Each entry:
# (subject, qtype, stem, options_list, correct_letter, explanation, is_repeated)
# qtype = 'mcq' | 'tf' | 'fill' (fill = short answer; rendered as MCQ with 4 plausible choices)
# For tf: options = ['True','False'], correct = 'A' or 'B'
QUESTIONS = [
# ══════════ ANATOMY ══════════
('A','mcq',
'Blood leaving the LEFT VENTRICLE passes through which valve?',
['A) Bicuspid (mitral) valve',
'B) Tricuspid valve',
'C) Aortic semilunar valve',
'D) Pulmonary semilunar valve'],
'C',
'The LV ejects oxygenated blood into the AORTA via the AORTIC SEMILUNAR valve. The mitral valve sits BETWEEN LA and LV — it does not receive outflow from the LV.',
True),
('A','mcq',
'Which vein does NOT drain into the coronary sinus?',
['A) Great cardiac vein',
'B) Middle cardiac vein',
'C) Anterior cardiac veins',
'D) Small cardiac vein'],
'C',
'Anterior cardiac veins drain DIRECTLY into the right atrium, bypassing the coronary sinus. All other major cardiac veins (great, middle, small, oblique, posterior) drain into the coronary sinus.',
True),
('A','mcq',
'The tricuspid valve has 3 cusps named:',
['A) Superior, inferior, and medial',
'B) Anterior, posterior, and lateral',
'C) Anterior, septal, and posterior',
'D) Medial, lateral, and posterior'],
'C',
'RIGHT AV valve (tricuspid) = anterior, septal, posterior cusps. LEFT AV valve (mitral) = 2 cusps: anterior + posterior. The pulmonary semilunar valve cusps = left, right, anterior.',
True),
('A','tf',
'The epicardium is the same as the visceral layer of serous pericardium.',
['A) True', 'B) False'],
'A',
'Epicardium = visceral pericardium. It directly covers the heart. Layers outside → in: fibrous pericardium → parietal serous → pericardial cavity → visceral serous (= epicardium).',
True),
('A','mcq',
'The atrioventricular valves cannot be inverted during ventricular systole because of the attachment of:',
['A) Interventricular septum',
'B) Chordae tendineae',
'C) Cardiac fibrous skeleton',
'D) Pectinate muscles'],
'B',
'Chordae tendineae connect AV valve cusps to papillary muscles, preventing inversion (prolapse) into the atria during systole. The fibrous skeleton prevents OVERDILATION of valve openings — a separate function.',
True),
('A','mcq',
'Which structure is NOT found in the middle mediastinum?',
['A) Heart and pericardium',
'B) Ascending aorta',
'C) Thymus',
'D) Phrenic nerves'],
'C',
'The THYMUS is in the ANTERIOR mediastinum (major structure in children). The middle mediastinum contains: heart + pericardium, ascending aorta, SVC, IVC, pulmonary trunk/veins, phrenic nerves.',
True),
('A','mcq',
'The trachea bifurcates at which vertebral level?',
['A) C6',
'B) T1/T2',
'C) T4/T5 (sternal angle)',
'D) T8'],
'C',
'Trachea bifurcates at T4/T5 = sternal angle (angle of Louis). The carina is the internal ridge at this point. Trachea starts at C6 (below cricoid cartilage). Range = C6 to T4.',
True),
('A','mcq',
'Compared to the RIGHT main bronchus, the LEFT main bronchus is:',
['A) Shorter, wider, and more vertical',
'B) Shorter, narrower, and more horizontal',
'C) Longer, narrower, and more horizontal',
'D) Longer, wider, and more vertical'],
'C',
'Left bronchus: longer, narrower, ~45° angle (horizontal). Right: shorter, wider, ~25° angle (vertical). Because right is wider + more vertical → inhaled foreign bodies lodge in right bronchus more commonly.',
True),
('A','tf',
'Ciliated pseudostratified columnar epithelium is found in bronchioles.',
['A) True', 'B) False'],
'B',
'Ciliated pseudostratified columnar epithelium = trachea and larger BRONCHI, NOT bronchioles. Bronchioles have simple columnar/cuboidal with CLARA (Club) cells. No cartilage in bronchioles either.',
True),
('A','mcq',
'The space between the visceral and parietal pleura is known as the:',
['A) Pericardial cavity',
'B) Peritoneal cavity',
'C) Mediastinum',
'D) Pleural cavity'],
'D',
'The pleural cavity is the potential space between visceral (covers lung) and parietal (lines thoracic wall) pleura. Contains a small amount of serous fluid. Air entry = PNEUMOTHORAX.',
True),
('A','mcq',
'The largest cartilage of the larynx is the:',
['A) Cricoid cartilage',
'B) Thyroid cartilage',
'C) Epiglottis',
'D) Arytenoid cartilage'],
'B',
'Thyroid cartilage is the LARGEST laryngeal cartilage (forms the "Adam\'s apple"). Cricoid = only complete ring, directly below thyroid. Epiglottis = elastic cartilage. Arytenoids = paired, have vocal + muscular processes.',
True),
('A','mcq',
'Which type of tissue makes up the epiglottis?',
['A) Hyaline cartilage',
'B) Fibrocartilage',
'C) Elastic cartilage',
'D) Dense fibrous connective tissue'],
'C',
'Epiglottis = ELASTIC cartilage (flexible, springs back). The thyroid, cricoid, and most of arytenoid cartilages = HYALINE cartilage. The corniculate and cuneiform cartilages are also elastic.',
True),
('A','mcq',
'The left brachiocephalic vein is formed by the confluence of which two veins?',
['A) Left subclavian + Left internal jugular',
'B) Right subclavian + Right internal jugular',
'C) Left subclavian + Left external jugular',
'D) Left common carotid + Left subclavian'],
'A',
'Both brachiocephalic veins = subclavian + IJV on each side. The LEFT brachiocephalic crosses the superior mediastinum HORIZONTALLY to join the right brachiocephalic → forming the SVC.',
True),
('A','tf',
'The right subclavian artery arises directly from the aortic arch.',
['A) True', 'B) False'],
'B',
'The RIGHT subclavian arises from the BRACHIOCEPHALIC TRUNK (which arises from the aortic arch). The LEFT subclavian artery arises DIRECTLY from the aortic arch. The brachiocephalic trunk gives: right subclavian + right CCA.',
True),
('A','mcq',
'The azygos vein terminates by draining into the:',
['A) Inferior vena cava',
'B) Right brachiocephalic vein',
'C) Superior vena cava',
'D) Pulmonary veins'],
'C',
'The azygos vein ascends on the RIGHT side of the vertebral column, arches over the right main bronchus at T4, and drains into the SVC. It drains the thoracic wall. The hemiazygos drains the left lower thoracic wall.',
True),
('A','mcq',
'Splitting of the aortic intima from the media is called:',
['A) Aortic aneurysm',
'B) Aortic dissection',
'C) Aortic stenosis',
'D) Aortic coarctation'],
'B',
'Aortic dissection = intimal tear → blood enters the aortic wall, creating a false lumen. Stanford A: ascending aorta (surgical emergency). Stanford B: descending aorta (medical management). Risk: Marfan syndrome, hypertension.',
True),
('A','mcq',
'Which of the following is NOT a branch of the inferior mesenteric artery?',
['A) Left colic artery',
'B) Sigmoid arteries',
'C) Right colic artery',
'D) Superior rectal artery'],
'C',
'IMA branches: left colic, sigmoid arteries, superior rectal. RIGHT COLIC is a branch of the SUPERIOR MESENTERIC ARTERY (SMA). IMA supplies hindgut derivatives: descending colon, sigmoid, rectum, upper anal canal.',
True),
('A','mcq',
'The celiac trunk divides into three major branches. Which of the following is one of them?',
['A) Inferior mesenteric artery',
'B) Superior mesenteric artery',
'C) Splenic artery',
'D) Renal artery'],
'C',
'Celiac trunk (T12) = left gastric + splenic + common hepatic arteries. Supplies FOREGUT. IMA (L3) and SMA (L1) are SEPARATE branches of the abdominal aorta — NOT branches of the celiac trunk.',
True),
('A','mcq',
'The internal iliac artery branch that supplies the uterus is the:',
['A) Ovarian artery',
'B) Obturator artery',
'C) Uterine artery',
'D) Vaginal artery'],
'C',
'Uterine artery = branch of the anterior division of the internal iliac. It crosses the ureter ("water under the bridge") — key landmark in hysterectomy to avoid ureteric injury.',
True),
('A','mcq',
'At the apex of the cubital fossa, the brachial artery divides into:',
['A) Radial and median arteries',
'B) Ulnar and axillary arteries',
'C) Radial and ulnar arteries',
'D) Anterior and posterior interosseous arteries'],
'C',
'The brachial artery (in the ANTERIOR compartment of the arm) bifurcates at the apex of the cubital fossa into the RADIAL (lateral) and ULNAR (medial) arteries. Its pulse is used for blood pressure measurement.',
True),
('A','tf',
'The basilic vein is considered a deep vein of the upper limb.',
['A) True', 'B) False'],
'B',
'The basilic vein is a SUPERFICIAL vein on the MEDIAL side of the arm/forearm. The cephalic vein is superficial on the LATERAL side. Deep veins of the arm = brachial, axillary veins.',
True),
('A','mcq',
'Which artery passes through the anatomical snuffbox?',
['A) Ulnar artery',
'B) Brachial artery',
'C) Radial artery',
'D) Anterior interosseous artery'],
'C',
'The radial artery crosses the floor of the anatomical snuffbox (floor = scaphoid + trapezium). The radial pulse can be palpated here. The Allen test checks patency of radial and ulnar arteries.',
True),
('A','mcq',
'In a fracture of the midshaft of the humerus, which artery is most likely injured?',
['A) Axillary artery',
'B) Anterior circumflex humeral artery',
'C) Profunda brachii artery',
'D) Ulnar artery'],
'C',
'The profunda brachii (deep brachial artery) and the RADIAL NERVE travel together in the radial groove (spiral groove) of the humerus. Midshaft fracture → radial nerve palsy + profunda brachii injury.',
True),
('A','mcq',
'In the posterior mediastinum, which structure is most closely applied to the posterior surface of the pericardial sac?',
['A) Descending thoracic aorta',
'B) Thoracic duct',
'C) Esophagus',
'D) Azygos vein'],
'C',
'The esophagus lies directly posterior to the left atrium/pericardial sac. This anatomical relationship is why transesophageal echocardiography (TEE) provides excellent views of the left atrium.',
True),
('A','mcq',
'All structures are seen in the superior mediastinum EXCEPT:',
['A) Left recurrent laryngeal nerve',
'B) Trachea',
'C) Right recurrent laryngeal nerve',
'D) Esophagus'],
'C',
'The RIGHT RLN hooks around the right subclavian artery at the ROOT OF THE NECK — it does NOT descend into the superior mediastinum. The LEFT RLN hooks under the aortic arch inside the superior mediastinum.',
True),
# ══════════ HISTOLOGY / EMBRYOLOGY ══════════
('H','mcq',
'The cardiovascular system begins to develop during:',
['A) First week',
'B) Third week',
'C) Fifth week',
'D) Eighth week'],
'B',
'The CV system is one of the FIRST organ systems to develop. The heart tube forms at ~day 18-19. The heart begins to beat at day ~21 (week 3). Septation into 4 chambers occurs weeks 5-8.',
True),
('H','tf',
'The primitive heart is partitioned into four separate chambers during the fourth week of development.',
['A) True', 'B) False'],
'B',
'The heart TUBE forms in weeks 3-4 and undergoes LOOPING in week 4. SEPTATION (creating 4 chambers) occurs weeks 5-8, completed at the end of the 8th week. Do NOT confuse tube formation with chamber septation.',
True),
('H','mcq',
'Which two parts of the primitive heart tube form the OUTFLOW TRACT?',
['A) Sinus venosus and primitive atrium',
'B) Primitive ventricle and sinus venosus',
'C) Bulbus cordis and truncus arteriosus',
'D) Primitive atrium and bulbus cordis'],
'C',
'Primitive heart tube (cranio-caudal): TRUNCUS ARTERIOSUS → BULBUS CORDIS → Primitive ventricle → Primitive atrium → Sinus venosus. Spiral septation of the truncus/bulbus creates the aorta and pulmonary trunk.',
True),
('H','mcq',
'The fetal left atrium is mainly derived from the:',
['A) Sinus venosus',
'B) Primitive pulmonary vein',
'C) Common cardinal vein',
'D) Bulbus cordis'],
'B',
'The LA is mainly formed by incorporation of the PRIMITIVE PULMONARY VEIN and its branches into the posterior atrial wall. The RIGHT ATRIUM derives mainly from the right horn of the sinus venosus.',
True),
('H','mcq',
'The fetal shunt between the pulmonary trunk and aorta is the:',
['A) Foramen ovale',
'B) Ductus venosus',
'C) Ductus arteriosus',
'D) Umbilical vein'],
'C',
'Ductus arteriosus connects pulmonary trunk to aortic arch → bypasses fetal (non-functional) lungs. After birth, it closes and becomes the LIGAMENTUM ARTERIOSUM. Embryonic origin = 6th pharyngeal arch artery.',
True),
('H','mcq',
'After birth, the ductus venosus becomes the:',
['A) Ligamentum arteriosum',
'B) Medial umbilical ligament',
'C) Ligamentum teres hepatis',
'D) Ligamentum venosum'],
'D',
'Fetal structure → adult remnant: ductus arteriosus → ligamentum ARTERIOSUM | ductus venosus → ligamentum VENOSUM | umbilical arteries → medial umbilical ligaments | umbilical vein → lig. TERES HEPATIS.',
True),
('H','mcq',
'The foramen ovale closes after birth because:',
['A) The ductus arteriosus closes first',
'B) Left atrial pressure exceeds right atrial pressure',
'C) The lungs deflate and reduce pulmonary pressure',
'D) Aldosterone causes fluid retention'],
'B',
'At birth: lungs expand → pulmonary resistance drops → LA pressure rises above RA pressure → pushes septum primum against septum secundum → FO closes functionally. Anatomical closure may take weeks to months.',
True),
('H','mcq',
'Each of the following statements is correctly paired EXCEPT:',
['A) Ductus arteriosus → ligamentum arteriosum',
'B) Right umbilical vein → definitive umbilical vein',
'C) Umbilical arteries → medial umbilical ligaments',
'D) Ductus venosus → ligamentum venosum'],
'B',
'The RIGHT umbilical vein REGRESSES early in development. The LEFT umbilical vein persists as the definitive umbilical vein. After birth: left umbilical vein → ligamentum teres hepatis (in the falciform ligament).',
True),
('H','mcq',
'The left 4th aortic arch artery develops into the:',
['A) Right subclavian artery',
'B) Common carotid artery',
'C) Ductus arteriosus',
'D) Arch of the aorta'],
'D',
'4th arch LEFT → ARCH OF THE AORTA. 4th arch RIGHT → right subclavian artery. 6th arch LEFT → ductus arteriosus. 3rd arch → common carotid + ICA. 1st arch → maxillary artery.',
True),
('H','tf',
'The internal surface of all components of the cardiovascular system is lined by simple squamous epithelium.',
['A) True', 'B) False'],
'A',
'All blood vessels, lymphatics, and heart chambers are lined by ENDOTHELIUM — a monolayer of simple squamous epithelial cells. Endothelium regulates vasomotor tone, prevents thrombosis, and controls permeability.',
True),
('H','tf',
'Pericytes are found in the wall of ALL blood vessels.',
['A) True', 'B) False'],
'B',
'Pericytes are associated specifically with CAPILLARIES and postcapillary VENULES — NOT all vessels. Larger vessels have smooth muscle cells in their tunica media. Pericytes regulate capillary diameter and support angiogenesis.',
True),
('H','mcq',
'The thickest layer in the wall of ARTERIES is the:',
['A) Tunica intima',
'B) Tunica media',
'C) Tunica adventitia',
'D) Basement membrane'],
'B',
'ARTERIES: thickest = tunica MEDIA (smooth muscle + elastic fibers) — resists high pressure. VEINS: thickest = tunica ADVENTITIA (connective tissue). Capillaries = only tunica intima (endothelium + basement membrane).',
True),
('H','mcq',
'The lining of lymphatic vessels is composed of which cell type?',
['A) Stratified squamous epithelium',
'B) Simple columnar epithelium',
'C) Pseudostratified columnar epithelium',
'D) Simple squamous epithelium'],
'D',
'Lymphatic vessels are lined by SIMPLE SQUAMOUS endothelium (same lineage as blood vessel endothelium). They have NO continuous basement membrane, making them more permeable. Absent in CNS, bone marrow, cartilage, cornea.',
True),
('H','mcq',
'The most immature recognizable cell in the myeloid series is the:',
['A) Metamyelocyte',
'B) Myelocyte',
'C) Promyelocyte',
'D) Myeloblast'],
'D',
'Myeloid development: MYELOBLAST → Promyelocyte → Myelocyte → Metamyelocyte → Band cell → Mature granulocyte. The myeloblast is the first recognizable committed myeloid cell by morphology.',
True),
('H','tf',
'Pulmonary surfactant prevents alveolar collapse by INCREASING surface tension.',
['A) True', 'B) False'],
'B',
'Surfactant DECREASES (REDUCES) surface tension of the fluid lining alveoli — this prevents collapse. It is produced by TYPE II PNEUMOCYTES (septal cells). Deficiency causes RDS (hyaline membrane disease) in premature infants.',
True),
('H','mcq',
'Which cells are found in large numbers in the terminal bronchioles?',
['A) Type I pneumocytes',
'B) Goblet cells',
'C) Clara (Club) cells',
'D) Alveolar macrophages'],
'C',
'Clara cells (Club cells): non-ciliated, dome-shaped cells in terminal bronchioles. They produce surfactant-like compounds, detoxify inhaled substances, and act as progenitor stem cells for bronchiolar epithelium.',
True),
('H','mcq',
'The connective tissue of the trachea is derived from:',
['A) Surface ectoderm',
'B) Paraxial mesoderm',
'C) Neural crest cells',
'D) Splanchnic mesenchyme'],
'D',
'Tracheal EPITHELIUM = endodermal. CARTILAGE and CONNECTIVE TISSUE = splanchnic mesenchyme (splanchnic lateral plate mesoderm). This is the same origin as gut smooth muscle and connective tissue.',
True),
('H','mcq',
'The laryngotracheal diverticulum maintains communication with what structure through the primordial laryngeal inlet?',
['A) Esophagus',
'B) Primordial pharynx',
'C) Sinus venosus',
'D) Foregut'],
'B',
'The laryngotracheal diverticulum grows from the ventral wall of the PRIMORDIAL PHARYNX. It maintains communication through the laryngeal inlet. The tracheoesophageal septum separates it from the esophagus dorsally.',
True),
('H','tf',
'Before birth, the primordial alveoli appear as small bulges on the walls of terminal bronchioles.',
['A) True', 'B) False'],
'B',
'Primordial alveoli appear as bulges on walls of RESPIRATORY BRONCHIOLES and alveolar SACS (NOT terminal bronchioles). They develop in the alveolar stage (~36 weeks to birth). Alveoli multiply rapidly after birth.',
True),
# ══════════ PHYSIOLOGY ══════════
('P','mcq',
'The correct formula for calculating cardiac output is:',
['A) CO = Stroke volume ÷ Heart rate',
'B) CO = Heart rate × Stroke volume',
'C) CO = End-diastolic volume − End-systolic volume',
'D) CO = Blood pressure ÷ Vascular resistance'],
'B',
'CO = HR × SV. Normal ≈ 5 L/min (70 bpm × 70 mL). SV = EDV − ESV. Ejection fraction = SV/EDV × 100% (normal 55-70%). Cardiac index = CO / body surface area.',
True),
('P','mcq',
'The correct sequence of the cardiac conduction system is:',
['A) AV node → SA node → Bundle of His → Purkinje fibers',
'B) SA node → AV node → Bundle of His → Bundle branches → Purkinje fibers',
'C) SA node → Bundle of His → AV node → Purkinje fibers',
'D) SA node → AV node → Purkinje fibers → Bundle of His'],
'B',
'SA node (60-100 bpm) → AV node (delays ~0.1 sec) → Bundle of His → Left + Right bundle branches → Purkinje fibers (fastest conduction: 1-4 m/s) → Ventricles. The AV node allows atrial contraction before ventricular.',
True),
('P','mcq',
'Acetylcholine (vagal stimulation) causes which effect on the SA node?',
['A) Depolarization, increasing heart rate',
'B) Increased calcium influx, increasing contraction',
'C) Hyperpolarization, decreasing heart rate',
'D) Repolarization, causing arrhythmias'],
'C',
'ACh → M2 receptors → opens IKACh (K+ channels) → hyperpolarization → slower pacemaker depolarization → ↓HR. Opposite: NE/sympathetic → β1 receptors → ↑If and Ca²⁺ currents → ↑HR.',
True),
('P','mcq',
'Cardiac weakness can be caused by deficiency of which substance in the extracellular fluid?',
['A) Sodium',
'B) Chloride',
'C) Calcium',
'D) Bicarbonate'],
'C',
'Ca²⁺ is essential for cardiac muscle contraction (enters via L-type channels → triggers Ca²⁺-induced Ca²⁺ release from SR). Most Ca²⁺ for cardiac muscle comes from EXTRACELLULAR space. Hypocalcemia → reduced contractility.',
True),
('P','mcq',
'Active hyperemia occurs when the tissue _____ rate increases:',
['A) Respiration',
'B) Metabolic',
'C) Filtration',
'D) Excretion'],
'B',
'Active (functional) hyperemia: ↑metabolism → local vasodilatory metabolites (CO₂, adenosine, K⁺, H⁺, ↓O₂) → vasodilation → ↑blood flow. Classic example: skeletal muscle during exercise.',
True),
('P','mcq',
'Veins are called capacitance vessels because they:',
['A) Have the highest blood flow velocity',
'B) Contain the greatest percentage (~64%) of total blood volume',
'C) Generate the most blood pressure',
'D) Have the thickest walls in the vasculature'],
'B',
'Veins are highly compliant and contain ~64% of total blood volume. Arteries = pressure vessels. Capillaries = exchange vessels. Arterioles = resistance vessels. Veins serve as blood reservoirs.',
True),
('P','mcq',
'Arterial blood pressure is a product of:',
['A) Heart rate and stroke volume only',
'B) Cardiac output and total peripheral resistance',
'C) Blood volume and venous return',
'D) Heart rate and blood viscosity'],
'B',
'MAP = CO × SVR (systemic vascular resistance). BP = CO × TPR. Both cardiac output (HR × SV) and total peripheral resistance (mainly arterioles) must be addressed to treat hypertension.',
True),
('P','mcq',
'According to Poiseuille\'s law, which factor has the GREATEST impact on vascular resistance?',
['A) Blood viscosity (η)',
'B) Vessel length (L)',
'C) Vessel radius (r) — to the 4th power',
'D) Blood density'],
'C',
'Resistance = 8ηL / πr⁴. Radius has the dominant effect (r⁴). Halving the radius increases resistance 16-fold (2⁴=16). This is why arterioles (which can constrict/dilate) are the primary regulators of blood flow distribution.',
True),
('P','mcq',
'The structure that opens and closes the entrance to a capillary bed is the:',
['A) Metarteriole',
'B) Arteriole',
'C) Precapillary sphincter',
'D) Thoroughfare channel'],
'C',
'Precapillary sphincters are smooth muscle rings at the origin of capillaries. The most important factor controlling them = tissue O₂ concentration (↓O₂ → sphincters OPEN → more blood flow = autoregulation).',
True),
('P','mcq',
'During isovolumetric relaxation time (IVRT), which statement is correct?',
['A) Only the mitral valve is open',
'B) Only the aortic valve is open',
'C) Both mitral and aortic valves are closed',
'D) Both mitral and aortic valves are open'],
'C',
'IVRT = period from AORTIC valve closure to MITRAL valve opening. Ventricular pressure drops rapidly but no valves are open → volume stays constant. IVRT ends when ventricular pressure falls below atrial pressure.',
True),
('P','mcq',
'The "a" wave on the atrial pressure/JVP curve is caused by:',
['A) Tricuspid valve closure',
'B) Ventricular systole',
'C) Atrial contraction',
'D) Venous filling of the atrium'],
'C',
'JVP waves: "a" = ATRIAL CONTRACTION | "c" = tricuspid bulging into RA | "x" = atrial relaxation | "v" = venous filling during ventricular systole | "y" = tricuspid opening. The "a" wave is absent in atrial fibrillation.',
True),
('P','mcq',
'The Frank-Starling law states that:',
['A) Heart rate is directly proportional to blood pressure',
'B) The greater the venous return, the stronger the ventricular contraction and the greater the stroke volume',
'C) Stroke volume is inversely proportional to end-diastolic volume',
'D) Cardiac output is independent of preload'],
'B',
'Frank-Starling: ↑venous return → ↑EDV → ↑myocardial fiber stretch → ↑force of contraction → ↑SV → ↑CO. The heart automatically pumps whatever blood it receives. This intrinsic mechanism needs no neural input.',
True),
('P','mcq',
'Coronary blood flow mostly occurs during which phase of the cardiac cycle?',
['A) Isovolumetric contraction',
'B) Systole',
'C) Diastole',
'D) Isovolumetric relaxation'],
'C',
'Left coronary flow is mainly in DIASTOLE — the contracting myocardium compresses left coronary vessels during systole, reducing flow. High HR shortens diastole → less filling time → risk of ischemia. Right coronary is less affected.',
True),
('P','mcq',
'Afterload for the LEFT ventricle is equivalent to:',
['A) End-diastolic ventricular volume',
'B) Central venous pressure',
'C) Aortic pressure (systemic vascular resistance)',
'D) Pulmonary artery pressure'],
'C',
'Afterload = resistance against which the ventricle pumps. LV afterload = AORTIC PRESSURE / SVR. RV afterload = pulmonary artery pressure. ↑Afterload (e.g., hypertension, aortic stenosis) → ↓SV → LV hypertrophy.',
True),
('P','tf',
'Cardiac tamponade increases cardiac output.',
['A) True', 'B) False'],
'B',
'Cardiac tamponade = pericardial fluid compresses the heart → impaired diastolic filling → ↓CO. Beck\'s triad: (1) hypotension, (2) muffled heart sounds, (3) distended neck veins. Treatment: urgent pericardiocentesis.',
True),
('P','tf',
'Collateral coronary flow can damage the myocardium.',
['A) True', 'B) False'],
'B',
'Collateral vessels PROTECT the myocardium by providing alternative blood supply routes around blocked coronary arteries. The more developed the collaterals, the smaller the infarct. Collateral flow ≠ reperfusion injury.',
True),
('P','mcq',
'Pulse pressure is defined as:',
['A) Mean arterial pressure divided by diastolic pressure',
'B) The difference between systolic and diastolic blood pressure',
'C) The product of heart rate and stroke volume',
'D) Systolic pressure divided by diastolic pressure'],
'B',
'Pulse pressure = Systolic BP − Diastolic BP (normal ≈ 40 mmHg). MAP = DBP + (PP/3) ≈ 93 mmHg. Pulse pressure is highest in LARGE ARTERIES and diminishes progressively toward capillaries/veins.',
True),
('P','mcq',
'The normal right atrial pressure is approximately:',
['A) 0 mmHg',
'B) 10 mmHg',
'C) 25 mmHg',
'D) 80 mmHg'],
'A',
'Normal pressures: RA ≈ 0 mmHg | RV systolic = 25 mmHg | Pulmonary artery systolic = 25 mmHg | LA = 5-10 mmHg | LV systolic = 120 mmHg | Aorta = 120/80 mmHg. RA pressure ≈ CVP (central venous pressure).',
True),
('P','mcq',
'Edema is BEST described as:',
['A) Decreased plasma volume',
'B) Accumulation of excess fluid in the interstitium',
'C) Increased lymphatic flow',
'D) Decreased capillary hydrostatic pressure'],
'B',
'Edema = excess fluid in interstitial space. Causes: (1) ↑capillary hydrostatic P (heart failure), (2) ↓plasma oncotic P (hypoalbuminemia), (3) lymphatic obstruction, (4) ↑capillary permeability (inflammation). ALL are valid causes.',
True),
('P','mcq',
'Lymph capillaries differ from systemic blood capillaries in that they:',
['A) Are present in the central nervous system',
'B) Have continuous basement membranes',
'C) Are absent in the central nervous system',
'D) Are lined by stratified squamous epithelium'],
'C',
'Lymph capillaries are absent in: CNS, bone marrow, avascular tissues (cartilage, cornea). They are blind-ended, lack a continuous basement membrane (more permeable), and pick up excess interstitial fluid + proteins.',
True),
('P','mcq',
'Flow of fluid through the lymphatic vessels will be DECREASED if there is an increase in:',
['A) Capillary hydrostatic pressure',
'B) Capillary permeability',
'C) Capillary oncotic pressure',
'D) Interstitial fluid volume'],
'C',
'↑Capillary oncotic pressure → more fluid is reabsorbed BACK into the capillary (by osmosis) → LESS fluid enters lymphatics → decreased lymph flow. Conversely, ↑hydrostatic pressure → more filtration → more lymph.',
True),
('P','mcq',
'The PQ (PR) interval on ECG represents:',
['A) Ventricular depolarization',
'B) Ventricular repolarization',
'C) AV nodal conduction time',
'D) Atrial repolarization'],
'C',
'PR interval = onset of P wave to onset of QRS = AV conduction time (normal 0.12-0.20 sec). Prolonged PR = 1st degree AV block. Short PR (< 0.12 sec) = WPW syndrome (accessory pathway bypasses AV node).',
True),
('P','tf',
'Vagal stimulation of the SA node increases Ca²⁺ influx into pacemaker cells.',
['A) True', 'B) False'],
'B',
'Vagal stimulation releases ACh → M2 receptors → ↑K⁺ permeability (IKACh) → HYPERPOLARIZATION → slower rate. Ca²⁺ influx is DECREASED (not increased). Sympathetic stimulation INCREASES Ca²⁺ and funny (If) channel activity.',
True),
('P','mcq',
'Norepinephrine stimulates _____ receptors, which mediate effects on heart rate:',
['A) Alpha-1 adrenergic receptors',
'B) Muscarinic receptors',
'C) Beta-2 adrenergic receptors',
'D) Beta-1 adrenergic receptors'],
'D',
'Beta-1 (β1) receptors are in the HEART. NE/Epi → β1 → ↑HR (chronotropy), ↑contractility (inotropy), ↑conduction speed (dromotropy). β2 = lungs (bronchodilation) + vessels (vasodilation). α1 = vessels (vasoconstriction).',
True),
('P','tf',
'Peripheral chemoreceptors are located in the carotid sinus and aortic arch.',
['A) True', 'B) False'],
'B',
'Peripheral O₂ chemoreceptors = carotid BODY + aortic BODIES. The carotid SINUS is a BARORECEPTOR (senses pressure, not O₂). Central chemoreceptors (in the brainstem) sense CO₂ and pH, not O₂.',
True),
('P','mcq',
'The velocity of blood flow is slowest in capillaries because:',
['A) They have the thickest walls',
'B) They carry the least total blood volume',
'C) They have the largest total cross-sectional area',
'D) Their blood pressure is the highest'],
'C',
'Velocity ∝ 1/total cross-sectional area. Capillaries have the LARGEST total CSA → SLOWEST velocity. Aorta = smallest CSA → fastest velocity. Slow capillary flow allows maximum time for O₂/nutrient exchange.',
True),
('P','mcq',
'The smaller the alveolus, the _____ the alveolar pressure due to surface tension (Law of Laplace):',
['A) Lower',
'B) Greater',
'C) Equal',
'D) Negligible'],
'B',
'Law of Laplace: P = 2T/r. Smaller radius → GREATER pressure → tendency to collapse into larger alveoli. Surfactant reduces T more in smaller alveoli (higher concentration) → stabilises all alveoli equally.',
True),
('P','mcq',
'How to distinguish pericarditis from myocardial infarction clinically?',
['A) Pericarditis pain radiates to the left arm',
'B) Pericarditis pain is relieved by sitting/leaning forward',
'C) Pericarditis causes ST depression in all leads',
'D) Pericarditis presents with a Q wave on ECG'],
'B',
'Pericarditis: sharp, pleuritic pain, worse lying flat, RELIEVED leaning forward (reduces friction between pericardial layers). MI: crushing pain, radiates to left arm/jaw, NOT relieved by position. Friction rub = pericarditis.',
True),
('P','mcq',
'Most carbon dioxide (~70%) is transported from tissues in the blood as:',
['A) Dissolved CO₂',
'B) Carbaminohemoglobin',
'C) Bicarbonate ions (HCO₃⁻)',
'D) Carbonic acid'],
'C',
'CO₂ transport: 70% as HCO₃⁻ (CO₂+H₂O→H₂CO₃→H⁺+HCO₃⁻, catalysed by carbonic anhydrase in RBCs), 23% as carbaminoHb, 7% dissolved. The HCO₃⁻ is exchanged for Cl⁻ (chloride shift).',
True),
]
# ── SHUFFLE ───────────────────────────────────────────────────────────────────
random.shuffle(QUESTIONS)
# ── helper styles ─────────────────────────────────────────────────────────────
sH1 = S('sH1', fontSize=22, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=26, spaceAfter=4)
sH2 = S('sH2', fontSize=13, textColor=colors.HexColor('#90CAF9'),
fontName='Helvetica', alignment=TA_CENTER, leading=16)
sHdr = S('sHdr', fontSize=11, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=14)
sQnum= S('sQnum', fontSize=13, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=16)
sStem= S('sStem', fontSize=11, textColor=C_DARK, fontName='Helvetica-Bold',
leading=15, spaceAfter=4)
sOpt = S('sOpt', fontSize=10.5, textColor=C_DARK, fontName='Helvetica',
leading=14, leftIndent=8, spaceAfter=1)
sTag2= S('sTag2', fontSize=7.5, textColor=C_WHITE, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=9)
sSmall=S('sSmall', fontSize=8, textColor=C_MID, fontName='Helvetica',
alignment=TA_RIGHT, leading=10)
sAnsHdr=S('sAnsHdr',fontSize=12,textColor=C_WHITE,fontName='Helvetica-Bold',
alignment=TA_CENTER,leading=15)
sAnsQ= S('sAnsQ', fontSize=10, textColor=C_DARK, fontName='Helvetica-Bold', leading=14)
sAnsC= S('sAnsC', fontSize=10, textColor=C_GREEN, fontName='Helvetica-Bold', leading=14)
sAnsE= S('sAnsE', fontSize=9, textColor=C_DARK, fontName='Helvetica',
leading=13, leftIndent=8)
sBox = S('sBox', fontSize=9, textColor=C_DARK, fontName='Helvetica',
leading=13, alignment=TA_CENTER)
sRepPh= S('sRepPh', fontSize=7.5, textColor=C_GOLD, fontName='Helvetica-Bold',
alignment=TA_LEFT, leading=9)
sCovSub=S('sCovSub',fontSize=11,textColor=colors.HexColor('#AACCEE'),
fontName='Helvetica',alignment=TA_CENTER,leading=14)
W = PAGE_W - 2*MARGIN
def subj_tag_cell(subj, repeated):
hdr_c, bg_c, label = SUBJ_COLORS[subj]
tag_text = f'⭐ REPEATED | {label}' if repeated else label
tc = Table([[Paragraph(tag_text, sTag2)]], colWidths=[W])
tc.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), hdr_c),
('TOPPADDING',(0,0),(-1,-1),3),
('BOTTOMPADDING',(0,0),(-1,-1),3),
]))
return tc
def build_question_block(num, subj, qtype, stem, opts, correct, expl, repeated):
hdr_c, bg_c, label = SUBJ_COLORS[subj]
# number badge
num_tab = Table([[Paragraph(str(num), sQnum)]], colWidths=[1.1*cm], rowHeights=[1.1*cm])
num_tab.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),hdr_c),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
# TF badge
tf_label = 'TRUE / FALSE' if qtype=='tf' else 'MCQ'
type_tab = Table([[Paragraph(tf_label, sTag2)]], colWidths=[1.8*cm], rowHeights=[1.1*cm])
type_tab.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), C_GOLD if qtype=='tf' else C_BLUE),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
# subject tag
tag_text = f'⭐ {label}' if repeated else label
subj_tab = Table([[Paragraph(tag_text, sTag2)]], colWidths=[W-1.1*cm-1.8*cm-0.4*cm],
rowHeights=[1.1*cm])
subj_tab.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), hdr_c),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
('ALIGN',(0,0),(-1,-1),'RIGHT'),
]))
header = Table([[num_tab, type_tab, Spacer(0.2*cm,1), subj_tab]],
colWidths=[1.1*cm, 1.8*cm, 0.2*cm, W-1.1*cm-1.8*cm-0.2*cm])
header.setStyle(TableStyle([
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),0),
('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
# stem + options
rows = [[Paragraph(stem, sStem)]]
rows.append([Spacer(1, 3)])
for opt in opts:
rows.append([Paragraph(opt, sOpt)])
# answer blank
rows.append([Spacer(1, 4)])
rows.append([Paragraph('My answer: ______', S(f'blank{num}', fontSize=9.5,
textColor=C_MID, fontName='Helvetica-Oblique', leading=14))])
body = Table(rows, colWidths=[W])
body.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),C_WHITE),
('TOPPADDING',(0,0),(-1,-1),5),
('BOTTOMPADDING',(0,0),(-1,-1),2),
('LEFTPADDING',(0,0),(-1,-1),10),
('RIGHTPADDING',(0,0),(-1,-1),10),
('LINEBELOW',(0,-1),(-1,-1),0.5,C_LITE),
]))
card = Table([[header],[body]], colWidths=[W])
card.setStyle(TableStyle([
('BOX',(0,0),(-1,-1),1.2, hdr_c),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
('LEFTPADDING',(0,0),(-1,-1),0),
('RIGHTPADDING',(0,0),(-1,-1),0),
]))
return card
def build_answer_block(num, subj, qtype, stem_short, correct, expl):
hdr_c, bg_c, label = SUBJ_COLORS[subj]
opt_letter = correct
rows = [
[Paragraph(f'<b>Q{num}.</b> {stem_short[:80]}{"..." if len(stem_short)>80 else ""}', sAnsQ)],
[Paragraph(f'✔ Correct Answer: <b>{opt_letter}</b>', sAnsC)],
[Paragraph(expl, sAnsE)],
[Spacer(1,3)],
]
body = Table(rows, colWidths=[W])
body.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0), bg_c),
('BACKGROUND',(0,1),(-1,1), C_LIME),
('BACKGROUND',(0,2),(-1,2), C_GREY),
('TOPPADDING',(0,0),(-1,-1),4),
('BOTTOMPADDING',(0,0),(-1,-1),4),
('LEFTPADDING',(0,0),(-1,-1),8),
('RIGHTPADDING',(0,0),(-1,-1),8),
('LINEBELOW',(0,-1),(-1,-1),0.5,hdr_c),
]))
return body
# ── BUILD PDF ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT_EXAM, pagesize=A4,
leftMargin=MARGIN, rightMargin=MARGIN,
topMargin=MARGIN, bottomMargin=MARGIN,
title='Human Body Finals — Practice Exam',
author='Orris AI'
)
story = []
# ── COVER ─────────────────────────────────────────────────────────────────────
cover = Table([
[Paragraph('📝 PRACTICE EXAM', sH1)],
[Paragraph('Human Body Systems — Finals Preparation', sH2)],
[Spacer(1, 0.3*cm)],
[Paragraph('Anatomy • Histology & Embryology • Physiology', sCovSub)],
[Spacer(1, 0.5*cm)],
[Paragraph(f'<b>{len(QUESTIONS)} Questions</b> (MCQ + True/False) • Questions in random order • Answer Key at end',
S('cI', fontSize=10, textColor=colors.HexColor('#90CAF9'),
fontName='Helvetica', alignment=TA_CENTER, leading=14))],
[Spacer(1, 0.4*cm)],
[Table([
[Paragraph('📋 INSTRUCTIONS', S('iH',fontSize=11,textColor=C_GOLD,fontName='Helvetica-Bold',alignment=TA_LEFT,leading=14))],
[Paragraph(
'• For MCQ: circle or write the letter (A / B / C / D) of the best answer.\n'
'• For True/False: write A for True, B for False.\n'
'• ⭐ = appeared in multiple past exams — highest priority.\n'
'• 🟦 Navy border = Anatomy | 🟪 Purple = Histo/Embryo | 🟩 Teal = Physiology\n'
'• Time yourself: aim for ~1 minute per question.',
S('iB',fontSize=9,textColor=colors.HexColor('#CCDFF5'),
fontName='Helvetica',alignment=TA_LEFT,leading=13))],
], colWidths=[W-3*cm])],
], colWidths=[W])
cover.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),colors.HexColor('#0D2B4E')),
('TOPPADDING',(0,0),(-1,-1),10),
('BOTTOMPADDING',(0,0),(-1,-1),10),
('LEFTPADDING',(0,0),(-1,-1),20),
('RIGHTPADDING',(0,0),(-1,-1),20),
('LINEBELOW',(0,1),(0,1),1,C_BLUE),
('LINEBELOW',(0,5),(0,5),1,C_BLUE),
('ROUNDEDCORNERS',(0,0),(-1,-1),[8,8,8,8]),
]))
story.append(cover)
story.append(Spacer(1, 0.4*cm))
# summary stats
anat_n = sum(1 for q in QUESTIONS if q[0]=='A')
hist_n = sum(1 for q in QUESTIONS if q[0]=='H')
phys_n = sum(1 for q in QUESTIONS if q[0]=='P')
rep_n = sum(1 for q in QUESTIONS if q[6])
mcq_n = sum(1 for q in QUESTIONS if q[1]=='mcq')
tf_n = sum(1 for q in QUESTIONS if q[1]=='tf')
stats = Table([[
Paragraph(f'🟦 Anatomy\n<b>{anat_n} Qs</b>', sBox),
Paragraph(f'🟪 Histo/Emb\n<b>{hist_n} Qs</b>', sBox),
Paragraph(f'🟩 Physiology\n<b>{phys_n} Qs</b>', sBox),
Paragraph(f'🔵 MCQ\n<b>{mcq_n} Qs</b>', sBox),
Paragraph(f'🟡 True/False\n<b>{tf_n} Qs</b>', sBox),
Paragraph(f'⭐ Repeated\n<b>{rep_n} Qs</b>', sBox),
]], colWidths=[W/6]*6)
stats.setStyle(TableStyle([
('BACKGROUND',(0,0),(0,0), C_SKY),
('BACKGROUND',(1,0),(1,0), C_LAV),
('BACKGROUND',(2,0),(2,0), C_TEAL_L),
('BACKGROUND',(3,0),(3,0), colors.HexColor('#E0EEFF')),
('BACKGROUND',(4,0),(4,0), C_YELLOW),
('BACKGROUND',(5,0),(5,0), colors.HexColor('#FFF3CD')),
('INNERGRID',(0,0),(-1,-1),0.5,C_LITE),
('BOX',(0,0),(-1,-1),0.5,C_LITE),
('TOPPADDING',(0,0),(-1,-1),6),
('BOTTOMPADDING',(0,0),(-1,-1),6),
('ALIGN',(0,0),(-1,-1),'CENTER'),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
]))
story.append(stats)
story.append(PageBreak())
# ── QUESTIONS ─────────────────────────────────────────────────────────────────
for i, (subj, qtype, stem, opts, correct, expl, repeated) in enumerate(QUESTIONS):
block = build_question_block(i+1, subj, qtype, stem, opts, correct, expl, repeated)
story.append(KeepTogether([block, Spacer(1, 0.5*cm)]))
# ── ANSWER SHEET ─────────────────────────────────────────────────────────────
story.append(PageBreak())
ans_sheet_hdr = Table([[Paragraph('📋 QUICK ANSWER SHEET', sAnsHdr)]],
colWidths=[W])
ans_sheet_hdr.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),C_NAVY),
('TOPPADDING',(0,0),(-1,-1),8),
('BOTTOMPADDING',(0,0),(-1,-1),8),
('ROUNDEDCORNERS',(0,0),(-1,-1),[6,6,0,0]),
]))
story.append(ans_sheet_hdr)
story.append(Spacer(1,0.15*cm))
# build grid: 10 per row
grid_rows = []
COLS = 10
for row_start in range(0, len(QUESTIONS), COLS):
num_row = []
ans_row = []
for j in range(COLS):
idx = row_start + j
if idx < len(QUESTIONS):
subj, qtype, stem, opts, correct, expl, repeated = QUESTIONS[idx]
hdr_c, _, _ = SUBJ_COLORS[subj]
num_row.append(Paragraph(f'<b>Q{idx+1}</b>', S(f'gs{idx}', fontSize=8,
textColor=C_WHITE, fontName='Helvetica-Bold', alignment=TA_CENTER)))
ans_row.append(Paragraph('___', S(f'ga{idx}', fontSize=9,
textColor=C_DARK, fontName='Helvetica', alignment=TA_CENTER)))
else:
num_row.append(Paragraph('', sBox))
ans_row.append(Paragraph('', sBox))
grid_rows.append(num_row)
grid_rows.append(ans_row)
col_w = W / COLS
grid = Table(grid_rows, colWidths=[col_w]*COLS)
grid_style = [
('INNERGRID',(0,0),(-1,-1),0.4,C_LITE),
('BOX',(0,0),(-1,-1),0.8,C_NAVY),
('TOPPADDING',(0,0),(-1,-1),4),
('BOTTOMPADDING',(0,0),(-1,-1),4),
('ALIGN',(0,0),(-1,-1),'CENTER'),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
]
# Colour number rows
for row_start in range(0, len(QUESTIONS), COLS):
row_idx = (row_start // COLS) * 2
grid_style.append(('BACKGROUND',(0,row_idx),(-1,row_idx), C_NAVY))
grid_style.append(('BACKGROUND',(0,row_idx+1),(-1,row_idx+1), C_GREY))
grid.setStyle(TableStyle(grid_style))
story.append(grid)
story.append(Spacer(1,0.3*cm))
story.append(Paragraph('Fill in your answers above, then check against the Answer Key on the next pages.',
S('hint', fontSize=9, textColor=C_MID, fontName='Helvetica-Oblique',
alignment=TA_CENTER, leading=12)))
# ── ANSWER KEY ────────────────────────────────────────────────────────────────
story.append(PageBreak())
key_hdr = Table([[Paragraph('🔑 ANSWER KEY WITH EXPLANATIONS', sAnsHdr)]],
colWidths=[W])
key_hdr.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),C_GREEN),
('TOPPADDING',(0,0),(-1,-1),10),
('BOTTOMPADDING',(0,0),(-1,-1),10),
('ROUNDEDCORNERS',(0,0),(-1,-1),[6,6,0,0]),
]))
story.append(key_hdr)
story.append(Spacer(1,0.2*cm))
for i, (subj, qtype, stem, opts, correct, expl, repeated) in enumerate(QUESTIONS):
# find option text for correct letter
correct_text = next((o for o in opts if o.startswith(f'{correct})')), correct)
block = build_answer_block(i+1, subj, qtype, stem, correct_text, expl)
story.append(KeepTogether([block]))
story.append(Spacer(1,0.4*cm))
# ── SCORE GUIDE ───────────────────────────────────────────────────────────────
total = len(QUESTIONS)
score_data = [
[Paragraph('<b>Score</b>', sBox),
Paragraph(f'<b>{int(total*0.9)}-{total}</b>', sBox),
Paragraph(f'<b>{int(total*0.75)}-{int(total*0.9)-1}</b>', sBox),
Paragraph(f'<b>{int(total*0.6)}-{int(total*0.75)-1}</b>', sBox),
Paragraph(f'<b>Below {int(total*0.6)}</b>', sBox)],
[Paragraph('<b>Grade</b>', sBox),
Paragraph('🏆 Excellent', sBox),
Paragraph('✅ Good', sBox),
Paragraph('⚠️ Review needed', sBox),
Paragraph('❌ Must restudy', sBox)],
]
score_tab = Table(score_data, colWidths=[W/5]*5)
score_tab.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0), C_NAVY),
('TEXTCOLOR',(0,0),(-1,0), C_WHITE),
('BACKGROUND',(1,1),(1,1), C_LIME),
('BACKGROUND',(2,1),(2,1), C_SKY),
('BACKGROUND',(3,1),(3,1), C_YELLOW),
('BACKGROUND',(4,1),(4,1), C_PINK),
('INNERGRID',(0,0),(-1,-1),0.5,C_LITE),
('BOX',(0,0),(-1,-1),1,C_NAVY),
('TOPPADDING',(0,0),(-1,-1),6),
('BOTTOMPADDING',(0,0),(-1,-1),6),
('ALIGN',(0,0),(-1,-1),'CENTER'),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
]))
story.append(score_tab)
doc.build(story)
print(f'Done → {OUTPUT_EXAM}')
print(f'Total questions: {total} | MCQ: {mcq_n} | T/F: {tf_n} | Repeated: {rep_n}')
cd /tmp/workspace/finals-study-guide && python3 make_exam.py 2>&1
ls -lh /tmp/workspace/finals-study-guide/PRACTICE_EXAM.pdf
PRACTICE EXAM
PDF Document · PDF
| Category | Questions | Format |
|---|---|---|
| 🟦 Anatomy | 25 | MCQ + T/F |
| 🟪 Histology / Embryology | 21 | MCQ + T/F |
| 🟩 Physiology | 27 | MCQ + T/F |
| Total | 73 | 60 MCQ + 13 True/False |
| Score | Grade |
|---|---|
| 66-73 | 🏆 Excellent — exam ready |
| 55-65 | ✅ Good — review weak topics |
| 44-54 | ⚠️ Review needed — go back to flashcards |
| Below 44 | ❌ Must restudy — use the study guide docx |
Can you generate a summary of the 30 most frequently tested topics to focus on last?
~/finals-study-guide/make_top30.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, KeepTogether
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
OUTPUT = '/tmp/workspace/finals-study-guide/TOP30_LAST_MINUTE.pdf'
PAGE_W, PAGE_H = A4
M = 1.5 * cm
W = PAGE_W - 2 * M
# ── palette ───────────────────────────────────────────────────────────────────
CN = colors.HexColor('#0D2A4E') # deep navy
CB = colors.HexColor('#1668B0') # blue
CSK = colors.HexColor('#DFF0FF') # sky
CPU = colors.HexColor('#4A006A') # purple
CLAV = colors.HexColor('#F0E8FF') # lavender
CTL = colors.HexColor('#005850') # teal
CTLL = colors.HexColor('#DCF5F2') # teal light
CRD = colors.HexColor('#B30000') # red
CPK = colors.HexColor('#FFF0F0') # pink bg
CGN = colors.HexColor('#1A5C28') # green
CLM = colors.HexColor('#E8F8EE') # lime
COR = colors.HexColor('#C04800') # orange
CYL = colors.HexColor('#FFF5D0') # yellow
CGD = colors.HexColor('#9A7200') # gold dark
CGD2 = colors.HexColor('#FFD700') # gold
CWH = colors.white
CGY = colors.HexColor('#F4F4F4') # grey bg
CML = colors.HexColor('#777777') # mid grey
CLT = colors.HexColor('#DDDDDD') # light grey
def S(n, **k):
return ParagraphStyle(n, parent=getSampleStyleSheet()['Normal'], **k)
# ── TOP 30 DATA ───────────────────────────────────────────────────────────────
# Format per entry:
# (rank, subj, appearances, topic_title,
# key_fact, ← the ONE sentence answer you must know
# trap, ← the wrong answer that appeared in exams
# detail) ← 1-2 extra lines of supporting detail
#
# subj: 'A'=Anatomy 'H'=Histo/Embryo 'P'=Physiology
TOP30 = [
(1, 'H', 6,
"Surfactant & Surface Tension",
"Surfactant DECREASES surface tension, preventing alveolar collapse.",
"TRAP: 'increases surface tension' — this is FALSE and appeared as the wrong answer 4× across files.",
"Produced by Type II pneumocytes (septal cells). Deficiency → RDS in premature babies. "
"Starts forming at ~20-22 weeks gestation. By LaPlace's law: smaller alveoli have greater collapse pressure — surfactant compensates."),
(2, 'P', 6,
"Cardiac Conduction Order",
"SA node → AV node → Bundle of His → Bundle branches → Purkinje fibers → Ventricles",
"TRAP: wrong orders appeared in almost every exam version (e.g. 'SA → Bundle of His → AV node').",
"SA node = pacemaker (60-100 bpm), right atrium near SVC. AV node DELAYS 0.1 s (allows atrial emptying). "
"Purkinje fibers conduct fastest (1-4 m/s). AV node = slowest. 'Ectopic pacemaker' = any site other than SA node."),
(3, 'A', 6,
"Ciliated Epithelium in Bronchioles",
"Ciliated pseudostratified columnar epithelium is NOT found in bronchioles — this statement is FALSE.",
"TRAP: answered TRUE in multiple exams. Ciliated pseudostratified = trachea + large bronchi ONLY.",
"Bronchioles have simple columnar/cuboidal epithelium with CLARA (Club) cells. "
"No cartilage in bronchioles. Clara cells: non-ciliated, dome-shaped, produce surfactant-like compounds."),
(4, 'P', 6,
"Collateral Coronary Flow",
"Collateral flow PROTECTS the myocardium — it does NOT damage it.",
"TRAP: 'collateral flow damages myocardium' appeared as the wrong answer in 4+ versions.",
"Collateral vessels are alternative pathways that open when a coronary artery is occluded. "
"More developed collaterals = smaller infarct. Coronary blood flow mainly occurs in DIASTOLE "
"(myocardium compresses vessels during systole)."),
(5, 'H', 5,
"Fetal Cardiac Shunts & Their Adult Remnants",
"Ductus arteriosus → Ligamentum arteriosum | Ductus venosus → Ligamentum venosum | Umbilical arteries → Medial umbilical ligaments | Umbilical vein → Lig. teres hepatis",
"TRAP: 'ductus venosus → ligamentum arteriosum' — completely reversed. Appeared multiple times.",
"Foramen ovale → fossa ovalis (closes when LA pressure > RA pressure at birth). "
"Ductus arteriosus = 6th arch artery. RIGHT umbilical vein regresses; LEFT persists as definitive UV."),
(6, 'A', 5,
"Left vs Right Main Bronchus",
"Left: LONGER, NARROWER, MORE HORIZONTAL (~45°). Right: shorter, wider, more vertical (~25°).",
"TRAP: reversed — 'left is wider and more vertical' appeared in old exam versions.",
"Foreign bodies lodge in the RIGHT bronchus (wider + more vertical). "
"Left bronchus crosses midline. Both primary bronchi are derivatives of the lung buds at week 5."),
(7, 'P', 5,
"Acetylcholine Effect on SA Node",
"ACh causes HYPERPOLARIZATION of the SA node → decreased heart rate.",
"TRAP: 'repolarization' or 'depolarization' appeared as wrong answers. Also wrong: 'increases Ca²⁺ influx'.",
"ACh → M2 receptors → opens IKACh (K⁺ channels) → hyperpolarization → slowed pacemaker. "
"Opposite: NE/sympathetic → β1 → ↑If + Ca²⁺ channels → ↑HR. "
"Vagal stimulation does NOT increase Ca²⁺ influx."),
(8, 'H', 5,
"Heart Chamber Septation Timing",
"Heart chambers are partitioned (septated) during weeks 5–8, NOT the 4th week.",
"TRAP: 'partitioned into 4 chambers during the 4th week' — FALSE. Appeared wrong 4+ times.",
"Week 3 = heart tube forms. Week 4 = looping. Weeks 5-8 = septation completed. "
"Outflow tract = bulbus cordis + truncus arteriosus. "
"CV system is one of the FIRST organ systems to develop (begins week 3)."),
(9, 'A', 5,
"Anterior Cardiac Veins",
"Anterior cardiac veins drain directly into the RIGHT ATRIUM — NOT into the coronary sinus.",
"TRAP: 'great cardiac vein does not drain into coronary sinus' — wrong; it's the anterior cardiac veins.",
"Coronary sinus receives: great, middle, small cardiac veins + oblique + posterior vein of LV. "
"Coronary sinus is located in the posterior atrioventricular (coronary) sulcus. Drains into RA."),
(10, 'P', 5,
"Cardiac Output Formula",
"CO = Heart Rate × Stroke Volume (normal ≈ 5 L/min = 70 bpm × 70 mL)",
"TRAP: 'CO = SV ÷ HR' or 'CO = BP ÷ resistance' appeared as wrong choices.",
"SV = EDV − ESV. Ejection fraction = SV/EDV × 100% (normal 55-70%). "
"Frank-Starling: ↑EDV → ↑stretch → ↑SV → ↑CO. "
"Afterload for LV = aortic pressure. Cardiac tamponade → DECREASES CO."),
(11, 'A', 5,
"Epicardium Identity",
"Epicardium = visceral layer of serous pericardium (innermost layer, directly on heart).",
"TRAP: 'parietal pericardium' or 'fibrous pericardium' — both wrong.",
"Layer order (outside → in): Fibrous pericardium → Parietal serous pericardium → "
"Pericardial cavity → Visceral serous pericardium (= EPICARDIUM). "
"Pericarditis: pain relieved by leaning forward — distinguishes it from MI."),
(12, 'P', 5,
"Calcium & Cardiac Muscle",
"Cardiac weakness is caused by Ca²⁺ DEFICIENCY in the extracellular fluid.",
"TRAP: 'sodium deficiency' or 'potassium deficiency' appeared as distractors.",
"Most Ca²⁺ for cardiac contraction enters from EXTRACELLULAR space via L-type channels "
"(unlike skeletal muscle which mainly uses SR). Ca²⁺ → Ca²⁺-induced Ca²⁺ release from SR. "
"K⁺ ions maintain resting membrane potential and are responsible for repolarization."),
(13, 'H', 5,
"Left Atrium Embryonic Origin",
"The fetal LEFT ATRIUM is mainly derived from the primitive pulmonary vein.",
"TRAP: 'sinus venosus' — that gives rise to the RIGHT atrium.",
"The sinus venosus (right horn) forms the smooth part of the right atrium, SVC, IVC openings. "
"The primitive pulmonary vein becomes incorporated into the posterior LA wall. "
"The left sinus horn becomes the coronary sinus."),
(14, 'A', 5,
"Trachea: Level & Bifurcation",
"Trachea extends C6 → T4/T5. Bifurcates at T4/T5 (sternal angle).",
"TRAP: 'bifurcates at TIV/I or TII' appeared in old exam answer.",
"Tracheal rings = 16-20 C-shaped HYALINE cartilage rings. Posterior wall = trachealis muscle. "
"Elastin fibers allow shape adaptation during breathing. "
"Carina = internal ridge at bifurcation. During quiet respiration, lung base crosses rib VIII (midaxillary line)."),
(15, 'P', 4,
"Isovolumetric Relaxation Time",
"During IVRT, ALL valves are CLOSED (both mitral AND aortic).",
"TRAP: 'mitral opens, aortic closes' — wrong. ALL valves closed during IVRT.",
"IVRT = aortic valve closure → mitral valve opening. "
"Ventricular pressure drops but volume stays CONSTANT. "
"Once ventricular pressure < atrial pressure, mitral opens → rapid filling begins (~70% of ventricular filling)."),
(16, 'A', 4,
"Middle Mediastinum Contents",
"Middle mediastinum = heart + pericardium. THYMUS is in the ANTERIOR mediastinum.",
"TRAP: 'aorta' alone or 'trachea' as the main occupant — both wrong.",
"Anterior = thymus, lymph nodes, fatty tissue. Middle = heart+pericardium, ascending aorta, "
"SVC, IVC, pulmonary trunk/veins, phrenic nerves. Posterior = descending aorta, esophagus, "
"thoracic duct, azygos/hemiazygos, sympathetic trunks."),
(17, 'A', 4,
"Superior Mediastinum: Recurrent Laryngeal Nerves",
"RIGHT RLN does NOT descend into superior mediastinum — it hooks at the ROOT OF THE NECK around the right subclavian artery.",
"TRAP: 'left recurrent laryngeal nerve' not in superior mediastinum — wrong; LEFT RLN IS there.",
"LEFT RLN hooks under the aortic arch inside the superior mediastinum — vulnerable in aortic arch surgery. "
"RIGHT RLN hooks around right subclavian at the root of the neck. "
"Both RLNs supply intrinsic laryngeal muscles (except cricothyroid)."),
(18, 'H', 4,
"Pericytes Location",
"Pericytes are found ONLY in capillaries and postcapillary venules — NOT in all blood vessels.",
"TRAP: 'pericytes are found in the wall of ALL blood vessels' — FALSE, appeared 4+ times.",
"Pericytes = long cytoplasmic processes of mesenchymal cells wrapping capillaries/venules. "
"They regulate capillary diameter, support endothelium, and participate in angiogenesis. "
"Larger vessels have smooth muscle cells in tunica media instead."),
(19, 'H', 4,
"Artery vs Vein: Thickest Layer",
"ARTERIES: thickest = tunica MEDIA. VEINS: thickest = tunica ADVENTITIA.",
"TRAP: 'adventitia thickest in arteries' — wrong. Arteries need thick media to handle high pressure.",
"Arteries: tunica media dominant (smooth muscle + elastic). Veins: tunica adventitia dominant (collagen). "
"Capillaries = only intima (endothelium + basement membrane). Vasa vasorum = nutrient vessels for large vessel walls."),
(20, 'A', 4,
"Tricuspid & Pulmonary Valve Cusps",
"Tricuspid = ANTERIOR + SEPTAL + POSTERIOR. Pulmonary semilunar = LEFT + RIGHT + ANTERIOR.",
"TRAP: 'superior, inferior, medial' for tricuspid — wrong. Aortic semilunar = left, right, posterior (non-coronary).",
"Mitral (bicuspid) = 2 cusps: anterior + posterior. Chordae tendineae prevent AV valve inversion. "
"Fibrous skeleton prevents overdilation of valve openings. "
"Aortic valve auscultated at 2nd ICS right. Mitral at apex (5th ICS, left midclavicular)."),
(21, 'H', 4,
"Foramen Ovale: Closure Mechanism",
"Foramen ovale closes when LEFT ATRIAL pressure exceeds RIGHT ATRIAL pressure (at birth).",
"TRAP: 'closes because ductus arteriosus closes first' — incorrect sequence.",
"FO allows oxygenated blood (IVC) to bypass RV → go directly LA → LV → body. "
"At birth: lungs expand → pulmonary resistance drops → LA pressure rises → FO closes. "
"Probe-patent FO exists in ~25% of adults. Persistent FO = ASD risk."),
(22, 'P', 4,
"Frank-Starling Law",
"Increased venous return → increased EDV → more stretch → stronger contraction → increased SV.",
"TRAP: 'SV is inversely proportional to EDV' — completely reversed.",
"Preload = EDV (end-diastolic volume) = myocardial stretch before contraction. "
"Afterload = aortic pressure for LV. INCORRECT definition of preload: 'right atrial pressure'. "
"Cardiac tamponade reduces venous return → decreases CO (NOT increases)."),
(23, 'A', 4,
"Right Subclavian Artery Origin",
"Right subclavian arises from the BRACHIOCEPHALIC TRUNK — NOT directly from the aorta.",
"TRAP: 'right subclavian arises directly from aorta' — FALSE. Left subclavian DOES arise directly.",
"Aortic arch branches (left → right): brachiocephalic trunk → left CCA → left subclavian. "
"Brachiocephalic trunk → right CCA + right subclavian. "
"Subclavian → axillary (at lateral border of 1st rib) → brachial (at lower border of teres major)."),
(24, 'H', 4,
"Lymphatic Vessel Lining",
"Lymphatic vessels are lined by SIMPLE SQUAMOUS epithelium (endothelium).",
"TRAP: 'stratified squamous epithelium' or 'simple columnar' appeared as wrong answers in multiple versions.",
"No continuous basement membrane → more permeable than blood capillaries. "
"Lymph capillaries are absent in CNS, bone marrow, cartilage, cornea. "
"They are blind-ended and pick up excess interstitial fluid + proteins."),
(25, 'A', 4,
"Celiac Trunk Branches",
"Celiac trunk (T12) = LEFT GASTRIC + SPLENIC + COMMON HEPATIC arteries.",
"TRAP: 'inferior mesenteric artery' listed as a celiac branch — it is a SEPARATE aortic branch.",
"Celiac = foregut supply. SMA (L1) = midgut. IMA (L3) = hindgut. "
"IMA branches: left colic, sigmoid arteries, superior rectal. "
"Right colic = SMA branch (NOT IMA). Uterine artery = anterior division of internal iliac."),
(26, 'P', 4,
"Blood Pressure Regulation",
"MAP = CO × TPR (cardiac output × total peripheral resistance). Arterioles = main resistance vessels.",
"TRAP: 'CO = BP ÷ resistance' used as CO formula — wrong direction.",
"Pulse pressure = SBP − DBP (≈ 40 mmHg). MAP = DBP + PP/3 ≈ 93 mmHg. "
"Normal BP = 120/80 mmHg. RA pressure ≈ 0 mmHg. RV systolic = 25 mmHg. "
"Veins = capacitance vessels (64% of blood volume). Precapillary sphincter opens when O₂ is low."),
(27, 'P', 4,
"Edema Causes & Lymphatics",
"Edema = all causes: ↑capillary hydrostatic P + ↓oncotic P + lymphatic obstruction + ↑permeability.",
"TRAP: 'lymph flow increases when capillary oncotic pressure increases' — wrong; it DECREASES.",
"Lymph capillaries are absent in CNS. They lack a continuous basement membrane. "
"Lymph flow DECREASES with ↑capillary oncotic pressure (more fluid reabsorbed back into capillaries). "
"Lymphatic vessels have valves to prevent backflow. Thoracic duct → left subclavian + left IJV junction."),
(28, 'P', 4,
"Peripheral Chemoreceptors Location",
"Peripheral O₂ chemoreceptors are in the CAROTID BODY and AORTIC BODIES — NOT the carotid sinus.",
"TRAP: 'carotid sinus and aortic arch' — the carotid SINUS is a BARORECEPTOR, not a chemoreceptor.",
"Carotid SINUS = baroreceptor (senses pressure). Carotid BODY = chemoreceptor (senses O₂, CO₂, pH). "
"Central chemoreceptors (brainstem) sense CO₂/pH, NOT O₂. "
"Severe hyperventilation (↓CO₂) CAN lead to loss of consciousness."),
(29, 'H', 4,
"Laryngotracheal Diverticulum",
"Laryngotracheal diverticulum communicates with the PRIMORDIAL PHARYNX through the laryngeal inlet.",
"TRAP: 'pharyngeal cavity and primordial cavity' is vague and wrong as used in exam.",
"Grows from ventral wall of pharynx. Tracheoesophageal septum separates it from esophagus. "
"Tracheal epithelium = endodermal. Tracheal connective tissue = splanchnic mesenchyme. "
"Failure of separation → tracheoesophageal fistula → polyhydramnios (amniotic fluid cannot reach stomach)."),
(30, 'A', 4,
"Azygos Vein & Thoracic Duct",
"Azygos vein drains into SVC. Thoracic duct drains into left subclavian + left IJV junction.",
"TRAP: 'azygos drains into pulmonary veins' or 'thoracic duct drains right side' — both wrong.",
"Azygos = right side. Hemiazygos = left lower thorax. Accessory hemiazygos = left upper thorax. "
"Thoracic duct: begins at cisterna chyli (L1-L2), enters thorax at T12, "
"lies POSTERIOR to ESOPHAGUS in mid-thorax, drains ALL lymph except right upper body."),
]
# ── styles ────────────────────────────────────────────────────────────────────
sCoverH = S('sCoverH', fontSize=26, textColor=CWH, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=30, spaceAfter=4)
sCoverS = S('sCoverS', fontSize=13, textColor=colors.HexColor('#A0C8EE'),
fontName='Helvetica', alignment=TA_CENTER, leading=16)
sRankBig = S('sRankBig',fontSize=22, textColor=CWH, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=26)
sTopic = S('sTopic', fontSize=12, textColor=CWH, fontName='Helvetica-Bold',
alignment=TA_LEFT, leading=15, spaceAfter=0)
sApps = S('sApps', fontSize=8.5,textColor=CGD2,fontName='Helvetica-Bold',
alignment=TA_LEFT, leading=11)
sKeyFact = S('sKeyFact',fontSize=11, textColor=CN, fontName='Helvetica-Bold',
leading=14, spaceAfter=2)
sTrap = S('sTrap', fontSize=9.5,textColor=CRD, fontName='Helvetica-Bold',
leading=13, spaceAfter=2)
sDetail = S('sDetail', fontSize=9, textColor=colors.HexColor('#333333'),
fontName='Helvetica', leading=12, spaceAfter=0)
sBoxLbl = S('sBoxLbl', fontSize=7.5,textColor=CWH, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=9)
sSubj = S('sSubj', fontSize=8, textColor=CWH, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=10)
sTocN = S('sTocN', fontSize=9, textColor=CN, fontName='Helvetica-Bold',
leading=12)
sTocT = S('sTocT', fontSize=9, textColor=CN, fontName='Helvetica',
leading=12)
sTocA = S('sTocA', fontSize=8, textColor=CML, fontName='Helvetica',
leading=11)
sFooter = S('sFooter', fontSize=7.5,textColor=CML, fontName='Helvetica',
alignment=TA_CENTER, leading=10)
sSummHdr = S('sSummHdr',fontSize=14, textColor=CWH, fontName='Helvetica-Bold',
alignment=TA_CENTER, leading=17)
SUBJ_META = {
'A': (CN, CSK, 'ANATOMY'),
'H': (CPU, CLAV, 'HISTO / EMBRYO'),
'P': (CTL, CTLL, 'PHYSIOLOGY'),
}
# ── helpers ───────────────────────────────────────────────────────────────────
def rank_bg(rank):
if rank == 1: return colors.HexColor('#B8860B'), colors.HexColor('#FFF8DC')
if rank <= 3: return colors.HexColor('#888888'), colors.HexColor('#F5F5F5')
if rank <= 10: return CN, CSK
if rank <= 20: return CPU, CLAV
return CTL, CTLL
def stars(n):
full = min(n, 6)
return '★' * full + '☆' * (6 - full)
def build_card(rank, subj, apps, topic, key_fact, trap, detail):
hdr_c, bg_c, subj_label = SUBJ_META[subj]
rk_c, rk_bg = rank_bg(rank)
# ── header row: [rank badge | apps stars | topic | subj tag] ──────────
rank_cell = Table(
[[Paragraph(f'#{rank}', sRankBig)]],
colWidths=[1.3*cm], rowHeights=[1.4*cm]
)
rank_cell.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), rk_c),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
stars_text = stars(apps)
apps_cell = Table(
[[Paragraph(f'{stars_text}', sApps)],
[Paragraph(f'seen {apps}×', S(f'sa{rank}', fontSize=7.5, textColor=CML,
fontName='Helvetica', alignment=TA_LEFT, leading=9))]],
colWidths=[1.6*cm]
)
apps_cell.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), rk_bg),
('TOPPADDING',(0,0),(-1,-1),4),
('BOTTOMPADDING',(0,0),(-1,-1),4),
('LEFTPADDING',(0,0),(-1,-1),5),
('RIGHTPADDING',(0,0),(-1,-1),5),
]))
topic_cell = Table(
[[Paragraph(topic, sTopic)]],
colWidths=[W - 1.3*cm - 1.6*cm - 1.8*cm - 0.4*cm]
)
topic_cell.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), hdr_c),
('TOPPADDING',(0,0),(-1,-1),6),
('BOTTOMPADDING',(0,0),(-1,-1),6),
('LEFTPADDING',(0,0),(-1,-1),8),
('RIGHTPADDING',(0,0),(-1,-1),4),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
]))
subj_cell = Table(
[[Paragraph(subj_label, sSubj)]],
colWidths=[1.8*cm]
)
subj_cell.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), hdr_c),
('TOPPADDING',(0,0),(-1,-1),4),
('BOTTOMPADDING',(0,0),(-1,-1),4),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('ALIGN',(0,0),(-1,-1),'CENTER'),
]))
header = Table(
[[rank_cell, apps_cell, topic_cell, subj_cell]],
colWidths=[1.3*cm, 1.6*cm, W-1.3*cm-1.6*cm-1.8*cm-0.4*cm, 1.8*cm],
spaceBefore=0, spaceAfter=0
)
header.setStyle(TableStyle([
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),0),
('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
('LINEBELOW',(0,0),(-1,-1),1, hdr_c),
]))
# ── body ──────────────────────────────────────────────────────────────
kf_label = Table([[Paragraph('KEY FACT', sBoxLbl)]],
colWidths=[1.5*cm])
kf_label.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CGN),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
('LEFTPADDING',(0,0),(-1,-1),3),('RIGHTPADDING',(0,0),(-1,-1),3),
('ROUNDEDCORNERS',(0,0),(-1,-1),[4,4,4,4]),
]))
kf_text = Table([[Paragraph(key_fact, sKeyFact)]], colWidths=[W - 1.5*cm - 0.3*cm])
kf_text.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CLM),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
]))
kf_row = Table([[kf_label, Spacer(0.3*cm,1), kf_text]],
colWidths=[1.5*cm, 0.3*cm, W-1.5*cm-0.3*cm])
kf_row.setStyle(TableStyle([
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),0),('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
tr_label = Table([[Paragraph('⚠ TRAP', sBoxLbl)]],
colWidths=[1.5*cm])
tr_label.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CRD),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
('LEFTPADDING',(0,0),(-1,-1),3),('RIGHTPADDING',(0,0),(-1,-1),3),
('ROUNDEDCORNERS',(0,0),(-1,-1),[4,4,4,4]),
]))
tr_text = Table([[Paragraph(trap, sTrap)]], colWidths=[W - 1.5*cm - 0.3*cm])
tr_text.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CPK),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
]))
tr_row = Table([[tr_label, Spacer(0.3*cm,1), tr_text]],
colWidths=[1.5*cm, 0.3*cm, W-1.5*cm-0.3*cm])
tr_row.setStyle(TableStyle([
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),0),('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
det_label = Table([[Paragraph('DETAIL', sBoxLbl)]],
colWidths=[1.5*cm])
det_label.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CB),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
('LEFTPADDING',(0,0),(-1,-1),3),('RIGHTPADDING',(0,0),(-1,-1),3),
('ROUNDEDCORNERS',(0,0),(-1,-1),[4,4,4,4]),
]))
det_text = Table([[Paragraph(detail, sDetail)]], colWidths=[W - 1.5*cm - 0.3*cm])
det_text.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CGY),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
]))
det_row = Table([[det_label, Spacer(0.3*cm,1), det_text]],
colWidths=[1.5*cm, 0.3*cm, W-1.5*cm-0.3*cm])
det_row.setStyle(TableStyle([
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),0),('BOTTOMPADDING',(0,0),(-1,-1),0),
]))
body_rows = [[kf_row],[Spacer(1,4)],[tr_row],[Spacer(1,4)],[det_row]]
body = Table(body_rows, colWidths=[W])
body.setStyle(TableStyle([
('TOPPADDING',(0,0),(-1,-1),5),
('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),8),
('RIGHTPADDING',(0,0),(-1,-1),8),
('BACKGROUND',(0,0),(-1,-1), CWH),
]))
# ── assemble ──────────────────────────────────────────────────────────
card = Table([[header],[body]], colWidths=[W])
card.setStyle(TableStyle([
('BOX',(0,0),(-1,-1),1.5, hdr_c),
('TOPPADDING',(0,0),(-1,-1),0),
('BOTTOMPADDING',(0,0),(-1,-1),0),
('LEFTPADDING',(0,0),(-1,-1),0),
('RIGHTPADDING',(0,0),(-1,-1),0),
]))
return card
# ── BUILD DOC ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
leftMargin=M, rightMargin=M, topMargin=M, bottomMargin=M,
title='Top 30 Most Tested Topics — Last Minute Review',
author='Orris AI'
)
story = []
# ── COVER ─────────────────────────────────────────────────────────────────────
cover = Table([
[Paragraph('🏆 TOP 30', sCoverH)],
[Paragraph('Most Frequently Tested Topics', sCoverS)],
[Paragraph('Human Body Systems — Finals Last-Minute Review', sCoverS)],
[Spacer(1, 0.4*cm)],
[Paragraph('Anatomy • Histology & Embryology • Physiology', sCoverS)],
[Spacer(1, 0.4*cm)],
[Table([[
Paragraph('Ranked by frequency across all 5 exam versions.\n'
'Each topic shows: ✅ KEY FACT to memorise • ⚠ TRAP answer to avoid • 📌 Supporting detail.',
S('ci', fontSize=10, textColor=colors.HexColor('#AACCEE'),
fontName='Helvetica', alignment=TA_CENTER, leading=14))
]], colWidths=[W-2*cm])],
[Spacer(1, 0.3*cm)],
[Table([[
Paragraph('🟦 Blue = Anatomy', S('la', fontSize=10, textColor=colors.HexColor('#60A8FF'),
fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph('🟪 Purple = Histo/Embryo', S('lh', fontSize=10, textColor=colors.HexColor('#CC88FF'),
fontName='Helvetica-Bold', alignment=TA_CENTER)),
Paragraph('🟩 Teal = Physiology', S('lp', fontSize=10, textColor=colors.HexColor('#44DDCC'),
fontName='Helvetica-Bold', alignment=TA_CENTER)),
]], colWidths=[W/3]*3)],
], colWidths=[W])
cover.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CN),
('TOPPADDING',(0,0),(-1,-1),10),
('BOTTOMPADDING',(0,0),(-1,-1),10),
('LEFTPADDING',(0,0),(-1,-1),20),
('RIGHTPADDING',(0,0),(-1,-1),20),
('LINEBELOW',(0,2),(0,2),1,CB),
('LINEBELOW',(0,4),(0,4),0.5, colors.HexColor('#2244AA')),
('ROUNDEDCORNERS',(0,0),(-1,-1),[8,8,8,8]),
]))
story.append(cover)
story.append(Spacer(1, 0.4*cm))
# ── QUICK INDEX TABLE ─────────────────────────────────────────────────────────
idx_hdr = Table([[Paragraph('QUICK INDEX', S('ih', fontSize=11, textColor=CWH,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=14))]],
colWidths=[W])
idx_hdr.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), colors.HexColor('#2244AA')),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
]))
story.append(idx_hdr)
# 3-column index
idx_rows = []
for i in range(0, 30, 3):
row = []
for j in range(3):
if i+j < 30:
r, subj, apps, topic = TOP30[i+j][:4]
hdr_c = SUBJ_META[subj][0]
row.append(Paragraph(
f'<font color="#{hdr_c.hexval()[2:]}"><b>#{r}</b></font> {topic}',
S(f'idx{r}', fontSize=8.5, textColor=CN, fontName='Helvetica', leading=11)
))
else:
row.append(Paragraph('', S(f'e{i+j}', fontSize=8)))
idx_rows.append(row)
idx_tab = Table(idx_rows, colWidths=[W/3]*3)
idx_tab.setStyle(TableStyle([
('INNERGRID',(0,0),(-1,-1),0.3,CLT),
('BOX',(0,0),(-1,-1),0.5,CB),
('TOPPADDING',(0,0),(-1,-1),3),
('BOTTOMPADDING',(0,0),(-1,-1),3),
('LEFTPADDING',(0,0),(-1,-1),6),
('RIGHTPADDING',(0,0),(-1,-1),4),
('BACKGROUND',(0,0),(-1,-1),CGY),
*[('BACKGROUND',(0,r),(2,r),CWH if r%2==0 else CGY) for r in range(len(idx_rows))]
]))
story.append(idx_tab)
story.append(PageBreak())
# ── TOPIC CARDS ───────────────────────────────────────────────────────────────
for entry in TOP30:
rank, subj, apps, topic, key_fact, trap, detail = entry
card = build_card(rank, subj, apps, topic, key_fact, trap, detail)
story.append(KeepTogether([card, Spacer(1, 0.5*cm)]))
# ── FINAL SUMMARY PAGE ────────────────────────────────────────────────────────
story.append(PageBreak())
summ_hdr = Table([[Paragraph('⚡ THE MOST COMMON TRAPS — NEVER GET THESE WRONG', sSummHdr)]],
colWidths=[W])
summ_hdr.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),CRD),
('TOPPADDING',(0,0),(-1,-1),8),
('BOTTOMPADDING',(0,0),(-1,-1),8),
('ROUNDEDCORNERS',(0,0),(-1,-1),[6,6,0,0]),
]))
story.append(summ_hdr)
story.append(Spacer(1,0.15*cm))
traps = [
("Surfactant DECREASES (not increases) surface tension",
"appeared WRONG in 4+ exam versions as 'increases'"),
("Ciliated pseudostratified columnar epithelium is NOT in bronchioles",
"FALSE statement repeated 4× and students still answered True"),
("Heart chambers partition in WEEKS 5-8, not week 4",
"'4th week' was the wrong answer most students selected"),
("Collateral flow PROTECTS — does NOT damage — the myocardium",
"'damages' appeared as an option and was chosen incorrectly 4+ times"),
("Anterior cardiac veins → RIGHT ATRIUM, not coronary sinus",
"students confused with great cardiac vein"),
("Ductus venosus → Ligamentum VENOSUM (not arteriosum)",
"ductus arteriosus → ligamentum arteriosum — students mixed these up"),
("Right subclavian arises from BRACHIOCEPHALIC TRUNK, not aorta",
"answered wrong as 'from aorta directly' multiple times"),
("Pericytes are in capillaries/venules ONLY, not all vessels",
"'all blood vessels' was chosen incorrectly 4+ times"),
("Peripheral chemoreceptors = carotid BODY (not carotid sinus)",
"carotid sinus = baroreceptor, appeared confusingly similar"),
("Vagal stimulation does NOT increase Ca²⁺ influx — it increases K⁺ permeability",
"'increases Ca²⁺' was the trap answer for ACh effect"),
("Cardiac tamponade DECREASES cardiac output (not increases)",
"'increases CO' was a chosen wrong answer"),
("LEFT bronchus is longer, narrower, more horizontal (not wider/vertical)",
"reversed descriptions appeared and were selected"),
("IMA branches: left colic, sigmoid, superior rectal — RIGHT colic = SMA",
"right colic was listed as IMA branch in wrong answers"),
("IVRT: ALL valves closed (both mitral AND aortic)",
"'mitral open, aortic closed' was a common wrong answer"),
("Lymph flow DECREASES when capillary oncotic pressure INCREASES",
"students answered 'increased lymph flow' incorrectly"),
]
trap_rows = []
for i, (trap_text, why) in enumerate(traps):
bg = CPK if i % 2 == 0 else CWH
trap_rows.append([
Paragraph(f'<b>{i+1}.</b> {trap_text}',
S(f'tr{i}', fontSize=9.5, textColor=CRD, fontName='Helvetica-Bold', leading=13)),
Paragraph(f'({why})',
S(f'tw{i}', fontSize=8.5, textColor=CML, fontName='Helvetica-Oblique', leading=11)),
])
trap_tab = Table(trap_rows, colWidths=[W*0.55, W*0.45])
trap_style = [
('BOX',(0,0),(-1,-1),0.8,CRD),
('INNERGRID',(0,0),(-1,-1),0.3,CLT),
('TOPPADDING',(0,0),(-1,-1),5),
('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),8),
('RIGHTPADDING',(0,0),(-1,-1),8),
('VALIGN',(0,0),(-1,-1),'MIDDLE'),
]
for i in range(len(trap_rows)):
bg = CPK if i % 2 == 0 else CWH
trap_style.append(('BACKGROUND',(0,i),(-1,i), bg))
trap_tab.setStyle(TableStyle(trap_style))
story.append(trap_tab)
story.append(Spacer(1, 0.4*cm))
# ── numbers to remember ───────────────────────────────────────────────────────
num_hdr = Table([[Paragraph('🔢 NUMBERS TO REMEMBER', S('nh', fontSize=11, textColor=CWH,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=14))]], colWidths=[W])
num_hdr.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1), CN),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
('ROUNDEDCORNERS',(0,0),(-1,-1),[6,6,0,0]),
]))
story.append(num_hdr)
nums = [
['Normal BP', '120/80 mmHg', 'Right atrial pressure', '~0 mmHg'],
['RV systolic', '25 mmHg', 'LV systolic', '120 mmHg'],
['Trachea', 'C6 → T4', 'Bifurcation', 'T4/T5'],
['Right lung lobes', '3', 'Left lung lobes', '2'],
['CO normal', '~5 L/min', 'EF normal', '55-70%'],
['Lung base (midaxillary)', 'Rib VIII', 'Pleural reflection', 'Rib X'],
['Thoracic duct starts', 'L1-L2 (cisterna chyli)', 'Ends', 'Left subclavian + IJV'],
['Surfactant starts', '~20-22 wk', 'Heart beats start', 'Day 21 (wk 3)'],
['PR interval normal', '0.12-0.20s', 'Veins hold blood', '~64% of total volume'],
['IMA originates', 'L3', 'Celiac trunk', 'T12'],
]
num_rows = []
for row in nums:
num_rows.append([
Paragraph(f'<b>{row[0]}</b>', S('nl', fontSize=9, textColor=CN, fontName='Helvetica-Bold', leading=12)),
Paragraph(f'<b>{row[1]}</b>', S('nv', fontSize=9, textColor=CGN, fontName='Helvetica-Bold', leading=12)),
Paragraph(f'<b>{row[2]}</b>', S('nl2', fontSize=9, textColor=CN, fontName='Helvetica-Bold', leading=12)),
Paragraph(f'<b>{row[3]}</b>', S('nv2', fontSize=9, textColor=CGN, fontName='Helvetica-Bold', leading=12)),
])
num_tab = Table(num_rows, colWidths=[W*0.22, W*0.28, W*0.22, W*0.28])
num_style = [
('BOX',(0,0),(-1,-1),0.8, CN),
('INNERGRID',(0,0),(-1,-1),0.3, CLT),
('TOPPADDING',(0,0),(-1,-1),4),
('BOTTOMPADDING',(0,0),(-1,-1),4),
('LEFTPADDING',(0,0),(-1,-1),6),
('RIGHTPADDING',(0,0),(-1,-1),6),
]
for i in range(len(num_rows)):
bg = CSK if i % 2 == 0 else CWH
num_style.append(('BACKGROUND',(0,i),(-1,i), bg))
num_tab.setStyle(TableStyle(num_style))
story.append(num_tab)
doc.build(story)
print(f'Done → {OUTPUT}')
cd /tmp/workspace/finals-study-guide && python3 make_top30.py 2>&1
ls -lh /tmp/workspace/finals-study-guide/TOP30_LAST_MINUTE.pdf
TOP30 LAST MINUTE
PDF Document · PDF
| Rank | Seen | Subject | Topic | The ONE fact to know |
|---|---|---|---|---|
| #1 | 6× | H | Surfactant & Surface Tension | Surfactant DECREASES surface tension |
| #2 | 6× | P | Cardiac Conduction Order | SA → AV → His → Branches → Purkinje |
| #3 | 6× | A | Ciliated Epithelium in Bronchioles | NOT in bronchioles — FALSE |
| #4 | 6× | P | Collateral Coronary Flow | Collateral flow PROTECTS the myocardium |
| #5 | 5× | H | Fetal Shunts & Adult Remnants | DA→lig.arteriosum / DV→lig.venosum / UV→lig.teres |
| #6 | 5× | A | Left vs Right Bronchus | Left = longer, narrower, more horizontal |
| #7 | 5× | P | ACh Effect on SA Node | ACh → hyperpolarization → ↓HR |
| #8 | 5× | H | Heart Chamber Septation | Weeks 5-8, NOT week 4 |
| #9 | 5× | A | Anterior Cardiac Veins | Drain into right atrium, not coronary sinus |
| #10 | 5× | P | Cardiac Output Formula | CO = HR × SV |
| #11 | 5× | A | Epicardium Identity | = Visceral layer of serous pericardium |
| #12 | 5× | P | Calcium & Cardiac Muscle | Weakness from Ca²⁺ deficiency (extracellular) |
| #13 | 5× | H | Left Atrium Origin | From primitive pulmonary vein |
| #14 | 5× | A | Trachea Level & Bifurcation | C6 → T4; bifurcates at T4/T5 |
| #15 | 4× | P | Isovolumetric Relaxation | ALL valves closed |
| #16 | 4× | A | Middle Mediastinum | Heart + pericardium; thymus = anterior |
| #17 | 4× | A | Superior Mediastinum / RLN | Right RLN NOT in superior mediastinum |
| #18 | 4× | H | Pericytes Location | Only in capillaries/venules — NOT all vessels |
| #19 | 4× | H | Thickest Vessel Layer | Arteries = media; Veins = adventitia |
| #20 | 4× | A | Tricuspid & Pulmonary Valve Cusps | Tricuspid = ant/septal/post; Pulmonary = L/R/ant |
| #21 | 4× | H | Foramen Ovale Closure | LA pressure > RA pressure at birth |
| #22 | 4× | P | Frank-Starling Law | ↑venous return → ↑EDV → ↑stretch → ↑SV |
| #23 | 4× | A | Right Subclavian Origin | From brachiocephalic trunk, not aorta directly |
| #24 | 4× | H | Lymphatic Vessel Lining | Simple squamous epithelium |
| #25 | 4× | A | Celiac Trunk Branches | Left gastric + splenic + common hepatic (NOT IMA) |
| #26 | 4× | P | Blood Pressure Regulation | MAP = CO × TPR; arterioles = resistance vessels |
| #27 | 4× | P | Edema & Lymphatics | Lymph flow ↓ when capillary oncotic P ↑ |
| #28 | 4× | P | Peripheral Chemoreceptors | Carotid BODY (not sinus — sinus = baroreceptor) |
| #29 | 4× | H | Laryngotracheal Diverticulum | Communicates with primordial pharynx |
| #30 | 4× | A | Azygos Vein & Thoracic Duct | Azygos → SVC; thoracic duct → left subclavian + IJV |
give correct answers for the above documents with explanation
give correct answers for the above word documents question papers with explanation
Review the complete answer key I just provided — it covers 200+ questions across all 5 Word documents with full explanations