TexToTest is an AI-powered assistant that automatically generates quiz questions from e-learning PDFs using NLP pipelines. It combines Heuristic + Pattern-based approaches with lightweight NLP and optional semantic validation to create high-quality, domain-relevant quizzes efficiently.
- Multiple Choice Questions (MCQ) - Traditional 4-option questions with intelligent distractors
- True/False Questions - Binary choice questions with contextual variations
- Fill-in-the-Blank - Interactive completion exercises
- Short Answer Questions - Open-ended explanatory responses
- Matching Questions - Connect related concepts across columns
- Mixed Question Sets - Adaptive combination of question types
- Intelligent content extraction from PDFs with advanced text preprocessing
- Semantic distractor generation using sentence transformers for contextually relevant wrong answers
- Automatic difficulty classification (Easy/Medium/Hard) based on Bloom's taxonomy
- Subject categorization into domains like Science, History, Mathematics, Literature, etc.
- Multi-format export: JSON, Plain Text, PDF, Word Documents, Moodle XML
- LMS Integration with Moodle-compatible XML format
- Professional formatting with metadata, answer keys, and difficulty indicators
- Batch processing for institutional use
- Interactive question configuration with type, difficulty, and quantity selection
- Real-time preview of different question formats
- Responsive design optimized for desktop and mobile
- Export menu with format descriptions and compatibility information
- Hybrid NLP pipeline combining heuristic and ML-based approaches
- Graceful fallbacks when advanced features are unavailable
- Scalable architecture suitable for individual and institutional deployment
- Quality validation with automatic assessment of question and distractor quality
- Frontend: React.js, CSS, PWA
- Backend: Python with FastAPI
- AI & NLP:
- Sentence-Transformers (semantic similarity for enhanced distractors)
- SpaCy (NER, POS tagging, dependency parsing)
- NLTK (tokenization, pattern-based rules)
- Scikit-learn (ML utilities and classification)
- NumPy (numerical computations)
- PDFPlumber (advanced PDF text extraction)
- Document Generation:
- ReportLab (professional PDF export)
- python-docx (Word document generation)
- XML processing (Moodle LMS integration)
- Hosting: Render (backend), Vercel (frontend)
-
Upload PDF
Users upload an e-learning PDF via the frontend. -
Text Extraction & Preprocessing
- PDFPlumber extracts text, tables, and bullet points.
- Text is cleaned and chunked for efficient processing.
-
Content Selection
- Heuristic Layer: Identifies key concepts using NER, POS tagging, frequency analysis, and PDF formatting cues.
- Pattern-based Layer: Converts key concepts into candidate questions using predefined templates.
-
Question & Distractor Generation
- Rule-based pipelines generate question stems.
- Distractors are created using spelling/format patterns and optional lightweight semantic similarity checks.
-
Result Delivery
- The system returns the generated questions in a clean, responsive UI.
- Users can view, download, or export quizzes.
git clone https://github.com/alurubalakarthikeya/TexToTest.git
cd TexToTestcd backend
pip install -r requirements.txt
uvicorn app:app --reloadCreate a .env file in backend/ with:
OPENROUTER_API_KEY=sk-or-v1_your_openrouter_key
# Comma-separated list of allowed frontend origins (scheme+host+port)
ALLOWED_ORIGINS=https://your-frontend.example.com,http://localhost:5173
# Optional attribution headers for OpenRouter (recommended but not required)
OPENROUTER_SITE_URL=https://your-frontend.example.com
APP_TITLE=TexToTestQuick diagnostics:
- Check service health:
GET /health - Check readiness (context present):
GET /ready - Check configuration status:
GET /status
Example with curl (adjust host/port as needed):
curl -s http://localhost:8000/status | jqIf openrouter.configured is false or you get a 401 from /ask-model, verify the OPENROUTER_API_KEY value in your environment or hosting provider. Keys typically start with sk-or-v1_….
cd ../frontend
npm install
npm run dev- Set
VITE_API_BASEinfrontend/.envto point to your backend (prod or local):
VITE_API_BASE=https://textotest.onrender.com
# or
# VITE_API_BASE=http://localhost:8000The frontend also falls back to window.API_BASE and a sane default if not provided.