Create a note and Flash cards and Quiz for this
cd /home/daytona/workspace && python -m markitdown "attachments/7210acc0-e997-49b3-a104-be6156af448b/lesson 1 general immunology, cells, and immune organs (3).pptx" 2>&1 | head -300
cd /home/daytona/workspace && python3 -c " from pptx import Presentation import os pptx_path = 'attachments/7210acc0-e997-49b3-a104-be6156af448b/lesson 1 general immunology, cells, and immune organs (3).pptx' prs = Presentation(pptx_path) for i, slide in enumerate(prs.slides): print(f'=== SLIDE {i+1} ===') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(shape.text) print() " 2>&1
pip install --user python-pptx 2>&1 | tail -5
cd /home/daytona/workspace && python3 -c " from pptx import Presentation pptx_path = 'attachments/7210acc0-e997-49b3-a104-be6156af448b/lesson 1 general immunology, cells, and immune organs (3).pptx' prs = Presentation(pptx_path) for i, slide in enumerate(prs.slides): print(f'=== SLIDE {i+1} ===') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(shape.text) print() " 2>&1
mkdir -p /home/daytona/workspace/immunology-lesson1
~/immunology-lesson1/study-notes.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lesson 1 – General Immunology: Cells and Immune Organs</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f4f8; color: #1a202c; line-height: 1.7; }
header { background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%); color: white; padding: 40px 30px; text-align: center; }
header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 6px; }
header p { font-size: 1rem; opacity: 0.85; }
.toc { background: white; max-width: 900px; margin: 24px auto; border-radius: 12px; padding: 24px 28px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.toc h2 { color: #2d6a9f; font-size: 1.1rem; margin-bottom: 12px; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; }
.toc ol { padding-left: 20px; }
.toc li { margin: 6px 0; }
.toc a { color: #2d6a9f; text-decoration: none; font-size: 0.95rem; }
.toc a:hover { text-decoration: underline; }
.container { max-width: 900px; margin: 0 auto; padding: 0 16px 48px; }
.section { background: white; border-radius: 12px; padding: 28px 32px; margin-bottom: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.section h2 { color: #1a3c5e; font-size: 1.35rem; border-left: 5px solid #2d6a9f; padding-left: 14px; margin-bottom: 18px; }
.section h3 { color: #2d6a9f; font-size: 1.1rem; margin: 18px 0 10px; }
.section h4 { color: #4a6fa5; font-size: 1rem; margin: 14px 0 8px; }
ul, ol { padding-left: 22px; margin: 8px 0; }
li { margin: 5px 0; }
.highlight-box { background: #eef6ff; border-left: 4px solid #2d6a9f; border-radius: 6px; padding: 14px 18px; margin: 14px 0; }
.clinical-box { background: #fff8e6; border-left: 4px solid #e6a817; border-radius: 6px; padding: 14px 18px; margin: 14px 0; }
.clinical-box strong { color: #b07d00; }
.key-term { background: #e8f4fd; color: #1a3c5e; padding: 2px 7px; border-radius: 4px; font-weight: 600; font-size: 0.9em; }
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.93rem; }
th { background: #2d6a9f; color: white; padding: 10px 14px; text-align: left; }
td { padding: 9px 14px; border-bottom: 1px solid #e2e8f0; }
tr:nth-child(even) td { background: #f7fafc; }
.tag { display: inline-block; background: #2d6a9f; color: white; font-size: 0.75rem; padding: 2px 9px; border-radius: 12px; margin: 2px; }
.arrows { color: #2d6a9f; font-weight: 700; }
</style>
</head>
<body>
<header>
<h1>General Immunology: Cells and Immune Organs</h1>
<p>Lesson 1 | Dr. Mai Dieu Linh | Complete Study Notes</p>
</header>
<div class="toc">
<h2>Table of Contents</h2>
<ol>
<li><a href="#concepts">Key Concepts</a></li>
<li><a href="#functions">Functions of the Immune System</a></li>
<li><a href="#classification">Classification of Immunity</a></li>
<li><a href="#central-organs">Central Lymphoid Organs</a>
<ul>
<li><a href="#bone-marrow">Bone Marrow</a></li>
<li><a href="#thymus">Thymus</a></li>
</ul>
</li>
<li><a href="#peripheral-organs">Peripheral Lymphoid Organs</a>
<ul>
<li><a href="#lymph-nodes">Lymph Nodes</a></li>
<li><a href="#spleen">Spleen</a></li>
<li><a href="#malt">Mucosal Lymphoid Tissue (MALT)</a></li>
</ul>
</li>
<li><a href="#cells">Cells of the Immune System</a></li>
</ol>
</div>
<div class="container">
<!-- SECTION 1 -->
<div class="section" id="concepts">
<h2>1. Key Concepts</h2>
<table>
<tr><th>Term</th><th>Definition</th></tr>
<tr><td><span class="key-term">Immunity</span></td><td>The body's ability to resist pathogens.</td></tr>
<tr><td><span class="key-term">Immune System</span></td><td>Immune organs, cells, and molecules secreted by cells (e.g., antibodies).</td></tr>
<tr><td><span class="key-term">Immune Response</span></td><td>The immune system's response to microorganisms and harmful substances.</td></tr>
<tr><td><span class="key-term">Immunology</span></td><td>Study of the structure and function of the immune system and the body's immune responses.</td></tr>
</table>
</div>
<!-- SECTION 2 -->
<div class="section" id="functions">
<h2>2. Functions of the Immune System</h2>
<ul>
<li>Prevent and eliminate pathogenic infection (e.g., VSV)</li>
<li>Fight tumor growth</li>
<li>Regenerate damaged tissues</li>
</ul>
<h3>Disorders When Immune Function Fails</h3>
<ul>
<li><strong>Immunodeficiency</strong> – weakened or absent immune response</li>
<li><strong>Chronic inflammation</strong> – persistent, dysregulated immune activation</li>
<li><strong>Autoimmune disease</strong> – immune attack on self-tissues</li>
<li><strong>Graft rejection</strong> – immune response against transplanted tissue</li>
</ul>
</div>
<!-- SECTION 3 -->
<div class="section" id="classification">
<h2>3. Classification of Immunity</h2>
<div class="highlight-box">
<strong>Two main branches:</strong>
<ul>
<li><strong>Innate Immunity</strong> – non-specific, immediate, no memory (granulocytes, monocytes, NK cells, etc.)</li>
<li><strong>Adaptive Immunity</strong> – specific, delayed, has memory (T cells, B cells, antibodies)</li>
</ul>
</div>
<h3>Immune System Components</h3>
<ul>
<li><strong>Immune Organs</strong> – anatomical structures housing immune cells</li>
<li><strong>Immune Cells</strong> – active cellular components</li>
</ul>
<p>A balanced immune system <span class="arrows">↑</span> prevents invasion by bacteria/foreign objects and <span class="arrows">↓</span> does NOT attack normal tissues.</p>
</div>
<!-- SECTION 4 -->
<div class="section" id="central-organs">
<h2>4. Central Lymphoid Organs</h2>
<div class="highlight-box">
Central lymphoid organs are <strong>lymphoid stem cell organs</strong>. They produce stem cells and train them into mature cells — this process is <strong>antigen-independent</strong>.
</div>
<div id="bone-marrow">
<h3>4.1 Bone Marrow</h3>
<p>Not a classic lymphoid organ, but is where <strong>multipotent stem cells</strong>, immunocompetent precursor cells, and other blood cells are produced.</p>
<h4>Macroscopic Anatomy</h4>
<ul>
<li><strong>Red marrow</strong> – contains hematopoietic stem cells; actively involved in hematopoiesis</li>
<li><strong>Yellow marrow</strong> – contains mainly fat; less involved in hematopoiesis</li>
</ul>
<h4>Hematopoietic Cell Lines</h4>
<ul>
<li><strong>Myeloid line</strong> – granulocytes, monocytes</li>
<li><strong>Lymphoid line</strong> – B lymphocytes (also T cell precursors before thymus migration)</li>
</ul>
<h4>Histology</h4>
<p>Located in the marrow cavity; made of connective tissue. Includes:</p>
<ul>
<li>Hematopoietic stem cells</li>
<li>Bone marrow stroma</li>
<li>Bone marrow capillary network</li>
<li>Various immune cells</li>
</ul>
<h4>Functions</h4>
<ol>
<li>Produces immune cells: granulocytes, monocytes, B lymphocytes</li>
<li>Acts as a secondary immune organ: contains APCs, stores neutrophils and macrophages for rapid response</li>
<li>Maintains immune balance</li>
</ol>
<div class="clinical-box"><strong>Clinical Note:</strong> Bone marrow dysfunction leads to impaired immune response.</div>
</div>
<div id="thymus">
<h3>4.2 Thymus</h3>
<p>Located just behind the <strong>sternum</strong>; consists of 2 large lobes, each divided into lobules.</p>
<ul>
<li>Develops early from the embryonic period</li>
<li>Largest size (30–50 g) at puberty</li>
<li>Gradually regresses; <15 g in elderly</li>
<li>Does <strong>NOT</strong> directly participate in immune response – only helps T lymphocyte division and differentiation</li>
</ul>
<h4>Gross Anatomy</h4>
<ul>
<li>Surrounded by a fibrous capsule with fibrous septa dividing it into lobules (morphological and functional units)</li>
<li>Divided into: <strong>Cortex</strong> and <strong>Medulla</strong></li>
</ul>
<h4>Thymic Cortex</h4>
<ul>
<li>85–90% of thymus cells</li>
<li>Mainly small, immature lymphocytes (<strong>thymocytes</strong>) with high mitotic rate</li>
<li>T-cell precursors undergoing TCR recombination</li>
<li>Contains epithelial reticular cells (secretory granules stimulate lymphocyte differentiation) and few macrophages</li>
<li><strong>Only ~2–5%</strong> of T cells survive; the rest (~95–98%) are eliminated via apoptosis through <strong>positive selection</strong></li>
</ul>
<h4>Thymic Medulla</h4>
<ul>
<li>Maturation site of immature T lymphocytes</li>
<li>Lower cell density; mainly lymphoblasts and reticular epithelial cells; very few macrophages</li>
<li><strong>No blood-thymus barrier</strong> in the medulla</li>
<li><strong>Hassall's corpuscles</strong>: degenerated reticular epithelial cells forming concentric keratin rings – regulate T lymphocyte differentiation and death</li>
<li><strong>Negative selection</strong>: eliminates T cells that strongly recognize self-antigens (~15–20% eliminated here)</li>
</ul>
<h4>Mature T Lymphocytes in Medulla</h4>
<ul>
<li>Corticosteroid-resistant</li>
<li>Express MHC class I</li>
<li>Express either <strong>CD4</strong> or <strong>CD8</strong> surface antigens</li>
</ul>
<h4>Blood-Thymus Barrier</h4>
<p>Arterial branches form an arterial ring at the cortex-medulla boundary. Creates <strong>immune isolation</strong> — protects immature thymocytes from exposure to foreign antigens, ensuring safe T cell differentiation and selection ("immunological inertia").</p>
<h4>Thymic Endocrine Factors (from Reticular Epithelial Cells)</h4>
<table>
<tr><th>Factor</th><th>Function</th></tr>
<tr><td>Thymotaxin</td><td>Attracts lymphocytes to migrate from blood to thymic cortex</td></tr>
<tr><td>Lymphopoietin</td><td>Induces differentiation of mother cells into lymphocytes/thymocytes</td></tr>
<tr><td>Thymuline</td><td>Promotes synthesis of surface markers (maturation) by lymphocytes</td></tr>
</table>
<h4>Thymus Physiology – Step by Step</h4>
<ol>
<li>T lymphoid precursors generated in medulla via veins → concentrated in superficial cortex</li>
<li>In the <strong>cortex</strong>: active proliferation, antigen-independent differentiation (TCR gene recombination), positive selection (MHC recognition)</li>
<li>In the <strong>medulla</strong>: surviving pre-T cells migrate here → negative selection → become naive T CD4+ or CD8+ cells → enter circulatory system</li>
<li>Then either (1) contact antigens in peripheral lymphoid organs and differentiate, or (2) migrate back to thymic medulla only</li>
</ol>
<div class="highlight-box">
<strong>Why mature T cells only return to the medulla (not cortex):</strong>
<ul>
<li>Lack of early differentiation receptors in the cortex</li>
<li>Lack of receptors necessary to enter the cortex</li>
<li>Avoids disrupting immature T cells and preventing autoimmune diseases</li>
<li>Medulla is more suitable for immune regulatory mechanisms</li>
</ul>
</div>
<h4>Role of Mature Thymocytes in Peripheral Organs</h4>
<ul>
<li><strong>Direct role</strong>: cellular immunity (e.g., graft rejection)</li>
<li><strong>Indirect role</strong>: humoral immunity (coordination with B lymphocytes)</li>
</ul>
<div class="clinical-box">
<strong>Clinical Context – Corticosteroids:</strong>
<ul>
<li>Potent immunosuppressants; induce apoptosis in immune cells including naive T cells</li>
<li>More effective for <strong>acute</strong> inflammation (involving immature/active T cells)</li>
<li>Less effective in <strong>chronic</strong> autoimmune diseases where mature T cells have established function</li>
<li><strong>Congenital immunodeficiency</strong>: deficiency in mature T cells → susceptible to severe infections, less responsive to corticosteroids</li>
<li><strong>HIV patients</strong>: do NOT treat with corticosteroids – virus attacks CD4+ cells</li>
</ul>
</div>
</div>
</div>
<!-- SECTION 5 -->
<div class="section" id="peripheral-organs">
<h2>5. Peripheral Lymphoid Organs</h2>
<div class="highlight-box">
Peripheral lymphoid organs are the <strong>main residence and concentration of lymphocytes and macrophages</strong>. They concentrate antigens, stimulating cell differentiation and division to eliminate antigens.
</div>
<div id="lymph-nodes">
<h3>5.1 Lymph Nodes</h3>
<p>Bean-shaped, covered in connective tissue. Located along lymphatic pathways (neck, armpits, groin). ~600 nodes in the body. Normally <1 cm (not palpable).</p>
<h4>Lymph Fluid</h4>
<ul>
<li>Clear, yellowish fluid; main component is interstitial fluid</li>
<li>Composition: ~95% water, proteins (albumin, globulin), T & B lymphocytes, fats (intestinal lymph = chyle), cellular waste</li>
<li>Journey: small lymphatic vessels → larger vessels (through nodes) → thoracic duct / right lymphatic duct → veins near heart</li>
</ul>
<h4>Lymphatic Vessels</h4>
<ul>
<li><strong>Capillary ends</strong>: thin endothelium forming one-way valves</li>
<li><strong>Afferent vessels</strong>: carry lymph from tissues TO nodes</li>
<li><strong>Efferent vessels</strong>: carry purified lymph FROM nodes to other nodes or back to circulation</li>
<li><strong>Chylothorax</strong> (small intestine): transports absorbed fats</li>
<li><strong>Right lymphatic duct</strong>: receives from upper right body (right arm, head, neck)</li>
<li><strong>Thoracic duct</strong> (left lymphatic duct / canal of van Hoorne): receives from the rest of the body; originates above the chyle sac (~T12)</li>
</ul>
<h4>Structure (Parenchyma – 3 Regions)</h4>
<table>
<tr><th>Region</th><th>Key Features</th></tr>
<tr><td><strong>Cortex</strong></td><td>Spherical lymphoid follicles; mainly B lymphocytes; primary follicles → secondary follicles (with germinal centers) after antigen invasion; thymus-independent</td></tr>
<tr><td><strong>Paracortex</strong></td><td>Many T lymphocytes, few macrophages/B cells; entry point for T & B cells from blood; "thymus-dependent zone"</td></tr>
<tr><td><strong>Medulla</strong></td><td>Marrow cords; T lymphocytes, plasma cells, macrophages; B lymphocytes reproduce and differentiate into plasma cells here; contains lymphatic cavities</td></tr>
</table>
<h4>Immune Response in Lymph Nodes (Step by Step)</h4>
<ol>
<li>Antigens invade → captured by macrophages</li>
<li>Macrophages process and present antigens to T and B cells (APCs)</li>
<li>CD4+ T cells activate in paracortical region → activate B cells in lymphoid follicles</li>
<li>B cells proliferate → plasma cells → antibody production</li>
<li>After days, activated immune cells leave and migrate to expand the response</li>
</ol>
<div class="clinical-box"><strong>Clinical Note:</strong> Lymph nodes enlarge significantly with infection, antigen stimulation, or tumor. They play a defensive role against bacterial invasion and tumor spread.</div>
</div>
<div id="spleen">
<h3>5.2 Spleen</h3>
<p>Largest lymphoid organ in the body, weighing <strong>75–150 g</strong>. Surrounded by connective tissue and peritoneum. Septa divide the parenchyma into compartments.</p>
<h4>Fibrous Capsule</h4>
<p>Contains collagen fibers, elastic fibers, fibrocytes, and few smooth muscle cells – contracts to push blood from spleen to circulatory system. Splenic lymph originates from fibrous septa (not from the hilum).</p>
<h4>White Pulp</h4>
<ul>
<li>Mainly lymphoid tissue with central arterioles</li>
<li>Lymphoid capsules (sheaths) along arterioles</li>
<li>Lymphoid follicles where capsule swells</li>
<li>Region 1: germinal center of B lymphocyte lineage</li>
<li>Region 2: T lymphocytes</li>
</ul>
<h4>Red Pulp (~4/5 of mass)</h4>
<ul>
<li>Filters old red blood cells and dead cell fragments</li>
<li>Contains venous sinuses and lymphocytes</li>
<li>Billroth's cords: macrophages destroy cells using lysosomal enzymes</li>
<li>Spongy structure acts as a blood reserve</li>
</ul>
<h4>Splenic Circulation</h4>
<p>Two hypotheses: <strong>closed circulation</strong> and <strong>open circulation</strong>.</p>
<h4>Splenic Physiology</h4>
<table>
<tr><th>Function</th><th>Details</th></tr>
<tr><td>Lymphocyte generation</td><td>Occurs in white pulp; lymphocytes produced, enter red pulp, then venous sinuses. Embryonic: produces RBC, WBC, platelets, lymphocytes. Postnatal: produces only lymphocytes.</td></tr>
<tr><td>Protection</td><td>Fights foreign invaders via macrophages and antibody production</td></tr>
<tr><td>Destruction of old RBCs</td><td>Occurs in red pulp; macrophages in Billroth's cords use lysosomal enzymes</td></tr>
<tr><td>Blood reservoir</td><td>Spongy red pulp retains blood in venous sinuses; releases when needed</td></tr>
</table>
</div>
<div id="malt">
<h3>5.3 Mucosal-Associated Lymphoid Tissue (MALT)</h3>
<p>Lymphoid tissues <strong>without connective tissue capsule</strong>. Located in mucosa of digestive, respiratory, and urinary tracts.</p>
<h4>GALT (Gut-Associated Lymphoid Tissue)</h4>
<ul>
<li>Includes <strong>Peyer's patches</strong> and scattered lymphoid follicles</li>
<li><strong>Peyer's patches</strong>: characteristic lymphoid structures in the small intestine wall; center: B lymphocytes; surrounding: T lymphocytes (mainly CD8+) and macrophages; processes antigens effectively</li>
</ul>
<h4>BALT (Bronchus-Associated Lymphoid Tissue)</h4>
<ul>
<li>Along trachea, bronchi, bronchioles, and lung lobules</li>
<li>Located just below the respiratory epithelium – allows early contact with new antigens</li>
<li>Less developed than GALT but reacts strongly to inhaled agents (e.g., influenza, SARS-CoV-2)</li>
</ul>
<h4>Waldeyer's Lymphatic Ring (Tonsils)</h4>
<ul>
<li>Consists of lymphocytes, primary and secondary follicles</li>
<li>B lymphocytes account for 40–50%</li>
</ul>
</div>
</div>
<!-- SECTION 6 -->
<div class="section" id="cells">
<h2>6. Cells Involved in Immune Response</h2>
<h3>Innate Immunity Cells</h3>
<p>Provide immediate, non-specific defense. Include:</p>
<ul>
<li><strong>Granulocytes</strong> (neutrophils, eosinophils, basophils/mast cells)</li>
<li><strong>Monocytes / Macrophages</strong> – phagocytosis and antigen presentation</li>
<li><strong>Natural Killer (NK) cells</strong> – kill virus-infected and tumor cells</li>
<li><strong>Dendritic cells</strong> – professional APCs linking innate and adaptive immunity</li>
</ul>
<h3>Adaptive Immunity Cells</h3>
<p>Provide specific, memory-based defense. Include:</p>
<ul>
<li><strong>T lymphocytes (T cells)</strong>
<ul>
<li>CD4+ T helper cells – activate B cells and other immune cells</li>
<li>CD8+ Cytotoxic T cells – directly kill infected/tumor cells</li>
<li>Regulatory T cells (Tregs) – suppress autoimmune responses</li>
</ul>
</li>
<li><strong>B lymphocytes (B cells)</strong> – differentiate into plasma cells to produce antibodies</li>
<li><strong>Plasma cells</strong> – effector B cells producing large amounts of antibody</li>
<li><strong>Memory cells</strong> – long-lived; enable rapid response upon re-exposure</li>
</ul>
<div class="highlight-box">
<strong>Summary Table – Lymphocyte Origin and Maturation</strong>
<table>
<tr><th>Cell Type</th><th>Origin</th><th>Maturation Site</th><th>Function</th></tr>
<tr><td>T lymphocytes</td><td>Bone marrow</td><td>Thymus</td><td>Cellular immunity; help B cells</td></tr>
<tr><td>B lymphocytes</td><td>Bone marrow</td><td>Bone marrow</td><td>Humoral immunity (antibodies)</td></tr>
<tr><td>NK cells</td><td>Bone marrow</td><td>Bone marrow/peripheral</td><td>Innate cytotoxicity</td></tr>
<tr><td>Macrophages</td><td>Bone marrow (monocytes)</td><td>Tissues</td><td>Phagocytosis, antigen presentation</td></tr>
</table>
</div>
</div>
</div>
</body>
</html>
~/immunology-lesson1/flashcards.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flashcards – General Immunology: Cells and Immune Organs</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #eef2f7; color: #1a202c; min-height: 100vh; }
header { background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%); color: white; padding: 32px 20px; text-align: center; }
header h1 { font-size: 1.8rem; font-weight: 700; }
header p { margin-top: 6px; opacity: 0.85; font-size: 0.95rem; }
.controls { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 20px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.controls button { padding: 9px 20px; border: none; border-radius: 8px; font-size: 0.9rem; cursor: pointer; font-weight: 600; transition: all 0.2s; }
#prevBtn { background: #e2e8f0; color: #1a3c5e; }
#nextBtn { background: #2d6a9f; color: white; }
#shuffleBtn { background: #1a3c5e; color: white; }
#resetBtn { background: #e53e3e; color: white; }
.controls button:hover { opacity: 0.85; transform: translateY(-1px); }
.progress-bar-wrap { background: #e2e8f0; height: 6px; width: 100%; }
.progress-bar { background: #2d6a9f; height: 6px; transition: width 0.3s; }
.counter { text-align: center; padding: 10px; font-size: 0.9rem; color: #4a6fa5; font-weight: 600; }
.card-area { display: flex; justify-content: center; align-items: center; padding: 30px 16px; min-height: 380px; }
.card-scene { width: 100%; max-width: 700px; perspective: 1200px; }
.card { width: 100%; min-height: 300px; position: relative; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.4,0,0.2,1); cursor: pointer; }
.card.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; min-height: 300px; backface-visibility: hidden; border-radius: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 36px 40px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.13); }
.card-front { background: white; border-top: 6px solid #2d6a9f; }
.card-back { background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%); color: white; transform: rotateY(180deg); }
.card-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #a0aec0; margin-bottom: 18px; }
.card-back .card-label { color: rgba(255,255,255,0.6); }
.card-question { font-size: 1.25rem; font-weight: 700; color: #1a3c5e; line-height: 1.5; }
.card-answer { font-size: 1.05rem; line-height: 1.6; }
.card-hint { margin-top: 16px; font-size: 0.8rem; color: #a0aec0; }
.card-back .card-hint { color: rgba(255,255,255,0.5); }
.category-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 16px; background: #f7fafc; border-bottom: 1px solid #e2e8f0; }
.tab { padding: 6px 16px; border-radius: 20px; border: 2px solid #2d6a9f; background: white; color: #2d6a9f; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.tab.active, .tab:hover { background: #2d6a9f; color: white; }
.category-badge { display: inline-block; background: rgba(255,255,255,0.2); color: white; font-size: 0.72rem; padding: 2px 10px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; letter-spacing: 1px; }
.mark-btns { display: flex; justify-content: center; gap: 10px; padding: 14px; }
.mark-btns button { padding: 8px 22px; border: none; border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.btn-know { background: #38a169; color: white; }
.btn-review { background: #e6a817; color: white; }
.stats { display: flex; justify-content: center; gap: 24px; padding: 10px; font-size: 0.85rem; }
.stat { text-align: center; }
.stat span { display: block; font-size: 1.3rem; font-weight: 800; }
.stat-know span { color: #38a169; }
.stat-review span { color: #e6a817; }
.stat-left span { color: #2d6a9f; }
</style>
</head>
<body>
<header>
<h1>Flashcards</h1>
<p>General Immunology: Cells and Immune Organs | Click a card to reveal the answer</p>
</header>
<div class="category-tabs">
<button class="tab active" onclick="filterCategory('all')">All (40)</button>
<button class="tab" onclick="filterCategory('concepts')">Key Concepts</button>
<button class="tab" onclick="filterCategory('bone-marrow')">Bone Marrow</button>
<button class="tab" onclick="filterCategory('thymus')">Thymus</button>
<button class="tab" onclick="filterCategory('lymph-nodes')">Lymph Nodes</button>
<button class="tab" onclick="filterCategory('spleen')">Spleen</button>
<button class="tab" onclick="filterCategory('malt')">MALT</button>
<button class="tab" onclick="filterCategory('cells')">Immune Cells</button>
</div>
<div class="progress-bar-wrap"><div class="progress-bar" id="progressBar"></div></div>
<div class="counter" id="counter">Card 1 of 40</div>
<div class="stats">
<div class="stat stat-know"><span id="knowCount">0</span>Know It</div>
<div class="stat stat-review"><span id="reviewCount">0</span>Review</div>
<div class="stat stat-left"><span id="leftCount">40</span>Remaining</div>
</div>
<div class="card-area">
<div class="card-scene">
<div class="card" id="flashcard" onclick="flipCard()">
<div class="card-face card-front">
<div class="card-label">Question</div>
<div class="card-question" id="cardQuestion"></div>
<div class="card-hint">Click to reveal answer</div>
</div>
<div class="card-face card-back">
<div class="category-badge" id="cardCategory"></div>
<div class="card-label">Answer</div>
<div class="card-answer" id="cardAnswer"></div>
</div>
</div>
</div>
</div>
<div class="mark-btns">
<button class="btn-know" onclick="markCard('know')">✓ Know It</button>
<button class="btn-review" onclick="markCard('review')">↻ Review Later</button>
</div>
<div class="controls">
<button id="prevBtn" onclick="prevCard()">← Previous</button>
<button id="nextBtn" onclick="nextCard()">Next →</button>
<button id="shuffleBtn" onclick="shuffleCards()">🔀 Shuffle</button>
<button id="resetBtn" onclick="resetCards()">↺ Reset</button>
</div>
<script>
const allCards = [
// KEY CONCEPTS
{ category: 'concepts', q: 'What is Immunity?', a: 'The body\'s ability to resist pathogens.' },
{ category: 'concepts', q: 'What is the Immune System composed of?', a: 'Immune organs, cells, and molecules secreted by cells (e.g., antibodies).' },
{ category: 'concepts', q: 'What is an Immune Response?', a: 'The immune system\'s response to microorganisms and harmful substances.' },
{ category: 'concepts', q: 'What is Immunology?', a: 'The study of the structure and function of the immune system and the body\'s immune responses.' },
{ category: 'concepts', q: 'Name 4 disorders that arise when the immune system is dysregulated.', a: '1. Immunodeficiency\n2. Chronic inflammation\n3. Autoimmune disease\n4. Graft rejection' },
{ category: 'concepts', q: 'What are the 2 types of lymphoid organs?', a: '1. Central lymphoid organs – produce and train stem cells (antigen-independent)\n2. Peripheral lymphoid organs – concentrate lymphocytes/macrophages; respond to antigens' },
// BONE MARROW
{ category: 'bone-marrow', q: 'What are the 2 main types of bone marrow?', a: 'Red marrow – contains hematopoietic stem cells (active hematopoiesis)\nYellow marrow – contains mainly fat; less involved in hematopoiesis' },
{ category: 'bone-marrow', q: 'What are the 2 hematopoietic cell lines produced in bone marrow?', a: 'Myeloid line (granulocytes, monocytes) and Lymphoid line (B lymphocytes; T cell precursors)' },
{ category: 'bone-marrow', q: 'What 3 functions does bone marrow serve in immunity?', a: '1. Produces immune cells (granulocytes, monocytes, B lymphocytes)\n2. Acts as secondary immune organ (contains APCs; stores neutrophils and macrophages)\n3. Maintains immune balance' },
{ category: 'bone-marrow', q: 'Bone marrow dysfunction leads to what?', a: 'Impaired immune response' },
{ category: 'bone-marrow', q: 'Is bone marrow a classic lymphoid organ?', a: 'No – it is not a classic lymphoid organ, but it is where multipotent stem cells and immunocompetent precursor cells are produced.' },
// THYMUS
{ category: 'thymus', q: 'Where is the thymus located?', a: 'Just behind the sternum; consists of 2 large lobes, each divided into lobules.' },
{ category: 'thymus', q: 'What is the weight of the thymus at puberty vs. in the elderly?', a: 'Puberty: 30–50 g (largest)\nElderly: <15 g (physiological regression)' },
{ category: 'thymus', q: 'What percentage of thymocytes survive positive selection in the cortex?', a: 'Only ~2–5% survive; ~95–98% are eliminated via apoptosis (positive selection).' },
{ category: 'thymus', q: 'What is positive selection in the thymic cortex?', a: 'Elimination of T cells that cannot recognize MHC complexes on thymic epithelial cells – ~95–98% die via apoptosis.' },
{ category: 'thymus', q: 'What is negative selection in the thymic medulla?', a: 'Elimination of T cells that strongly recognize self-antigens – prevents autoimmune reactions. ~15–20% of thymocytes eliminated here.' },
{ category: 'thymus', q: 'What are Hassall\'s corpuscles?', a: 'Degenerated reticular epithelial cells in the thymic medulla, arranged in concentric keratin rings. They regulate T lymphocyte differentiation and death.' },
{ category: 'thymus', q: 'What is the function of the blood-thymus barrier?', a: 'Creates immune isolation – protects immature thymocytes from foreign antigens, ensuring safe T cell differentiation and selection ("immunological inertia").' },
{ category: 'thymus', q: 'What 3 endocrine factors do thymic reticular epithelial cells secrete?', a: '1. Thymotaxin – attracts lymphocytes from blood to cortex\n2. Lymphopoietin – induces differentiation into lymphocytes/thymocytes\n3. Thymuline – promotes surface marker synthesis (maturation)' },
{ category: 'thymus', q: 'What surface antigens do mature T lymphocytes in the thymic medulla express?', a: 'MHC class I, and either CD4 or CD8' },
{ category: 'thymus', q: 'Why do mature T cells only return to the thymic medulla and NOT the cortex?', a: '1. Lack of early differentiation receptors in the cortex\n2. Lack of receptors to enter the cortex\n3. Avoids disrupting immature T cells / preventing autoimmune disease\n4. Medulla is more suitable for immune regulatory mechanisms' },
{ category: 'thymus', q: 'Why should corticosteroids NOT be used in HIV patients?', a: 'HIV attacks CD4+ T cells; corticosteroids would further suppress these cells, worsening immune deficiency.' },
{ category: 'thymus', q: 'What are the 2 roles of mature thymocytes in peripheral lymphoid organs?', a: 'Direct role: cellular immunity (e.g., graft rejection)\nIndirect role: humoral immunity (coordination with B lymphocytes)' },
// LYMPH NODES
{ category: 'lymph-nodes', q: 'How many lymph nodes are in the human body, and what is their normal size?', a: 'About 600 lymph nodes; normally <1 cm (not palpable).' },
{ category: 'lymph-nodes', q: 'What are the 3 regions of the lymph node parenchyma?', a: '1. Cortex – B lymphocytes, lymphoid follicles (primary → secondary with germinal centers)\n2. Paracortex – T lymphocytes; "thymus-dependent zone"\n3. Medulla – plasma cells, macrophages; B cells differentiate into plasma cells here' },
{ category: 'lymph-nodes', q: 'What is the "thymus-dependent zone" of a lymph node?', a: 'The paracortical region – contains mainly T lymphocytes and is where T and B cells from blood enter the lymph node.' },
{ category: 'lymph-nodes', q: 'What happens to lymphoid follicles in the cortex when antigens invade?', a: 'Primary lymphoid follicles expand, germinal centers appear, and they become secondary lymphoid follicles.' },
{ category: 'lymph-nodes', q: 'Describe the step-by-step immune response in a lymph node.', a: '1. Antigens captured by macrophages\n2. Macrophages process/present antigens to T and B cells\n3. CD4+ T cells activate in paracortex → activate B cells in follicles\n4. B cells proliferate → plasma cells → antibodies\n5. Activated cells leave lymph nodes after a few days' },
{ category: 'lymph-nodes', q: 'What is the right lymphatic duct vs. the thoracic duct?', a: 'Right lymphatic duct: drains upper right body (right arm, right head/neck)\nThoracic duct (left lymphatic duct): drains the rest of the body; originates ~T12' },
{ category: 'lymph-nodes', q: 'What is chyle?', a: 'Lymph fluid in the intestine that contains a lot of fat absorbed from food.' },
// SPLEEN
{ category: 'spleen', q: 'What is the weight of the spleen and what are its 2 main parenchymal regions?', a: 'Weight: 75–150 g\n1. Red pulp (~4/5 of mass) – filters old RBCs; blood reservoir\n2. White pulp – lymphoid tissue; site of immune responses' },
{ category: 'spleen', q: 'What is the function of the white pulp of the spleen?', a: 'Contains lymphoid tissue with central arterioles; lymphoid follicles with germinal centers (B cells) and T lymphocyte zones. Site of lymphocyte production and immune activation.' },
{ category: 'spleen', q: 'What is the function of the red pulp of the spleen?', a: 'Filters old red blood cells and dead cell fragments (via macrophages in Billroth\'s cords using lysosomal enzymes); also serves as a blood reservoir.' },
{ category: 'spleen', q: 'What are the 4 main physiological functions of the spleen?', a: '1. Lymphocyte generation\n2. Protection (fight pathogens via macrophages and antibodies)\n3. Destruction of old RBCs\n4. Blood reservoir' },
{ category: 'spleen', q: 'In the embryonic period, what does the spleen produce?', a: 'Red blood cells, white blood cells, platelets, and lymphocytes. Postnatally, it produces only lymphocytes.' },
// MALT
{ category: 'malt', q: 'What distinguishes MALT from other lymphoid organs structurally?', a: 'MALT lacks a connective tissue capsule. It is found in the mucosa of the digestive, respiratory, and urinary tracts.' },
{ category: 'malt', q: 'What are Peyer\'s patches and where are they located?', a: 'Characteristic lymphoid structures in the small intestine wall. Center: B lymphocytes; Surrounding: T lymphocytes (mainly CD8+) and macrophages. Effectively process antigens.' },
{ category: 'malt', q: 'What is BALT and what makes it clinically important?', a: 'Bronchus-Associated Lymphoid Tissue – along trachea, bronchi, bronchioles. Located just below respiratory epithelium for early antigen contact. Reacts strongly to inhaled agents (e.g., influenza, SARS-CoV-2).' },
{ category: 'malt', q: 'What are the tonsils and what is the composition of Waldeyer\'s lymphatic ring?', a: 'Waldeyer\'s ring: lymphocytes, primary and secondary follicles. B lymphocytes account for 40–50%.' },
// IMMUNE CELLS
{ category: 'cells', q: 'Where do T lymphocytes originate and where do they mature?', a: 'Originate in bone marrow; mature in the THYMUS.' },
{ category: 'cells', q: 'Where do B lymphocytes originate and where do they mature?', a: 'Originate AND mature in the BONE MARROW.' },
{ category: 'cells', q: 'What is the difference between CD4+ and CD8+ T cells?', a: 'CD4+ T helper cells – activate B cells and coordinate immune responses\nCD8+ Cytotoxic T cells – directly kill virus-infected or tumor cells' },
];
let cards = [...allCards];
let current = 0;
let known = 0, review = 0;
let marked = new Array(allCards.length).fill(null);
let flipped = false;
let activeCategory = 'all';
function filterCategory(cat) {
activeCategory = cat;
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
event.target.classList.add('active');
if (cat === 'all') cards = [...allCards];
else cards = allCards.filter(c => c.category === cat);
current = 0;
known = 0; review = 0;
marked = new Array(cards.length).fill(null);
updateStats();
showCard();
}
function showCard() {
if (cards.length === 0) return;
const card = cards[current];
document.getElementById('cardQuestion').textContent = card.q;
document.getElementById('cardAnswer').textContent = card.a;
const catLabels = { 'concepts':'Key Concepts','bone-marrow':'Bone Marrow','thymus':'Thymus','lymph-nodes':'Lymph Nodes','spleen':'Spleen','malt':'MALT','cells':'Immune Cells' };
document.getElementById('cardCategory').textContent = catLabels[card.category] || card.category;
document.getElementById('flashcard').classList.remove('flipped');
flipped = false;
const pct = ((current + 1) / cards.length) * 100;
document.getElementById('progressBar').style.width = pct + '%';
document.getElementById('counter').textContent = `Card ${current + 1} of ${cards.length}`;
document.getElementById('leftCount').textContent = cards.length - known - review;
}
function flipCard() {
const card = document.getElementById('flashcard');
flipped = !flipped;
if (flipped) card.classList.add('flipped');
else card.classList.remove('flipped');
}
function nextCard() {
if (current < cards.length - 1) { current++; showCard(); }
}
function prevCard() {
if (current > 0) { current--; showCard(); }
}
function shuffleCards() {
for (let i = cards.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[cards[i], cards[j]] = [cards[j], cards[i]];
}
current = 0;
showCard();
}
function resetCards() {
if (activeCategory === 'all') cards = [...allCards];
else cards = allCards.filter(c => c.category === activeCategory);
current = 0; known = 0; review = 0;
marked = new Array(cards.length).fill(null);
updateStats();
showCard();
}
function markCard(type) {
if (marked[current] !== type) {
if (marked[current] === 'know') known--;
if (marked[current] === 'review') review--;
marked[current] = type;
if (type === 'know') known++;
if (type === 'review') review++;
updateStats();
}
if (current < cards.length - 1) { current++; showCard(); }
}
function updateStats() {
document.getElementById('knowCount').textContent = known;
document.getElementById('reviewCount').textContent = review;
document.getElementById('leftCount').textContent = cards.length - known - review;
}
showCard();
</script>
</body>
</html>
~/immunology-lesson1/quiz.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quiz – General Immunology: Cells and Immune Organs</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #eef2f7; color: #1a202c; min-height: 100vh; }
header { background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%); color: white; padding: 32px 20px; text-align: center; }
header h1 { font-size: 1.8rem; font-weight: 700; }
header p { margin-top: 6px; opacity: 0.85; font-size: 0.95rem; }
.container { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; }
/* START SCREEN */
#startScreen { background: white; border-radius: 16px; padding: 40px 36px; box-shadow: 0 4px 20px rgba(0,0,0,0.09); text-align: center; }
#startScreen h2 { color: #1a3c5e; font-size: 1.5rem; margin-bottom: 14px; }
#startScreen p { color: #4a6fa5; margin-bottom: 24px; font-size: 1rem; }
.start-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 24px; }
.start-options button { padding: 10px 22px; border: 2px solid #2d6a9f; background: white; color: #2d6a9f; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.start-options button.active, .start-options button:hover { background: #2d6a9f; color: white; }
#startBtn { background: #2d6a9f; color: white; border: none; padding: 14px 40px; border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: all 0.2s; margin-top: 6px; }
#startBtn:hover { background: #1a3c5e; transform: translateY(-2px); }
/* QUIZ SCREEN */
#quizScreen { display: none; }
.progress-wrap { background: white; border-radius: 12px; padding: 14px 20px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; align-items: center; gap: 14px; }
.progress-text { font-size: 0.9rem; color: #4a6fa5; font-weight: 600; white-space: nowrap; }
.progress-bar-bg { flex: 1; background: #e2e8f0; border-radius: 8px; height: 10px; }
.progress-bar-fill { background: linear-gradient(90deg, #2d6a9f, #38a169); height: 10px; border-radius: 8px; transition: width 0.4s; }
.score-badge { background: #2d6a9f; color: white; border-radius: 8px; padding: 4px 14px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.question-card { background: white; border-radius: 16px; padding: 32px 36px; box-shadow: 0 4px 20px rgba(0,0,0,0.09); margin-bottom: 18px; }
.q-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.q-category { background: #eef6ff; color: #2d6a9f; font-size: 0.78rem; padding: 4px 12px; border-radius: 12px; font-weight: 700; letter-spacing: 0.5px; }
.q-number { color: #a0aec0; font-size: 0.85rem; font-weight: 600; }
.q-text { font-size: 1.12rem; font-weight: 700; color: #1a3c5e; line-height: 1.5; margin-bottom: 24px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option { padding: 14px 18px; border: 2px solid #e2e8f0; border-radius: 10px; background: white; text-align: left; cursor: pointer; font-size: 0.95rem; color: #2d3748; font-weight: 500; transition: all 0.18s; display: flex; gap: 12px; align-items: flex-start; }
.option:hover:not(.answered) { border-color: #2d6a9f; background: #eef6ff; }
.option-letter { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; background: #e2e8f0; color: #4a6fa5; font-size: 0.82rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.option.correct { border-color: #38a169; background: #f0fff4; }
.option.correct .option-letter { background: #38a169; color: white; }
.option.wrong { border-color: #e53e3e; background: #fff5f5; }
.option.wrong .option-letter { background: #e53e3e; color: white; }
.option.show-correct { border-color: #38a169; background: #f0fff4; }
.option.show-correct .option-letter { background: #38a169; color: white; }
.feedback { margin-top: 18px; padding: 14px 18px; border-radius: 10px; font-size: 0.93rem; line-height: 1.6; display: none; }
.feedback.correct { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.feedback.wrong { background: #fff5f5; border: 1px solid #feb2b2; color: #9b2c2c; }
.feedback strong { display: block; margin-bottom: 4px; font-size: 1rem; }
.next-btn { background: #2d6a9f; color: white; border: none; padding: 12px 32px; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s; display: none; margin-top: 18px; }
.next-btn:hover { background: #1a3c5e; }
/* RESULTS SCREEN */
#resultsScreen { display: none; background: white; border-radius: 16px; padding: 40px 36px; box-shadow: 0 4px 20px rgba(0,0,0,0.09); text-align: center; }
.score-circle { width: 130px; height: 130px; border-radius: 50%; border: 8px solid #2d6a9f; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 0 auto 24px; }
.score-pct { font-size: 2.2rem; font-weight: 800; color: #1a3c5e; }
.score-label { font-size: 0.8rem; color: #4a6fa5; font-weight: 600; }
.result-stats { display: flex; justify-content: center; gap: 28px; margin: 20px 0 30px; flex-wrap: wrap; }
.result-stat { text-align: center; }
.result-stat .val { font-size: 1.5rem; font-weight: 800; }
.result-stat .lbl { font-size: 0.82rem; color: #718096; margin-top: 2px; }
.r-correct .val { color: #38a169; }
.r-wrong .val { color: #e53e3e; }
.r-total .val { color: #2d6a9f; }
.grade-msg { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.grade-sub { color: #718096; font-size: 0.95rem; margin-bottom: 28px; }
.result-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.result-btns button { padding: 11px 28px; border-radius: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: none; transition: all 0.2s; }
.btn-retry { background: #2d6a9f; color: white; }
.btn-wrong-only { background: #e6a817; color: white; }
.btn-retry:hover { background: #1a3c5e; }
.btn-wrong-only:hover { background: #b07d00; }
.review-section { margin-top: 32px; text-align: left; }
.review-section h3 { color: #1a3c5e; font-size: 1.1rem; margin-bottom: 16px; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; }
.review-item { border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; font-size: 0.9rem; }
.review-item.was-correct { background: #f0fff4; border-left: 4px solid #38a169; }
.review-item.was-wrong { background: #fff5f5; border-left: 4px solid #e53e3e; }
.review-item .rq { font-weight: 700; color: #1a3c5e; margin-bottom: 6px; }
.review-item .ra { color: #2d6a9f; }
.review-item .rw { color: #e53e3e; text-decoration: line-through; margin-bottom: 2px; }
</style>
</head>
<body>
<header>
<h1>Quiz</h1>
<p>General Immunology: Cells and Immune Organs | Test your knowledge</p>
</header>
<div class="container">
<!-- START SCREEN -->
<div id="startScreen">
<h2>Ready to Test Yourself?</h2>
<p>30 questions covering all topics from Lesson 1. Choose how many questions and a topic focus.</p>
<div style="margin-bottom:18px;">
<p style="font-weight:700;color:#1a3c5e;margin-bottom:10px;">Number of Questions:</p>
<div class="start-options" id="countOptions">
<button onclick="setCount(10)" class="active">10 Questions</button>
<button onclick="setCount(20)">20 Questions</button>
<button onclick="setCount(30)">All 30</button>
</div>
</div>
<div>
<p style="font-weight:700;color:#1a3c5e;margin-bottom:10px;">Topic Focus:</p>
<div class="start-options" id="topicOptions">
<button onclick="setTopic('all')" class="active">All Topics</button>
<button onclick="setTopic('concepts')">Key Concepts</button>
<button onclick="setTopic('bone-marrow')">Bone Marrow</button>
<button onclick="setTopic('thymus')">Thymus</button>
<button onclick="setTopic('lymph-nodes')">Lymph Nodes</button>
<button onclick="setTopic('spleen')">Spleen</button>
<button onclick="setTopic('malt')">MALT</button>
<button onclick="setTopic('cells')">Immune Cells</button>
</div>
</div>
<button id="startBtn" onclick="startQuiz()">Start Quiz →</button>
</div>
<!-- QUIZ SCREEN -->
<div id="quizScreen">
<div class="progress-wrap">
<div class="progress-text" id="progressText">Question 1/10</div>
<div class="progress-bar-bg"><div class="progress-bar-fill" id="progressFill" style="width:0%"></div></div>
<div class="score-badge" id="scoreBadge">Score: 0</div>
</div>
<div class="question-card" id="questionCard">
<div class="q-meta">
<span class="q-category" id="qCategory"></span>
<span class="q-number" id="qNumber"></span>
</div>
<div class="q-text" id="qText"></div>
<div class="options" id="optionsContainer"></div>
<div class="feedback" id="feedback"></div>
<button class="next-btn" id="nextBtn" onclick="nextQuestion()">Next Question →</button>
</div>
</div>
<!-- RESULTS SCREEN -->
<div id="resultsScreen">
<div class="score-circle">
<div class="score-pct" id="scorePct"></div>
<div class="score-label">Score</div>
</div>
<div class="grade-msg" id="gradeMsg"></div>
<div class="grade-sub" id="gradeSub"></div>
<div class="result-stats">
<div class="result-stat r-correct"><div class="val" id="rCorrect"></div><div class="lbl">Correct</div></div>
<div class="result-stat r-wrong"><div class="val" id="rWrong"></div><div class="lbl">Incorrect</div></div>
<div class="result-stat r-total"><div class="val" id="rTotal"></div><div class="lbl">Total</div></div>
</div>
<div class="result-btns">
<button class="btn-retry" onclick="retryQuiz()">↺ Retry Quiz</button>
<button class="btn-wrong-only" onclick="retryWrong()">Review Wrong Answers</button>
</div>
<div class="review-section" id="reviewSection"></div>
</div>
</div>
<script>
const allQuestions = [
// KEY CONCEPTS
{ category: 'concepts', q: 'What is the definition of "Immunity"?', options: ['The body\'s ability to resist pathogens', 'The set of immune organs and molecules', 'The study of immune system structure', 'The response to harmful environmental chemicals'], correct: 0, explanation: 'Immunity is specifically defined as the body\'s ability to resist pathogens.' },
{ category: 'concepts', q: 'Which of the following best describes the "Immune System"?', options: ['Only immune cells in the bloodstream', 'Immune organs, cells, and molecules secreted by cells (e.g., antibodies)', 'Antibodies and complement proteins only', 'The lymphatic system and lymph nodes'], correct: 1, explanation: 'The immune system includes immune organs, cells, AND molecules secreted by cells (such as antibodies).' },
{ category: 'concepts', q: 'Which of the following is NOT a consequence of immune system dysregulation?', options: ['Autoimmune disease', 'Immunodeficiency', 'Hypertension', 'Graft rejection'], correct: 2, explanation: 'Hypertension is a cardiovascular condition, not a direct result of immune dysregulation. The immune disorders include immunodeficiency, chronic inflammation, autoimmune disease, and graft rejection.' },
{ category: 'concepts', q: 'Which type of lymphoid organ trains stem cells into mature cells WITHOUT requiring antigens?', options: ['Peripheral lymphoid organs', 'Central lymphoid organs', 'Spleen', 'Lymph nodes'], correct: 1, explanation: 'Central lymphoid organs (bone marrow and thymus) produce and train stem cells into mature immune cells in an antigen-independent manner.' },
// BONE MARROW
{ category: 'bone-marrow', q: 'Which type of bone marrow contains hematopoietic stem cells?', options: ['Yellow marrow', 'Cortical marrow', 'Red marrow', 'Trabecular marrow'], correct: 2, explanation: 'Red marrow contains hematopoietic stem cells and is actively involved in blood cell production. Yellow marrow contains mainly fat.' },
{ category: 'bone-marrow', q: 'Which of the following immune cells is NOT produced primarily in bone marrow from the myeloid lineage?', options: ['Granulocytes', 'Monocytes', 'T lymphocytes (mature)', 'Neutrophils'], correct: 2, explanation: 'T lymphocytes originate in bone marrow but MATURE in the thymus. Granulocytes, monocytes, and neutrophils are myeloid-lineage cells that mature in bone marrow.' },
{ category: 'bone-marrow', q: 'What is the consequence of bone marrow dysfunction?', options: ['Enhanced immune response', 'Impaired immune response', 'Only affects red blood cell production', 'Causes autoimmune disease exclusively'], correct: 1, explanation: 'Bone marrow dysfunction leads to impaired immune response because it is the primary source of all immune cells.' },
{ category: 'bone-marrow', q: 'What secondary immune function does bone marrow serve?', options: ['Site of T cell negative selection', 'Contains APCs that help activate immune responses; stores neutrophils and macrophages', 'Produces only B lymphocytes', 'Acts as a blood filter like the spleen'], correct: 1, explanation: 'Bone marrow acts as a secondary immune organ by containing antigen-presenting cells (APCs) and storing large numbers of neutrophils and macrophages for rapid response.' },
// THYMUS
{ category: 'thymus', q: 'When does the thymus reach its maximum size, and what is that maximum weight?', options: ['At birth; 10-15 g', 'At puberty; 30-50 g', 'In early childhood; 20-25 g', 'In elderly; <15 g'], correct: 1, explanation: 'The thymus reaches its maximum size at puberty, weighing 30-50 g, and then gradually regresses to <15 g in the elderly.' },
{ category: 'thymus', q: 'What percentage of T cells survive positive selection in the thymic cortex?', options: ['50-60%', '30-40%', '15-20%', '~2-5%'], correct: 3, explanation: 'Only about 2-5% of T cells survive positive selection in the cortex. The remaining 95-98% are eliminated via apoptosis.' },
{ category: 'thymus', q: 'What is the purpose of NEGATIVE selection in the thymic medulla?', options: ['To select T cells that recognize MHC molecules', 'To eliminate T cells that strongly recognize self-antigens, preventing autoimmunity', 'To produce mature B lymphocytes', 'To create Hassall\'s corpuscles'], correct: 1, explanation: 'Negative selection eliminates T cells with too high an affinity for self-antigens, which prevents autoimmune reactions. About 15-20% of thymocytes are eliminated in this phase.' },
{ category: 'thymus', q: 'What are Hassall\'s corpuscles?', options: ['Germinal centers in the thymic cortex', 'Degenerated reticular epithelial cells forming concentric keratin rings in the medulla', 'Blood-thymus barrier components', 'Primary lymphoid follicles in the thymus'], correct: 1, explanation: 'Hassall\'s corpuscles are degenerated reticular epithelial cells that form concentric keratin rings in the thymic medulla. They regulate T lymphocyte differentiation and death.' },
{ category: 'thymus', q: 'Which thymic endocrine factor attracts lymphocytes to migrate from blood to the thymic cortex?', options: ['Lymphopoietin', 'Thymuline', 'Thymotaxin', 'Interleukin-7'], correct: 2, explanation: 'Thymotaxin (a tropic peptide) causes lymphocytes to migrate from the blood to the thymic cortex. Lymphopoietin induces differentiation; thymuline promotes surface marker synthesis.' },
{ category: 'thymus', q: 'What is the blood-thymus barrier and where is it located?', options: ['A barrier in the thymic medulla separating T cells from B cells', 'An arterial ring at the cortex-medulla boundary that protects immature thymocytes from foreign antigens', 'The fibrous capsule surrounding the thymus', 'The basement membrane of thymic cortical epithelial cells'], correct: 1, explanation: 'The blood-thymus barrier is an arterial ring at the boundary between the cortex and medulla. It creates immune isolation, protecting immature thymocytes from premature antigen exposure.' },
{ category: 'thymus', q: 'Why should corticosteroids NOT be used in HIV patients?', options: ['HIV makes patients resistant to corticosteroids', 'Corticosteroids activate HIV replication directly', 'HIV attacks CD4+ T cells; corticosteroids would further suppress these cells', 'HIV causes excessive corticosteroid production'], correct: 2, explanation: 'HIV specifically attacks CD4+ T cells. Administering corticosteroids, which induce apoptosis in immune cells including T cells, would further deplete the already-reduced CD4+ population.' },
{ category: 'thymus', q: 'Surface markers of mature T lymphocytes in the thymic medulla include:', options: ['MHC class II and CD3', 'MHC class I and either CD4 or CD8', 'CD19 and CD20', 'IgM and IgD'], correct: 1, explanation: 'Mature T lymphocytes in the medulla are corticosteroid-resistant and express MHC class I along with either CD4 or CD8 antigens.' },
{ category: 'thymus', q: 'Why do mature T cells return ONLY to the thymic medulla and NOT the cortex?', options: ['The cortex is too crowded with new T cells', 'Mature T cells lack receptors to enter the cortex; returning would disrupt immature T cells and risk autoimmune disease', 'The cortex has a blood-thymus barrier blocking mature cells', 'Corticosteroids prevent mature T cells from entering the cortex'], correct: 1, explanation: 'Mature T cells lack early differentiation receptors and the receptors necessary to enter the cortex. Entering the cortex could disrupt immature T cell selection and risk autoimmune disease.' },
// LYMPH NODES
{ category: 'lymph-nodes', q: 'Which region of the lymph node is the "thymus-dependent zone"?', options: ['Cortex', 'Germinal center', 'Paracortex', 'Medullary cords'], correct: 2, explanation: 'The paracortical region is called the thymus-dependent zone because it is populated by T lymphocytes and is where T and B cells from blood enter the lymph node.' },
{ category: 'lymph-nodes', q: 'Where in the lymph node do B cells differentiate into plasma cells?', options: ['Paracortex', 'Primary follicles', 'Medullary region', 'Subcapsular sinus'], correct: 2, explanation: 'The medullary region is where B lymphocytes reproduce and differentiate into plasma cells, which then produce antibodies.' },
{ category: 'lymph-nodes', q: 'What structural change occurs in lymphoid follicles when antigens invade?', options: ['Primary follicles shrink and disappear', 'Primary follicles expand, germinal centers appear, and they become secondary follicles', 'T cells replace B cells in the follicles', 'The follicles migrate to the paracortex'], correct: 1, explanation: 'When antigens invade, primary lymphoid follicles expand, germinal centers appear, and they transform into secondary lymphoid follicles.' },
{ category: 'lymph-nodes', q: 'Which lymphatic duct drains the upper RIGHT side of the body?', options: ['Thoracic duct', 'Left lymphatic duct', 'Right lymphatic duct', 'Canal of van Hoorne'], correct: 2, explanation: 'The right lymphatic duct receives fluid from the upper right body: right upper body, right arm, right head, and neck. The thoracic duct drains the rest of the body.' },
{ category: 'lymph-nodes', q: 'What is "chyle"?', options: ['Lymph fluid in the pleural cavity', 'Lymph fluid in the intestine that contains high amounts of absorbed fat', 'Clear fluid produced by the spleen', 'Protein-rich fluid in lymph nodes'], correct: 1, explanation: 'Chyle is the specialized lymph fluid in the intestine that contains a lot of fat absorbed from food. It is transported by lacteals (chylothorax).' },
// SPLEEN
{ category: 'spleen', q: 'What is the approximate weight of the spleen?', options: ['15-30 g', '50-75 g', '75-150 g', '150-250 g'], correct: 2, explanation: 'The spleen weighs approximately 75-150 g and is the largest lymphoid organ in the body.' },
{ category: 'spleen', q: 'What proportion of the spleen is made up of red pulp?', options: ['1/5', '2/5', '3/5', '4/5'], correct: 3, explanation: 'Red pulp constitutes approximately 4/5 of the splenic mass; white pulp is scattered within the red pulp.' },
{ category: 'spleen', q: 'Where in the spleen are old red blood cells destroyed?', options: ['White pulp germinal centers', 'Billroth\'s cords in the red pulp (by macrophages using lysosomal enzymes)', 'Central arterioles', 'Fibrous capsule'], correct: 1, explanation: 'Macrophages in Billroth\'s cords of the red pulp destroy old red blood cells using lysosomal enzymes.' },
{ category: 'spleen', q: 'During the embryonic period, the spleen produces:', options: ['Only lymphocytes', 'Only red blood cells', 'Red blood cells, white blood cells, platelets, and lymphocytes', 'Only B lymphocytes and plasma cells'], correct: 2, explanation: 'In the embryonic period, the spleen produces red blood cells, white blood cells, platelets, and lymphocytes. After birth, it produces only lymphocytes.' },
{ category: 'spleen', q: 'What is the function of the spongy structure of the red pulp?', options: ['Filters antigens and presents them to T cells', 'Stores blood in venous sinuses and releases it when needed (blood reservoir)', 'Produces erythropoietin', 'Generates germinal centers for B cell activation'], correct: 1, explanation: 'The spongy structure of the red pulp keeps blood in the venous sinuses, acting as a blood reservoir, and releases it when needed to increase blood volume.' },
// MALT
{ category: 'malt', q: 'What distinguishes MALT from other lymphoid organs?', options: ['It is located only in the gut', 'It has a thick fibrous capsule', 'It lacks a connective tissue capsule', 'It contains only T lymphocytes'], correct: 2, explanation: 'MALT (Mucosal-Associated Lymphoid Tissue) is distinguished from other lymphoid organs by the absence of a connective tissue capsule.' },
{ category: 'malt', q: 'What is the predominant T cell type in the area SURROUNDING Peyer\'s patches?', options: ['CD4+ T helper cells', 'Regulatory T cells', 'CD8+ T cells and macrophages', 'NK cells'], correct: 2, explanation: 'In Peyer\'s patches, the center contains B lymphocytes while the surrounding area contains mainly CD8+ T cells and macrophages.' },
{ category: 'malt', q: 'Which mucosal lymphoid tissue responds strongly to SARS-CoV-2 and influenza?', options: ['GALT (Peyer\'s patches)', 'BALT (Bronchus-Associated Lymphoid Tissue)', 'Waldeyer\'s ring only', 'Mesenteric lymph nodes'], correct: 1, explanation: 'BALT is located just below the respiratory epithelium and reacts strongly to inhaled agents such as influenza and SARS-CoV-2, although it is less developed than GALT.' },
{ category: 'malt', q: 'What percentage of cells in Waldeyer\'s lymphatic ring (tonsils) are B lymphocytes?', options: ['5-10%', '20-30%', '40-50%', '60-70%'], correct: 2, explanation: 'B lymphocytes account for 40-50% of cells in Waldeyer\'s lymphatic ring.' },
// IMMUNE CELLS
{ category: 'cells', q: 'Which cell type bridges innate and adaptive immunity by acting as professional antigen-presenting cells?', options: ['Neutrophils', 'Mast cells', 'NK cells', 'Dendritic cells'], correct: 3, explanation: 'Dendritic cells are professional antigen-presenting cells (APCs) that link the innate and adaptive immune systems by capturing antigens and presenting them to T cells.' },
{ category: 'cells', q: 'What is the difference between the maturation sites of T and B lymphocytes?', options: ['Both mature in the thymus', 'T cells mature in bone marrow; B cells in thymus', 'T cells mature in the thymus; B cells mature in bone marrow', 'Both mature in peripheral lymphoid organs'], correct: 2, explanation: 'T lymphocytes originate in bone marrow and mature in the thymus. B lymphocytes both originate AND mature in the bone marrow.' },
];
let quizQuestions = [];
let current = 0;
let score = 0;
let answered = false;
let selectedCount = 10;
let selectedTopic = 'all';
let wrongQuestions = [];
let userAnswers = [];
function setCount(n) {
selectedCount = n;
document.querySelectorAll('#countOptions button').forEach(b => b.classList.remove('active'));
event.target.classList.add('active');
}
function setTopic(t) {
selectedTopic = t;
document.querySelectorAll('#topicOptions button').forEach(b => b.classList.remove('active'));
event.target.classList.add('active');
}
function startQuiz(wrongOnly = false) {
let pool;
if (wrongOnly && wrongQuestions.length > 0) {
pool = wrongQuestions;
} else {
pool = selectedTopic === 'all' ? [...allQuestions] : allQuestions.filter(q => q.category === selectedTopic);
}
// Shuffle
for (let i = pool.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[pool[i], pool[j]] = [pool[j], pool[i]];
}
quizQuestions = pool.slice(0, Math.min(wrongOnly ? pool.length : selectedCount, pool.length));
current = 0; score = 0; wrongQuestions = []; userAnswers = [];
document.getElementById('startScreen').style.display = 'none';
document.getElementById('resultsScreen').style.display = 'none';
document.getElementById('quizScreen').style.display = 'block';
showQuestion();
}
const catLabels = { 'concepts': 'Key Concepts', 'bone-marrow': 'Bone Marrow', 'thymus': 'Thymus', 'lymph-nodes': 'Lymph Nodes', 'spleen': 'Spleen', 'malt': 'MALT', 'cells': 'Immune Cells' };
function showQuestion() {
const q = quizQuestions[current];
answered = false;
document.getElementById('qCategory').textContent = catLabels[q.category] || q.category;
document.getElementById('qNumber').textContent = `Q${current + 1} of ${quizQuestions.length}`;
document.getElementById('qText').textContent = q.q;
const pct = (current / quizQuestions.length) * 100;
document.getElementById('progressFill').style.width = pct + '%';
document.getElementById('progressText').textContent = `Question ${current + 1}/${quizQuestions.length}`;
document.getElementById('scoreBadge').textContent = `Score: ${score}`;
document.getElementById('feedback').style.display = 'none';
document.getElementById('nextBtn').style.display = 'none';
const letters = ['A', 'B', 'C', 'D'];
const container = document.getElementById('optionsContainer');
container.innerHTML = '';
q.options.forEach((opt, i) => {
const btn = document.createElement('button');
btn.className = 'option';
btn.innerHTML = `<span class="option-letter">${letters[i]}</span><span>${opt}</span>`;
btn.onclick = () => selectAnswer(i);
container.appendChild(btn);
});
}
function selectAnswer(idx) {
if (answered) return;
answered = true;
const q = quizQuestions[current];
const options = document.querySelectorAll('.option');
options.forEach(o => o.classList.add('answered'));
const feedback = document.getElementById('feedback');
if (idx === q.correct) {
score++;
options[idx].classList.add('correct');
feedback.className = 'feedback correct';
feedback.innerHTML = `<strong>✓ Correct!</strong>${q.explanation}`;
userAnswers.push({ q: q.q, userAnswer: q.options[idx], correctAnswer: q.options[q.correct], wasCorrect: true });
} else {
options[idx].classList.add('wrong');
options[q.correct].classList.add('show-correct');
feedback.className = 'feedback wrong';
feedback.innerHTML = `<strong>✗ Incorrect.</strong>${q.explanation}`;
wrongQuestions.push(q);
userAnswers.push({ q: q.q, userAnswer: q.options[idx], correctAnswer: q.options[q.correct], wasCorrect: false });
}
feedback.style.display = 'block';
document.getElementById('nextBtn').style.display = 'block';
document.getElementById('nextBtn').textContent = current < quizQuestions.length - 1 ? 'Next Question →' : 'See Results →';
}
function nextQuestion() {
current++;
if (current < quizQuestions.length) showQuestion();
else showResults();
}
function showResults() {
document.getElementById('quizScreen').style.display = 'none';
const resultsDiv = document.getElementById('resultsScreen');
resultsDiv.style.display = 'block';
const pct = Math.round((score / quizQuestions.length) * 100);
document.getElementById('scorePct').textContent = pct + '%';
document.getElementById('rCorrect').textContent = score;
document.getElementById('rWrong').textContent = quizQuestions.length - score;
document.getElementById('rTotal').textContent = quizQuestions.length;
let grade, sub;
if (pct >= 90) { grade = '🏆 Excellent!'; sub = 'Outstanding performance! You have mastered this lesson.'; }
else if (pct >= 75) { grade = '👍 Good Job!'; sub = 'Strong performance. Review the ones you missed.'; }
else if (pct >= 60) { grade = '📚 Keep Studying'; sub = 'You\'re on the right track. Focus on your weak areas.'; }
else { grade = '🔄 Needs More Review'; sub = 'Don\'t worry — review the notes and try again!'; }
document.getElementById('gradeMsg').textContent = grade;
document.getElementById('gradeSub').textContent = sub;
// Review section
const rev = document.getElementById('reviewSection');
rev.innerHTML = '<h3>Answer Review</h3>';
userAnswers.forEach((a, i) => {
const div = document.createElement('div');
div.className = `review-item ${a.wasCorrect ? 'was-correct' : 'was-wrong'}`;
div.innerHTML = `<div class="rq">Q${i+1}: ${a.q}</div>` +
(a.wasCorrect ? `<div class="ra">✓ ${a.correctAnswer}</div>` :
`<div class="rw">✗ Your answer: ${a.userAnswer}</div><div class="ra">✓ Correct: ${a.correctAnswer}</div>`);
rev.appendChild(div);
});
}
function retryQuiz() {
document.getElementById('resultsScreen').style.display = 'none';
document.getElementById('startScreen').style.display = 'block';
}
function retryWrong() {
if (wrongQuestions.length === 0) { alert('No wrong answers to review!'); return; }
startQuiz(true);
}
</script>
</body>
</html>