A modern AI-powered test generation application that creates custom exam questions from your study materials.
- Document Upload: Support for PDF, DOCX, and TXT formats
- Smart Question Generation: Uses Google's Gemini AI models to create contextually relevant questions
- Exam Format Detection: Automatically detects and formats questions based on the content
- Subject Classification: Categorizes questions by subject (Physics, Chemistry, Mathematics, Biology)
- Exam Type Support: Optimized for JEE and NEET exam formats
- Interactive UI: Modern card-based interface with show/hide answer functionality
- Fallback Mechanism: Includes sample questions when AI generation is unavailable
- Frontend: HTML, CSS, JavaScript
- Backend: Python, Flask
- AI Model: Google Gemini API (1.5-flash, 2.0-flash, pro)
- Document Processing: PyPDF2, python-docx
- Python 3.8+
- Google Gemini API key
-
Clone the repository:
git clone https://github.com/yourusername/testcraft.git cd testcraft -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows, use: .venv\Scripts\activate -
Install dependencies:
cd backend pip install -r requirements.txt -
Create a
.envfile in the backend directory with your Google Gemini API key:GEMINI_API_KEY=your_api_key_here -
Start the Flask server:
python -m flask runThe backend will run on http://localhost:5000
-
Open a new terminal window/tab
-
Navigate to the frontend directory:
cd frontend -
Start a simple HTTP server:
python -m http.serverThe frontend will be available at http://localhost:8000
- Open the application in your browser (http://localhost:8000)
- Upload your study document (PDF, DOCX, or TXT)
- Specify the number of questions you want to generate
- Click "Generate Test"
- Review the generated questions, which are organized by subject
- Use the "Show Answer" button to reveal answers and explanations
The application follows a client-server architecture:
- Frontend: Handles user interaction, document upload, and displays generated tests
- Backend: Processes documents, detects exam types, extracts content, and generates questions using AI
- Document upload → Text extraction
- Exam type detection → Question format detection
- Subject classification → Content extraction
- AI question generation → Response formatting
If no Gemini API key is provided, the application runs in offline mode, providing sample questions for demonstration purposes.
- Google Gemini API for AI capabilities
- Flask for the backend framework
- FontAwesome for icons