Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AssignmentAgent

Python Selenium Gemini Git GitHub

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.

About the Project

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.

Features

  • 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.

Project Workflow

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

Project Structure

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

Technologies Used

  • Python
  • Selenium WebDriver
  • Google Gemini API
  • python-docx
  • python-dotenv
  • Git
  • GitHub

Installation

Clone the repository:

git clone https://github.com/AtifCodes1/AssignmentAgent.git

Move into the project directory:

cd AssignmentAgent

Create a virtual environment:

python -m venv .venv

Activate the virtual environment.

Windows

.venv\Scripts\activate

Install the required packages:

pip install -r requirements.txt

Configuration

Create a .env file in the project folder.

Example:

PORTAL_USERNAME=your_username
PORTAL_PASSWORD=your_password
GEMINI_API_KEY=your_api_key

Update the values inside config.json according to your setup.

Running the Project

python main.py

Design Concepts Used

During 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

Future Improvements

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.

Author

Muhammad Atif

Computer Science Student

Currently learning:

  • Python
  • Selenium
  • Artificial Intelligence
  • Software Design
  • Automation

License

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

About

An AI-powered assignment automation agent using Selenium and Gemini.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages