Skip to content

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

PDF → Quiz Feature

Upload a PDF (text-based or scanned). The backend will:

  1. Extract selectable text via pdfminer.six.
  2. OCR low-text pages with Tesseract (needs local install) & PyMuPDF rendering.
  3. Clean headers/footers and chunk content; build a FAISS vector index.
  4. Generate quiz questions (MCQ / T/F / short answer) using Gemini or an external provider.

Environment Variables

Create .env.local (frontend) and server env vars for backend:

GEMINI_API_KEY=your_key_here
GEMINI_MODEL=models/gemini-2.5-flash
QUIZ_PROVIDER=gemini            # or external
QUIZ_API_URL=                   # required if QUIZ_PROVIDER=external
QUIZ_API_KEY=                   # optional external key
VECTOR_DIR=./data/indexes
SQLITE_PATH=./data/app.db

Windows Tesseract Install

  1. Download installer: https://github.com/UB-Mannheim/tesseract/wiki
  2. Install (default path: C:\Program Files\Tesseract-OCR).
  3. Add that path to your system PATH or set TESSERACT_CMD environment variable.

Backend Setup

cd exam-backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python main.py

Frontend Usage

Navigate to /practice:

  1. Upload PDF.
  2. Adjust count, difficulty, type.
  3. Generate quiz and answer questions.
  4. Submit results (stored via /attempts/save).

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages