i have a test on anatomy of musculoskeletal system tomorrow. prepare top 40 questions pdf from grays and moore anatomy and other resources.
mkdir -p /home/daytona/workspace/msk-anatomy-quiz && ls /home/daytona/workspace/
~/msk-anatomy-quiz/generate_quiz.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, HRFlowable,
Table, TableStyle, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/msk-anatomy-quiz/MSK_Anatomy_Top40_Questions.pdf"
# ── Q&A DATA ──────────────────────────────────────────────────────────────────
# Each entry: (number, question, answer, source)
QA = [
# BONE STRUCTURE & CLASSIFICATION
(1,
"What are the five functions of bone in the human body?",
"1. Supportive structures for the body\n2. Protection of vital organs\n3. Reservoirs of calcium and phosphorus\n4. Levers on which muscles act to produce movement\n5. Containers for blood-producing cells (haematopoiesis)",
"Gray's Anatomy for Students"),
(2,
"Classify bones by shape and give one example of each type.",
"• Long bones – tubular (e.g., humerus, femur)\n• Short bones – cuboidal (e.g., carpal/tarsal bones)\n• Flat bones – two compact plates with spongy bone between (e.g., skull)\n• Irregular bones – varied shapes (e.g., facial bones, vertebrae)\n• Sesamoid bones – round/oval bones that develop in tendons (e.g., patella)",
"Gray's Anatomy for Students"),
(3,
"Describe the two types of bone tissue and their structural characteristics.",
"• Compact (cortical) bone: Dense bone forming the outer shell of all bones; surrounds spongy bone.\n• Spongy (trabecular/cancellous) bone: Consists of bone spicules (trabeculae) enclosing cavities containing blood-forming marrow.",
"Gray's Anatomy for Students"),
(4,
"What is the periosteum and what is its clinical significance?",
"The periosteum is a fibrous connective tissue membrane covering all bone surfaces except articular cartilage. It is unique in its capacity to form new bone. Its blood vessels supply the outer layers of compact bone. A bone stripped of periosteum will not survive. It is richly supplied with sensory nerve fibres and is very sensitive to injury—explaining the severe pain of periosteal injuries.",
"Gray's Anatomy for Students"),
(5,
"What are the two mechanisms of bone development (ossification)? How do they differ?",
"• Intramembranous ossification: Mesenchymal models undergo direct ossification without a cartilage intermediate (e.g., flat bones of skull, clavicle).\n• Endochondral ossification: Cartilaginous models form from mesenchyme first, then undergo ossification (e.g., long bones, vertebrae).",
"Gray's Anatomy for Students"),
(6,
"What is avascular necrosis of bone? Give a classic anatomical example and explain why it occurs.",
"Avascular necrosis is cellular death of bone from temporary or permanent loss of blood supply. A classic site is the femoral head after a femoral neck fracture in elderly patients. The fracture disrupts the cortical/medullary blood flow and the blood supply deep to the retinacular fibres, rendering the femoral head ischaemic → necrosis → collapse. Management: femoral head prosthesis replacement.",
"Gray's Anatomy for Students"),
(7,
"What is a greenstick fracture and in which age group does it occur?",
"A greenstick fracture occurs in children whose bones are still developing. It involves partial cortical disruption—similar to breaking a young tree branch—without complete cortical breach. These shaft fractures occur because paediatric bone is more flexible than adult bone. Growth plate (epiphyseal) fractures in children aged 7–10 and in puberty are particularly important because growth plate compression can result in asymmetrical growth.",
"Gray's Anatomy for Students"),
# JOINTS
(8,
"What are the two broad categories of joints? Give their defining feature.",
"1. Synovial joints: Skeletal elements are separated by an articular cavity.\n2. Solid (fibrous/cartilaginous) joints: No cavity; components held together by connective tissue.",
"Gray's Anatomy for Students"),
(9,
"List the characteristic features of a synovial joint.",
"1. Articular cavity separating the two bony surfaces\n2. Hyaline cartilage covering articulating surfaces\n3. Joint capsule composed of:\n – Inner synovial membrane (produces synovial fluid; lubricates joint)\n – Outer fibrous membrane (dense connective tissue; may thicken into ligaments)\n4. May contain accessory structures: articular discs (fibrocartilage), fat pads, intra-articular tendons\n5. Synovial bursae and tendon sheaths are extensions of synovial membrane outside the joint",
"Gray's Anatomy for Students"),
(10,
"Classify synovial joints by shape. Provide the joint type and an example for each.",
"• Plane joint – flat surfaces; gliding movement (e.g., intercarpal joints)\n• Hinge joint – uniaxial; flexion/extension (e.g., elbow, knee)\n• Pivot joint – uniaxial; rotation (e.g., atlanto-axial, proximal radioulnar)\n• Condyloid (ellipsoid) joint – biaxial (e.g., radiocarpal/wrist joint)\n• Saddle joint – biaxial; two saddle-shaped surfaces (e.g., carpometacarpal of thumb, sternoclavicular)\n• Ball-and-socket joint – multiaxial; widest range (e.g., hip, glenohumeral)",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(11,
"What is the role of articular discs (menisci) in synovial joints?",
"Articular discs absorb compression forces, adjust to changes in joint surface contours during movement, and increase the range of movement. They also help distribute synovial fluid. In the knee, the fibrocartilaginous menisci improve congruency between the femoral and tibial condyles, accommodating changes from curved surfaces in flexion to flat surfaces in extension.",
"Gray's Anatomy for Students"),
# SHOULDER / UPPER LIMB
(12,
"Describe the glenohumeral joint: type, articular surfaces, and what provides its stability.",
"Type: Synovial ball-and-socket (multiaxial). \nArticular surfaces: Head of humerus + glenoid cavity of scapula.\nStability (poor bony congruency compensated by soft tissue):\n• Rotator cuff muscles (SITS: Supraspinatus, Infraspinatus, Teres minor, Subscapularis)\n• Glenoid labrum (fibrocartilaginous rim deepening the socket)\n• Long head of biceps brachii\n• Extracapsular ligaments (glenohumeral ligaments, coracohumeral ligament)\n• Related bony processes (acromion, coracoid)",
"Gray's Anatomy for Students"),
(13,
"What is the rotator cuff? Name the four muscles and their primary actions.",
"The rotator cuff is a musculotendinous cuff surrounding the glenohumeral joint that provides dynamic stability.\n• Supraspinatus – initiates abduction (first 15°)\n• Infraspinatus – lateral (external) rotation\n• Teres minor – lateral (external) rotation\n• Subscapularis – medial (internal) rotation\nMnemonic: SITS",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(14,
"What is supraspinatus impingement syndrome? Why is supraspinatus specifically vulnerable?",
"Supraspinatus passes beneath the coracoacromial arch (acromion + acromioclavicular ligament). The space is fixed in dimension. Swelling of the tendon, excess subacromial/subdeltoid bursal fluid, or subacromial bone spurs cause impingement on arm abduction. The supraspinatus tendon also has relatively poor blood supply, making it susceptible to degeneration and calcification with repeated micro-trauma. This is the most common rotator cuff disorder.",
"Gray's Anatomy for Students"),
(15,
"What nerve is at risk in anterior dislocation of the glenohumeral joint, and why?",
"The axillary nerve (C5, C6) is most at risk. In anteroinferior dislocation (the most common type), the humeral head displaces anteriorly and inferiorly, compressing the axillary nerve as it passes through the quadrangular space. The nerve supplies the deltoid and teres minor muscles and the skin over the lateral shoulder (regimental badge area). Test by checking sensation over the lateral shoulder after shoulder dislocation.",
"Gray's Anatomy for Students"),
(16,
"Describe the sternoclavicular joint: type, articular disc, and ligaments.",
"Type: Synovial, saddle-shaped.\nUnique feature: The only true synovial joint connecting the upper limb to the axial skeleton.\nArticular disc: Completely divides the joint into two compartments.\nLigaments:\n• Anterior and posterior sternoclavicular ligaments\n• Interclavicular ligament (links both clavicles across the manubrium)\n• Costoclavicular ligament (links clavicle to 1st rib/costal cartilage)\nMovement: Anteroposterior, vertical, and some rotation.",
"Gray's Anatomy for Students"),
(17,
"What is the coracoclavicular ligament and what are its two components?",
"The coracoclavicular ligament is an important accessory ligament of the acromioclavicular joint. It provides the main weight-bearing support for the upper limb on the clavicle.\nTwo components:\n1. Trapezoid ligament (anterior) – attaches to the trapezoid line on the clavicle\n2. Conoid ligament (posterior) – attaches to the conoid tubercle on the clavicle\nBoth span from the coracoid process of the scapula to the inferior surface of the acromial end of clavicle.",
"Gray's Anatomy for Students"),
# LOWER LIMB – HIP
(18,
"Describe the hip joint: type, articular surfaces, and why it is more stable than the shoulder.",
"Type: Synovial, multiaxial ball-and-socket.\nArticular surfaces:\n• Spherical head of femur (covered by hyaline cartilage except at fovea)\n• Lunate surface of acetabulum (broadest superiorly; covered by hyaline cartilage)\nAcetabular labrum (fibrocartilaginous collar) deepens the socket, almost completely encompassing the femoral head → much greater bony congruency than the glenohumeral joint.\nMovements: Flexion, extension, abduction, adduction, medial/lateral rotation, circumduction.",
"Gray's Anatomy for Students"),
(19,
"What is the ligament of the head of the femur? What artery travels within it?",
"The ligament of the head of the femur (ligamentum teres) is a flat band of connective tissue running from the fovea capitis on the femoral head to the acetabular fossa, transverse acetabular ligament, and margins of the acetabular notch. It carries a branch of the obturator artery (acetabular branch) which contributes to blood supply of the femoral head. In children this is a more important blood supply; in adults the contribution is minor.",
"Gray's Anatomy for Students"),
(20,
"What is the transverse acetabular ligament and what is its function?",
"The transverse acetabular ligament is formed by the acetabular labrum bridging across the acetabular notch inferiorly, converting the notch into a foramen. This foramen allows passage of blood vessels and nerves into the joint. The ligament also provides attachment for the ligament of the head of the femur.",
"Gray's Anatomy for Students"),
(21,
"Which muscles are the primary hip flexors? What is their nerve supply?",
"Primary hip flexors:\n• Iliopsoas (iliacus + psoas major) – main hip flexor; iliacus: femoral nerve (L2–L4); psoas major: lumbar plexus (L1–L3)\n• Rectus femoris (part of quadriceps) – femoral nerve (L2–L4)\n• Sartorius – femoral nerve (L2–L3)\n• Tensor fasciae latae – superior gluteal nerve (L4–L5)",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(22,
"Name the three gluteal muscles, their primary actions, and nerve supply.",
"• Gluteus maximus: Hip extension and lateral rotation; inferior gluteal nerve (L5, S1–S2)\n• Gluteus medius: Hip abduction and medial rotation; superior gluteal nerve (L4–S1)\n• Gluteus minimus: Hip abduction and medial rotation; superior gluteal nerve (L4–S1)\nNote: Gluteus medius/minimus prevent pelvic drop (Trendelenburg) during single-leg stance.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
# LOWER LIMB – KNEE
(23,
"Why is the knee joint considered the largest synovial joint? Describe its two articulations.",
"The knee is the largest synovial joint in the body. It consists of:\n1. Femorotibial articulation (medial and lateral condyles of femur + tibial condyles) – weight-bearing component; hinge joint\n2. Patellofemoral articulation (posterior patella + anterior femoral trochlea) – allows quadriceps pull to be redirected anteriorly over the knee to the tibial tuberosity without tendon wear\nBoth articulations share a single articular cavity.",
"Gray's Anatomy for Students"),
(24,
"Describe the two cruciate ligaments: attachments, functions, and clinical test for each.",
"Anterior cruciate ligament (ACL):\n• Attaches: Anterior intercondylar area of tibia → posterior lateral femoral condyle\n• Function: Prevents anterior translation of tibia on femur; limits hyperextension\n• Test: Anterior drawer test / Lachman test\n\nPosterior cruciate ligament (PCL):\n• Attaches: Posterior intercondylar area of tibia → medial femoral condyle\n• Function: Prevents posterior translation of tibia on femur; main stabiliser of knee\n• Test: Posterior drawer test\nNote: The cruciates are intracapsular but extrasynovial.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(25,
"Compare medial and lateral menisci of the knee: shape, attachments, mobility, and clinical relevance.",
"Medial meniscus:\n• C-shaped, larger\n• Firmly attached around its periphery to the joint capsule AND tibial collateral ligament\n• Less mobile → MORE prone to injury\nLateral meniscus:\n• More circular, smaller\n• NOT attached to the capsule; connected to popliteus tendon\n• More mobile → LESS prone to injury\nBoth are attached at each end to intercondylar region of tibial plateau. MRI is gold standard for assessment; arthroscopy for repair.",
"Gray's Anatomy for Students"),
(26,
"What is the 'locking' mechanism of the knee and which muscle unlocks it?",
"In full knee extension, the tibia rotates laterally on the femur (or femur medially on tibia in non-weight-bearing), causing the joint surfaces to become congruent and 'locked' (close-packed position). This reduces the muscular energy needed to maintain standing.\nThe popliteus muscle 'unlocks' the knee by medially rotating the tibia (or laterally rotating the femur), allowing flexion to begin.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(27,
"What are the collateral ligaments of the knee? What do they prevent?",
"• Tibial (medial) collateral ligament (TCL): Broad, flat; attached to medial meniscus. Prevents valgus (lateral) stress.\n• Fibular (lateral) collateral ligament (FCL): Cord-like; not attached to lateral meniscus. Prevents varus (medial) stress.\nThe medial collateral ligament's attachment to the medial meniscus means MCL injuries commonly involve medial meniscus tears (O'Donoghue's unhappy triad: ACL + MCL + medial meniscus).",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
# LOWER LIMB – ANKLE & FOOT
(28,
"Describe the ankle (talocrural) joint: type, bones forming it, and its main ligaments.",
"Type: Synovial hinge (uniaxial).\nBones: Distal tibia (medial malleolus + inferior articular surface) + fibula (lateral malleolus) forming a mortise around the body (trochlea) of the talus.\nLigaments:\n• Medial (deltoid) ligament: Triangular, very strong; prevents eversion (torn in severe eversion injury)\n• Lateral ligaments (3 bands): Anterior talofibular (ATFL – most commonly sprained), calcaneofibular (CFL), posterior talofibular (PTFL)\nPlantar flexion is more extensive than dorsiflexion.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(29,
"What is the difference between inversion and eversion sprains of the ankle? Which ligament is most commonly injured?",
"Inversion (supination) sprain: Most common type. Foot is plantarflexed and inverted; the anterior talofibular ligament (ATFL) is the weakest and most commonly torn lateral ligament. If severe, the calcaneofibular ligament may also tear.\nEversion (pronation) sprain: Less common; the stronger deltoid ligament is damaged. Severe eversion forces can fracture the fibula (Maisonneuve fracture) rather than tearing the ligament.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(30,
"The human foot contains how many bones, joints, muscles, and ligaments? What are the structural arches?",
"The human foot contains 28 bones, 33 joints, 19 intrinsic muscles, and 107 ligaments.\nArches:\n• Medial longitudinal arch (highest): Calcaneus–talus–navicular–3 cuneiforms–1st/2nd/3rd metatarsals. Maintained by plantar fascia, spring (plantar calcaneonavicular) ligament, and tibialis posterior.\n• Lateral longitudinal arch (lower): Calcaneus–cuboid–4th/5th metatarsals.\n• Transverse arch: Across the midfoot at level of cuneiforms/cuboid.",
"Imaging Anatomy: Bones, Joints, Vessels & Nerves"),
# MUSCLES
(31,
"Distinguish between skeletal, cardiac, and smooth muscle.",
"• Skeletal muscle: Striated, multinucleated, voluntary; attaches to bones (or skin/eyes/pharynx) via tendons; powerful, fatigable; innervated by somatic motor nerves.\n• Cardiac muscle: Striated, single nuclei, involuntary; found only in heart wall and adjacent great vessels; branching fibrils electrically/mechanically linked; resistant to fatigue; innervated by visceral motor nerves.\n• Smooth muscle: Non-striated (unstriated), spindle-shaped, involuntary; found in vessel walls, visceral organs, hair follicles, eyeball; slow sustained contractions; innervated by visceral (autonomic) motor nerves.",
"Gray's Anatomy for Students"),
(32,
"Muscles are named according to various characteristics. List six such naming conventions and give an example of each.",
"1. Location – tibialis anterior (near tibia, front)\n2. Size – gluteus maximus (large gluteal muscle)\n3. Shape – trapezius (trapezoid shape)\n4. Number of heads – biceps (two heads), triceps (three heads)\n5. Attachment – sternocleidomastoid (sternum, clavicle → mastoid process)\n6. Action – extensor digitorum (extends fingers)\n7. Fiber orientation – external oblique (oblique fibers); transverse abdominis (transverse fibers)\n8. Position (medial/lateral, superficial/deep) – interosseous (between bones)",
"Gray's Anatomy for Students"),
(33,
"What is the difference between the origin and insertion of a muscle? What is a muscle's action?",
"• Origin: The proximal/fixed attachment of a muscle (usually the less mobile bone).\n• Insertion: The distal/mobile attachment (the bone that moves).\n• Action: The movement produced when the muscle contracts. Muscles act as agonists (prime movers), antagonists (oppose), synergists (assist agonists), or fixators (stabilise a joint).\nNote: Origins and insertions can be reversed when the distal part is fixed (e.g., pull-ups: latissimus dorsi moves the trunk, not the arm).",
"Moore's Clinically Oriented Anatomy"),
(34,
"What are tendons and aponeuroses? What is the clinical significance of tendon injuries?",
"• Tendon: A cord of dense collagenous connective tissue connecting muscle to bone. Transmits the pulling force of muscle contraction.\n• Aponeurosis: A flat, sheet-like tendon connecting muscle to bone or adjacent structures (e.g., epicranial aponeurosis, abdominal aponeurosis).\nClinical: Tendons can rupture (e.g., Achilles tendon rupture → loss of plantarflexion; tested by Simmonds/Thompson test). Tendinitis/tendinopathy results from repetitive micro-trauma. Tendon sheaths (synovial) reduce friction and can become inflamed (tenosynovitis).",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
# UPPER LIMB – ARM & FOREARM
(35,
"What are the compartments of the arm and what muscles and nerves are in each?",
"Anterior compartment:\n• Muscles: Biceps brachii (flexion of elbow/forearm supination), brachialis (elbow flexion), coracobrachialis (shoulder flexion/adduction)\n• Nerve: Musculocutaneous nerve (C5–C7)\n\nPosterior compartment:\n• Muscles: Triceps brachii (3 heads – elbow extension), anconeus\n• Nerve: Radial nerve (C5–T1)\n\nSeparated by medial and lateral intermuscular septa.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(36,
"Describe the carpal tunnel: boundaries, contents, and clinical syndrome.",
"Boundaries: A fibro-osseous tunnel formed by the carpal bones (forming a groove posteriorly) and the flexor retinaculum (transverse carpal ligament) anteriorly.\nContents (9 tendons + 1 nerve):\n• Flexor digitorum superficialis (4 tendons)\n• Flexor digitorum profundus (4 tendons)\n• Flexor pollicis longus (1 tendon)\n• Median nerve\nNote: The flexor carpi radialis has its own compartment; the ulnar nerve is NOT in the carpal tunnel (passes through Guyon's canal).\nCarpal tunnel syndrome: Compression of the median nerve → pain/tingling in lateral 3½ fingers, thenar wasting. Tests: Tinel's sign, Phalen's test.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
# SPINE & BACK
(37,
"Describe the intervertebral disc: structure, components, and clinical relevance.",
"The intervertebral disc is a fibrocartilaginous joint (secondary cartilaginous joint/symphysis).\nComponents:\n• Nucleus pulposus (central): Gel-like, high water content; remnant of the notochord; distributes compressive loads hydrostatically.\n• Annulus fibrosus (peripheral): Concentric lamellae of fibrocartilage with alternating fiber orientations; contains the nucleus.\nClinical: With age/trauma, the annulus can tear (posterolateral is weakest – no posterior longitudinal ligament reinforcement laterally), allowing the nucleus pulposus to herniate (prolapsed disc/herniated nucleus pulposus). Compresses nerve roots → radiculopathy. L4–L5 and L5–S1 are most common levels.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
(38,
"What is osteoarthritis? What are the pathological and radiological features?",
"Osteoarthritis (OA) is a degenerative joint disease characterised by progressive degradation of articular cartilage.\nPathological features: Loss of hyaline cartilage, subchondral bone sclerosis, osteophyte formation, subchondral cyst formation.\nRadiological features (X-ray):\n• Loss of joint space (cartilage thinning)\n• Osteophytes (bony spurs at joint margins)\n• Subchondral sclerosis\n• Subchondral cysts\nAetiology: Primary (idiopathic) or secondary to RA, infection, overuse, trauma. Commonly affects hip, knee, and small joints. Treatment: weight reduction, exercise, NSAIDs, joint replacement.",
"Gray's Anatomy for Students"),
# CLINICAL APPLIED
(39,
"What is the Trendelenburg sign? What does it indicate anatomically?",
"The Trendelenburg sign is positive when the pelvis drops on the unsupported side during single-leg stance.\nAnatomy: Normally, the gluteus medius and minimus (superior gluteal nerve, L4–S1) contract on the stance-side, keeping the pelvis level by abducting the hip.\nCauses of positive Trendelenburg: Weakness/paralysis of gluteus medius/minimus (e.g., superior gluteal nerve injury, polio), hip pain inhibiting contraction, or structural hip disease (e.g., DDH, coxa vara).\nClinical gait: Trendelenburg gait = lurching of trunk toward affected side on weight-bearing.",
"Moore's Clinically Oriented Anatomy / Gray's Anatomy for Students"),
(40,
"Explain the anatomical basis for the unhappy triad (O'Donoghue's triad) of the knee.",
"The unhappy triad consists of injury to:\n1. Anterior cruciate ligament (ACL)\n2. Medial (tibial) collateral ligament (MCL)\n3. Medial meniscus\nMechanism: A valgus stress (lateral blow) combined with lateral rotation of the femur on the fixed tibia (e.g., football tackle). The MCL resists valgus stress; when torn, the medial meniscus—which is firmly attached to the MCL—is also injured. The ACL tears from the rotational component.\nNote: Modern studies show the lateral meniscus may be more commonly injured than the medial in ACL tears; classical teaching still includes medial meniscus.",
"Gray's Anatomy for Students / Moore's Clinically Oriented Anatomy"),
]
# ── STYLES ────────────────────────────────────────────────────────────────────
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=2*cm, leftMargin=2*cm,
topMargin=2.2*cm, bottomMargin=2.2*cm,
title="MSK Anatomy – Top 40 Questions",
author="Orris Medical Study Aid"
)
styles = getSampleStyleSheet()
title_style = ParagraphStyle(
"TitleStyle",
parent=styles["Title"],
fontSize=22,
textColor=colors.HexColor("#1a3a5c"),
spaceAfter=4,
fontName="Helvetica-Bold",
alignment=TA_CENTER,
)
subtitle_style = ParagraphStyle(
"SubtitleStyle",
parent=styles["Normal"],
fontSize=11,
textColor=colors.HexColor("#4a6080"),
spaceAfter=2,
alignment=TA_CENTER,
)
source_tag_style = ParagraphStyle(
"SourceTag",
parent=styles["Normal"],
fontSize=8,
textColor=colors.HexColor("#888888"),
spaceAfter=12,
alignment=TA_CENTER,
)
category_style = ParagraphStyle(
"CategoryStyle",
parent=styles["Heading2"],
fontSize=13,
textColor=colors.white,
fontName="Helvetica-Bold",
spaceAfter=0,
spaceBefore=14,
)
q_num_style = ParagraphStyle(
"QNum",
parent=styles["Normal"],
fontSize=11,
textColor=colors.HexColor("#1a3a5c"),
fontName="Helvetica-Bold",
spaceBefore=10,
spaceAfter=2,
)
q_text_style = ParagraphStyle(
"QText",
parent=styles["Normal"],
fontSize=11,
textColor=colors.HexColor("#1a3a5c"),
fontName="Helvetica-Bold",
spaceAfter=4,
leading=16,
)
a_label_style = ParagraphStyle(
"ALabel",
parent=styles["Normal"],
fontSize=10,
textColor=colors.HexColor("#27602e"),
fontName="Helvetica-Bold",
spaceAfter=2,
)
a_text_style = ParagraphStyle(
"AText",
parent=styles["Normal"],
fontSize=10,
textColor=colors.HexColor("#1e1e1e"),
leading=15,
spaceAfter=3,
)
source_style = ParagraphStyle(
"SourceStyle",
parent=styles["Normal"],
fontSize=8,
textColor=colors.HexColor("#888888"),
fontName="Helvetica-Oblique",
spaceAfter=6,
)
CATEGORIES = [
("BONE STRUCTURE & CLASSIFICATION", range(1, 8)),
("JOINTS", range(8, 12)),
("SHOULDER & UPPER LIMB – SHOULDER REGION", range(12, 18)),
("LOWER LIMB – HIP", range(18, 23)),
("LOWER LIMB – KNEE", range(23, 28)),
("LOWER LIMB – ANKLE & FOOT", range(28, 31)),
("MUSCLES – STRUCTURE & TYPES", range(31, 35)),
("UPPER LIMB – ARM & FOREARM", range(35, 37)),
("SPINE & BACK / PATHOLOGY", range(37, 39)),
("CLINICAL APPLIED ANATOMY", range(39, 41)),
]
story = []
# ── Cover section ──
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("Musculoskeletal System Anatomy", title_style))
story.append(Paragraph("Top 40 High-Yield Questions & Answers", subtitle_style))
story.append(Paragraph("Sources: Gray's Anatomy for Students · Moore's Clinically Oriented Anatomy · Imaging Anatomy (THIEME)", source_tag_style))
story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor("#1a3a5c"), spaceAfter=10))
story.append(Spacer(1, 0.3*cm))
# instructions box
instr_data = [[
Paragraph(
"<b>How to use this guide:</b> Cover the answer and attempt the question first. "
"Then reveal the answer and compare. Green heading = answer block. "
"All questions are sourced directly from Gray's Anatomy for Students and Moore's Clinically Oriented Anatomy textbooks.",
ParagraphStyle("instr", parent=styles["Normal"], fontSize=9.5,
textColor=colors.HexColor("#2c2c2c"), leading=14)
)
]]
instr_table = Table(instr_data, colWidths=[16.6*cm])
instr_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#eaf3fb")),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#4a8cc2")),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
]))
story.append(instr_table)
story.append(Spacer(1, 0.4*cm))
qa_dict = {num: (q, a, src) for num, q, a, src in QA}
for cat_name, qnums in CATEGORIES:
# Category header as a coloured box
cat_data = [[Paragraph(cat_name, category_style)]]
cat_table = Table(cat_data, colWidths=[16.6*cm])
cat_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#1a3a5c")),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
]))
story.append(KeepTogether([cat_table, Spacer(1, 0.2*cm)]))
for num in qnums:
if num not in qa_dict:
continue
q, a, src = qa_dict[num]
answer_lines = a.replace("\n", "<br/>")
block = [
Paragraph(f"Q{num}.", q_num_style),
Paragraph(q, q_text_style),
Paragraph("▶ ANSWER", a_label_style),
Paragraph(answer_lines, a_text_style),
Paragraph(f"📚 {src}", source_style),
HRFlowable(width="100%", thickness=0.5,
color=colors.HexColor("#cccccc"), spaceAfter=4),
]
story.append(KeepTogether(block))
# Footer note
story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="100%", thickness=1.5, color=colors.HexColor("#1a3a5c")))
story.append(Paragraph(
"Generated by Orris AI · Study Aid for Musculoskeletal Anatomy · May 2026",
ParagraphStyle("footer", parent=styles["Normal"], fontSize=8,
textColor=colors.grey, alignment=TA_CENTER, spaceBefore=6)
))
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
build_pdf()
cd /home/daytona/workspace/msk-anatomy-quiz && python generate_quiz.py
ls -lh /home/daytona/workspace/msk-anatomy-quiz/MSK_Anatomy_Top40_Questions.pdf
MSK Anatomy Top40 Questions
PDF Document · PDF
| Category | Qs | Key Topics |
|---|---|---|
| Bone Structure & Classification | 1–7 | Bone types, periosteum, ossification, fractures, avascular necrosis, greenstick |
| Joints | 8–11 | Synovial vs solid joints, synovial joint features, menisci, joint classification |
| Shoulder Region | 12–17 | Glenohumeral joint, rotator cuff (SITS), impingement, dislocation + axillary nerve, SC joint, coracoclavicular ligament |
| Hip | 18–22 | Ball-and-socket stability, ligament of femoral head, transverse acetabular ligament, hip flexors, gluteal muscles |
| Knee | 23–27 | Largest joint in body, ACL/PCL, medial vs lateral meniscus, locking/unlocking mechanism, collateral ligaments |
| Ankle & Foot | 28–30 | Talocrural joint, inversion vs eversion sprains (ATFL), foot bones/joints/arches |
| Muscles | 31–34 | Skeletal vs cardiac vs smooth, naming conventions, origin/insertion, tendons/aponeuroses |
| Arm & Forearm | 35–36 | Arm compartments, carpal tunnel contents + median nerve, CTS |
| Spine & Pathology | 37–38 | Intervertebral disc (nucleus pulposus/annulus fibrosis), osteoarthritis features |
| Clinical Applied | 39–40 | Trendelenburg sign/gait, O'Donoghue's unhappy triad |