GPT-QuestPro: Personalized Exam Generation

Ankur Katiyar
4 min readApr 8, 2024

--

Introducing GPT-QuestPro, an innovative app designed with a personal touch.

As a parent, I found myself spending countless hours creating exam papers for my 10-year-old son, only to struggle with evaluating his progress afterward. This tedious process inspired me to develop GPT-QuestPro, leveraging the power of Chat-GPT to generate multiple-choice online exams effortlessly. With just a prompt, the app crafts customized question papers, allowing my son to test his knowledge in various subjects. Not only does this save valuable time for me, but it also provides my son with an engaging learning experience while enabling me to track his improvement effectively. GPT-QuestPro transforms the way we approach learning and assessment, making education both efficient and enjoyable.

Table of Contents

  1. Requirements
  2. Installation
  3. Obtaining OpenAI API Keys
  4. Setting Secrets
  5. Setting Email
  6. Executing the App
  7. Contributing
  8. License

Requirements

To use GPT QuestPro, you need the following:

  • Python 3.8 or higher
  • An OpenAI API key to access GPT-3.5

Installation

Clone the repository to your local machine:

git clone https://github.com/ankur-katiyar/GPT-QuestPro.git

Change to the project directory:

cd GPT-QuestPro

Create a virtual environment and activate it:

python3 -m venv venv
source venv/bin/activate

Alternatively, you can use conda to create a virtual environment:

conda create -n GPT-QuestPro python=3.9
conda activate GPT-QuestPro

Install the required packages from requirements.txt:

pip install -r requirements.txt

Obtaining OpenAI API Keys

To obtain the necessary API key and organization from OpenAI, follow these steps:

  • Go to the OpenAI website.
  • If you don’t have an account, click “Sign up” and create one.
  • Once logged in, navigate to the API key management page.
  • Click “Create new secret key” and note down the generated API key (you would not see the key again).
  • On the same page, find your organization ID under the “Settings” section.

You now have the API key and organization ID required for GPT QuestPro.

Setting Secrets

Create a new directory .streamlit in the root directory of the project and create a new file secrets.toml inside it.

mkdir .streamlit
touch .streamlit/secrets.toml

Open the secrets.toml file and add the following lines:

OPENAI_TOKEN = <your-token>
OPENAI_ORG = <your-org>

Note: If it’s a personal account, you can leave OPENAI_ORG as an empty string (“”).

Setting Email

Open or Create config.ini File in the root directory:

  • If the config.ini file doesn’t exist, create a new file named config.ini.
  • If it already exists, open the existing config.ini file.
  • Add Email Configuration:

Under the [Email] section, fill in the following details:

sender_email: Your sender email address (e.g., "your_sender_email@gmail.com").
receiver_email: The recipient email address (e.g., "your_receiver_email@gmail.com").
sender_password: Your email account password.

Note: Make sure that you don’t enclose the values with double-quotes.

Executing the App

After installing dependencies and setting secrets, execute GPT QuestPro app by running:

streamlit run GPT-QuestPro.py

The GPT QuestPro app should now be accessible in your web browser at http://localhost:8501.

Contributing

I welcome contributions to improve GPT QuestPro.

ankur-katiyar/GPT-QuestPro: GPT QuestPro — written in Python/Streamlit & powered by ChatGPT (github.com)

If you’d like to contribute, please fork the repository and create a pull request with your proposed changes. I’ll review and merge the changes as appropriate.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

GPT-QuestPro is not just a tool for personalized exam generation; it’s a testament to the power of innovation driven by personal experience. Join us in revolutionizing education one exam at a time!

--

--