Quiz Generator is a Streamlit application that generates multiple-choice quizzes based on provided text content. Users can select the difficulty level of the quiz and get a set of multiple-choice questions that conform to the provided text. The application leverages the OpenAI API to generate questions dynamically.
- Generate multiple-choice questions from provided text.
- Choose quiz difficulty level (EASY, MEDIUM, HARD).
- View and submit answers to the generated quiz.
- Display quiz results with correct answers.
- Python 3.x
- Streamlit
- OpenAI API
-
Clone the Repository:
git clone https://github.com/amiteshsrinivas/Quiz-Generator.git
-
Navigate to the Project Directory:
cd Quiz-Generator
-
Set Up a Virtual Environment: a. Create a virtual environment (if not already created): ```bash python -m venv quiz_env
b. Activate the virtual environment:
- For Windows PowerShell:
.\quiz_env\Scripts\Activate.ps1
- For Windows Command Prompt:
.\quiz_env\Scripts\activate
- For macOS/Linux:
source quiz_env/bin/activate
- For Windows PowerShell:
-
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
- Create a .env file in the root directory of the project.
- Add your OpenAI API key to the .env file:
OPENAI_API_KEY=your_openai_api_key
-
Run the Application:
streamlit run quizapp.py
- Open the Application:
Navigate to http://localhost:8501 in your web browser.
- Enter Text Content:
Paste the text content for which you want to generate a quiz in the text area.
- Select Quiz Level:
Choose the difficulty level from the dropdown menu.
- Generate Quiz:
Click the "Generate Quiz" button to create the quiz.
- Answer Questions:
Select your answers for each multiple-choice question and click "Submit" to see your results.
This project is licensed under the MIT License - see the LICENSE file for details.
- This project uses the OpenAI API for generating quiz questions.
- Thanks to the Streamlit community for providing an excellent framework for building web applications.