Upload any document and instantly get a multiple-choice exam generated by Claude AI. Answer the questions and get instant feedback on what you got right and wrong.
- Upload a document (PDF, DOCX, TXT, or Markdown)
- Configure how many questions and how many alternatives per question you want
- Start the exam — a countdown timer (1 minute per question) begins and stays visible as you scroll
- Answer the questions before time runs out — the exam auto-submits when the timer hits zero
- Review your results — score, which answers were correct, the correct answer for each wrong one, and a short explanation of why each answer is right or wrong
- Node.js (v18+) with ES Modules
- Express — HTTP server
- Multer — file upload handling
- pdf-parse — text extraction from PDFs
- Mammoth — text extraction from DOCX files
- Anthropic API (Claude) — exam question generation via native
fetch
exam-generator/
├── server.js # Express server — upload, text extraction, AI call, grading
├── package.json
├── .env.example # Environment variable template
└── public/
└── index.html # Single-page frontend (upload → exam → results)
cd exam-generatornpm installcp .env.example .envOpen .env and fill in your Anthropic API key:
ANTHROPIC_API_KEY=sk-ant-...
PORT=3000Getting an API key:
- If your company has an Anthropic enterprise account, ask your Console admin to invite you and generate a key from console.anthropic.com
- For personal use, sign up at console.anthropic.com, add billing, and create a key under API Keys
# Production
npm start
# Development (auto-restarts on file changes, Node 18+)
npm run devThe app will be available at http://localhost:3000
- Open http://localhost:3000 in your browser
- Upload a document (PDF, DOCX, TXT, or MD — up to 20 MB)
- Set the number of questions (1–50) and alternatives per question (2–6)
- Click Generate Exam and wait a few seconds while Claude reads the document
- Answer all questions and click Submit Answers
- Review your score and per-question breakdown
| Setting | Min | Max | Default |
|---|---|---|---|
| Questions | 1 | 50 | 10 |
| Alternatives | 2 | 6 | 4 |
| File size | — | 20 MB | — |
| Format | Extension |
|---|---|
.pdf |
|
| Word Document | .docx |
| Plain Text | .txt |
| Markdown | .md |
- Exam sessions are held in memory and expire after 2 hours
- The correct answers are never sent to the browser until after submission, preventing cheating
- Only the first ~40,000 characters of the document are sent to the AI to stay within token limits — for very long documents, the questions will be based on the beginning of the content
