Provide 50mcqs pattern exam without answers related to my above file.difficulty level is easy to moderate leve. Please follow the following instructions: ○Don't provide same option as correct answers for again and again. ○Don't provide long option as correct answer for all questions.
python3 << 'EOF' import pdfplumber text1 = "" with pdfplumber.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 1 Lim.pdf") as pdf: print(f"Part 1 pages: {len(pdf.pages)}") for page in pdf.pages: t = page.extract_text() if t: text1 += t + "\n" text2 = "" with pdfplumber.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 2 Lim 2.pdf") as pdf: print(f"Part 2 pages: {len(pdf.pages)}") for page in pdf.pages: t = page.extract_text() if t: text2 += t + "\n" # Save extracted text with open("/tmp/workspace/skin_part1.txt", "w") as f: f.write(text1) with open("/tmp/workspace/skin_part2.txt", "w") as f: f.write(text2) print(f"Part 1 chars: {len(text1)}") print(f"Part 2 chars: {len(text2)}") print("\n--- PART 1 SAMPLE (first 3000 chars) ---") print(text1[:3000]) EOF
python3 << 'EOF' from pypdf import PdfReader reader1 = PdfReader("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 1 Lim.pdf") reader2 = PdfReader("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 2 Lim 2.pdf") # Check for text in pages for i, page in enumerate(reader1.pages[:5]): t = page.extract_text() print(f"Page {i+1}: '{t[:200] if t else 'EMPTY'}'") print("---") for i, page in enumerate(reader2.pages[:3]): t = page.extract_text() print(f"Page {i+1}: '{t[:200] if t else 'EMPTY'}'") EOF
python3 << 'EOF' import fitz # PyMuPDF import os os.makedirs("/tmp/workspace/skin_images", exist_ok=True) # Convert Part 1 pages to images (first 30 pages to get content) doc1 = fitz.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 1 Lim.pdf") print(f"Part 1: {len(doc1)} pages") for i in range(min(30, len(doc1))): page = doc1[i] mat = fitz.Matrix(1.5, 1.5) pix = page.get_pixmap(matrix=mat) pix.save(f"/tmp/workspace/skin_images/part1_page{i+1:03d}.png") doc2 = fitz.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 2 Lim 2.pdf") print(f"Part 2: {len(doc2)} pages") for i in range(min(25, len(doc2))): page = doc2[i] mat = fitz.Matrix(1.5, 1.5) pix = page.get_pixmap(matrix=mat) pix.save(f"/tmp/workspace/skin_images/part2_page{i+1:03d}.png") print("Done converting pages to images") print(os.listdir("/tmp/workspace/skin_images")[:10]) EOF
pip install --user pymupdf -q && python3 -c "import fitz; print('fitz ok')"
python3 << 'EOF' import sys sys.path.insert(0, '/opt/amazon/genesis1p-tools/var/.local/lib/python3.12/site-packages') import fitz import os os.makedirs("/tmp/workspace/skin_images", exist_ok=True) # Extract text using PyMuPDF (handles image PDFs via built-in) doc1 = fitz.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 1 Lim.pdf") print(f"Part 1: {len(doc1)} pages") # Try text extraction first all_text = "" for i in range(len(doc1)): page = doc1[i] t = page.get_text() all_text += t print(f"Part 1 text length: {len(all_text)}") print(all_text[:500]) EOF
python3 << 'EOF' import sys sys.path.insert(0, '/opt/amazon/genesis1p-tools/var/.local/lib/python3.12/site-packages') import fitz import os os.makedirs("/tmp/workspace/skin_images", exist_ok=True) doc1 = fitz.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 1 Lim.pdf") # Convert select pages to PNG for visual analysis # Sample pages: 1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80 pages_to_convert = [0, 2, 4, 8, 12, 16, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 88] for i in pages_to_convert: if i < len(doc1): page = doc1[i] mat = fitz.Matrix(1.5, 1.5) pix = page.get_pixmap(matrix=mat) pix.save(f"/tmp/workspace/skin_images/part1_p{i+1:03d}.png") doc2 = fitz.open("/tmp/workspace/attachments/4624fb7b-8bec-40c5-be15-773f4fe38b22/Skin Part 2 Lim 2.pdf") pages2 = [0, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 50] for i in pages2: if i < len(doc2): page = doc2[i] mat = fitz.Matrix(1.5, 1.5) pix = page.get_pixmap(matrix=mat) pix.save(f"/tmp/workspace/skin_images/part2_p{i+1:03d}.png") files = sorted(os.listdir("/tmp/workspace/skin_images")) print(f"Created {len(files)} images: {files}") EOF
Generate a Word document with all 50 MCQs for easy sharing
mkdir -p /tmp/workspace/skin-mcq && python3 << 'EOF' from docx import Document from docx.shared import Pt, RGBColor, Inches from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.oxml.ns import qn from docx.oxml import OxmlElement doc = Document() # ── Page margins ── from docx.shared import Inches section = doc.sections[0] section.left_margin = Inches(1.0) section.right_margin = Inches(1.0) section.top_margin = Inches(1.0) section.bottom_margin = Inches(1.0) # ── Default Normal style ── normal = doc.styles["Normal"] normal.font.name = "Calibri" normal.font.size = Pt(11) # ── Title ── title = doc.add_heading("Dermatology / Skin Disorders", level=1) title.alignment = WD_ALIGN_PARAGRAPH.CENTER for run in title.runs: run.font.color.rgb = RGBColor(0x1F, 0x4E, 0x79) subtitle = doc.add_paragraph("50 Multiple Choice Questions | Easy to Moderate Level") subtitle.alignment = WD_ALIGN_PARAGRAPH.CENTER sub_run = subtitle.runs[0] sub_run.bold = True sub_run.font.size = Pt(12) sub_run.font.color.rgb = RGBColor(0x2E, 0x74, 0xB5) doc.add_paragraph("") # spacer # ── Instruction ── instr = doc.add_paragraph( "Instructions: Choose the single best answer for each question. " "Answers are NOT provided in this document." ) instr.runs[0].italic = True instr.runs[0].font.size = Pt(10) instr.runs[0].font.color.rgb = RGBColor(0x70, 0x70, 0x70) doc.add_paragraph("") # ── MCQ DATA ── mcqs = [ ( "The outermost layer of the epidermis is called the:", ["Stratum granulosum", "Stratum spinosum", "Stratum corneum", "Stratum basale"] ), ( "Which cells in the epidermis are responsible for producing melanin?", ["Langerhans cells", "Keratinocytes", "Melanocytes", "Merkel cells"] ), ( "The dermis is primarily composed of which protein?", ["Elastin", "Collagen", "Keratin", "Fibronectin"] ), ( "Which layer of the skin contains sweat glands, hair follicles, and blood vessels?", ["Epidermis", "Hypodermis", "Dermis", "Stratum corneum"] ), ( "Psoriasis is characterized by which of the following histological features?", [ "Spongiosis and vesicle formation", "Acanthosis, parakeratosis, and Munro microabscesses", "Hyperkeratosis with no inflammation", "Subepidermal blistering" ] ), ( "The Koebner phenomenon (isomorphic response) is classically associated with:", ["Lichen planus and psoriasis", "Acne vulgaris", "Rosacea", "Seborrheic dermatitis"] ), ( "Tinea versicolor is caused by:", ["Trichophyton rubrum", "Microsporum canis", "Malassezia furfur", "Candida albicans"] ), ( "A child presents with honey-colored crusted lesions around the mouth and nose. The most likely diagnosis is:", ["Contact dermatitis", "Herpes simplex", "Impetigo", "Chickenpox"] ), ( "Which virus causes molluscum contagiosum?", ["Human papillomavirus", "Herpes simplex virus", "Poxvirus", "Varicella-zoster virus"] ), ( "Dermatophytes infect which structures of the body?", [ "Mucous membranes and blood vessels", "Keratinized structures - skin, hair, and nails", "Subcutaneous fat only", "Lymph nodes and spleen" ] ), ( "The primary lesion in pemphigus vulgaris is:", [ "Bullae above the basement membrane (intraepidermal)", "Vesicles in the dermis", "Subepidermal bullae", "Pustules in the follicle" ] ), ( "Nikolsky sign is positive in which condition?", ["Bullous pemphigoid", "Pemphigus vulgaris", "Dermatitis herpetiformis", "Epidermolysis bullosa"] ), ( "Acne vulgaris is primarily caused by obstruction of which structure?", ["Eccrine sweat gland", "Apocrine gland", "Pilosebaceous unit", "Sebaceous gland duct only"] ), ( "The most common type of skin cancer is:", ["Melanoma", "Squamous cell carcinoma", "Kaposi sarcoma", "Basal cell carcinoma"] ), ( "A 'pearly papule with rolled edges and telangiectasia' is the classic description of:", ["Squamous cell carcinoma", "Basal cell carcinoma", "Sebaceous cyst", "Actinic keratosis"] ), ( "The ABCDE rule in melanoma assessment stands for:", [ "Age, Border, Color, Diameter, Evolution", "Asymmetry, Border, Color, Diameter, Evolution", "Area, Bleeding, Crust, Depth, Elevation", "Asymmetry, Bleeding, Color, Diameter, Elevation" ] ), ( "Which UV radiation type is the most important cause of skin cancer?", ["UVA (320-400 nm)", "UVC (100-280 nm)", "Infrared", "UVB (280-320 nm)"] ), ( "Auspitz sign (pinpoint bleeding when scales are removed) is characteristic of:", ["Eczema", "Psoriasis", "Pityriasis rosea", "Lichen planus"] ), ( "The herald patch is a feature of:", ["Psoriasis", "Tinea corporis", "Pityriasis rosea", "Seborrheic dermatitis"] ), ( "Contact dermatitis caused by poison ivy is an example of which type of hypersensitivity reaction?", [ "Type I (IgE-mediated)", "Type II (cytotoxic)", "Type IV (delayed-type/cell-mediated)", "Type III (immune complex)" ] ), ( "Wickham striae are white lacy lines seen on the surface of lesions in:", ["Psoriasis", "Pityriasis rosea", "Lichen planus", "Discoid lupus erythematosus"] ), ( "The characteristic lesion of lichen planus is described as:", [ "Pink macules with fine scales", "Flat-topped, purple, polygonal papules", "Silvery scaly plaques", "Vesicles on an erythematous base" ] ), ( "Scabies is caused by:", ["Pediculus humanus", "Sarcoptes scabiei", "Demodex folliculorum", "Phthirus pubis"] ), ( "Which of the following is the pathognomonic sign of scabies?", [ "Target lesions", "Burrows in the web spaces of fingers", "Herald patch", "Koebner phenomenon" ] ), ( "Rosacea most commonly affects which part of the face?", [ "Forehead and temples", "Central face - nose, cheeks, and chin", "Periorbital area only", "Jawline and neck" ] ), ( "Which organism most commonly causes cellulitis?", [ "Staphylococcus aureus and Streptococcus pyogenes", "Pseudomonas aeruginosa", "Clostridium perfringens", "Escherichia coli" ] ), ( "Erythema multiforme is commonly triggered by:", [ "Autoimmune thyroid disease", "Herpes simplex virus and Mycoplasma pneumoniae", "Fungal infections", "Vitamin D deficiency" ] ), ( "Stevens-Johnson syndrome is defined by epidermal detachment involving what percentage of body surface area?", ["Greater than 30%", "Less than 10%", "10 to 30%", "Greater than 50%"] ), ( "The condition characterized by depigmented (white) macules due to destruction of melanocytes is:", ["Albinism", "Vitiligo", "Tinea versicolor", "Pityriasis alba"] ), ( "Wood lamp examination of tinea capitis caused by Microsporum shows:", ["No fluorescence", "Red fluorescence", "Green-yellow fluorescence", "Blue-white fluorescence"] ), ( "Seborrheic dermatitis most commonly affects which areas?", [ "Palms and soles", "Scalp, nasolabial folds, and eyebrows", "Back and buttocks", "Groin and axilla" ] ), ( "The most common organism causing folliculitis is:", ["Staphylococcus aureus", "Candida albicans", "Streptococcus pyogenes", "Pseudomonas aeruginosa"] ), ( "Erysipelas differs from cellulitis in that it:", [ "Involves deeper tissues", "Is caused by Gram-negative bacteria", "Has a sharply demarcated, raised border", "Affects only the lower limbs" ] ), ( "Squamous cell carcinoma of the skin most commonly arises from:", ["Sebaceous gland", "Melanocytes", "Keratinocytes", "Eccrine sweat gland"] ), ( "Dermatitis herpetiformis is strongly associated with:", [ "Crohn disease", "Celiac disease (gluten-sensitive enteropathy)", "Ulcerative colitis", "Lactose intolerance" ] ), ( "The term 'onychomycosis' refers to fungal infection of the:", ["Scalp", "Groin", "Nails", "Feet"] ), ( "A mole (nevus) that is benign is typically:", [ "Asymmetric with irregular borders", "Larger than 6 mm", "Symmetric, well-defined, single color", "Rapidly changing in size" ] ), ( "Actinic keratosis is considered a precursor to:", ["Basal cell carcinoma", "Squamous cell carcinoma", "Melanoma", "Merkel cell carcinoma"] ), ( "The primary treatment for scabies is:", ["Fluconazole", "Doxycycline", "Permethrin cream", "Hydrocortisone"] ), ( "Chickenpox (varicella) skin lesions are described as:", [ "Only macules and papules", "Only pustules", "Lesions in different stages simultaneously - macules, papules, vesicles, and crusts", "Only vesicles on an erythematous base" ] ), ( "Which of the following is a feature of atopic dermatitis (eczema)?", [ "Absence of pruritus", "Silvery scaly plaques", "Intense pruritus, flexural involvement, and dry skin", "Fixed drug eruption pattern" ] ), ( "The hypodermis (subcutaneous layer) is mainly composed of:", [ "Dense regular connective tissue", "Adipose tissue", "Elastic fibers", "Reticular fibers" ] ), ( "Herpes zoster results from reactivation of which virus?", [ "Herpes simplex virus type 1", "Epstein-Barr virus", "Varicella-zoster virus", "Cytomegalovirus" ] ), ( "The rash of herpes zoster is characteristically:", [ "Bilateral and symmetric", "Unilateral and dermatomal", "Scattered randomly over the trunk", "Confined to palms and soles" ] ), ( "Keratoacanthoma is a rapidly growing skin tumor that closely resembles:", ["Basal cell carcinoma", "Melanoma", "Squamous cell carcinoma", "Dermatofibroma"] ), ( "The Tzanck smear is used to diagnose infections caused by:", [ "Dermatophytes", "Staphylococcus aureus", "Herpes simplex and varicella-zoster viruses", "Sarcoptes scabiei" ] ), ( "Erythema nodosum presents as:", [ "Blistering lesions on the trunk", "Tender red nodules on the shins", "Scaly plaques on the scalp", "Papules on the back" ] ), ( "Sebaceous (epidermal inclusion) cysts are lined by:", [ "Columnar epithelium", "Stratified squamous epithelium", "Transitional epithelium", "Simple cuboidal epithelium" ] ), ( "Kaposi sarcoma is strongly associated with which condition?", [ "Diabetes mellitus", "HIV/AIDS", "Systemic lupus erythematosus", "Rheumatoid arthritis" ] ), ( "The drug of choice for systemic fungal skin infections such as widespread tinea is:", ["Penicillin", "Metronidazole", "Griseofulvin or oral terbinafine", "Acyclovir"] ), ] LETTERS = ["A", "B", "C", "D"] for idx, (question, options) in enumerate(mcqs, start=1): # Question number + text q_para = doc.add_paragraph() q_run = q_para.add_run(f"{idx}. {question}") q_run.bold = True q_run.font.size = Pt(11) q_run.font.color.rgb = RGBColor(0x1F, 0x1F, 0x1F) q_para.paragraph_format.space_before = Pt(10) q_para.paragraph_format.space_after = Pt(2) # Options for letter, option in zip(LETTERS, options): opt_para = doc.add_paragraph() opt_para.paragraph_format.left_indent = Inches(0.35) opt_para.paragraph_format.space_before = Pt(1) opt_para.paragraph_format.space_after = Pt(1) opt_run = opt_para.add_run(f"{letter}) {option}") opt_run.font.size = Pt(11) # Separator line after each question sep = doc.add_paragraph() sep.paragraph_format.space_before = Pt(2) sep.paragraph_format.space_after = Pt(2) sep_run = sep.add_run("─" * 72) sep_run.font.size = Pt(8) sep_run.font.color.rgb = RGBColor(0xCC, 0xCC, 0xCC) # ── Footer note ── doc.add_paragraph("") footer_note = doc.add_paragraph( "End of Question Paper | Total: 50 Questions | Difficulty: Easy - Moderate | Topic: Dermatology / Skin Disorders" ) footer_note.alignment = WD_ALIGN_PARAGRAPH.CENTER fn_run = footer_note.runs[0] fn_run.italic = True fn_run.font.size = Pt(9) fn_run.font.color.rgb = RGBColor(0x70, 0x70, 0x70) out_path = "/tmp/workspace/skin-mcq/Skin_Dermatology_50_MCQs.docx" doc.save(out_path) print(f"Saved: {out_path}") EOF
python3 << 'EOF' from docx import Document doc = Document("/tmp/workspace/skin-mcq/Skin_Dermatology_50_MCQs.docx") paras = [p.text for p in doc.paragraphs if p.text.strip()] print(f"Total non-empty paragraphs: {len(paras)}") print("\nFirst 15 paragraphs:") for p in paras[:15]: print(repr(p)) print("\nLast 5 paragraphs:") for p in paras[-5:]: print(repr(p)) EOF
Skin Dermatology 50 MCQs
Word Document · DOCX