Answer all questions

Reading File
Running Command

cd /tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/ && python3 -c " from pptx import Presentation import sys try: prs = Presentation('OSCE-UNI-4915539319ans.ppt') for i, slide in enumerate(prs.slides, 1): print(f'=== SLIDE {i} ===') for shape in slide.shapes: if shape.has_text_frame: txt = shape.text_frame.text.strip() if txt: print(txt) print() except Exception as e: print(f'Error: {e}') "

Running Command

ls /tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/ && file "/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt"

Running Command

python3 -c " import subprocess, sys # Try converting .ppt to .pptx using python-pptx (won't work directly) # Try using olefile to extract text from the PPT try: import olefile print('olefile available') except: print('olefile not available') # Try extracting text with python-pptx directly (it sometimes handles old ppt) try: from pptx import Presentation prs = Presentation('/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt') print('pptx opened successfully') except Exception as e: print(f'pptx error: {e}') # Try pptx2txt or similar try: import pptx2txt text = pptx2txt.get_text('/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt') print('pptx2txt text:', text[:500]) except Exception as e: print(f'pptx2txt error: {e}') "

Running Command

# Try extracting text from PPT using strings command or python struct parsing # PPT files store text in plaintext chunks we can extract python3 -c " import struct, re with open('/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt', 'rb') as f: data = f.read() # Extract readable ASCII/UTF-16 strings # Try UTF-16 LE (Windows PPT often uses UTF-16) texts = [] i = 0 while i < len(data) - 1: if data[i+1] == 0 and 32 <= data[i] < 127: # Possible UTF-16 LE string j = i s = b'' while j < len(data) - 1 and data[j+1] == 0 and (32 <= data[j] < 127 or data[j] in [9, 10, 13]): s += bytes([data[j]]) j += 2 if len(s) >= 8: texts.append(s.decode('ascii', errors='ignore').strip()) i = j else: i += 1 # deduplicate and filter seen = set() for t in texts: if t not in seen and len(t) >= 8: seen.add(t) print(repr(t)) " 2>&1 | head -200

Running Command

# Install olefile to properly parse the .ppt CFB format pip install --user olefile 2>&1 | tail -3

Running Command

python3 -c " import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile, struct, io PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' ole = olefile.OleFileIO(PPT_FILE) print('Streams:', ole.listdir()) "

Running Command

python3 << 'EOF' import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile, struct PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' ole = olefile.OleFileIO(PPT_FILE) stream = ole.openstream('PowerPoint Document').read() # Parse PPT binary records to extract text # Each record has: recVer(4b) + recType(12b) = 2 bytes, recLen = 4 bytes # TextCharsAtom recType = 0x0FA0 (4000) # TextBytesAtom recType = 0x0FA8 (4008) i = 0 texts = [] while i < len(stream) - 8: try: ver_type = struct.unpack_from('<H', stream, i)[0] rec_type = (ver_type >> 4) & 0x0FFF # Wait - actually recVer is low 4 bits, recType is high 12 bits rec_type2 = ver_type >> 4 rec_len = struct.unpack_from('<I', stream, i+2)[0] # TextCharsAtom = 0x0FA0 = 4000 # TextBytesAtom = 0x0FA8 = 4008 if rec_type2 == 0x0FA0: # TextCharsAtom - UTF-16LE if rec_len > 0 and i+6+rec_len <= len(stream): text = stream[i+6:i+6+rec_len].decode('utf-16-le', errors='replace') texts.append(('TextChars', text)) elif rec_type2 == 0x0FA8: # TextBytesAtom - Latin-1 if rec_len > 0 and i+6+rec_len <= len(stream): text = stream[i+6:i+6+rec_len].decode('latin-1', errors='replace') texts.append(('TextBytes', text)) if rec_len == 0: i += 6 else: i += 6 + rec_len except: i += 1 for t in texts: print(f'[{t[0]}] {t[1]!r}') EOF

Running Command

python3 << 'EOF' import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile, struct PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' ole = olefile.OleFileIO(PPT_FILE) stream = ole.openstream('PowerPoint Document').read() print(f'Stream length: {len(stream)}') # Let's check the record structure more carefully # PPT record header: verAndInstance (2 bytes), recType (2 bytes), recLen (4 bytes) i = 0 count = 0 texts = [] while i < len(stream) - 8 and count < 50000: count += 1 try: ver_inst = struct.unpack_from('<H', stream, i)[0] rec_type = struct.unpack_from('<H', stream, i+2)[0] rec_len = struct.unpack_from('<I', stream, i+4)[0] # TextCharsAtom = 0x0FA0 = 4000 # TextBytesAtom = 0x0FA8 = 4008 if rec_type == 0x0FA0: # TextCharsAtom - UTF-16LE if rec_len > 0 and i+8+rec_len <= len(stream): text = stream[i+8:i+8+rec_len].decode('utf-16-le', errors='replace') texts.append(('TextChars', text)) elif rec_type == 0x0FA8: # TextBytesAtom - Latin-1 if rec_len > 0 and i+8+rec_len <= len(stream): text = stream[i+8:i+8+rec_len].decode('latin-1', errors='replace') texts.append(('TextBytes', text)) if rec_len == 0: i += 8 else: i += 8 + rec_len except Exception as e: i += 1 print(f'Found {len(texts)} text atoms') for t in texts: print(f'[{t[0]}] {repr(t[1])}') EOF

Running Command

python3 << 'EOF' import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile, struct PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' ole = olefile.OleFileIO(PPT_FILE) stream = ole.openstream('PowerPoint Document').read() # Scan for all unique rec_type values in the stream to understand the structure i = 0 type_counts = {} while i < len(stream) - 8: ver_inst = struct.unpack_from('<H', stream, i)[0] rec_type = struct.unpack_from('<H', stream, i+2)[0] rec_len = struct.unpack_from('<I', stream, i+4)[0] type_counts[rec_type] = type_counts.get(rec_type, 0) + 1 if rec_len > 0 and rec_len < 100000 and i+8+rec_len <= len(stream): i += 8 + rec_len else: i += 8 for k,v in sorted(type_counts.items()): print(f'recType=0x{k:04X} ({k}): {v} times') EOF

Running Command

# The PPT may have text embedded in a compressed/encrypted format or a UserEdit # Let's try a brute-force text extraction approach - scan for UTF-16 readable strings python3 << 'EOF' import sys, re sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' ole = olefile.OleFileIO(PPT_FILE) stream = ole.openstream('PowerPoint Document').read() # Brute force: scan for sequences of UTF-16LE printable characters data = stream results = [] i = 0 while i < len(data) - 3: # Check if this looks like start of UTF-16LE text (char, 0x00) if data[i+1] == 0 and 0x20 <= data[i] <= 0x7E: j = i chars = [] while j < len(data) - 1 and data[j+1] == 0 and (0x20 <= data[j] <= 0x7E or data[j] in [0x09, 0x0A, 0x0D]): chars.append(chr(data[j])) j += 2 if len(chars) >= 5: results.append((i, ''.join(chars))) i = max(i+1, j) else: i += 1 seen = set() for pos, text in results: t = text.strip() if t and t not in seen and len(t) >= 5: seen.add(t) print(f'@{pos:06X}: {t}') EOF

Running Command

python3 << 'EOF' import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile, os PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' OUT_DIR = '/tmp/workspace/ppt_images/' os.makedirs(OUT_DIR, exist_ok=True) ole = olefile.OleFileIO(PPT_FILE) # Check Pictures stream if ole.exists('Pictures'): pics = ole.openstream('Pictures').read() print(f'Pictures stream size: {len(pics)} bytes') # Save it with open(OUT_DIR + 'pictures_stream.bin', 'wb') as f: f.write(pics) print('Saved pictures stream') # Show first 100 bytes hex print('First 100 bytes:', pics[:100].hex()) else: print('No Pictures stream') # Also check full PPT stream ppt = ole.openstream('PowerPoint Document').read() # Find JPEG signatures pos = 0 jpg_count = 0 while True: idx = ppt.find(b'\xff\xd8\xff', pos) if idx == -1: break # Find end of JPEG end = ppt.find(b'\xff\xd9', idx+3) if end != -1: jpg_data = ppt[idx:end+2] fname = OUT_DIR + f'slide_img_{jpg_count}.jpg' with open(fname, 'wb') as f: f.write(jpg_data) print(f'Found JPEG at {idx:#x}, size {len(jpg_data)}, saved to {fname}') jpg_count += 1 pos = idx + 1 # Find PNG signatures pos = 0 png_count = 0 while True: idx = ppt.find(b'\x89PNG', pos) if idx == -1: break end = ppt.find(b'IEND\xaeB`\x82', idx) if end != -1: png_data = ppt[idx:end+8] fname = OUT_DIR + f'slide_img_{png_count}.png' with open(fname, 'wb') as f: f.write(png_data) print(f'Found PNG at {idx:#x}, size {len(png_data)}, saved to {fname}') png_count += 1 pos = idx + 1 print(f'Total: {jpg_count} JPEGs, {png_count} PNGs in PPT stream') EOF

Running Command

python3 << 'EOF' import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') import olefile, os PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' OUT_DIR = '/tmp/workspace/ppt_images/' ole = olefile.OleFileIO(PPT_FILE) pics = ole.openstream('Pictures').read() # The Pictures stream in PPT has a header per image # Office Drawing (ODRAW) image container format # Each entry: OfficeArtRecordHeader (8 bytes) + data # recVer=0x0, recInst=..., recType, recLen import struct i = 0 img_count = 0 while i < len(pics) - 8: ver_inst = struct.unpack_from('<H', pics, i)[0] rec_type = struct.unpack_from('<H', pics, i+2)[0] rec_len = struct.unpack_from('<I', pics, i+4)[0] # MSOFBT_BSE = 0xF007, MSOFBT_BlipJPEG = 0xF01D, MSOFBT_BlipPNG = 0xF01E, etc. # Actually blip types: JPEG = 0xF01D, PNG = 0xF01E, EMF = 0xF01A, WMF = 0xF01B print(f'@{i}: recType=0x{rec_type:04X}, recLen={rec_len}') if rec_type in [0xF01D, 0xF01E, 0xF01A, 0xF01B, 0xF01C, 0xF01F, 0xF020, 0xF021]: if rec_len > 0 and i + 8 + rec_len <= len(pics): # Skip the header (16 bytes for JPEG/PNG blip) # Blip data starts after header: 16 bytes UID + optional secondary UID blip_data = pics[i+8:i+8+rec_len] ext = 'jpg' if rec_type == 0xF01D else 'png' if rec_type == 0xF01E else f'bin_{rec_type:04X}' # Find the actual image start if rec_type == 0xF01D: # JPEG # Skip 17 bytes (UID + tag) jpg_start = blip_data.find(b'\xff\xd8') if jpg_start >= 0: fname = OUT_DIR + f'img_{img_count}.jpg' with open(fname, 'wb') as f: f.write(blip_data[jpg_start:]) print(f' -> Saved JPEG to {fname}, size {len(blip_data[jpg_start:])}') img_count += 1 elif rec_type == 0xF01E: # PNG png_start = blip_data.find(b'\x89PNG') if png_start >= 0: fname = OUT_DIR + f'img_{img_count}.png' with open(fname, 'wb') as f: f.write(blip_data[png_start:]) print(f' -> Saved PNG to {fname}') img_count += 1 if rec_len == 0: i += 8 break # avoid infinite loop else: i += 8 + rec_len if img_count >= 20: break print(f'Extracted {img_count} images') EOF

analyse_media
analyse_media
analyse_media
analyse_media
analyse_media
Running Command

python3 << 'EOF' # Use pytesseract or PIL to read text from images import sys sys.path.insert(0, '/root/.local/lib/python3.11/site-packages') try: import pytesseract from PIL import Image print('pytesseract available') imgs = [ '/tmp/workspace/ppt_images/img_0.jpg', '/tmp/workspace/ppt_images/img_1.jpg', '/tmp/workspace/ppt_images/img_2.png', '/tmp/workspace/ppt_images/img_3.png', '/tmp/workspace/ppt_images/img_4.png', '/tmp/workspace/ppt_images/img_5.png', ] for imgpath in imgs: img = Image.open(imgpath) print(f'\n=== {imgpath} (size: {img.size}) ===') text = pytesseract.image_to_string(img) print(text[:3000]) except ImportError as e: print(f'Import error: {e}') except Exception as e: print(f'Error: {e}') EOF

Running Command

# Install pytesseract and check for tesseract binary pip install --user pytesseract 2>&1 | tail -2 which tesseract 2>/dev/null || echo "tesseract not found" ls /usr/bin/tesseract 2>/dev/null || echo "not in /usr/bin"

Running Command

# Try fetch_image approach - use read_file to see image content, or use PIL to display info # Let's read the images as base64 and check if we can use markitdown on the PDF conversion # Or convert PPT to PDF and use PDF skill # First, let's try to get image dimensions/thumbnails using PIL python3 -c " from PIL import Image import os for f in ['img_0.jpg','img_1.jpg','img_2.png','img_3.png','img_4.png','img_5.png']: p = '/tmp/workspace/ppt_images/'+f img = Image.open(p) print(f'{f}: size={img.size}, mode={img.mode}, format={img.format}') "

Loading Image
Loading Image
Running Command

python3 << 'EOF' # Use the PDF skill approach: convert images to PDF, then read with pdfplumber # Or use the markitdown approach # First let's try to extract text from the PPT differently - look at the full binary for readable text blocks # Brute force: extract all readable ASCII text runs from the PPT binary PPT_FILE = '/tmp/workspace/attachments/bcf9d94f-7711-4c78-b284-9925b435448a/OSCE-UNI-4915539319ans.ppt' with open(PPT_FILE, 'rb') as f: data = f.read() # Extract long ASCII runs import re # Find runs of printable ASCII of length >= 10 runs = re.findall(b'[ -~\t\n\r]{10,}', data) seen = set() for r in runs: t = r.decode('ascii', errors='ignore').strip() if t and t not in seen: seen.add(t) print(repr(t)) EOF

I successfully extracted all the text content from the PPT file. Here are all the OSCE questions with their answers:

OSCE Questions & Answers

Instructions

Attempt all the questions | Answer only what is asked!!

Question 1 - ECG / Cardiac

Q1. What are the abnormalities? Q2. Write 2 most important treatments.
Answers:
  • ECG diagnosis: Ischemia (AWMI - Anterior Wall MI based on the embedded ECG image)
  • Two important treatments: Aspirin, Nitrates

Question 2 - ECG Rhythm

Q1. What is the ECG diagnosis? Q2. Mention two important causes.
Answers:
  • Diagnosis: Atrial Fibrillation (AF)
  • Two important causes: Hypertension (HTN), Mitral Stenosis (MS)

Question 3 - Endotracheal Tube

Q1. What is the use of the balloon and the markings? Q2. Name the instrument used to insert the tube.
Answers:
  • Balloon: To prevent aspiration, and retain tube in place to prevent leakage of air
  • Markings: To know where the tube reached during insertion
  • Instrument: Laryngoscope and guide wire
  • Tube name: Cuffed Endotracheal Tube

Question 4 - Intravenous Cannula

Q1. Mention the use. Q2. Identify the color codes.
Answers:
  • Use: To administer IV fluids and drugs, draw blood
  • Colour codes:
    • Violet - 26G
    • Grey - 16G
    • Green - 18G
    • Pink - 20G
    • Blue - 22G
    • Yellow - 24G

Question 5 - Chest X-Ray (Right Lung)

Q1. Mention two abnormalities. Q2. Mention two important causes.
Answers:
  • Abnormalities: Blunting of costophrenic angle, bulging fissure → Pleural effusion; Cavitation
  • Important causes: Pleural effusion, Cavitation (TB, malignancy)

Question 6 - Chest X-Ray (Bilateral Lung Fields)

Q1. Comment on the lung fields. Q2. Two important possibilities.
Answers:
  • Lung fields: Millet-like diffuse opacity in bilateral lung fields (Miliary pattern)
  • Two possibilities:
    1. Miliary TB
    2. Interstitial Lung Disease (ILD) / Sarcoidosis

Question 7 - Clinical Scenario (Stroke + Cardiac)

"30-year-old female, sudden onset loss of consciousness with weakness on the left half of the body. She had a mid-diastolic murmur on auscultation with a loud S1."
Q1. What is the most possible diagnosis?
Mitral Stenosis causing stroke due to Atrial Fibrillation (AF)
Q2. What is the most important investigation to confirm?
Non-contrast CT scan and Echocardiography
Q3. What complication has occurred?
Embolic stroke due to AF

Question 8 - Lab Findings

"Normal abdominal findings; TLC = 2000; DLC: N = 30%, L = 64%, E = 4%, B = 2%; Platelet count = 20,000; Hb = 7 g/dL"
Q1. What is the abnormality?
Pancytopenia
Q2. What is your investigation of choice?
Bone marrow aspiration (alternative: trephine biopsy)
Q3. What are two differential diagnoses?
  1. Aplastic anemia
  2. Acute leukemia
  3. (Also: AIDS, SLE)

Question 9 - Prescription Writing: Giardiasis

Write prescription for Giardiasis:
  • Tinidazole 2 g single dose
  • OR Metronidazole 400 mg TDS for 10 days
  • OR Nitazoxanide 500 mg PO BD for 3 days

Question 10 - Prescription Writing: Thyrotoxicosis

Write prescription for Thyrotoxicosis:
  • Propranolol 160 mg daily
  • Sodium ipodate 500 mg PO for 2-3 days

These are the complete questions and model answers from the OSCE file. The slides contained ECG images (AWMI and AF tracings), chest X-ray images, photos of an endotracheal tube and IV cannula, and clinical/lab vignettes - all answered above.
This is a shared conversation. Sign in to Orris to start your own chat.