attachment
attachment

answer these questions. According to rguhs pattern, by following G. K. Park textbook of physiology. Make a pdf

Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/rguhs-reproductive-physiology && ls /home/dayto…

Writing File

~/rguhs-reproductive-physiology/generate_pdf.py

#!/usr/bin/env python3
"""
RGUHS Reproductive System Physiology - Questions and Answers
Based on G.K. Park / Standard Physiology (Ganong's pattern)
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib.colors import HexColor, black, white
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.lib import colors

OUTPUT_PATH = "/home/daytona/workspace/rguhs-reproductive-physiology/RGUHS_Reproductive_Physiology_QA.pdf"

# ── Color palette ──────────────────────────────────────────────────────────────
DARK_BLUE   = HexColor("#1A3C5E")
MED_BLUE    = HexColor("#2E6DA4")
LIGHT_BLUE  = HexColor("#D6E8F7")
ACCENT      = HexColor("#E8733A")
LIGHT_GREY  = HexColor("#F5F5F5")
BORDER_GREY = HexColor("#CCCCCC")

def build_styles():
    base = getSampleStyleSheet()

    title_style = ParagraphStyle(
        "DocTitle", parent=base["Title"],
        fontSize=20, textColor=white, alignment=TA_CENTER,
        spaceAfter=4, spaceBefore=4, fontName="Helvetica-Bold"
    )
    subtitle_style = ParagraphStyle(
        "DocSubtitle", parent=base["Normal"],
        fontSize=11, textColor=LIGHT_BLUE, alignment=TA_CENTER,
        spaceAfter=2, fontName="Helvetica"
    )
    q_header_style = ParagraphStyle(
        "QHeader", parent=base["Normal"],
        fontSize=12, textColor=white, fontName="Helvetica-Bold",
        leftIndent=8, spaceBefore=0, spaceAfter=0
    )
    q_number_style = ParagraphStyle(
        "QNumber", parent=base["Normal"],
        fontSize=10, textColor=ACCENT, fontName="Helvetica-Bold",
        spaceBefore=12, spaceAfter=2
    )
    section_style = ParagraphStyle(
        "SectionHead", parent=base["Normal"],
        fontSize=11, textColor=MED_BLUE, fontName="Helvetica-Bold",
        spaceBefore=8, spaceAfter=3, underlineWidth=0
    )
    body_style = ParagraphStyle(
        "Body", parent=base["Normal"],
        fontSize=9.5, textColor=black, fontName="Helvetica",
        spaceBefore=3, spaceAfter=3, leading=14, alignment=TA_JUSTIFY,
        leftIndent=0
    )
    bullet_style = ParagraphStyle(
        "Bullet", parent=base["Normal"],
        fontSize=9.5, textColor=black, fontName="Helvetica",
        spaceBefore=1, spaceAfter=1, leading=13, leftIndent=16,
        bulletIndent=4
    )
    table_header_style = ParagraphStyle(
        "TableH", parent=base["Normal"],
        fontSize=9, textColor=white, fontName="Helvetica-Bold",
        alignment=TA_CENTER
    )
    table_cell_style = ParagraphStyle(
        "TableC", parent=base["Normal"],
        fontSize=9, textColor=black, fontName="Helvetica",
        alignment=TA_LEFT, leading=12
    )
    note_style = ParagraphStyle(
        "Note", parent=base["Normal"],
        fontSize=9, textColor=HexColor("#555555"), fontName="Helvetica-Oblique",
        spaceBefore=4, spaceAfter=4, leading=12, leftIndent=8,
        borderPad=4
    )
    return {
        "title": title_style, "subtitle": subtitle_style,
        "q_header": q_header_style, "q_number": q_number_style,
        "section": section_style, "body": body_style,
        "bullet": bullet_style, "table_header": table_header_style,
        "table_cell": table_cell_style, "note": note_style
    }


def question_block(styles, q_num, q_text, marks, content_elements):
    """Wrap a question + answer in a styled block."""
    elems = []
    # Question header bar
    hdr_text = f"Q{q_num}. {q_text}  [{marks}]"
    hdr_para = Paragraph(hdr_text, styles["q_header"])
    hdr_table = Table([[hdr_para]], colWidths=[17.5*cm])
    hdr_table.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
        ("ROUNDEDCORNERS", [4,4,4,4]),
    ]))
    elems.append(KeepTogether([hdr_table] + content_elements[:3]))
    elems += content_elements[3:]
    elems.append(Spacer(1, 0.3*cm))
    return elems


def p(text, style):
    return Paragraph(text, style)

def b(text, style):
    return Paragraph(f"• {text}", style)

def sp(h=0.2):
    return Spacer(1, h*cm)


def build_content(styles):
    S = styles
    elems = []

    # ─── Q1: Turner's Syndrome ───────────────────────────────────────────────
    c1 = [
        sp(),
        p("<b>Definition:</b> Turner's syndrome is a chromosomal disorder in females characterized by the karyotype <b>45, XO</b> (monosomy X), resulting from absence of one sex chromosome.", S["body"]),
        sp(0.15),
        p("<b>Etiology:</b>", S["section"]),
        b("Chromosomal nondisjunction during meiosis (most common)", S["bullet"]),
        b("Loss of sex chromosome during early embryonic mitosis", S["bullet"]),
        b("Mosaicism: 45,X / 46,XX or 45,X / 46,XY (10-20% of cases)", S["bullet"]),
        sp(0.15),
        p("<b>Clinical Features:</b>", S["section"]),
        p("Short stature (most consistent feature - final height 135-150 cm)", S["bullet"]),
        p("Sexual infantilism - primary amenorrhea, streak gonads", S["bullet"]),
        p("Webbed neck (pterygium colli)", S["bullet"]),
        p("Shield-shaped chest with widely spaced nipples", S["bullet"]),
        p("Cubitus valgus (increased carrying angle at elbow)", S["bullet"]),
        p("Low posterior hairline", S["bullet"]),
        p("Lymphedema of hands and feet at birth", S["bullet"]),
        p("Coarctation of aorta (cardiovascular anomaly in 20%)", S["bullet"]),
        p("Horseshoe kidney (renal anomalies)", S["bullet"]),
        p("Normal intelligence (though spatial perception may be impaired)", S["bullet"]),
        sp(0.15),
        p("<b>Hormonal Profile:</b>", S["section"]),
        p("Due to streak (dysgenetic) ovaries: Estrogen low, FSH and LH markedly elevated (hypergonadotropic hypogonadism).", S["body"]),
        sp(0.15),
        p("<b>Treatment:</b>", S["section"]),
        b("Growth hormone therapy to improve final height", S["bullet"]),
        b("Estrogen replacement at age 12-13 years to induce secondary sexual characteristics", S["bullet"]),
        b("Cyclic estrogen-progesterone for menstrual cycles", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23</i>", S["note"]),
    ]
    elems += question_block(S, 1, "Turner's Syndrome", "5 Marks", c1)

    # ─── Q2: Physiological changes during puberty in male ───────────────────
    c2 = [
        sp(),
        p("<b>Definition:</b> Puberty is the period of transition from sexual immaturity to full reproductive maturity. In males it occurs between <b>10-14 years</b>.", S["body"]),
        sp(0.15),
        p("<b>Sequence of Events (Tanner Stages):</b>", S["section"]),
        # Table
        Table(
            [
                [Paragraph("<b>Stage</b>", S["table_header"]), Paragraph("<b>Age (yrs)</b>", S["table_header"]), Paragraph("<b>Event</b>", S["table_header"])],
                [Paragraph("1", S["table_cell"]), Paragraph("< 9", S["table_cell"]), Paragraph("Prepubertal - no changes", S["table_cell"])],
                [Paragraph("2", S["table_cell"]), Paragraph("9-11", S["table_cell"]), Paragraph("Testicular enlargement (first sign), pubic hair begins", S["table_cell"])],
                [Paragraph("3", S["table_cell"]), Paragraph("11-13", S["table_cell"]), Paragraph("Penile growth, pubic hair curls, voice breaks", S["table_cell"])],
                [Paragraph("4", S["table_cell"]), Paragraph("12-14", S["table_cell"]), Paragraph("Axillary hair, acne, adult-type pubic hair", S["table_cell"])],
                [Paragraph("5", S["table_cell"]), Paragraph("14-16", S["table_cell"]), Paragraph("Adult genitalia, facial hair, spermatogenesis complete", S["table_cell"])],
            ],
            colWidths=[2.5*cm, 3*cm, 12*cm],
        ),
        sp(0.15),
        p("<b>Physiological Changes in Males:</b>", S["section"]),
        p("<u>Genital Development:</u> Testicular enlargement is the first sign. Penis elongates and broadens. Scrotum becomes pigmented.", S["body"]),
        p("<u>Hair Changes:</u> Pubic hair (pubarche) appears, followed by axillary, facial and body hair. Male-pattern temporal hairline recession.", S["body"]),
        p("<u>Growth Spurt:</u> Rapid increase in height (8-10 cm/year peak velocity). Androgens stimulate linear growth but ultimately fuse epiphyses (via conversion to estrogen).", S["body"]),
        p("<u>Muscular Development:</u> Increase in muscle mass and strength due to testosterone anabolic effects.", S["body"]),
        p("<u>Voice Changes:</u> Laryngeal growth causes voice deepening (\"voice breaking\").", S["body"]),
        p("<u>Sebaceous Glands:</u> Activation leads to acne vulgaris.", S["body"]),
        p("<u>Spermatogenesis:</u> Begins with the onset of puberty; first ejaculation (spermarche) at ~13 years.", S["body"]),
        p("<u>Psychological Changes:</u> Increase in libido, aggressive behavior, sex drive.", S["body"]),
        sp(0.15),
        p("<b>Hormonal Control of Puberty:</b>", S["section"]),
        b("Hypothalamus: Pulsatile GnRH secretion begins (nocturnal initially)", S["bullet"]),
        b("Pituitary: FSH and LH secreted", S["bullet"]),
        b("Testis: Testosterone and inhibin produced", S["bullet"]),
        b("Adrenal Androgens (DHEA, androstenedione): adrenarche precedes puberty", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23</i>", S["note"]),
    ]
    elems += question_block(S, 2, "Physiological Changes During Puberty in Male", "5 Marks", c2)
    # Style the table in c2
    t = c2[3]
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("BACKGROUND",    (0,1), (-1,-1), LIGHT_GREY),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [white, LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ]))

    # ─── Q3: Physiology of puberty in female ────────────────────────────────
    c3 = [
        sp(),
        p("<b>Definition:</b> Puberty in females begins at <b>8-13 years</b> and is complete by 16 years. It is controlled by the hypothalamo-pituitary-gonadal (HPG) axis.", S["body"]),
        sp(0.15),
        p("<b>Sequence of Events:</b>", S["section"]),
        b("<b>Thelarche</b> (8-13 yrs): Breast budding - FIRST sign of puberty in females", S["bullet"]),
        b("<b>Pubarche</b> (9-14 yrs): Pubic and axillary hair growth (adrenal androgens)", S["bullet"]),
        b("<b>Growth spurt</b> (10-14 yrs): Peak height velocity 6-8 cm/year (earlier than males)", S["bullet"]),
        b("<b>Menarche</b> (10-16 yrs, mean 12.8 yrs): First menstruation (late event)", S["bullet"]),
        sp(0.15),
        p("<b>Physiological Changes in Females:</b>", S["section"]),
        p("<u>Breast Development:</u> Estrogen stimulates ductal growth; progesterone promotes lobulo-alveolar development.", S["body"]),
        p("<u>External Genitalia:</u> Labia majora and minora enlarge, vaginal mucosa thickens and glycogen appears (Doderlein's bacilli colonize).", S["body"]),
        p("<u>Uterus and Ovaries:</u> Uterus enlarges, ovarian follicles mature, cyclical changes begin.", S["body"]),
        p("<u>Body Shape:</u> Fat deposition over hips, thighs, buttocks (gynoid pattern). Widening of pelvis.", S["body"]),
        p("<u>Skeletal:</u> Growth spurt earlier than boys; epiphyseal closure earlier.", S["body"]),
        p("<u>Skin:</u> Mild acne, sebaceous gland activation.", S["body"]),
        sp(0.15),
        p("<b>Hormonal Regulation:</b>", S["section"]),
        b("Hypothalamus secretes GnRH (pulsatile) - triggered by leptin (body fat threshold)", S["bullet"]),
        b("Anterior pituitary releases FSH and LH", S["bullet"]),
        b("Ovaries produce Estradiol - primary hormone driving female pubertal changes", S["bullet"]),
        b("Adrenal androgens (DHEA-S) cause pubic/axillary hair", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22</i>", S["note"]),
    ]
    elems += question_block(S, 3, "Physiology of Puberty in Female", "5 Marks", c3)

    # ─── Q4: Cell types in testis + capacitation ────────────────────────────
    c4 = [
        sp(),
        p("<b>A. Cell Types in Testis:</b>", S["section"]),
        p("The testis has two main compartments: <b>seminiferous tubules</b> (spermatogenesis) and <b>interstitium</b> (testosterone production).", S["body"]),
        sp(0.1),
        Table(
            [
                [Paragraph("<b>Cell Type</b>", S["table_header"]), Paragraph("<b>Location</b>", S["table_header"]), Paragraph("<b>Function</b>", S["table_header"])],
                [Paragraph("Sertoli Cells", S["table_cell"]), Paragraph("Seminiferous tubule wall", S["table_cell"]), Paragraph("Nurse cells; support spermatogenesis; secrete inhibin, ABP, AMH, estrogen", S["table_cell"])],
                [Paragraph("Leydig Cells", S["table_cell"]), Paragraph("Interstitium", S["table_cell"]), Paragraph("Testosterone synthesis (stimulated by LH)", S["table_cell"])],
                [Paragraph("Spermatogonia", S["table_cell"]), Paragraph("Basal lamina of tubule", S["table_cell"]), Paragraph("Stem cells; undergo mitosis to produce primary spermatocytes", S["table_cell"])],
                [Paragraph("Primary Spermatocytes", S["table_cell"]), Paragraph("Adluminal compartment", S["table_cell"]), Paragraph("Undergo meiosis I to form secondary spermatocytes", S["table_cell"])],
                [Paragraph("Secondary Spermatocytes", S["table_cell"]), Paragraph("Adluminal compartment", S["table_cell"]), Paragraph("Short-lived; undergo meiosis II to form spermatids", S["table_cell"])],
                [Paragraph("Spermatids", S["table_cell"]), Paragraph("Near lumen", S["table_cell"]), Paragraph("Haploid cells; undergo spermiogenesis to become spermatozoa", S["table_cell"])],
                [Paragraph("Peritubular Myoid Cells", S["table_cell"]), Paragraph("Around tubule", S["table_cell"]), Paragraph("Contractility; propel sperm toward epididymis", S["table_cell"])],
            ],
            colWidths=[4*cm, 4.5*cm, 9*cm],
        ),
        sp(0.15),
        p("<b>B. Capacitation of Sperms:</b>", S["section"]),
        p("Capacitation is the process by which spermatozoa acquire the ability to fertilize an ovum. It occurs in the <b>female reproductive tract</b> (uterus and fallopian tubes) over 5-6 hours.", S["body"]),
        p("<b>Changes During Capacitation:</b>", S["section"]),
        b("Removal of cholesterol from the sperm plasma membrane - increases membrane fluidity", S["bullet"]),
        b("Hyperpolarization then hyperactivation of sperm motility (whiplash movement)", S["bullet"]),
        b("Rise in intracellular Ca²⁺ - activates CatSper channels", S["bullet"]),
        b("Increase in intracellular cAMP levels", S["bullet"]),
        b("Membrane reorganization exposes zona-binding receptors (ZP3 receptors)", S["bullet"]),
        b("Enables Acrosome Reaction - release of acrosomal enzymes (hyaluronidase, acrosin) for zona pellucida penetration", S["bullet"]),
        p("<b>Factors promoting capacitation:</b> Bicarbonate ions, albumin, progesterone from follicular fluid, removal of decapacitation factors.", S["body"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23</i>", S["note"]),
    ]
    t4 = c4[3]
    t4.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [white, LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ]))
    elems += question_block(S, 4, "Cell Types in Testis and Capacitation of Sperms", "5 Marks", c4)

    # ─── Q5: Sertoli cells and role ─────────────────────────────────────────
    c5 = [
        sp(),
        p("<b>Definition:</b> Sertoli cells (sustentacular cells / nurse cells) are large, complex glycogen-containing cells that line the seminiferous tubules, stretching from basal lamina to lumen.", S["body"]),
        sp(0.15),
        p("<b>Morphology:</b>", S["section"]),
        b("Tall columnar cells resting on basal lamina of seminiferous tubules", S["bullet"]),
        b("Irregular nucleus with prominent nucleolus", S["bullet"]),
        b("Extensive cytoplasmic processes that surround and support developing germ cells", S["bullet"]),
        b("Adjacent Sertoli cells connected by tight junctions - form Blood-Testis Barrier", S["bullet"]),
        sp(0.15),
        p("<b>Functions of Sertoli Cells:</b>", S["section"]),
        p("<u>1. Nutritive/Support Function:</u> Provide nutrients and structural support to developing spermatogenic cells. Germ cells must maintain contact with Sertoli cells via cytoplasmic bridges to survive.", S["body"]),
        p("<u>2. Blood-Testis Barrier Formation:</u> Tight junctions between adjacent Sertoli cells form the BTB, protecting germ cells from immune attack and maintaining a specialized microenvironment.", S["body"]),
        p("<u>3. Phagocytic Function:</u> Phagocytose residual bodies (cytoplasmic remnants) shed by spermatids during spermiogenesis.", S["body"]),
        p("<u>4. Hormone Secretion:</u>", S["body"]),
        b("<b>Inhibin B:</b> Negative feedback on FSH secretion from anterior pituitary", S["bullet"]),
        b("<b>Androgen-Binding Protein (ABP):</b> Concentrates testosterone in seminiferous tubule lumen (essential for spermatogenesis). Secretion stimulated by FSH and testosterone.", S["bullet"]),
        b("<b>Anti-Mullerian Hormone (AMH):</b> Causes regression of Mullerian ducts in male fetus", S["bullet"]),
        b("<b>Activin:</b> Stimulates FSH secretion (opposite of inhibin)", S["bullet"]),
        b("<b>Estradiol:</b> Via aromatization of androgens (in Sertoli cells)", S["bullet"]),
        b("<b>Transferrin, Ceruloplasmin:</b> Transport proteins for iron and copper to germ cells", S["bullet"]),
        p("<u>5. FSH Receptor Site:</u> Sertoli cells are the primary target of FSH in the male. FSH-stimulated Sertoli cells support spermatogenesis indirectly.", S["body"]),
        p("<u>6. Spermiogenesis Support:</u> Guide spermatid transformation into spermatozoa (spermiogenesis).", S["body"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23</i>", S["note"]),
    ]
    elems += question_block(S, 5, "Sertoli Cells and Their Role", "5 Marks", c5)

    # ─── Q6: Blood-Testis Barrier ───────────────────────────────────────────
    c6 = [
        sp(),
        p("<b>Definition:</b> The Blood-Testis Barrier (BTB) is a physical and physiological barrier formed by <b>tight junctions (zonula occludens) between adjacent Sertoli cells</b> near the basal lamina of seminiferous tubules, dividing the tubule into two compartments.", S["body"]),
        sp(0.15),
        p("<b>Compartments Created:</b>", S["section"]),
        b("<b>Basal Compartment:</b> Between basal lamina and tight junctions - contains spermatogonia and early primary spermatocytes; communicates freely with blood", S["bullet"]),
        b("<b>Adluminal Compartment:</b> Between tight junctions and lumen - contains late primary spermatocytes, secondary spermatocytes, spermatids; isolated from blood", S["bullet"]),
        sp(0.15),
        p("<b>Components of BTB:</b>", S["section"]),
        b("Tight junctions (Claudin-3, -11, Occludin) between Sertoli cells", S["bullet"]),
        b("Gap junctions and adherens junctions", S["bullet"]),
        b("Peritubular myoid cells and basement membrane", S["bullet"]),
        sp(0.15),
        p("<b>Functions of BTB:</b>", S["section"]),
        p("<u>1. Immunological Privilege:</u> Prevents antigenic spermatogenic cells from entering blood circulation and generating autoimmune response. (Spermatogenesis begins at puberty - after immune tolerance is established; so haploid sperm antigens are \"non-self\")", S["body"]),
        p("<u>2. Specialized Microenvironment:</u> Tubular fluid differs from plasma - rich in androgens, estrogens, K⁺, inositol, glutamic acid and poor in protein and glucose. BTB maintains this unique composition essential for spermatogenesis.", S["body"]),
        p("<u>3. Protection from Noxious Agents:</u> Prevents bloodborne toxic substances (drugs, toxins) from damaging developing germ cells.", S["body"]),
        p("<u>4. Osmotic Gradient:</u> Creates osmotic gradient that facilitates fluid movement into tubular lumen, aiding sperm transport.", S["body"]),
        sp(0.15),
        p("<b>What Crosses the BTB:</b>", S["section"]),
        b("Steroids (lipid-soluble) - pass freely through BTB", S["bullet"]),
        b("Some proteins pass in paracrine manner between Sertoli and Leydig cells", S["bullet"]),
        b("Maturing germ cells migrate through BTB via coordinated tight junction remodeling (breakdown above, reformation below the migrating cell)", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23, p.423-424</i>", S["note"]),
    ]
    elems += question_block(S, 6, "Blood-Testis Barrier", "5 Marks", c6)

    elems.append(PageBreak())

    # ─── Q7: Spermatogenesis + factors + male infertility ───────────────────
    c7 = [
        sp(),
        p("<b>Spermatogenesis</b> is the process by which spermatogonia develop into mature spermatozoa. It occurs in seminiferous tubules and takes approximately <b>74 days</b>.", S["body"]),
        sp(0.15),
        p("<b>Stages of Spermatogenesis:</b>", S["section"]),
        p("<b>Phase 1 - Spermatocytogenesis (Mitosis):</b>", S["body"]),
        b("Type A spermatogonia (stem cells) divide by mitosis", S["bullet"]),
        b("Type B spermatogonia form primary spermatocytes (2n = 46 chromosomes)", S["bullet"]),
        p("<b>Phase 2 - Meiosis:</b>", S["body"]),
        b("Primary spermatocytes undergo Meiosis I → 2 Secondary spermatocytes (2n)", S["bullet"]),
        b("Secondary spermatocytes undergo Meiosis II → 4 Spermatids (n = 23 chromosomes, haploid)", S["bullet"]),
        p("<b>Phase 3 - Spermiogenesis (Differentiation):</b>", S["body"]),
        b("Spermatids transform into spermatozoa (no cell division)", S["bullet"]),
        b("Golgi phase: Acrosomal vesicle formation", S["bullet"]),
        b("Cap phase: Acrosome covers nucleus", S["bullet"]),
        b("Acrosomal phase: Nucleus condenses, flagellum forms", S["bullet"]),
        b("Maturation phase: Residual cytoplasm shed, mitochondria form sheath", S["bullet"]),
        sp(0.15),
        p("<b>Factors Regulating Spermatogenesis:</b>", S["section"]),
        b("<b>FSH:</b> Acts on Sertoli cells; promotes ABP production and supports spermatogenesis", S["bullet"]),
        b("<b>LH:</b> Stimulates Leydig cells → testosterone production → essential for spermatogenesis", S["bullet"]),
        b("<b>Testosterone:</b> High intratubular concentration required (maintained by ABP)", S["bullet"]),
        b("<b>Temperature:</b> Optimal at 33-35°C (2-4°C below body temp) - explains scrotal position", S["bullet"]),
        b("<b>Thyroid Hormones:</b> Needed for normal function", S["bullet"]),
        b("<b>Nutrition:</b> Vitamin A, E, zinc deficiency impairs spermatogenesis", S["bullet"]),
        b("<b>Inhibin:</b> (from Sertoli) negative feedback on FSH", S["bullet"]),
        sp(0.15),
        p("<b>Factors Causing Male Infertility:</b>", S["section"]),
        Table(
            [
                [Paragraph("<b>Category</b>", S["table_header"]), Paragraph("<b>Examples</b>", S["table_header"])],
                [Paragraph("Pre-testicular", S["table_cell"]), Paragraph("Hypogonadotropic hypogonadism, pituitary tumors, Kallmann syndrome, obesity, drugs (anabolic steroids, chemotherapy)", S["table_cell"])],
                [Paragraph("Testicular", S["table_cell"]), Paragraph("Cryptorchidism, varicocele, orchitis (mumps), Klinefelter syndrome (47,XXY), radiation, testicular torsion, Y chromosome microdeletions", S["table_cell"])],
                [Paragraph("Post-testicular", S["table_cell"]), Paragraph("Obstruction (vas deferens agenesis, epididymitis), erectile dysfunction, retrograde ejaculation, antisperm antibodies", S["table_cell"])],
                [Paragraph("Sperm defects", S["table_cell"]), Paragraph("Azoospermia, oligospermia (<15 million/mL), asthenospermia (motility <40%), teratospermia (morphology <4%)", S["table_cell"])],
            ],
            colWidths=[4.5*cm, 13*cm],
        ),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23</i>", S["note"]),
    ]
    t7 = c7[-2]
    t7.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [white, LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    elems += question_block(S, 7, "Spermatogenesis: Regulation and Factors Causing Male Infertility", "5 Marks", c7)

    # ─── Q8: Endocrine functions of testis ──────────────────────────────────
    c8 = [
        sp(),
        p("The testis has dual function: <b>exocrine</b> (sperm production) and <b>endocrine</b> (hormone secretion).", S["body"]),
        sp(0.15),
        p("<b>A. Testosterone (Primary Androgen):</b>", S["section"]),
        b("Produced by: Leydig cells (stimulated by LH)", S["bullet"]),
        b("Daily production: 4-9 mg/day", S["bullet"]),
        b("Transport: 44% bound to SHBG, 54% to albumin, 2% free (active)", S["bullet"]),
        b("Converted to: DHT (by 5α-reductase in target cells), Estradiol (by aromatase)", S["bullet"]),
        sp(0.1),
        p("<b>Actions of Testosterone:</b>", S["section"]),
        b("Fetal: Wolffian duct development (internal male genitalia), descent of testes", S["bullet"]),
        b("Puberty: Development of secondary sexual characteristics, growth spurt, male pattern hair distribution, voice deepening, penile growth", S["bullet"]),
        b("Adult: Maintenance of libido, spermatogenesis, muscle anabolism", S["bullet"]),
        b("Metabolic: Protein anabolism, Na⁺/K⁺/H₂O retention, increases kidney size, RBC production (erythropoiesis)", S["bullet"]),
        b("CNS: Aggressive behavior, spatial cognition, sex drive", S["bullet"]),
        sp(0.15),
        p("<b>B. Dihydrotestosterone (DHT):</b>", S["section"]),
        b("More potent than testosterone (higher affinity for androgen receptor)", S["bullet"]),
        b("Responsible for: Male external genitalia formation in fetus, prostate growth, facial hair, temporal hairline recession, acne", S["bullet"]),
        sp(0.15),
        p("<b>C. Inhibin B:</b>", S["section"]),
        b("Secreted by Sertoli cells; selectively inhibits FSH secretion (negative feedback)", S["bullet"]),
        b("Acts as a marker of Sertoli cell function and spermatogenesis", S["bullet"]),
        sp(0.15),
        p("<b>D. Activin:</b>", S["section"]),
        b("Secreted by Sertoli cells; stimulates FSH secretion (opposite effect to inhibin)", S["bullet"]),
        sp(0.15),
        p("<b>E. Estradiol:</b>", S["section"]),
        b("Small amount produced by Sertoli cells (aromatization of testosterone)", S["bullet"]),
        b("Role in spermatogenesis, feedback on hypothalamus (suppresses GnRH)", S["bullet"]),
        sp(0.15),
        p("<b>F. Anti-Mullerian Hormone (AMH):</b>", S["section"]),
        b("Secreted by Sertoli cells during fetal development", S["bullet"]),
        b("Causes regression of Mullerian (paramesonephric) ducts → prevents uterus and fallopian tube development in males", S["bullet"]),
        p("<b>Regulation:</b>", S["section"]),
        p("Hypothalamus (GnRH) → Anterior Pituitary (LH → Leydig cells → Testosterone; FSH → Sertoli cells → Inhibin, ABP) → Negative feedback by testosterone and inhibin.", S["body"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 23</i>", S["note"]),
    ]
    elems += question_block(S, 8, "Endocrine Functions of Testis", "5 Marks", c8)

    elems.append(PageBreak())

    # ─── Q9: Functions of ovary and regulation (10m) ─────────────────────────
    c9 = [
        sp(),
        p("The ovary has two main functions: <b>gametogenic</b> (oogenesis) and <b>endocrine</b> (hormone secretion), both regulated by the hypothalamo-pituitary-gonadal axis.", S["body"]),
        sp(0.15),
        p("<b>A. GAMETOGENIC FUNCTION (Oogenesis):</b>", S["section"]),
        p("Production of mature ova from primordial germ cells.", S["body"]),
        b("At birth: ~2 million primordial follicles present (from 7 million at 20 weeks gestation)", S["bullet"]),
        b("At puberty: ~400,000 remain; only ~400-500 will ovulate in a lifetime", S["bullet"]),
        b("Follicular development occurs in waves throughout reproductive life", S["bullet"]),
        sp(0.1),
        p("<b>Stages of Follicular Development:</b>", S["body"]),
        b("Primordial follicle → Primary follicle → Secondary (antral) follicle → Graafian follicle → Ovulation", S["bullet"]),
        p("During each cycle, a cohort of follicles is recruited; only one becomes the dominant follicle (Graafian) which ovulates.", S["body"]),
        sp(0.15),
        p("<b>B. ENDOCRINE FUNCTION:</b>", S["section"]),
        p("<b>1. Estrogens (Estradiol E2, Estrone E1, Estriol E3):</b>", S["body"]),
        p("<i>Source:</i> Granulosa cells (via two-cell theory: Theca cells produce androgens under LH stimulation; granulosa cells aromatize to estrogens under FSH stimulation).", S["body"]),
        p("<i>Actions:</i>", S["body"]),
        b("Development of female secondary sexual characteristics", S["bullet"]),
        b("Stimulates growth of uterus, vagina, fallopian tubes", S["bullet"]),
        b("Proliferative phase of endometrium (endometrial proliferation)", S["bullet"]),
        b("Cervical mucus - thin, clear, ferning, spinnbarkeit (facilitates sperm entry)", S["bullet"]),
        b("Positive feedback on LH surge (at high levels, mid-cycle)", S["bullet"]),
        b("Bone: Increases bone density (decreases osteoclast activity)", S["bullet"]),
        b("Cardiovascular: Increases HDL, decreases LDL", S["bullet"]),
        b("Liver: Increases synthesis of clotting factors, SHBG, TBG, CBG", S["bullet"]),
        b("CNS: Mood regulation, neuroprotection, memory", S["bullet"]),
        b("Sodium and water retention", S["bullet"]),
        sp(0.1),
        p("<b>2. Progesterone:</b>", S["body"]),
        p("<i>Source:</i> Corpus luteum (after ovulation); placenta (in pregnancy).", S["body"]),
        p("<i>Actions:</i>", S["body"]),
        b("Secretory phase of endometrium - prepares uterus for implantation", S["bullet"]),
        b("Increases basal body temperature (thermogenic effect) by 0.5°C - used to detect ovulation", S["bullet"]),
        b("Cervical mucus - thick, scanty, hostile to sperm (blocks entry after ovulation)", S["bullet"]),
        b("Inhibits uterine contractility (\"uterine quiescence\")", S["bullet"]),
        b("Promotes alveolar (lobular) breast development", S["bullet"]),
        b("Negative feedback on hypothalamus and pituitary (suppresses GnRH, FSH, LH)", S["bullet"]),
        b("Natriuretic effect (aldosterone antagonism)", S["bullet"]),
        sp(0.1),
        p("<b>3. Inhibin A and B:</b>", S["body"]),
        b("Inhibin B: Secreted in follicular phase; inhibits FSH", S["bullet"]),
        b("Inhibin A: Secreted in luteal phase; inhibits FSH", S["bullet"]),
        sp(0.1),
        p("<b>4. Relaxin:</b> Secreted by corpus luteum; relaxes pubic symphysis during pregnancy; cervical ripening.", S["body"]),
        sp(0.15),
        p("<b>C. REGULATION OF OVARIAN FUNCTION:</b>", S["section"]),
        p("<b>Hypothalamus:</b> Secretes GnRH (gonadotropin-releasing hormone) in pulses. Pulse frequency determines whether FSH or LH is preferentially released.", S["body"]),
        p("<b>Anterior Pituitary:</b>", S["body"]),
        b("FSH: Stimulates follicular growth, granulosa cell proliferation, estrogen synthesis", S["bullet"]),
        b("LH: Required for theca cell androgen synthesis; triggers ovulation (LH surge); luteinizes granulosa cells → forms corpus luteum", S["bullet"]),
        p("<b>Feedback Mechanisms:</b>", S["body"]),
        b("Low estrogen: Negative feedback → suppresses FSH/LH (prevents premature ovulation)", S["bullet"]),
        b("High estrogen (pre-ovulatory): Positive feedback → triggers LH surge → ovulation", S["bullet"]),
        b("Progesterone (luteal phase): Negative feedback → suppresses GnRH, FSH, LH", S["bullet"]),
        b("Inhibin: Selectively inhibits FSH (negative feedback)", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22</i>", S["note"]),
    ]
    elems += question_block(S, 9, "Functions of Ovary and How It Is Regulated", "10 Marks", c9)

    # ─── Q10: Ovulation + regulation + tests for ovulation (5m) ─────────────
    c10 = [
        sp(),
        p("<b>Ovulation</b> is the release of a secondary oocyte from the dominant (Graafian) follicle. It occurs on approximately <b>Day 14</b> of a 28-day cycle.", S["body"]),
        sp(0.15),
        p("<b>Events Leading to Ovulation:</b>", S["section"]),
        b("Rising estradiol from dominant follicle triggers positive feedback on anterior pituitary", S["bullet"]),
        b("LH surge occurs 24-36 hours before ovulation (critical trigger)", S["bullet"]),
        b("FSH surge accompanies LH surge", S["bullet"]),
        b("LH surge triggers resumption of meiosis I in oocyte", S["bullet"]),
        b("Prostaglandins and proteolytic enzymes cause follicular wall thinning and rupture", S["bullet"]),
        b("Secondary oocyte expelled with cumulus oophorus (corona radiata)", S["bullet"]),
        b("Ruptured follicle becomes corpus luteum", S["bullet"]),
        sp(0.15),
        p("<b>Regulation of Ovulation:</b>", S["section"]),
        b("GnRH pulse frequency must increase to trigger LH surge", S["bullet"]),
        b("Kisspeptin neurons in arcuate nucleus drive GnRH surge", S["bullet"]),
        b("LH surge → Luteinization of granulosa cells → Progesterone spike → Further amplifies LH surge", S["bullet"]),
        b("Prostaglandin E2, collagenase, plasminogen activator dissolve follicular wall", S["bullet"]),
        sp(0.15),
        p("<b>Tests/Indicators of Ovulation:</b>", S["section"]),
        Table(
            [
                [Paragraph("<b>Test</b>", S["table_header"]), Paragraph("<b>Finding Indicating Ovulation</b>", S["table_header"]), Paragraph("<b>Timing</b>", S["table_header"])],
                [Paragraph("Basal Body Temperature (BBT)", S["table_cell"]), Paragraph("Rise of 0.5°C in post-ovulatory phase (due to progesterone)", S["table_cell"]), Paragraph("Daily morning measurement", S["table_cell"])],
                [Paragraph("Serum Progesterone", S["table_cell"]), Paragraph(">3-5 ng/mL (mid-luteal day 21)", S["table_cell"]), Paragraph("Day 21 of cycle", S["table_cell"])],
                [Paragraph("LH Urine Test (Ovulation Kit)", S["table_cell"]), Paragraph("Positive - detects LH surge 24-36 hrs before ovulation", S["table_cell"]), Paragraph("Around day 12-13", S["table_cell"])],
                [Paragraph("Transvaginal Ultrasound", S["table_cell"]), Paragraph("Follicle >18mm, then collapse after ovulation; free fluid in POD", S["table_cell"]), Paragraph("Serial monitoring", S["table_cell"])],
                [Paragraph("Cervical Mucus", S["table_cell"]), Paragraph("Spinnbarkeit >10cm, ferning pattern (estrogenic phase)", S["table_cell"]), Paragraph("Mid-cycle", S["table_cell"])],
                [Paragraph("Endometrial Biopsy", S["table_cell"]), Paragraph("Secretory endometrium confirms ovulation occurred", S["table_cell"]), Paragraph("Day 21-23", S["table_cell"])],
                [Paragraph("Mittelschmerz", S["table_cell"]), Paragraph("Mid-cycle pain (unilateral) at time of ovulation", S["table_cell"]), Paragraph("Day 14", S["table_cell"])],
            ],
            colWidths=[4.5*cm, 8*cm, 5*cm],
        ),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22</i>", S["note"]),
    ]
    t10 = c10[-2]
    t10.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [white, LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    elems += question_block(S, 10, "Ovulation: Description, Regulation and Tests for Ovulation", "5 Marks", c10)

    elems.append(PageBreak())

    # ─── Q11: Ovarian and endometrial changes in menstrual cycle (10m) ───────
    c11 = [
        sp(),
        p("The menstrual cycle averages <b>28 days</b> (range 21-35 days). It involves coordinated <b>ovarian</b> and <b>endometrial</b> changes driven by hormonal regulation.", S["body"]),
        sp(0.15),
        p("<b>A. OVARIAN CHANGES (Ovarian Cycle):</b>", S["section"]),
        p("<b>1. Follicular Phase (Days 1-14):</b>", S["body"]),
        b("Early follicular phase: FSH rises → recruits cohort of antral follicles", S["bullet"]),
        b("Dominant follicle selected (highest FSH receptor density, most estrogen production)", S["bullet"]),
        b("Dominant follicle grows 10-20mm; secretes increasing estradiol", S["bullet"]),
        b("Rising estrogen initially suppresses FSH (negative feedback) → follicular atresia of non-dominant follicles", S["bullet"]),
        p("<b>2. Ovulation (Day 14):</b>", S["body"]),
        b("Estradiol peaks → positive feedback → LH surge → ovulation within 36 hours", S["bullet"]),
        b("Secondary oocyte released, picked up by fimbriae of fallopian tube", S["bullet"]),
        p("<b>3. Luteal Phase (Days 14-28):</b>", S["body"]),
        b("Corpus luteum forms from ruptured follicle (granulosa lutein and theca lutein cells)", S["bullet"]),
        b("Corpus luteum secretes progesterone (max ~day 21), estradiol, inhibin A", S["bullet"]),
        b("If no fertilization: corpus luteum regresses (luteolysis) at day 26-28 → corpus albicans", S["bullet"]),
        b("Progesterone/estrogen fall → menstruation", S["bullet"]),
        b("If fertilized: hCG from trophoblast rescues corpus luteum (maintains it for 10-12 weeks)", S["bullet"]),
        sp(0.15),
        p("<b>B. ENDOMETRIAL CHANGES (Uterine Cycle):</b>", S["section"]),
        p("<b>1. Menstrual Phase (Days 1-4):</b>", S["body"]),
        b("Progesterone and estrogen fall → prostaglandin-mediated uterine contractions", S["bullet"]),
        b("Spiral arteries constrict → ischemia → necrosis → shedding of functional layer (stratum functionalis)", S["bullet"]),
        b("Blood loss: 30-80 mL", S["bullet"]),
        p("<b>2. Proliferative Phase (Days 5-14) - Estrogen phase:</b>", S["body"]),
        b("Estrogen stimulates regeneration of endometrium from stratum basalis", S["bullet"]),
        b("Glands: Straight, narrow, tubular", S["bullet"]),
        b("Stroma: Compact, dense", S["bullet"]),
        b("Endometrial thickness increases from 2mm → 8-10mm", S["bullet"]),
        b("Estrogen induces progesterone receptors in preparation for luteal phase", S["bullet"]),
        p("<b>3. Secretory Phase (Days 14-28) - Progesterone phase:</b>", S["body"]),
        b("Progesterone from corpus luteum acts on estrogen-primed endometrium", S["bullet"]),
        b("Glands: Tortuous, saw-toothed appearance, rich in glycogen secretions", S["bullet"]),
        b("Stroma: Edematous, decidual reaction begins", S["bullet"]),
        b("Spiral arteries elongate and become coiled", S["bullet"]),
        b("Endometrium prepared for implantation (\"window of implantation\" days 20-24)", S["bullet"]),
        sp(0.15),
        p("<b>C. HORMONAL REGULATION:</b>", S["section"]),
        b("<b>FSH:</b> Drives follicular development, stimulates estrogen production", S["bullet"]),
        b("<b>LH:</b> Triggers ovulation (LH surge); luteinizes follicle → corpus luteum", S["bullet"]),
        b("<b>Estrogen:</b> Proliferative phase of endometrium; positive feedback (LH surge) at high levels", S["bullet"]),
        b("<b>Progesterone:</b> Secretory phase of endometrium; negative feedback in luteal phase", S["bullet"]),
        b("<b>GnRH:</b> Pulsatile - regulates FSH/LH ratio", S["bullet"]),
        b("<b>Inhibin:</b> Selectively suppresses FSH", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22</i>", S["note"]),
    ]
    elems += question_block(S, 11, "Ovarian and Endometrial Changes During Menstrual Cycle with Hormonal Regulation", "10 Marks", c11)

    # ─── Q12: Phases of uterine endometrial cycle + ovulation test (10m) ─────
    c12 = [
        sp(),
        p("The uterine endometrial cycle has three phases: <b>Menstrual, Proliferative,</b> and <b>Secretory</b>. Each phase is driven by specific hormones.", S["body"]),
        sp(0.15),
        p("<b>PHASE 1: Menstrual Phase (Days 1-4)</b>", S["section"]),
        b("Hormonal trigger: Fall in progesterone and estrogen (corpus luteum regression)", S["bullet"]),
        b("Prostaglandin F2α causes vasospasm of spiral arteries → ischemia → necrosis", S["bullet"]),
        b("Stratum functionalis shed; stratum basalis retained (regenerative layer)", S["bullet"]),
        b("Duration: 3-7 days; blood loss 30-80 mL", S["bullet"]),
        b("Histology: Fragmented glands, stromal breakdown, red blood cells in stroma", S["bullet"]),
        sp(0.15),
        p("<b>PHASE 2: Proliferative (Follicular) Phase (Days 5-14)</b>", S["section"]),
        b("Hormonal driver: Estrogen (from growing ovarian follicle)", S["bullet"]),
        b("Regeneration from stratum basalis; rapid cellular proliferation", S["bullet"]),
        b("Glands: Straight, narrow, tubular; few mitoses initially", S["bullet"]),
        b("Stroma: Dense, compact with thin-walled blood vessels", S["bullet"]),
        b("Thickness: 2-4mm early → 8-10mm by day 14", S["bullet"]),
        b("Estrogen upregulates its own receptors and progesterone receptors", S["bullet"]),
        b("Cervical mucus: Thin, watery, abundant, ferning pattern, spinnbarkeit positive", S["bullet"]),
        sp(0.15),
        p("<b>PHASE 3: Secretory (Luteal) Phase (Days 15-28)</b>", S["section"]),
        b("Hormonal driver: Progesterone (from corpus luteum)", S["bullet"]),
        b("Glands: Become tortuous, saw-toothed; fill with glycogen-rich secretions", S["bullet"]),
        b("Early: Sub-nuclear glycogen vacuoles (first histological sign - Day 16-17)", S["bullet"]),
        b("Mid: Intraluminal secretions maximally visible (Day 20-22)", S["bullet"]),
        b("Late: Stromal predecidual reaction; spiral arteries prominent", S["bullet"]),
        b("Window of implantation: Days 20-24 (peak receptivity)", S["bullet"]),
        b("If no implantation: luteolysis → menstruation", S["bullet"]),
        sp(0.15),
        p("<b>Note on Tests for Ovulation:</b>", S["section"]),
        b("<b>Basal Body Temperature (BBT):</b> Rise of 0.5°C sustained for >12 days = ovulation occurred. Records retrospectively.", S["bullet"]),
        b("<b>Mid-luteal Progesterone (Day 21):</b> >3-5 ng/mL confirms ovulation. Gold standard biochemical test.", S["bullet"]),
        b("<b>Urinary LH Surge Test:</b> Positive 24-36h before ovulation; predicts impending ovulation.", S["bullet"]),
        b("<b>Transvaginal Ultrasound (TVS):</b> Dominant follicle >18mm → follicular rupture → free fluid in Pouch of Douglas. Most definitive.", S["bullet"]),
        b("<b>Endometrial Biopsy (Histological dating):</b> Secretory changes confirm ovulation occurred. Subnuclear glycogen vacuoles on day 16-17 = first sign.", S["bullet"]),
        b("<b>Cervical Mucus Testing:</b> Spinnbarkeit and ferning confirm estrogenic mid-cycle phase.", S["bullet"]),
        b("<b>Fern Test / Arborization:</b> Dried cervical mucus forms fern-like crystals due to estrogen (NaCl crystallization).", S["bullet"]),
        b("<b>Serum Estradiol:</b> Peak >200 pg/mL predicts LH surge.", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22</i>", S["note"]),
    ]
    elems += question_block(S, 12, "Phases and Regulation of Uterine Endometrial Cycle with Note on Tests for Ovulation", "10 Marks", c12)

    elems.append(PageBreak())

    # ─── Q13: Interplay ovarian-hypothalamic-pituitary hormones (10m) ────────
    c13 = [
        sp(),
        p("The menstrual cycle is governed by a complex interplay between <b>hypothalamic</b> (GnRH), <b>pituitary</b> (FSH, LH), and <b>ovarian hormones</b> (estrogen, progesterone, inhibin).", S["body"]),
        sp(0.15),
        p("<b>HYPOTHALAMUS:</b>", S["section"]),
        b("Arcuate nucleus neurons secrete GnRH in <b>pulsatile</b> manner (crucial - continuous GnRH suppresses gonadotropins)", S["bullet"]),
        b("Pulse frequency: Slow in luteal phase (every 4-6 hrs, progesterone slows pulses) → fast in follicular phase (every 60-90 min)", S["bullet"]),
        b("High frequency pulses favor LH; lower frequency favors FSH", S["bullet"]),
        b("Regulated by: Kisspeptin/Neurokinin B/Dynorphin (KNDy) neurons in arcuate nucleus", S["bullet"]),
        b("Inputs: Dopamine (inhibits), β-endorphin (inhibits), serotonin, norepinephrine", S["bullet"]),
        sp(0.15),
        p("<b>FOLLICULAR PHASE (Days 1-14) - Interplay:</b>", S["section"]),
        b("GnRH pulses → FSH + LH from anterior pituitary", S["bullet"]),
        b("FSH stimulates follicular growth; granulosa cells proliferate and produce estradiol (via aromatization of theca-derived androgens)", S["bullet"]),
        b("Rising estradiol: NEGATIVE FEEDBACK → suppresses FSH (selects dominant follicle by atresia of others)", S["bullet"]),
        b("Inhibin B (from small follicles) also suppresses FSH", S["bullet"]),
        b("LH acts on theca cells → androstenedione → granulosa cells → estradiol (two-cell theory)", S["bullet"]),
        b("As dominant follicle matures, estradiol rises sharply (>200 pg/mL for >36 hrs)", S["bullet"]),
        sp(0.15),
        p("<b>MID-CYCLE SWITCH (Day 12-14) - LH Surge:</b>", S["section"]),
        b("When estradiol exceeds threshold (>200 pg/mL sustained for >36 hrs) → POSITIVE FEEDBACK", S["bullet"]),
        b("Hypothalamic GnRH surge amplified by estrogen (increases GnRH receptor number)", S["bullet"]),
        b("Anterior pituitary: Increased sensitivity to GnRH (self-priming)", S["bullet"]),
        b("Massive LH surge (10-fold rise) + smaller FSH surge triggers ovulation within 36 hours", S["bullet"]),
        b("Kisspeptin neurons in anteroventral periventricular nucleus (AVPV) mediate positive feedback in females", S["bullet"]),
        sp(0.15),
        p("<b>LUTEAL PHASE (Days 14-28) - Interplay:</b>", S["section"]),
        b("Corpus luteum secretes progesterone + estradiol + inhibin A", S["bullet"]),
        b("Progesterone: NEGATIVE FEEDBACK → slows GnRH pulse frequency → suppresses new follicular development", S["bullet"]),
        b("Estradiol + Inhibin A: Suppress FSH and LH (negative feedback)", S["bullet"]),
        b("Corpus luteum has finite lifespan (~14 days) - luteolysis occurs due to prostaglandin F2α and declining LH support", S["bullet"]),
        b("Progesterone and estrogen fall → GnRH pulse frequency recovers → FSH rises → new cycle begins", S["bullet"]),
        sp(0.15),
        p("<b>Summary Diagram (Text):</b>", S["section"]),
        p("Hypothalamus (GnRH pulses) → Anterior Pituitary (FSH + LH) → Ovary (Estradiol + Progesterone + Inhibin) → FEEDBACK to Hypothalamus + Pituitary [Negative: low estrogen, progesterone, inhibin] [Positive: high estrogen → LH surge]", S["body"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22</i>", S["note"]),
    ]
    elems += question_block(S, 13, "Interplay Between Ovarian and Hypothalamic-Pituitary Hormones for Regulation of Menstrual Cycle", "10 Marks", c13)

    # ─── Q14: Hormonal control of breast development and lactation (5m) ──────
    c14 = [
        sp(),
        p("<b>A. HORMONAL CONTROL OF BREAST DEVELOPMENT:</b>", S["section"]),
        p("<b>Prepubertal:</b> Breasts consist of nipple and small amount of ductal tissue. No active hormonal stimulation.", S["body"]),
        p("<b>Pubertal:</b>", S["body"]),
        b("Estrogen (from ovaries): Primary hormone - stimulates ductal growth and branching. Breast budding is first sign of puberty in females.", S["bullet"]),
        b("Progesterone (with estrogen): Lobular and alveolar development", S["bullet"]),
        b("GH and IGF-1: Overall growth of breast stroma", S["bullet"]),
        b("Insulin: Permissive role in ductal growth", S["bullet"]),
        b("Cortisol: Permissive role", S["bullet"]),
        p("<b>Adult Cyclical Changes:</b>", S["body"]),
        b("Follicular phase (estrogen dominant): Ductal proliferation", S["bullet"]),
        b("Luteal phase (progesterone dominant): Alveolar proliferation, breast swelling and tenderness", S["bullet"]),
        p("<b>Pregnancy:</b>", S["body"]),
        b("Markedly elevated estrogen + progesterone: Full lobulo-alveolar development", S["bullet"]),
        b("Prolactin (from anterior pituitary): Rises throughout pregnancy (stimulated by estrogen)", S["bullet"]),
        b("hPL (human placental lactogen): Contributes to breast development", S["bullet"]),
        b("Milk secretion inhibited during pregnancy by high estrogen and progesterone antagonizing prolactin", S["bullet"]),
        sp(0.15),
        p("<b>B. HORMONAL CONTROL OF LACTATION:</b>", S["section"]),
        p("<b>Initiation (Parturition trigger):</b>", S["body"]),
        b("Expulsion of placenta → abrupt fall in estrogen and progesterone", S["bullet"]),
        b("Estrogen withdrawal removes inhibition of prolactin's milk-producing action on breast", S["bullet"]),
        b("Prolactin levels remain high → milk synthesis begins within 1-3 days (\"milk coming in\")", S["bullet"]),
        p("<b>Maintenance (Neuroendocrine reflex):</b>", S["body"]),
        b("Suckling stimulates mechanoreceptors in nipple → afferent signals to hypothalamus", S["bullet"]),
        b("Inhibits dopamine (PIH) secretion → Prolactin released from anterior pituitary → milk production maintained", S["bullet"]),
        b("Suckling also triggers oxytocin release (from posterior pituitary) → myoepithelial cell contraction → milk ejection (let-down reflex)", S["bullet"]),
        p("<b>Milk Ejection Reflex (Let-Down):</b>", S["body"]),
        b("Oxytocin acts on myoepithelial cells surrounding alveoli → milk ejected into ducts", S["bullet"]),
        b("Conditioned reflex: Can be triggered by sight or sound of baby", S["bullet"]),
        b("Inhibited by stress, pain, anxiety (via catecholamines blocking oxytocin action)", S["bullet"]),
        p("<b>Cessation of Lactation:</b> Cessation of suckling → prolactin falls → milk production stops. Estrogen administration can also stop lactation.", S["body"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed., Ch. 22, p.420</i>", S["note"]),
    ]
    elems += question_block(S, 14, "Hormonal Control of Breast Development and Lactation", "5 Marks", c14)

    elems.append(PageBreak())

    # ─── Q15: Oral contraceptives - contraindications (5m) ───────────────────
    c15 = [
        sp(),
        p("<b>Oral Contraceptive Pills (OCPs)</b> are the most widely used reversible contraceptive method. They contain synthetic estrogen (ethinyl estradiol) and progestogen, or progestogen alone.", S["body"]),
        sp(0.15),
        p("<b>Types:</b>", S["section"]),
        b("<b>Combined OCP (COCP):</b> Estrogen + Progestogen (monophasic, biphasic, triphasic)", S["bullet"]),
        b("<b>Mini-pill (POP):</b> Progestogen only (norethisterone, desogestrel)", S["bullet"]),
        b("<b>Emergency Contraceptive Pill:</b> High dose levonorgestrel (within 72 hrs)", S["bullet"]),
        sp(0.15),
        p("<b>Mechanism of Action:</b>", S["section"]),
        b("Suppression of ovulation (inhibit FSH and LH by negative feedback on hypothalamus and pituitary)", S["bullet"]),
        b("Cervical mucus thickening (progestogen) → impedes sperm penetration", S["bullet"]),
        b("Endometrial thinning → unsuitable for implantation", S["bullet"]),
        b("Altered tubal motility", S["bullet"]),
        sp(0.15),
        p("<b>CONTRAINDICATIONS TO ORAL CONTRACEPTIVES:</b>", S["section"]),
        Table(
            [
                [Paragraph("<b>Category</b>", S["table_header"]), Paragraph("<b>Absolute Contraindications (WHO Category 4)</b>", S["table_header"])],
                [Paragraph("Cardiovascular", S["table_cell"]), Paragraph("History of DVT/pulmonary embolism, ischemic heart disease, stroke, hypertension (BP >160/100), valvular heart disease with complications", S["table_cell"])],
                [Paragraph("Thrombophilia", S["table_cell"]), Paragraph("Factor V Leiden mutation, antiphospholipid syndrome, protein C/S deficiency", S["table_cell"])],
                [Paragraph("Liver disease", S["table_cell"]), Paragraph("Active hepatitis, cirrhosis, liver tumors (hepatocellular adenoma), severe liver disease", S["table_cell"])],
                [Paragraph("Hormonal cancers", S["table_cell"]), Paragraph("Breast cancer (current or past), estrogen-dependent tumors", S["table_cell"])],
                [Paragraph("Pregnancy", S["table_cell"]), Paragraph("Known or suspected pregnancy", S["table_cell"])],
                [Paragraph("Migraines", S["table_cell"]), Paragraph("Migraines with aura (focal neurological symptoms) - stroke risk", S["table_cell"])],
                [Paragraph("Smoking", S["table_cell"]), Paragraph("Age >35 years AND heavy smoker (>15 cigarettes/day)", S["table_cell"])],
                [Paragraph("Diabetes", S["table_cell"]), Paragraph("Diabetes with nephropathy, retinopathy, neuropathy or >20 years duration", S["table_cell"])],
                [Paragraph("Postpartum", S["table_cell"]), Paragraph("Breastfeeding <6 weeks postpartum (COC)", S["table_cell"])],
            ],
            colWidths=[4*cm, 13.5*cm],
        ),
        sp(0.1),
        p("<b>Relative Contraindications:</b> Hypertriglyceridemia, gallbladder disease, undiagnosed vaginal bleeding, controlled hypertension, mild headache, age >40.", S["body"]),
        p("<b>Non-contraceptive Benefits:</b> Reduced dysmenorrhea, PMS, endometriosis, ovarian cysts, ovarian and endometrial cancer risk; management of PCOS and acne.", S["body"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed.; WHO Medical Eligibility Criteria</i>", S["note"]),
    ]
    t15 = c15[-3]
    t15.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [white, LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    elems += question_block(S, 15, "Oral Contraceptives: Contraindications", "5 Marks", c15)

    # ─── Q16: Intrauterine contraceptive devices (5m) ────────────────────────
    c16 = [
        sp(),
        p("<b>Intrauterine Contraceptive Devices (IUCDs/IUDs)</b> are small T-shaped or other-shaped devices inserted into the uterine cavity for long-term contraception.", S["body"]),
        sp(0.15),
        p("<b>Types of IUDs:</b>", S["section"]),
        Table(
            [
                [Paragraph("<b>Type</b>", S["table_header"]), Paragraph("<b>Examples</b>", S["table_header"]), Paragraph("<b>Duration</b>", S["table_header"]), Paragraph("<b>Mechanism</b>", S["table_header"])],
                [Paragraph("Non-medicated (Inert)", S["table_cell"]), Paragraph("Lippes Loop, Saf-T-Coil (historical)", S["table_cell"]), Paragraph("Indefinite", S["table_cell"]), Paragraph("Foreign body reaction in uterus", S["table_cell"])],
                [Paragraph("Copper-containing", S["table_cell"]), Paragraph("Copper-T 380A (Cu-T), Multiload Cu-375", S["table_cell"]), Paragraph("10-12 years", S["table_cell"]), Paragraph("Copper ions toxic to sperm; prevents fertilization", S["table_cell"])],
                [Paragraph("Hormone-releasing (LNG-IUS)", S["table_cell"]), Paragraph("Mirena (levonorgestrel 52mg), Kyleena, Jaydess", S["table_cell"]), Paragraph("5-8 years", S["table_cell"]), Paragraph("Progestogen thickens cervical mucus, thins endometrium, may suppress ovulation", S["table_cell"])],
            ],
            colWidths=[3.5*cm, 4.5*cm, 2.5*cm, 7*cm],
        ),
        sp(0.15),
        p("<b>Mechanisms of Action of IUDs:</b>", S["section"]),
        b("<b>Foreign body reaction:</b> Causes sterile inflammatory response in endometrium; leukocyte infiltration; toxic to sperm and ovum", S["bullet"]),
        b("<b>Copper ions:</b> Spermicidal - impair sperm motility and viability; inhibit acrosome reaction; prevent fertilization", S["bullet"]),
        b("<b>Levonorgestrel (Mirena):</b> Thickens cervical mucus (main effect); thins endometrium (reduces bleeding); partial suppression of ovulation", S["bullet"]),
        b("<b>Altered tubal motility:</b> Changes fallopian tube peristalsis", S["bullet"]),
        b("<b>Prevention of implantation:</b> Altered endometrial environment (secondary mechanism)", S["bullet"]),
        sp(0.15),
        p("<b>Advantages:</b>", S["section"]),
        b("Highly effective (failure rate <1% for Cu-T, <0.1% for LNG-IUS)", S["bullet"]),
        b("Long-acting, reversible (LARC)", S["bullet"]),
        b("No systemic hormonal effects (copper IUD)", S["bullet"]),
        b("Suitable for breastfeeding women", S["bullet"]),
        b("Copper-T: Emergency contraception if inserted within 5 days of unprotected intercourse (>99% effective)", S["bullet"]),
        b("LNG-IUS: Treats menorrhagia, dysmenorrhea, endometriosis", S["bullet"]),
        sp(0.15),
        p("<b>Contraindications to IUD:</b>", S["section"]),
        b("Pregnancy or suspected pregnancy", S["bullet"]),
        b("Uterine anomalies (fibroids distorting cavity, bicornuate uterus)", S["bullet"]),
        b("Active PID or STI (within 3 months)", S["bullet"]),
        b("Unexplained uterine bleeding", S["bullet"]),
        b("Cervical or uterine cancer", S["bullet"]),
        b("Wilson's disease (copper IUD - excess copper metabolism disorder)", S["bullet"]),
        sp(0.15),
        p("<b>Complications:</b>", S["section"]),
        b("Expulsion (5-10%, most common in first year)", S["bullet"]),
        b("Dysmenorrhea and menorrhagia (copper IUD)", S["bullet"]),
        b("Pelvic inflammatory disease (PID) risk within 20 days of insertion", S["bullet"]),
        b("Ectopic pregnancy (if IUD fails)", S["bullet"]),
        b("Uterine perforation (rare, 1/1000 insertions)", S["bullet"]),
        p("<i>Reference: Ganong's Review of Medical Physiology, 26th Ed.; WHO Family Planning Guidelines</i>", S["note"]),
    ]
    t16 = c16[3]
    t16.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("ROWBACKGROUNDS",(0,1), (-1,-1), [white, LIGHT_BLUE]),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 5),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ]))
    elems += question_block(S, 16, "Intrauterine Contraceptive Devices (IUCDs)", "5 Marks", c16)

    return elems


def add_header_footer(canvas, doc):
    canvas.saveState()
    w, h = A4
    # Header
    canvas.setFillColor(DARK_BLUE)
    canvas.rect(0, h-25, w, 25, fill=1, stroke=0)
    canvas.setFillColor(white)
    canvas.setFont("Helvetica-Bold", 9)
    canvas.drawString(20, h-17, "REPRODUCTIVE SYSTEM PHYSIOLOGY - RGUHS PATTERN")
    canvas.setFont("Helvetica", 8)
    canvas.drawRightString(w-20, h-17, "Based on G.K. Park / Ganong's Physiology")
    # Footer
    canvas.setFillColor(DARK_BLUE)
    canvas.rect(0, 0, w, 18, fill=1, stroke=0)
    canvas.setFillColor(white)
    canvas.setFont("Helvetica", 8)
    canvas.drawString(20, 5, f"Page {doc.page}")
    canvas.drawCentredString(w/2, 5, "For Educational Use Only - RGUHS Physiology")
    canvas.drawRightString(w-20, 5, "July 2026")
    canvas.restoreState()


def build_cover_page(styles):
    S = styles
    elems = []
    # Title block
    title_table = Table(
        [[
            Paragraph("REPRODUCTIVE SYSTEM", S["title"]),
        ], [
            Paragraph("IMPORTANT QUESTIONS AND ANSWER KEY", S["title"]),
        ], [
            Paragraph("RGUHS Pattern | Based on G.K. Park Textbook of Physiology", S["subtitle"]),
        ], [
            Paragraph("All 16 Questions Covered | 5M and 10M Answers", S["subtitle"]),
        ]],
        colWidths=[17.5*cm]
    )
    title_table.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), DARK_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 12),
        ("BOTTOMPADDING", (0,0), (-1,-1), 12),
        ("LEFTPADDING",   (0,0), (-1,-1), 20),
        ("RIGHTPADDING",  (0,0), (-1,-1), 20),
        ("ROUNDEDCORNERS", [8,8,8,8]),
    ]))
    elems.append(Spacer(1, 1*cm))
    elems.append(title_table)
    elems.append(Spacer(1, 0.5*cm))

    # Info row
    info_table = Table(
        [[
            Paragraph("Subject: Physiology", ParagraphStyle("Info", fontSize=10, textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER)),
            Paragraph("University: RGUHS", ParagraphStyle("Info", fontSize=10, textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER)),
            Paragraph("Total Questions: 16", ParagraphStyle("Info", fontSize=10, textColor=DARK_BLUE, fontName="Helvetica-Bold", alignment=TA_CENTER)),
        ]],
        colWidths=[5.8*cm, 5.8*cm, 5.8*cm]
    )
    info_table.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), LIGHT_BLUE),
        ("GRID",          (0,0), (-1,-1), 0.5, MED_BLUE),
        ("TOPPADDING",    (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ]))
    elems.append(info_table)
    elems.append(Spacer(1, 0.4*cm))

    # Index
    index_data = [
        [Paragraph("<b>Q.No</b>", ParagraphStyle("IH", fontSize=9, textColor=white, fontName="Helvetica-Bold", alignment=TA_CENTER)),
         Paragraph("<b>Question</b>", ParagraphStyle("IH", fontSize=9, textColor=white, fontName="Helvetica-Bold")),
         Paragraph("<b>Marks</b>", ParagraphStyle("IH", fontSize=9, textColor=white, fontName="Helvetica-Bold", alignment=TA_CENTER))],
        ["1", "Turner's Syndrome", "5M"],
        ["2", "Physiological Changes During Puberty in Male", "5M"],
        ["3", "Physiology of Puberty in Female", "5M"],
        ["4", "Cell Types in Testis and Capacitation of Sperms", "5M"],
        ["5", "Sertoli Cells and Their Role", "5M"],
        ["6", "Blood-Testis Barrier", "5M"],
        ["7", "Spermatogenesis: Regulation and Factors Causing Male Infertility", "5M"],
        ["8", "Endocrine Functions of Testis", "5M"],
        ["9", "Functions of Ovary and How It Is Regulated", "10M"],
        ["10", "Ovulation: Description, Regulation and Tests for Ovulation", "5M"],
        ["11", "Ovarian and Endometrial Changes During Menstrual Cycle + Hormonal Regulation", "10M"],
        ["12", "Phases and Regulation of Uterine Endometrial Cycle + Note on Tests for Ovulation", "10M"],
        ["13", "Interplay: Ovarian and Hypothalamic-Pituitary Hormones in Menstrual Cycle", "10M"],
        ["14", "Hormonal Control of Breast Development and Lactation", "5M"],
        ["15", "Oral Contraceptives: Contraindications", "5M"],
        ["16", "Intrauterine Contraceptive Devices (IUCDs)", "5M"],
    ]
    cell_style = ParagraphStyle("IC", fontSize=9, fontName="Helvetica", leading=12)
    mark_style = ParagraphStyle("IM", fontSize=9, fontName="Helvetica-Bold", alignment=TA_CENTER, textColor=ACCENT)
    formatted = []
    for i, row in enumerate(index_data):
        if i == 0:
            formatted.append(row)
        else:
            bg = white if i % 2 == 0 else LIGHT_BLUE
            formatted.append([
                Paragraph(row[0], ParagraphStyle("INum", fontSize=9, fontName="Helvetica-Bold", alignment=TA_CENTER, textColor=DARK_BLUE)),
                Paragraph(row[1], cell_style),
                Paragraph(row[2], mark_style),
            ])

    idx_table = Table(formatted, colWidths=[1.5*cm, 14*cm, 2*cm])
    idx_style = [
        ("BACKGROUND",    (0,0), (-1,0), DARK_BLUE),
        ("GRID",          (0,0), (-1,-1), 0.5, BORDER_GREY),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "MIDDLE"),
    ]
    for i in range(1, len(formatted)):
        bg = LIGHT_BLUE if i % 2 == 0 else white
        idx_style.append(("BACKGROUND", (0, i), (-1, i), bg))
    idx_table.setStyle(TableStyle(idx_style))
    elems.append(idx_table)
    elems.append(PageBreak())
    return elems


def main():
    doc = SimpleDocTemplate(
        OUTPUT_PATH,
        pagesize=A4,
        leftMargin=2*cm,
        rightMargin=2*cm,
        topMargin=2.8*cm,
        bottomMargin=2*cm,
        title="RGUHS Reproductive System Physiology - Questions and Answers",
        author="Orris AI",
        subject="Reproductive System Physiology",
    )
    styles = build_styles()
    story = build_cover_page(styles) + build_content(styles)
    doc.build(story, onFirstPage=add_header_footer, onLaterPages=add_header_footer)
    print(f"PDF created successfully: {OUTPUT_PATH}")


if __name__ == "__main__":
    main()
Running Command

cd /home/daytona/workspace/rguhs-reproductive-physiology && python3 generate_pdf…

Editing File

~/rguhs-reproductive-physiology/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rguhs-reproductive-physiology/generate_pdf.py'
Running Command

cd /home/daytona/workspace/rguhs-reproductive-physiology && python3 -c " # Debug…

Running Command

cd /home/daytona/workspace/rguhs-reproductive-physiology && python3 generate_pdf…

Editing File

~/rguhs-reproductive-physiology/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rguhs-reproductive-physiology/generate_pdf.py'
Editing File

~/rguhs-reproductive-physiology/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rguhs-reproductive-physiology/generate_pdf.py'
Editing File

~/rguhs-reproductive-physiology/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rguhs-reproductive-physiology/generate_pdf.py'
Editing File

~/rguhs-reproductive-physiology/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rguhs-reproductive-physiology/generate_pdf.py'
Editing File

~/rguhs-reproductive-physiology/generate_pdf.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/rguhs-reproductive-physiology/generate_pdf.py'
Running Command

cd /home/daytona/workspace/rguhs-reproductive-physiology && python3 generate_pdf…

Model call limits exceeded: run limit (20/20)
This is a shared conversation. Sign in to Orris to start your own chat.