Transforming PDF question papers into interactive CBT experiences - a journey through hackathons, AI, and building for millions of students
The Spark โจ
It was 2 AM in the hostel room. My friend was frustratedโagain. He'd solved a 180-question JEE mock test on paper, only to realize he'd made a calculation error on question #45 that threw off his entire ranking. No instant results. No analytics. No way to know his weak areas.
"If only there was a way to just... upload the PDF and take it like the real exam."
That question changed everything.
๐ฏ What I Built: Rankify
Rankify is an AI-powered platform that transforms any PDF question paper into a fully interactive computer-based test (CBT). No more paper. No more manual checking. Just upload, practice, and analyze.
The Magic Flow โจ
graph LR
A[๐ PDF Upload] --> B[๐ค AI Extraction]
B --> C[๐๏ธ Review & Edit]
C --> D[โ๏ธ Configure Test]
D --> E[๐ฎ Take the Test]
E --> F[๐ Analyze Results]
Features That Actually Matter ๐ฎ
| Feature | What It Does | Why It Matters |
|---|---|---|
| AI Extraction | Gemini reads your PDF and extracts questions | No manual typing |
| Confidence Scores | Each question gets a 1-5 confidence rating | Know what to review |
| Diagram Detection | AI finds and maps diagrams to questions | Visual questions handled |
| Multi-PDF Batch | Process 10 PDFs at once | Save time |
| Offline Mode | Works without internet | Study anywhere |
๐ง The Hackathon Journey
This wasn't a weekend project. It started at an MLH hackathon where I had 24 hours to prove the concept worked.
Day 1: The Chaos ๐ช๏ธ
Me at 6 PM: "I'll use Gemini to extract questions from PDFs!"
Me at 8 PM: *Reading Gemini documentation*
Me at 10 PM: *Making API calls that fail*
Me at midnight: *First successful extraction! ๐*
Me at 2 AM: *It works but the JSON is garbage*
Day 2: The Pivot ๐
I realized the hard way: JSON output from LLMs is unpredictable. So I built:
- Zero-tolerance prompts - Instructions so strict Gemini had no choice but to behave
- Fallback chains - If one model fails, automatically try the next
- Confidence scoring - A multi-factor algorithm to rate extraction quality
// The fallback chain that saved my hackathon
const modelFallback = [
'gemini-2.5-flash', // Best quality
'gemini-2.5-flash-lite', // Quality + speed
'gemini-2.0-flash', // Reliable backup
'gemini-2.0-flash-lite' // Last resort
]
The Result? ๐
A working prototype that extracted 85 questions from a JEE sample paper in 3 minutes. Not perfectโbut proof it was possible.
๐ฅ What I Learned
Technical Wins ๐ป
-
Gemini's Vision API is underutilized
Most people use it for images. But PDFs? That's where the magic happens for educational tech.
-
Prompt engineering > Fine-tuning
I spent zero dollars on training. Just better prompts.
-
Client-side AI is viable
Privacy-first architecture actually became a selling point.
The Hard Lessons ๐ต
| Problem | Solution |
|---|---|
| Rate limits | Implemented exponential backoff + model fallback |
| PDF parsing issues | Added pdf.js preprocessing |
| JSON hallucinations | Built a validation layer with confidence scores |
| Cost tracking | Created real-time usage dashboard |
Soft Skills That Stuck ๐ฏ
- MVP-first thinking: Ship fast, iterate faster
- User empathy: Students don't care about AIโthey care about results
- Failure tolerance: 70% of my experiments failed. That's okay.
๐ My Google Gemini Feedback: The Good, The Bad, The Ugly
โ What Worked Brilliantly
Multi-modal = Game changer ๐จ
Processing text + images together meant diagrams weren't a separate problem.Context caching ๐พ
Reduced costs by 60%. Essential for production apps.Large context windows ๐
1M tokens = entire question papers in one go. Unreal.JSON mode ๐
Structured output without post-processing. So good.
โ ๏ธ Where Google Could Improve
PDF parsing is inconsistent
Rotated pages, watermarks, and scanned docs still cause headaches.Rate limits are tight
For a free tier, it's restrictive. I had to build a queuing system.Error messages are cryptic
"Internal error" tells me nothing. Help us help you!Cost visibility
Real-time spend tracking would prevent surprises.
๐ฌ The Ugly Truth
Sometimes Gemini hallucinates. It sees a question it can't parse and just... makes up options. That's why confidence scoring exists now.
๐ Where I'm Going Next
The journey continues:
Phase 1: Cloud Run Deployment
gcloud run deploy rankify-ai \
--source . \
--region us-central1 \
--no-allow-unauthenticated \
--labels dev-tutorial=blog-devcommunity2026
Phase 2: Agent Development Kit (ADK)
Building specialized agents for different subjects:
- Physics Agent ๐งช
- Chemistry Agent โ๏ธ
- Math Agent ๐
Phase 3: A2A Protocol
Agent-to-agent communication for complex multi-step reasoning
๐ก To Anyone Building with Gemini
- Start with Vision - It's more mature than you think
- Build for failure - Every API call can fail
- Hide the AI - Users want results, not technology
- Trust but verify - Confidence scores are your friend
๐ค Final Thoughts
Building Rankify taught me that AI isn't about replacing humansโit's about amplifying. A what we can do student in a small town with a cracked phone can now practice with the same quality as someone with expensive coaching.
That's what keeps me building.
Thanks for reading! If you want to try Rankify, check out the live demo. And if you're entering the Built with Google Gemini: Writing Challengeโgood luck! ๐
Top comments (0)