Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartQuiz – Auto MCQ Generator

Upload any file (PDF, DOCX, TXT, PPT) → AI generates 4-option MCQ quiz with result screen.


📁 Project Structure

smartquiz/
├── server.js          ← Node.js backend
├── package.json       ← Dependencies
├── .env               ← Your API key goes here
├── public/
│   └── index.html     ← Frontend quiz UI
└── uploads/           ← Temp folder (auto-cleaned)

🚀 Setup & Run

1. Install Node.js

Download from https://nodejs.org (LTS version)

2. Extract this folder

Unzip smartquiz.zip anywhere on your computer/server.

3. Add your API key

Open .env file and replace:

ANTHROPIC_API_KEY=your_api_key_here

with your actual Anthropic API key from https://console.anthropic.com

4. Install dependencies

Open terminal in the smartquiz folder:

npm install

5. Start the server

npm start

6. Open in browser

Go to: http://localhost:3000


🌐 Deploy on a Server (VPS / Hosting)

Using PM2 (keeps app running):

npm install -g pm2
pm2 start server.js --name smartquiz
pm2 save
pm2 startup

Using Nginx (optional reverse proxy):

server {
    listen 80;
    server_name yourdomain.com;
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
    }
}

📋 Features

  • ✅ PDF, DOCX, DOC, TXT, PPT, PPTX support
  • ✅ AI reads file → generates 4-option MCQ
  • ✅ Right answer → Green highlight ✓
  • ✅ Wrong answer → Red shake + shows correct answer
  • ✅ End screen with score + all wrong answers review
  • ✅ Explanation for each question
  • ✅ Easy / Medium / Hard difficulty
  • ✅ 5 / 10 / 15 / 20 questions

🔑 Environment Variables

Variable Description
ANTHROPIC_API_KEY Your API key from console.anthropic.com
PORT Server port (default: 3000)

⚠️ Notes

  • API key is stored only in .env — never exposed to browser
  • Uploaded files are deleted immediately after processing
  • Max file size: 20MB

About

easy to learn

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages