~/mbbs-qbank/generate_qbank.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os
OUTPUT = "/home/daytona/workspace/mbbs-qbank/MBBS_Physiology_QuestionBank.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.8*cm,
leftMargin=1.8*cm,
topMargin=2*cm,
bottomMargin=2*cm,
title="I MBBS Physiology Question Bank 2026",
author="Compiled from University Papers"
)
W, H = A4
styles = getSampleStyleSheet()
# ββ Custom styles ββββββββββββββββββββββββββββββββββββββββββββββ
DARK_BLUE = colors.HexColor("#1a237e")
MED_BLUE = colors.HexColor("#1565c0")
LIGHT_BLUE = colors.HexColor("#e3f2fd")
ACCENT = colors.HexColor("#ff6f00")
GREEN = colors.HexColor("#1b5e20")
LIGHT_GREEN= colors.HexColor("#e8f5e9")
ORANGE_BG = colors.HexColor("#fff3e0")
PURPLE = colors.HexColor("#4a148c")
LIGHT_PURPLE=colors.HexColor("#f3e5f5")
GREY_BG = colors.HexColor("#f5f5f5")
RED = colors.HexColor("#b71c1c")
LIGHT_RED = colors.HexColor("#ffebee")
cover_title = ParagraphStyle("cover_title", fontSize=26, textColor=colors.white,
alignment=TA_CENTER, fontName="Helvetica-Bold", spaceAfter=6, leading=32)
cover_sub = ParagraphStyle("cover_sub", fontSize=14, textColor=colors.HexColor("#bbdefb"),
alignment=TA_CENTER, fontName="Helvetica", spaceAfter=4)
cover_info = ParagraphStyle("cover_info", fontSize=11, textColor=colors.HexColor("#e3f2fd"),
alignment=TA_CENTER, fontName="Helvetica", spaceAfter=3)
sec_header = ParagraphStyle("sec_header", fontSize=15, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_LEFT, spaceAfter=2, spaceBefore=6,
leftIndent=8, leading=20)
marks_header = ParagraphStyle("marks_header", fontSize=13, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_LEFT, spaceAfter=2, spaceBefore=4,
leftIndent=6, leading=16)
q_num = ParagraphStyle("q_num", fontSize=10, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceAfter=0, leading=14)
q_text = ParagraphStyle("q_text", fontSize=10, textColor=colors.black,
fontName="Helvetica", spaceAfter=3, leading=14, leftIndent=18)
sub_q = ParagraphStyle("sub_q", fontSize=9.5, textColor=colors.HexColor("#37474f"),
fontName="Helvetica-Oblique", leftIndent=32, spaceAfter=1, leading=13)
freq_tag = ParagraphStyle("freq_tag", fontSize=8, textColor=colors.white,
fontName="Helvetica-Bold", alignment=TA_CENTER)
note_style = ParagraphStyle("note_style", fontSize=9, textColor=PURPLE,
fontName="Helvetica-Oblique", leftIndent=10, spaceAfter=2, leading=12)
toc_entry = ParagraphStyle("toc_entry", fontSize=11, textColor=DARK_BLUE,
fontName="Helvetica", spaceAfter=5, leading=16, leftIndent=20)
toc_section = ParagraphStyle("toc_section", fontSize=12, textColor=DARK_BLUE,
fontName="Helvetica-Bold", spaceAfter=3, spaceBefore=6)
story = []
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# COVER PAGE
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def cover_page():
# Dark blue banner
banner = Table([[""]],colWidths=[W-3.6*cm], rowHeights=[3.5*cm])
banner.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),DARK_BLUE),
("LINEBELOW",(0,0),(-1,-1),4,ACCENT)]))
story.append(banner)
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("I MBBS PHYSIOLOGY", ParagraphStyle("ct2",fontSize=20,
textColor=DARK_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=4)))
story.append(Paragraph("QUESTION BANK", ParagraphStyle("ct3",fontSize=30,
textColor=ACCENT,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=6,leading=36)))
story.append(Paragraph("Paper - II", ParagraphStyle("ct4",fontSize=16,
textColor=MED_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=4)))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="80%",thickness=2,color=ACCENT,hAlign='CENTER'))
story.append(Spacer(1, 0.4*cm))
info_data = [
["π Sources", "Govt. Siddhartha MC Vijayawada | Narayana MC | Santhiram MC Nandyal | Govt. MC Eluru"],
["π
Year", "2025-26 (III Internal Examinations)"],
["π Papers", "10 Question Papers Analysed"],
["π― Topics", "Neuromuscular | CNS | Reproduction | Special Senses | Endocrinology"],
]
info_table = Table(info_data, colWidths=[3.5*cm, 12*cm])
info_table.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,-1),LIGHT_BLUE),
("BACKGROUND",(1,0),(1,-1),GREY_BG),
("FONTNAME",(0,0),(0,-1),"Helvetica-Bold"),
("FONTNAME",(1,0),(1,-1),"Helvetica"),
("FONTSIZE",(0,0),(-1,-1),10),
("TEXTCOLOR",(0,0),(0,-1),DARK_BLUE),
("GRID",(0,0),(-1,-1),0.5,colors.HexColor("#b0bec5")),
("ROWBACKGROUNDS",(0,0),(-1,-1),[LIGHT_BLUE, GREY_BG]),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1),7),
("BOTTOMPADDING",(0,0),(-1,-1),7),
("LEFTPADDING",(0,0),(-1,-1),8),
]))
story.append(info_table)
story.append(Spacer(1, 0.6*cm))
# Legend
leg_data = [["MARKS LEGEND","10 marks = Essay","5 marks = Short Answer","3 marks = Reasoning"]]
leg = Table(leg_data, colWidths=[3.5*cm,3.5*cm,4*cm,4.5*cm])
leg.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0),DARK_BLUE),("BACKGROUND",(1,0),(1,0),RED),
("BACKGROUND",(2,0),(2,0),GREEN),("BACKGROUND",(3,0),(3,0),PURPLE),
("FONTNAME",(0,0),(-1,-1),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),9),
("TEXTCOLOR",(0,0),(-1,-1),colors.white),("ALIGN",(0,0),(-1,-1),"CENTER"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),("TOPPADDING",(0,0),(-1,-1),8),
("BOTTOMPADDING",(0,0),(-1,-1),8),("ROWHEIGHT",(0,0),(-1,-1),1*cm),
]))
story.append(leg)
story.append(Spacer(1,0.6*cm))
# Frequency guide
freq_data = [["βββ Asked 3-4 times","ββ Asked 2 times","β Asked once"]]
freq = Table(freq_data, colWidths=[5*cm,5*cm,5.5*cm])
freq.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0),colors.HexColor("#e65100")),
("BACKGROUND",(1,0),(1,0),colors.HexColor("#1565c0")),
("BACKGROUND",(2,0),(2,0),colors.HexColor("#37474f")),
("FONTNAME",(0,0),(-1,-1),"Helvetica-Bold"),("FONTSIZE",(0,0),(-1,-1),9.5),
("TEXTCOLOR",(0,0),(-1,-1),colors.white),("ALIGN",(0,0),(-1,-1),"CENTER"),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),("TOPPADDING",(0,0),(-1,-1),8),
("BOTTOMPADDING",(0,0),(-1,-1),8),("ROWHEIGHT",(0,0),(-1,-1),1*cm),
("LINEBEFORE",(1,0),(1,0),1,colors.white),("LINEBEFORE",(2,0),(2,0),1,colors.white),
]))
story.append(freq)
story.append(Spacer(1,0.8*cm))
story.append(Paragraph(
"Organised by Marks | All papers from July 2026",
ParagraphStyle("footer_cover",fontSize=9,textColor=colors.grey,
alignment=TA_CENTER,fontName="Helvetica-Oblique")))
story.append(PageBreak())
cover_page()
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# TABLE OF CONTENTS
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(Paragraph("TABLE OF CONTENTS", ParagraphStyle("toc_title",fontSize=18,
textColor=DARK_BLUE,fontName="Helvetica-Bold",alignment=TA_CENTER,spaceAfter=8)))
story.append(HRFlowable(width="100%",thickness=2,color=DARK_BLUE))
story.append(Spacer(1,0.3*cm))
toc_items = [
("SECTION 1", "10-Mark Essay Questions", "Neuromuscular | CNS | Endocrine"),
("SECTION 2", "5-Mark Short Answer Questions", "All 5 topics"),
("SECTION 3", "3-Mark Reasoning Questions", "Justify / Reason format"),
("SECTION 4", "Frequency Chart (Topic-wise)", "How many times each topic appeared"),
("SECTION 5", "Quick Revision - Topic List", "All topics at a glance"),
]
for sec, title, sub in toc_items:
row = Table([[Paragraph(f"<b>{sec}</b>",ParagraphStyle("ts",fontSize=11,textColor=DARK_BLUE,
fontName="Helvetica-Bold")),
Paragraph(f"<b>{title}</b><br/><i><font size=9 color=grey>{sub}</font></i>",
ParagraphStyle("tt",fontSize=11,textColor=colors.black,fontName="Helvetica",leading=16))]],
colWidths=[3*cm,12.5*cm])
row.setStyle(TableStyle([
("BACKGROUND",(0,0),(0,0),LIGHT_BLUE),
("BACKGROUND",(1,0),(1,0),GREY_BG),
("BOX",(0,0),(-1,-1),0.5,colors.HexColor("#90caf9")),
("TOPPADDING",(0,0),(-1,-1),8),("BOTTOMPADDING",(0,0),(-1,-1),8),
("LEFTPADDING",(0,0),(-1,-1),8),("VALIGN",(0,0),(-1,-1),"MIDDLE"),
]))
story.append(row)
story.append(Spacer(1,0.2*cm))
story.append(PageBreak())
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# HELPER FUNCTIONS
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
def section_banner(text, color=DARK_BLUE):
t = Table([[Paragraph(text, sec_header)]], colWidths=[W-3.6*cm])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),color),
("TOPPADDING",(0,0),(-1,-1),10),("BOTTOMPADDING",(0,0),(-1,-1),10),
("LEFTPADDING",(0,0),(-1,-1),12),
("LINEBELOW",(0,0),(-1,-1),3,ACCENT)]))
return t
def marks_banner(text, color=RED):
t = Table([[Paragraph(text, marks_header)]], colWidths=[W-3.6*cm])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),color),
("TOPPADDING",(0,0),(-1,-1),7),("BOTTOMPADDING",(0,0),(-1,-1),7),
("LEFTPADDING",(0,0),(-1,-1),10),
("LINEBELOW",(0,0),(-1,-1),2,colors.HexColor("#ffcc80"))]))
return t
def topic_banner(text, color=LIGHT_BLUE, text_color=DARK_BLUE):
t = Table([[Paragraph(f"<b>{text}</b>",
ParagraphStyle("tb",fontSize=11,textColor=text_color,fontName="Helvetica-Bold",
leftIndent=6))]],
colWidths=[W-3.6*cm])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),color),
("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),
("LEFTPADDING",(0,0),(-1,-1),10),
("LINEBELOW",(0,0),(-1,-1),1,colors.HexColor("#90caf9"))]))
return t
def freq_badge(stars):
if stars == 3:
col = colors.HexColor("#e65100"); label = "βββ MUST DO"
elif stars == 2:
col = colors.HexColor("#1565c0"); label = "ββ HIGH PRIORITY"
else:
col = colors.HexColor("#37474f"); label = "β IMPORTANT"
t = Table([[Paragraph(label,freq_tag)]], colWidths=[3.5*cm], rowHeights=[0.45*cm])
t.setStyle(TableStyle([("BACKGROUND",(0,0),(-1,-1),col),
("TOPPADDING",(0,0),(-1,-1),3),("BOTTOMPADDING",(0,0),(-1,-1),3),
("LEFTPADDING",(0,0),(-1,-1),4),("RIGHTPADDING",(0,0),(-1,-1),4),
("ROUNDEDCORNERS",[3])]))
return t
def question_row(num, q_main, sub_questions=None, stars=1, source="", bg=None):
bg_color = bg or (LIGHT_RED if stars==3 else (LIGHT_BLUE if stars==2 else GREY_BG))
content = [Paragraph(f"<b>Q{num}.</b> {q_main}", q_text)]
if sub_questions:
for sq in sub_questions:
content.append(Paragraph(sq, sub_q))
if source:
content.append(Paragraph(f"<i>Source: {source}</i>",
ParagraphStyle("src",fontSize=8,textColor=colors.grey,
fontName="Helvetica-Oblique",leftIndent=18,spaceAfter=0)))
inner = Table([[c] for c in content], colWidths=[W-7.5*cm if stars>=2 else W-4.6*cm])
inner.setStyle(TableStyle([("TOPPADDING",(0,0),(-1,-1),1),
("BOTTOMPADDING",(0,0),(-1,-1),1),("LEFTPADDING",(0,0),(-1,-1),0)]))
if stars >= 2:
badge = freq_badge(stars)
row = Table([[inner, badge]],
colWidths=[W-7.5*cm, 3.5*cm])
else:
row = Table([[inner]], colWidths=[W-4.6*cm])
row.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),bg_color),
("BOX",(0,0),(-1,-1),0.5,colors.HexColor("#b0bec5")),
("TOPPADDING",(0,0),(-1,-1),6),("BOTTOMPADDING",(0,0),(-1,-1),6),
("LEFTPADDING",(0,0),(-1,-1),8),("RIGHTPADDING",(0,0),(-1,-1),8),
("VALIGN",(0,0),(-1,-1),"TOP"),
]))
return row
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 1 β 10-MARK ESSAY QUESTIONS
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(section_banner("SECTION 1 | 10-MARK ESSAY QUESTIONS | 1 Γ 10 = 10 Marks", DARK_BLUE))
story.append(Spacer(1,0.3*cm))
essay_qs = {
"πͺ NEUROMUSCULAR PHYSIOLOGY": [
(1, "Define muscle tone and discuss its physiological basis. Explain how muscle tone is maintained and regulated by spinal and supraspinal mechanisms. Add a note on alpha-gamma co-activation.",
["(1+2+5+2 = 10 marks)"],1,"Santhiram MC Nandyal"),
],
"π§ CNS": [
(2,"A 62-year-old male presents with slowness of movements, difficulty walking, and tremors in both hands for 2 years. Mask-like face, few eye blinks, soft monotonous speech, slow resting 'pill-rolling' tremor, cogwheel rigidity.",
["a) What is your probable diagnosis? (1 mark)","b) What is the cause of this condition? (3 marks)",
"c) What is the physiological basis of the clinical findings? (4 marks)","d) How do you treat this condition? (2 marks)"],3,"Govt. MC Eluru"),
(3,"A 30-year-old male (RTA): involuntary rhythmic oscillatory eye movements, intentional tremors, in-coordinated right hand, unable to maintain balance and posture. (All other neurological exams normal.)",
["a) Probable diagnosis? (1+1 marks)","b) Enlist functional divisions, connections & functions of the affected structure (2+3 marks)",
"c) Characteristics of gait & speech seen in this condition. Add a note on rebound phenomenon. (1+1+1 marks)"],2,"Narayana MC (Both sets)"),
],
"π¦ ENDOCRINOLOGY": [
(4,"A 38-year-old woman: 1-year progressive weight gain, fat over face & abdomen, weakness, fatigability, irregular periods. Central obesity, moon face, buffalo hump, purple abdominal striae. BP 160/100 mmHg, fasting glucose 180 mg/dL.",
["a) What is your probable diagnosis? (1 mark)","b) What could be the cause of this clinical condition? (1 mark)",
"c) What are the other functions of this deficient hormone? (3 marks)"],3,"Govt. MC Eluru"),
(5,"A 60-year-old male: headache, excessive sweating, sleep disturbances, changes in jaw and forehead. On examination feet and hands are big.",
["What is the probable diagnosis?","What are the functions of the above hormone?"],3,"Govt. Siddhartha MC Vijayawada"),
],
}
for topic, qs in essay_qs.items():
story.append(topic_banner(topic))
story.append(Spacer(1,0.15*cm))
for (num, qtext, subs, stars, src) in qs:
story.append(question_row(num, qtext, subs, stars, src))
story.append(Spacer(1,0.2*cm))
story.append(Spacer(1,0.2*cm))
story.append(PageBreak())
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 2 β 5-MARK SHORT ANSWER QUESTIONS
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(section_banner("SECTION 2 | 5-MARK SHORT ANSWER QUESTIONS | 11 Γ 5 = 55 Marks", GREEN))
story.append(Spacer(1,0.3*cm))
short_qs = {
"πͺ NEUROMUSCULAR PHYSIOLOGY": [
(1,"Describe the properties of skeletal muscle.",[],1,"Govt. MC Eluru"),
(2,"Draw and describe the nerve action potential with a neat labelled diagram.",[],2,"Narayana MC"),
(3,"Draw a neat labelled diagram of the sarcomere and describe the sliding filament theory of muscle contraction.",[],2,"Narayana MC | Govt. MC Eluru"),
(4,"Define spermatogenesis. Mention the steps. Add a note on the regulation of the same.",[],2,"Narayana MC"),
(5,"The latch bridge mechanism and stress relaxation phenomenon.",[],1,"Santhiram MC Nandyal"),
(6,"Sarcotubular system.",[],1,"Govt. Siddhartha MC Vijayawada"),
(7,"A 25-year-old lady: weakness and fatigability worsening through the day, improves with rest. Ptosis, diplopia, difficulty swallowing. Positive anticholinesterase test, decremental response on repetitive nerve stimulation.",
["a) Probable diagnosis?","b) Cause of this condition?","c) Treatment?"],3,"Narayana MC (Both sets)"),
(8,"A 28-year-old man: progressive muscle weakness 4 months, worsens with activity, bilateral ptosis, reduced muscle strength on repeated activity.",
["a) Probable diagnosis? (1 mark)","b) Cause? (2 marks)","c) Treatment? (2 marks)"],3,"Govt. MC Eluru"),
(9,"A 40-year-old post-thyroidectomy patient: carpal and circumoral tingling, Chvostek's sign positive, serum CaΒ²βΊ = 6.5 mg/dL (Vit D normal).",
["i) Probable diagnosis?","ii) Pathophysiology?","iii) Physiological basis for increased neuromuscular excitability"],2,"Santhiram MC Nandyal"),
(10,"Add a note on neuromuscular blocking and facilitating drugs.",[],2,"Narayana MC"),
],
"π§ CNS": [
(11,"What are the differences between upper motor neuron (UMN) and lower motor neuron (LMN) lesions?",[],2,"Govt. MC Eluru"),
(12,"Describe the functions of the hypothalamus.",[],1,"Govt. MC Eluru"),
(13,"Draw and describe the olfactory pathway.",[],1,"Narayana MC"),
(14,"Describe the pain pathway. Add a note on the endogenous analgesic system.",[],2,"Narayana MC internal"),
(15,"Types and molecular basis of implicit memory.",[],1,"Narayana MC"),
(16,"Synaptic plasticity and long-term potentiation (LTP).",[],1,"Narayana MC internal"),
(17,"A 9-year-old girl: difficulty speaking, agraphia, non-fluent speech. What type of aphasia? Write differences between sensory aphasia and motor aphasia.",
["What type of aphasia is this?","Write differences between Sensory and Motor Aphasia"],2,"Govt. Siddhartha MC Vijayawada"),
(18,"A 20-year-old (RTA): lower limb fractures, severe pain at site of injury. Name the pain pathway. Draw a neat labelled diagram of the pain pathway.",[],1,"Govt. Siddhartha MC Vijayawada"),
(19,"A 68-year-old man: progressive loss of muscle power 5 months after a fall. Resting tremor, bradykinesia, rigidity, micrographia.",
["Probable diagnosis?","Physiological basis for treatment in this case"],3,"Govt. Siddhartha MC Vijayawada"),
],
"π¬ REPRODUCTION": [
(20,"Describe the endometrial changes in different phases of menstruation.",[],2,"Govt. MC Eluru"),
(21,"Describe endometrial changes and hormone regulation in different phases of the menstrual cycle.",[],2,"Narayana MC internal"),
(22,"A 28-year-old married woman (family planning): wants to delay pregnancy 3 years, regular 28-30-day cycles.",
["a) Which method is more effective, why? (2+3 marks)","b) Mention other methods of contraception"],2,"Govt. MC Eluru"),
(23,"A 29-year-old woman married 2 months: wants to postpone pregnancy 1 year.",
["i) What contraceptive methods can be advised?","ii) Physiological basis of how each method works"],2,"Santhiram MC Nandyal"),
(24,"Oral contraceptive pills - note.",[],2,"Narayana MC"),
(25,"IUD (Intrauterine Device) - short note.",[],1,"Govt. Siddhartha MC Vijayawada"),
(26,"Oxytocin - functions and physiological role.",[],1,"Govt. Siddhartha MC Vijayawada"),
],
"ποΈ SPECIAL SENSES": [
(27,"Describe the visual pathway with diagram. What are the effects of lesions at various levels of the visual pathway?",[],3,"Narayana MC internal | Govt. Siddhartha MC"),
(28,"A 7-year-old boy: cannot read 5th line on Snellen's chart at 6 metres, but reads books and sees mobile screen clearly.",
["a) Diagnosis?","b) Physiological basis?","c) Treatment?"],3,"Govt. Siddhartha MC Vijayawada"),
(29,"A 16-year-old boy: difficulty reading blackboard, but able to read books and see mobile clearly.",
["a) Diagnosis?","b) Pathophysiology?","c) Treatment?"],3,"Govt. MC Eluru"),
(30,"Describe the functions of ossicles and muscles in the middle ear.",[],1,"Govt. MC Eluru"),
(31,"Describe mechanism of impedance matching in the middle ear. Add a note on hearing tests.",[],2,"Narayana MC internal"),
(32,"What are the causes for loss of taste in the anterior 2/3 of the tongue? Give reasons.",[],1,"Govt. Siddhartha MC Vijayawada"),
],
"π¦ ENDOCRINOLOGY": [
(33,"A 35-year-old woman: gradual enlargement of hands and feet (ring resize), morning headache, vision disturbance, protruding jaw, enlarged tongue. Bitemporal hemianopia. Random GH = 19.3 ng/mL (ref < 3 ng/mL).",
["a) Provisional diagnosis? (1 mark)","b) Pathophysiology? (2 marks)","c) Management? (2 marks)"],3,"Narayana MC (Both sets)"),
(34,"A 50-year-old housewife: weight gain 5 kg/year, fatigue, memory loss, slow speech, dry skin, constipation, cold intolerance. Puffy face, pale cold dry thick skin. Tββ, Tββ, TSHβ, cholesterolβ. Delayed DTR.",
["a) Provisional diagnosis?","b) Describe and discuss actions and regulation of deficient hormone"],3,"Narayana MC"),
(35,"A 28-year-old female: weight gain 8 kg/3 months, abnormal menstrual cycles, menorrhagia, cold intolerance, excess hair fall. PR 62 bpm, dry skin, hoarseness.",
["i) Probable cause?","ii) Pathophysiology?","iii) Investigations to be done"],3,"Santhiram MC Nandyal"),
(36,"A 45-year-old male: enlarged hands and feet (18 months), visual abnormality. Prognathism, bitemporal hemianopia, fasting blood sugar 150 mg/dL.",
["a) Provisional diagnosis?","b) Physiological basis for this condition?"],3,"Narayana MC internal"),
(37,"Describe the functions of thyroid hormone.",[],3,"Govt. MC Eluru"),
(38,"Functions of cortisol.",[],2,"Govt. Siddhartha MC Vijayawada"),
(39,"Functions of growth hormone.",[],2,"Govt. Siddhartha MC Vijayawada"),
(40,"What is Diabetes Insipidus? What are the different types?",[],1,"Narayana MC internal"),
(41,"What is meant to be a patient? Explain their rights and responsibilities.",[],1,"Govt. MC Eluru"),
(42,"Describe the boundaries and code of conduct in a doctor-patient relationship.",[],1,"Narayana MC"),
(43,"Enlist the qualities of a good physician. Role of physician in the health care system.",[],1,"Govt. Siddhartha MC Vijayawada"),
],
}
for topic, qs in short_qs.items():
story.append(topic_banner(topic, LIGHT_GREEN, GREEN))
story.append(Spacer(1,0.15*cm))
for (num, qtext, subs, stars, src) in qs:
story.append(question_row(num, qtext, subs, stars, src))
story.append(Spacer(1,0.18*cm))
story.append(Spacer(1,0.25*cm))
story.append(PageBreak())
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 3 β 3-MARK REASONING QUESTIONS
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(section_banner("SECTION 3 | 3-MARK REASONING QUESTIONS | 5 Γ 3 = 15 Marks", PURPLE))
story.append(Spacer(1,0.2*cm))
story.append(Paragraph(
"Format: State the fact β Explain the physiological mechanism β Conclude with the justification",
ParagraphStyle("hint",fontSize=9.5,textColor=PURPLE,fontName="Helvetica-Oblique",
spaceAfter=8,leftIndent=5)))
story.append(Spacer(1,0.2*cm))
reasoning_qs = [
("CNS", [
(1,"Stress causes collapse in adrenocortical insufficiency (Addison's disease) - Justify.",
"Cortisol is needed to maintain vascular tone + gluconeogenesis; stress doubles cortisol demand but adrenals cannot respond.",3,"Narayana MC"),
(2,"In Brown-Sequard syndrome, below the level of lesion, on the same side touch sensation is lost but pain and temperature sensation are intact - Justify.",
"Dorsal columns (touch/proprioception) are uncrossed at cord level β ipsilateral loss. Spinothalamic tract (pain/temp) crosses at entry level β contralateral loss.",2,"Narayana MC"),
(3,"Hemi-section of spinal cord at L3-L4: what are the motor changes on the same side? Give reasons.",
"Corticospinal tract is uncrossed at this level β UMN signs (spasticity, hyperreflexia, Babinski +ve) ipsilateral below lesion.",2,"Govt. Siddhartha MC"),
(4,"Cardiac pain is felt in the left arm - Justify with supporting theories.",
"Referred pain via convergence-projection theory: cardiac + left T1-T4 somatic afferents converge on same dorsal horn neurons.",2,"Narayana MC"),
(5,"Why does a leg-amputated person feel they still have the leg?",
"Phantom limb: cortical representation of amputated limb persists in somatosensory cortex; brain continues to map missing body part.",1,"Govt. MC Eluru"),
(6,"Why is synaptic transmission between neurons mostly chemical?",
"Allows amplification, inhibition, modulation and integration; electrical synapses only where speed is essential (cardiac/smooth muscle).",1,"Govt. MC Eluru"),
]),
("REPRODUCTION", [
(7,"A 25-year-old married woman - missed menstrual cycle. Doctor advised urine pregnancy test. How is the urine test helpful?",
"hCG (human chorionic gonadotropin) secreted by trophoblast from day 8 post-fertilisation; detected in urine by immunological test.",2,"Govt. Siddhartha MC | Narayana MC"),
(8,"Why do reproductive-age women have fewer cardiovascular complaints?",
"Oestrogen: raises HDL, lowers LDL, promotes endothelial NO production β vasodilation, anti-atherogenic effect.",1,"Govt. MC Eluru"),
(9,"How does sperm know the location of the ovum?",
"Chemotaxis: cumulus cells + follicular fluid release progesterone and bourgeonal β activate CatSper CaΒ²βΊ channels on sperm flagellum β directed motility.",1,"Govt. MC Eluru"),
]),
("SPECIAL SENSES", [
(10,"Concave lens is used for the treatment of myopia - Justify.",
"Myopia: eyeball too long β image focused in front of retina. Concave lens diverges incoming rays β shifts focal point back onto retina.",3,"Narayana MC"),
(11,"A 60-year-old woman: hearing loss left ear. Weber's positive (lateralises left), Rinne's negative (BC > AC) on left. Diagnosis and reason.",
"Conductive hearing loss left ear: bone conduction > air conduction (Rinne negative) = conductive; Weber lateralises to affected (worse) ear.",2,"Govt. Siddhartha MC"),
(12,"Causes for loss of taste in anterior 2/3 of tongue - Reason.",
"Chorda tympani (branch of CN VII - facial nerve) carries taste from anterior 2/3 tongue via lingual nerve; damage in Bell's palsy or middle ear surgery.",1,"Govt. Siddhartha MC"),
]),
("ENDOCRINOLOGY", [
(13,"Primary hyperaldosteronism is not associated with oedema - Justify.",
"Aldosterone escape phenomenon: sustained ECF expansion β ANP released from atria β promotes natriuresis β counteracts Na retention β no oedema.",2,"Narayana MC"),
(14,"Why is there exophthalmos in Graves' disease?",
"TSI (thyroid-stimulating immunoglobulins) stimulate orbital fibroblasts β glycosaminoglycan (hyaluronic acid) deposition + adipogenesis in retro-orbital space β eyeball protrudes.",2,"Govt. MC Eluru"),
(15,"Increased appetite (polyphagia) and increased thirst (polydipsia) in Diabetes Mellitus - Reason.",
"Polyphagia: glucose cannot enter cells without insulin β cellular starvation β hunger signals. Polydipsia: osmotic diuresis β dehydration β activates thirst centre.",2,"Narayana MC internal"),
(16,"A 70-year-old woman: paraesthesia at mouth, plasma CaΒ²βΊ = 5 mg%. How do Trousseau's sign and Chvostek's sign help diagnose? Reason.",
"Hypocalcaemia β β neuromuscular excitability. Trousseau's: BP cuff inflation β carpal spasm (ischaemia lowers CaΒ²βΊ threshold). Chvostek's: tapping facial nerve β facial twitch.",2,"Govt. Siddhartha MC"),
]),
]
for (topic, qs) in reasoning_qs:
topic_icons = {"CNS":"π§ ","REPRODUCTION":"π¬","SPECIAL SENSES":"ποΈ","ENDOCRINOLOGY":"π¦"}
story.append(topic_banner(f"{topic_icons.get(topic,'')} {topic}", LIGHT_PURPLE, PURPLE))
story.append(Spacer(1,0.15*cm))
for (num, qtext, hint, stars, src) in qs:
main_content = [Paragraph(f"<b>Q{num}.</b> {qtext}", q_text)]
main_content.append(Paragraph(f"<b>Key points:</b> {hint}",
ParagraphStyle("kp",fontSize=9,textColor=GREEN,fontName="Helvetica",
leftIndent=20,spaceAfter=2,leading=13)))
main_content.append(Paragraph(f"<i>Source: {src}</i>",
ParagraphStyle("src2",fontSize=8,textColor=colors.grey,
fontName="Helvetica-Oblique",leftIndent=20)))
bg = LIGHT_RED if stars==3 else (LIGHT_BLUE if stars==2 else GREY_BG)
if stars >= 2:
inner = Table([[c] for c in main_content], colWidths=[W-7.5*cm])
inner.setStyle(TableStyle([("TOPPADDING",(0,0),(-1,-1),1),
("BOTTOMPADDING",(0,0),(-1,-1),1),("LEFTPADDING",(0,0),(-1,-1),0)]))
row = Table([[inner, freq_badge(stars)]], colWidths=[W-7.5*cm, 3.5*cm])
else:
inner = Table([[c] for c in main_content], colWidths=[W-4.6*cm])
inner.setStyle(TableStyle([("TOPPADDING",(0,0),(-1,-1),1),
("BOTTOMPADDING",(0,0),(-1,-1),1),("LEFTPADDING",(0,0),(-1,-1),0)]))
row = Table([[inner]], colWidths=[W-4.6*cm])
row.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),bg),
("BOX",(0,0),(-1,-1),0.5,colors.HexColor("#ce93d8")),
("TOPPADDING",(0,0),(-1,-1),7),("BOTTOMPADDING",(0,0),(-1,-1),7),
("LEFTPADDING",(0,0),(-1,-1),8),("RIGHTPADDING",(0,0),(-1,-1),8),
("VALIGN",(0,0),(-1,-1),"TOP"),
]))
story.append(row)
story.append(Spacer(1,0.2*cm))
story.append(Spacer(1,0.2*cm))
story.append(PageBreak())
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 4 β FREQUENCY CHART
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(section_banner("SECTION 4 | FREQUENCY CHART | Topics by Number of Appearances", colors.HexColor("#004d40")))
story.append(Spacer(1,0.3*cm))
freq_data = [
["TOPIC","CATEGORY","TIMES ASKED","PRIORITY","MARKS TYPE"],
["Parkinsonism","CNS","4","βββ MUST DO","Essay + Short"],
["Myasthenia Gravis","Neuromuscular","3","βββ MUST DO","Short Answer"],
["Acromegaly / GH excess","Endocrine","3","βββ MUST DO","Essay + Short"],
["Hypothyroidism / Myxoedema","Endocrine","3","βββ MUST DO","Short Answer"],
["Visual Pathway & Lesions","Special Senses","3","βββ MUST DO","Short Answer"],
["Contraception (OCP, IUD)","Reproduction","3","βββ MUST DO","Short Answer"],
["Myopia (+ Concave Lens)","Special Senses","3","βββ MUST DO","Short + Reasoning"],
["Sliding Filament / Sarcomere","Neuromuscular","2","ββ HIGH","Short Answer"],
["Menstrual Cycle Hormones","Reproduction","2","ββ HIGH","Short Answer"],
["Brown-Sequard Syndrome","CNS","2","ββ HIGH","Short + Reasoning"],
["Cerebellar Ataxia","CNS","2","ββ HIGH","Essay"],
["Cushing's Syndrome","Endocrine","2","ββ HIGH","Essay"],
["Aphasia","CNS","2","ββ HIGH","Short + Reasoning"],
["Hyperparathyroidism/Hypoparathyroidism","Endocrine","2","ββ HIGH","Short + Reasoning"],
["Spermatogenesis","Reproduction","2","ββ HIGH","Short Answer"],
["Nerve Action Potential","Neuromuscular","2","ββ HIGH","Short Answer"],
["Pain Pathway","CNS","2","ββ HIGH","Short + Reasoning"],
["Thyroid Hormone Functions","Endocrine","2","ββ HIGH","Short Answer"],
["Neuromuscular Blocking Drugs","Neuromuscular","2","ββ HIGH","Short + Reasoning"],
["Hearing Tests (Rinne/Weber)","Special Senses","2","ββ HIGH","Short + Reasoning"],
["Muscle Tone","Neuromuscular","1","β IMPORTANT","Essay"],
["Hypothalamus Functions","CNS","1","β IMPORTANT","Short Answer"],
["Olfactory Pathway","CNS","1","β IMPORTANT","Short Answer"],
["Implicit Memory / LTP","CNS","1","β IMPORTANT","Short Answer"],
["Cortisol Functions","Endocrine","1","β IMPORTANT","Short Answer"],
["Growth Hormone Functions","Endocrine","1","β IMPORTANT","Short Answer"],
["Oxytocin","Reproduction","1","β IMPORTANT","Short Answer"],
["Diabetes Insipidus","Endocrine","1","β IMPORTANT","Short Answer"],
["Taste Loss - Anterior 2/3 Tongue","Special Senses","1","β IMPORTANT","Reasoning"],
["Latch Bridge Mechanism","Neuromuscular","1","β IMPORTANT","Short Answer"],
["Sarcotubular System","Neuromuscular","1","β IMPORTANT","Short Answer"],
]
col_widths = [5.5*cm, 3.5*cm, 2*cm, 3.5*cm, 3*cm]
freq_table = Table(freq_data, colWidths=col_widths, repeatRows=1)
freq_table.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,0),DARK_BLUE),
("TEXTCOLOR",(0,0),(-1,0),colors.white),
("FONTNAME",(0,0),(-1,0),"Helvetica-Bold"),
("FONTSIZE",(0,0),(-1,0),10),
("ALIGN",(0,0),(-1,0),"CENTER"),
("FONTNAME",(0,1),(-1,-1),"Helvetica"),
("FONTSIZE",(0,1),(-1,-1),9),
("GRID",(0,0),(-1,-1),0.5,colors.HexColor("#b0bec5")),
("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("TOPPADDING",(0,0),(-1,-1),5),("BOTTOMPADDING",(0,0),(-1,-1),5),
("LEFTPADDING",(0,0),(-1,-1),6),
# Colour rows by priority
*[("BACKGROUND",(0,i),(-1,i),LIGHT_RED) for i in range(1,8)], # Must do
*[("BACKGROUND",(0,i),(-1,i),LIGHT_BLUE) for i in range(8,21)], # High
*[("BACKGROUND",(0,i),(-1,i),GREY_BG) for i in range(21,32)], # Important
("FONTNAME",(3,1),(3,-1),"Helvetica-Bold"),
]))
story.append(freq_table)
story.append(PageBreak())
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# SECTION 5 β QUICK REVISION TOPIC LIST
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
story.append(section_banner("SECTION 5 | QUICK REVISION β ALL TOPICS AT A GLANCE", colors.HexColor("#bf360c")))
story.append(Spacer(1,0.3*cm))
quick_topics = {
"πͺ NEUROMUSCULAR PHYSIOLOGY (10 Topics)": [
"Muscle tone (spinal + supraspinal regulation, alpha-gamma co-activation)",
"Sliding filament theory + Sarcomere diagram",
"Properties of skeletal muscle",
"Nerve action potential (with labelled diagram)",
"Myasthenia Gravis (AChR antibodies, decremental response, treatment)",
"Neuromuscular blocking drugs (succinylcholine, d-tubocurarine)",
"Excitation-contraction coupling",
"Latch bridge mechanism + stress relaxation",
"Sarcotubular system",
"Hypoparathyroidism / Tetany (increased neuromuscular excitability)",
],
"π§ CNS (13 Topics)": [
"Parkinsonism (TRAP signs, substantia nigra, Lewy bodies, L-DOPA)",
"Cerebellar ataxia (DANIAN, rebound phenomenon, gait, speech)",
"Brown-Sequard syndrome (ipsilateral/contralateral sensory-motor)",
"UMN vs LMN lesion differences (table format)",
"Aphasia - Broca's vs Wernicke's (differences + location)",
"Pain pathway + endogenous analgesic system (opioids, DREZ)",
"Referred pain - cardiac pain in left arm (convergence-projection theory)",
"Phantom limb phenomenon",
"Functions of hypothalamus",
"Olfactory pathway (diagram)",
"Implicit memory types + molecular basis (LTP, NMDA receptor)",
"Synaptic plasticity and LTP",
"Rebound phenomenon (cerebellar lesion)",
],
"π¬ REPRODUCTION (6 Topics)": [
"Contraception - OCP, IUD, barrier, emergency (mechanism of each)",
"Spermatogenesis - steps + FSH/testosterone regulation",
"Menstrual cycle - phases (follicular/ovulatory/luteal) + endometrial changes + hormones",
"Oxytocin - functions (parturition, milk ejection reflex, bonding)",
"hCG basis of urine pregnancy test",
"Oestrogen and cardiovascular protection (HDL, NO, anti-atherogenic)",
],
"ποΈ SPECIAL SENSES (5 Topics)": [
"Visual pathway - all 6 levels + effects of lesions (monocular β bitemporal β homonymous)",
"Myopia - pathophysiology + concave lens justification",
"Middle ear - impedance matching + ossicle functions",
"Hearing tests - Rinne's and Weber's interpretation (conductive vs SNHL)",
"Taste loss - anterior 2/3 tongue - chorda tympani / CN VII",
],
"π¦ ENDOCRINOLOGY (14 Topics)": [
"Acromegaly / Gigantism (GH excess, IGF-1, OGTT, bitemporal hemianopia)",
"Hypothyroidism / Myxoedema (T3/T4/TSH, glycosaminoglycans, hung-up reflex)",
"Cushing's syndrome (moon face, striae, LDST, cortisol functions)",
"Functions of thyroid hormone (metabolic, growth, cardiac, CNS)",
"Functions of cortisol (gluconeogenesis, anti-inflammatory, stress response)",
"Functions of growth hormone (anabolic, anti-insulin, GH-IGF1 axis)",
"Oxytocin (see Reproduction)",
"Diabetes Insipidus - central vs nephrogenic (types)",
"Adrenocortical insufficiency (Addison's) - stress collapse mechanism",
"Primary hyperaldosteronism - escape phenomenon (no oedema)",
"Exophthalmos in Graves' disease (TSI β orbital fibroblasts β GAG deposition)",
"Diabetes Mellitus - polyphagia + polydipsia mechanism",
"Hypoparathyroidism - Chvostek's + Trousseau's signs (low CaΒ²βΊ mechanism)",
"Post-thyroidectomy hypocalcaemia (parathyroids removed)",
],
}
for cat, items in quick_topics.items():
cat_color = {
"πͺ": colors.HexColor("#e3f2fd"),
"π§ ": colors.HexColor("#fce4ec"),
"π¬": colors.HexColor("#e8f5e9"),
"ποΈ": colors.HexColor("#fff8e1"),
"π¦": colors.HexColor("#f3e5f5"),
}.get(cat[0], GREY_BG)
cat_border = {
"πͺ": MED_BLUE,"π§ ": RED,"π¬": GREEN,"ποΈ": ACCENT,"π¦": PURPLE,
}.get(cat[0], DARK_BLUE)
story.append(Paragraph(f"<b>{cat}</b>",
ParagraphStyle("qt",fontSize=12,textColor=colors.white,fontName="Helvetica-Bold",
spaceAfter=2,spaceBefore=4,leftIndent=8,
backColor=cat_border,leading=18)))
rows = []
for i, item in enumerate(items, 1):
rows.append([
Paragraph(f"<b>{i}.</b>", ParagraphStyle("qn",fontSize=9.5,textColor=cat_border,
fontName="Helvetica-Bold",alignment=TA_CENTER)),
Paragraph(item, ParagraphStyle("qi",fontSize=9.5,textColor=colors.black,
fontName="Helvetica",leading=13)),
])
t = Table(rows, colWidths=[0.8*cm, W-4.8*cm])
t.setStyle(TableStyle([
("BACKGROUND",(0,0),(-1,-1),cat_color),
("GRID",(0,0),(-1,-1),0.3,colors.HexColor("#cfd8dc")),
("TOPPADDING",(0,0),(-1,-1),5),("BOTTOMPADDING",(0,0),(-1,-1),5),
("LEFTPADDING",(0,0),(-1,-1),6),("VALIGN",(0,0),(-1,-1),"MIDDLE"),
("LINEAFTER",(0,0),(0,-1),1,cat_border),
("ROWBACKGROUNDS",(0,0),(-1,-1),[cat_color, colors.HexColor("#ffffff")]),
]))
story.append(t)
story.append(Spacer(1,0.25*cm))
# ββ Build PDF ββββββββββββββββββββββββββββββββββββββββββββββββββ
def add_page_number(canvas, doc):
canvas.saveState()
canvas.setFont("Helvetica", 8)
canvas.setFillColor(colors.grey)
canvas.drawString(1.8*cm, 1.2*cm, "I MBBS Physiology Question Bank 2026 | Paper II")
canvas.drawRightString(W-1.8*cm, 1.2*cm, f"Page {doc.page}")
canvas.setStrokeColor(colors.HexColor("#b0bec5"))
canvas.setLineWidth(0.5)
canvas.line(1.8*cm, 1.5*cm, W-1.8*cm, 1.5*cm)
canvas.restoreState()
doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
print(f"PDF created: {OUTPUT}")