AssignmentAgent is a Python automation project that I built to automate the process of downloading, solving, and submitting university assignments. It combines Selenium for browser automation with Google Gemini AI to generate assignment solutions automatically.
I created this project to practice Python, Object-Oriented Programming, Selenium, and Artificial Intelligence by building something close to a real-world application.
The agent opens a university portal, logs into a student's account, navigates through available courses, checks for pending assignments, downloads assignment files, generates solutions using Google Gemini AI, creates formatted Microsoft Word documents, uploads the generated solutions, and finally submits the assignments automatically.
While developing this project, I focused on writing clean, modular, and maintainable code by separating different responsibilities into different classes. I also used design patterns like the Factory Pattern to make the project easier to extend in the future.
- Login to the university portal automatically.
- Browse all available courses.
- Detect pending assignments.
- Skip assignments that have already been submitted.
- Download assignment files automatically.
- Generate solutions using Google Gemini AI.
- Create formatted Microsoft Word (.docx) solution files.
- Upload generated solutions automatically.
- Submit assignments through the portal.
- Modular Object-Oriented architecture.
- Factory Pattern implementation.
- Secure credential management using environment variables.
- Centralized logging.
- Exception handling throughout the project.
- Easy to extend with additional AI providers or notification systems.
Start
│
▼
Load Configuration
│
▼
Open Browser
│
▼
Login to Portal
│
▼
Open Courses
│
▼
For Each Course
│
▼
Retrieve Assignments
│
▼
Already Submitted?
│
┌───────────┴───────────┐
│ │
Yes No
│ │
Skip Open Assignment
│
▼
Download Assignment
│
▼
Read Assignment File
│
▼
Generate Solution with
Google Gemini AI
│
▼
Create Word Document
│
▼
Upload Solution
│
▼
Submit Assignment
│
▼
Continue Next Assignment
│
▼
Finish
AssignmentAgent/
│
├── ai/
│ ├── base_ai.py
│ └── gemini_ai.py
│
├── notification/
│ ├── base_notification.py
│ └── console_notification.py
│
├── agent.py
├── assignment.py
├── assignment_factory.py
├── assignment_handler.py
├── ai_factory.py
├── base_page.py
├── browser.py
├── config.py
├── config.json
├── course_page.py
├── document_generator.py
├── document_reader.py
├── exceptions.py
├── locators.py
├── logger.py
├── main.py
├── notification_factory.py
├── portal.py
├── portal_manager.py
├── solution.py
├── requirements.txt
├── .gitignore
└── README.md
- Python
- Selenium WebDriver
- Google Gemini API
- python-docx
- python-dotenv
- Git
- GitHub
Clone the repository:
git clone https://github.com/AtifCodes1/AssignmentAgent.gitMove into the project directory:
cd AssignmentAgentCreate a virtual environment:
python -m venv .venvActivate the virtual environment.
Windows
.venv\Scripts\activateInstall the required packages:
pip install -r requirements.txtCreate a .env file in the project folder.
Example:
PORTAL_USERNAME=your_username
PORTAL_PASSWORD=your_password
GEMINI_API_KEY=your_api_keyUpdate the values inside config.json according to your setup.
python main.pyDuring this project I practiced and applied several software engineering concepts including:
- Object-Oriented Programming (OOP)
- Factory Pattern
- Exception Handling
- Modular Design
- Browser Automation
- API Integration
- File Handling
- Environment Variable Management
Some improvements I would like to add in the future include:
- Support for multiple AI providers.
- Email notifications.
- PDF assignment support.
- Multiple university portal support.
- Database integration.
- Better logging system.
- Automatic scheduling of assignments.
- Web dashboard.
Muhammad Atif
Computer Science Student
Currently learning:
- Python
- Selenium
- Artificial Intelligence
- Software Design
- Automation
This project is licensed under the MIT License. See the LICENSE file for more information.