Make them into solvable mcq questions
cd /tmp/workspace/attachments/2e07b2a7-daba-4edd-a58e-b7291d3b89a9 && python3 -c " import pdfplumber with pdfplumber.open('AIIMS MDS 2002.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[:5]): print(f'--- PAGE {i+1} ---') print(page.extract_text()) "
python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/2e07b2a7-daba-4edd-a58e-b7291d3b89a9/AIIMS MDS 2002.pdf') as pdf: full_text = '' for page in pdf.pages: t = page.extract_text() if t: full_text += t + '\n' print(full_text[:3000]) "
python3 << 'EOF' import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/2e07b2a7-daba-4edd-a58e-b7291d3b89a9/AIIMS MDS 2002.pdf') as pdf: full_text = '' for page in pdf.pages: t = page.extract_text() if t: full_text += t + '\n' # Save raw text with open('/tmp/workspace/aiims_raw.txt', 'w') as f: f.write(full_text) print(f"Total chars: {len(full_text)}") print("Saved to /tmp/workspace/aiims_raw.txt") EOF
python3 << 'PYEOF' import re import os with open('/tmp/workspace/aiims_raw.txt', 'r') as f: raw = f.read() # Split into lines and clean up lines = raw.split('\n') # We'll parse questions manually using regex patterns # Questions start with a number followed by ) # Options start with 1. 2. 3. 4. # Answers start with Ans questions = [] current_q = None current_opts = [] i = 0 # Combine lines to handle options split across lines text = raw # Find all question blocks using regex # Pattern: number) ... question text ... 1. ... 2. ... 3. ... 4. ... Ans # Let's do a line-by-line state machine approach lines = [l.strip() for l in raw.split('\n') if l.strip()] q_num_pattern = re.compile(r'^(\d+)\)\s+(.*)') opt_pattern = re.compile(r'^([1-4])[.)]\s+(.*)') ans_pattern = re.compile(r'^Ans\s*[\(]?\s*([1-4a-dA-D])\s*[\)]?', re.IGNORECASE) state = 'seek_q' current = {} all_qs = [] for line in lines: q_match = q_num_pattern.match(line) opt_match = opt_pattern.match(line) ans_match = ans_pattern.match(line) if q_match: # Save previous question if complete if current and 'num' in current and 'text' in current: if len(current.get('opts', [])) >= 2: all_qs.append(current) current = { 'num': int(q_match.group(1)), 'text': q_match.group(2), 'opts': [], 'ans': None, 'explanation': '' } state = 'in_q' elif state == 'in_q' and not opt_match and not ans_match and current: # Continuation of question text if not current['opts']: current['text'] += ' ' + line elif opt_match and state in ('in_q', 'in_opts') and current: opt_num = int(opt_match.group(1)) opt_text = opt_match.group(2) current['opts'].append((opt_num, opt_text)) state = 'in_opts' elif state == 'in_opts' and not opt_match and not ans_match and current: # Continuation of last option if current['opts']: last = current['opts'][-1] current['opts'][-1] = (last[0], last[1] + ' ' + line) elif ans_match and current: ans_val = ans_match.group(1).strip() # Normalize to number if ans_val.upper() in ('A','B','C','D'): ans_val = str(ord(ans_val.upper()) - ord('A') + 1) current['ans'] = ans_val state = 'in_ans' elif state == 'in_ans' and current: # Could be explanation - skip for clean output pass # Don't forget last question if current and 'num' in current and 'text' in current and len(current.get('opts', [])) >= 2: all_qs.append(current) print(f"Total questions parsed: {len(all_qs)}") for q in all_qs[:5]: print(f"\nQ{q['num']}: {q['text'][:60]}") for o in q['opts']: print(f" {o[0]}. {o[1][:50]}") print(f" Ans: {q['ans']}") PYEOF
python3 << 'PYEOF' import re, os 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, PageBreak, Table, TableStyle from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY # ── Re-parse the questions ────────────────────────────────────────────── with open('/tmp/workspace/aiims_raw.txt', 'r') as f: raw = f.read() lines = [l.strip() for l in raw.split('\n') if l.strip()] q_num_pattern = re.compile(r'^(\d+)\)\s+(.*)') opt_pattern = re.compile(r'^([1-4])[.)]\s+(.*)') ans_pattern = re.compile(r'^Ans\s*[\(]?\s*([1-4a-dA-D])\s*[\)]?', re.IGNORECASE) state = 'seek_q' current = {} all_qs = [] for line in lines: q_match = q_num_pattern.match(line) opt_match = opt_pattern.match(line) ans_match = ans_pattern.match(line) if q_match: if current and 'num' in current and len(current.get('opts', [])) >= 2: all_qs.append(current) current = {'num': int(q_match.group(1)), 'text': q_match.group(2), 'opts': [], 'ans': None} state = 'in_q' elif state == 'in_q' and not opt_match and not ans_match and current: if not current['opts']: current['text'] += ' ' + line elif opt_match and state in ('in_q', 'in_opts') and current: current['opts'].append((int(opt_match.group(1)), opt_match.group(2))) state = 'in_opts' elif state == 'in_opts' and not opt_match and not ans_match and current: if current['opts']: last = current['opts'][-1] current['opts'][-1] = (last[0], last[1] + ' ' + line) elif ans_match and current: av = ans_match.group(1).strip() if av.upper() in ('A','B','C','D'): av = str(ord(av.upper()) - ord('A') + 1) current['ans'] = av state = 'in_ans' if current and 'num' in current and len(current.get('opts', [])) >= 2: all_qs.append(current) print(f"Parsed {len(all_qs)} questions") # ── Build PDF ────────────────────────────────────────────────────────── os.makedirs('/tmp/workspace/aiims_mcq', exist_ok=True) out_path = '/tmp/workspace/aiims_mcq/AIIMS_MDS_2002_MCQ.pdf' doc = SimpleDocTemplate( out_path, pagesize=A4, leftMargin=2*cm, rightMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() # Custom styles title_style = ParagraphStyle('Title', parent=styles['Heading1'], fontSize=16, textColor=colors.HexColor('#1a237e'), spaceAfter=6, alignment=TA_CENTER, fontName='Helvetica-Bold') subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'], fontSize=11, textColor=colors.HexColor('#555555'), spaceAfter=4, alignment=TA_CENTER) section_style = ParagraphStyle('Section', parent=styles['Heading2'], fontSize=13, textColor=colors.HexColor('#1565C0'), spaceBefore=12, spaceAfter=8, fontName='Helvetica-Bold') q_style = ParagraphStyle('Question', parent=styles['Normal'], fontSize=10.5, leading=15, textColor=colors.black, spaceBefore=10, spaceAfter=4, leftIndent=0, fontName='Helvetica-Bold') opt_style = ParagraphStyle('Option', parent=styles['Normal'], fontSize=10, leading=14, textColor=colors.HexColor('#222222'), leftIndent=18, spaceBefore=2, spaceAfter=0) ans_key_style = ParagraphStyle('AnsKey', parent=styles['Normal'], fontSize=10, leading=14, textColor=colors.HexColor('#1a237e'), leftIndent=0, spaceBefore=4) ans_q_style = ParagraphStyle('AnsQ', parent=styles['Normal'], fontSize=10, leading=14, textColor=colors.HexColor('#333333'), leftIndent=0, spaceBefore=3, spaceAfter=2) story = [] # ── Cover / Header ───────────────────────────────────────────────────── story.append(Spacer(1, 0.5*cm)) story.append(Paragraph("AIIMS MDS Entrance Examination", title_style)) story.append(Paragraph("November 2002", subtitle_style)) story.append(Paragraph(f"Multiple Choice Questions | {len(all_qs)} Questions", subtitle_style)) story.append(Spacer(1, 0.3*cm)) story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a237e'))) story.append(Spacer(1, 0.4*cm)) instructions = ( "<b>Instructions:</b> Each question has four options. Select the single best answer. " "Attempt all questions before checking the Answer Key at the end." ) story.append(Paragraph(instructions, ParagraphStyle('Inst', parent=styles['Normal'], fontSize=9.5, textColor=colors.HexColor('#444444'), leading=14, backColor=colors.HexColor('#E3F2FD'), borderPadding=6, spaceBefore=4, spaceAfter=10))) story.append(Spacer(1, 0.3*cm)) story.append(Paragraph("QUESTIONS", section_style)) story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#BBDEFB'))) story.append(Spacer(1, 0.2*cm)) opt_letters = {1: 'A', 2: 'B', 3: 'C', 4: 'D'} # ── Questions Section ────────────────────────────────────────────────── for q in all_qs: q_text = f"<b>Q{q['num']}.</b> {q['text']}" story.append(Paragraph(q_text, q_style)) for opt_num, opt_text in q['opts']: letter = opt_letters.get(opt_num, str(opt_num)) story.append(Paragraph(f"({letter}) {opt_text}", opt_style)) story.append(Spacer(1, 4)) # ── Answer Key Section ──────────────────────────────────────────────── story.append(PageBreak()) story.append(Paragraph("ANSWER KEY", section_style)) story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a237e'))) story.append(Spacer(1, 0.3*cm)) # Build answer key table - 5 columns ans_data = [['Q#', 'Answer', 'Q#', 'Answer', 'Q#', 'Answer', 'Q#', 'Answer']] row = [] for idx, q in enumerate(all_qs): ans_num = q['ans'] try: ans_letter = opt_letters.get(int(ans_num), ans_num) if ans_num else '?' except: ans_letter = ans_num or '?' # Find option text opt_text = '' for on, ot in q['opts']: if str(on) == str(q['ans']): opt_text = ot[:35] + ('...' if len(ot) > 35 else '') break row.extend([f"Q{q['num']}", f"({ans_letter}) {opt_text}"]) if len(row) == 8: ans_data.append(row) row = [] if row: while len(row) < 8: row.append('') ans_data.append(row) # Simpler compact answer key - 2 cols: Q# | Answer ans_data2 = [['Q#', 'Correct Answer', 'Q#', 'Correct Answer']] half = (len(all_qs) + 1) // 2 left = all_qs[:half] right = all_qs[half:] for i in range(half): lq = left[i] try: la = opt_letters.get(int(lq['ans']), lq['ans']) if lq['ans'] else '?' except: la = lq['ans'] or '?' l_opt = '' for on, ot in lq['opts']: if str(on) == lq['ans']: l_opt = ot[:40] + ('...' if len(ot) > 40 else '') break if i < len(right): rq = right[i] try: ra = opt_letters.get(int(rq['ans']), rq['ans']) if rq['ans'] else '?' except: ra = rq['ans'] or '?' r_opt = '' for on, ot in rq['opts']: if str(on) == rq['ans']: r_opt = ot[:40] + ('...' if len(ot) > 40 else '') break ans_data2.append([f"Q{lq['num']}", f"({la}) {l_opt}", f"Q{rq['num']}", f"({ra}) {r_opt}"]) else: ans_data2.append([f"Q{lq['num']}", f"({la}) {l_opt}", '', '']) t = Table(ans_data2, colWidths=[1.2*cm, 8*cm, 1.2*cm, 8*cm]) t.setStyle(TableStyle([ ('BACKGROUND', (0, 0), (-1, 0), colors.HexColor('#1a237e')), ('TEXTCOLOR', (0, 0), (-1, 0), colors.white), ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'), ('FONTSIZE', (0, 0), (-1, 0), 9), ('ALIGN', (0, 0), (-1, -1), 'LEFT'), ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'), ('FONTNAME', (0, 1), (-1, -1), 'Helvetica'), ('FONTSIZE', (0, 1), (-1, -1), 8.5), ('ROWBACKGROUNDS', (0, 1), (-1, -1), [colors.white, colors.HexColor('#E8EAF6')]), ('GRID', (0, 0), (-1, -1), 0.5, colors.HexColor('#9E9E9E')), ('TOPPADDING', (0, 0), (-1, -1), 4), ('BOTTOMPADDING', (0, 0), (-1, -1), 4), ('LEFTPADDING', (0, 0), (-1, -1), 4), ('FONTNAME', (0, 1), (0, -1), 'Helvetica-Bold'), ('FONTNAME', (2, 1), (2, -1), 'Helvetica-Bold'), ('TEXTCOLOR', (0, 1), (0, -1), colors.HexColor('#1a237e')), ('TEXTCOLOR', (2, 1), (2, -1), colors.HexColor('#1a237e')), ])) story.append(t) doc.build(story) print(f"PDF created: {out_path}") PYEOF
ls -lh /tmp/workspace/aiims_mcq/
AIIMS MDS 2002 MCQ
PDF Document · PDF
Note: A small number of questions (fewer than 5) had unclear or missing answers in the original source - those show "?" in the answer key, consistent with the original document's disclaimer.
Search for recent AIIMS MDS question papers (2020-2026)
AIIMS MDS question papers 2020 2021 2022 2023 2024 2025 download PDF
AIIMS MDS entrance exam previous year papers 2022 2023 2024 free download
https://mdsprep.com/blog/ini-cet-mds-may-2025-recalls-analys…
| Exam | Status | Source |
|---|---|---|
| INI-CET MDS May 2021 | Available (memory-based) | MDSPrep / Meriters |
| INI-CET MDS Nov 2022 | Available (memory-based) | MDSPrep / Meriters |
| INI-CET MDS May 2023 | Available (memory-based) | MDSPrep / Meriters |
| INI-CET MDS Nov 2023 | Available (memory-based) | MDSPrep / Meriters |
| INI-CET MDS May 2024 | Available (memory-based) | MDSPrep / Meriters |
| INI-CET MDS Nov 2024 | Available (memory-based) | MDSPrep / Meriters |
| INI-CET MDS May 2025 | Part 1 free PDF available | MDSPrep / Meriters |