Skip to content

Prolab-Project/Exam-Schedule-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exam Schedule Generator

This project is a desktop application for generating and managing university exam schedules and seating plans.
It is built with Python, PyQt5 for the GUI, and PostgreSQL as the database.

The system allows administrators and department coordinators to:

  • Manage departments, classrooms, courses, and students
  • Automatically generate exam timetables under various constraints
  • Generate exam seating plans based on classroom layouts
  • Export exam schedules and seating plans (e.g. to Excel/PDF)

Features

  • User Authentication

    • Login with email and password
    • Role-based access: admin and coordinator
    • Default admin user is created automatically (admin@example.com / admin123)
  • Department & User Management (Admin)

    • Create and manage departments
    • Create admin and coordinator users linked to departments
  • Course & Student Management

    • Manage courses per department
    • Support for class level, instructor name, and course type (mandatory/elective)
    • Manage students and their course registrations
  • Classroom Management

    • Manage classrooms with:
      • Code and name
      • Capacity
      • Width / Height (rows and benches)
      • seat_structure for detailed seating layout (e.g. 2, 3, 4 seats per bench)
  • Exam Scheduling

    • Generate exam schedules for a department and exam type (midterm, final, resit)
    • Define:
      • Date range
      • Skip days (e.g. weekends/holidays)
      • Exam duration and break time between exams
    • Distribute exams across days considering:
      • Class levels
      • At most one or two exams per class per day
      • Non-overlapping time slots
  • Seating Plan Generation

    • Generate seating plans for each exam based on classroom layout
    • Uses seat_structure to place students only on edge seats in each bench:
      • 2 seats: [1 _]
      • 3 seats: [1 _ 2]
      • 4 seats: [1 _ _ 2]
    • Ensures capacity is not exceeded and reports if some students cannot be seated
  • UI

    • Modern login screen (Kocaeli University themed)
    • Separate panels for admin and coordinators
    • Themed with .qss style files

Technology Stack

  • Language: Python 3.x
  • GUI: PyQt5
  • Database: PostgreSQL
  • Database Driver: psycopg2

Project Structure

  • database/

    • models.py: Creates all database tables and inserts the default admin user.
    • queries/: Repository classes for interacting with tables
      (db_manager.py, user_repository.py, course_repository.py,
      classroom_repository.py, exam_repository.py, exam_seating_repository.py, etc.)
  • services/

    • Business logic / application services:
      • auth_service.py: User login and password verification
      • department_service.py, course_service.py, student_service.py
      • exam_service.py: Exam schedule generation logic
      • exam_seating_service.py: Seating plan generation
      • exam_classroom_service.py, classroom_service.py, exam_export_service.py
  • ui/

    • main_window.py: Application entry point and main window
    • login_window.py: Login form UI
    • admin_panel.py: Admin panel UI
    • coordinator_panel.py: Coordinator panel UI
    • style.qss, base.qss: Style sheets
    • Example export files (e.g. Oturma_Plani.pdf, Sinav_Programi.xlsx)
  • styles/

    • Additional QSS style files (e.g. base.qss)

Prerequisites

  • Python 3.8+
  • PostgreSQL (running locally)
  • A PostgreSQL user and database matching the connection settings in the code:
    • Database name: SinavProgramDb
    • User: postgres
    • Password: 1234
    • Host: localhost

You can change these values in database/models.py, services/exam_service.py, and database/queries/db_manager.py if needed.


Installation

  1. Clone the repository

    git clone <REPO_URL> cd Sinav-Programi-Olusturucu 2. Create and activate a virtual environment (recommended)

    python -m venv venv venv\Scripts\activate # On Windows

    source venv/bin/activate # On macOS/Linux

    1. Install dependencies

    pip install -r requirements.txt If there is no requirements.txt, install the basics manually:

    pip install PyQt5 psycopg2-binary 4. Configure PostgreSQL

    • Create the database and user if they do not exist:

    CREATE DATABASE "SinavProgramDb"; CREATE USER postgres WITH PASSWORD '1234'; GRANT ALL PRIVILEGES ON DATABASE "SinavProgramDb" TO postgres;

    • Adjust credentials in the code if you use different values.
  2. Initialize the database schema

    Run:

    python database/models.py This will:

    • Create all required tables
    • Insert a default admin user:
      • Email: admin@example.com
      • Password: admin123

Running the Application

From the project root, run:

python ui/main_window.py- The application will open with the login window.

  • Log in using the default admin credentials (or any user you have created).
  • Depending on the user role, you will be redirected to:
    • Admin Panel (admin)
    • Coordinator Panel (coordinator)

Usage Overview

  • Admin Panel

    • Manage departments and users (including coordinators)
    • Define classrooms, courses, and possibly global configurations
  • Coordinator Panel

    • Select a department and exam type
    • Set date range, skip days, duration, and break times
    • Generate exam schedule for selected courses
    • Generate seating plans for exams
    • Export schedules and seating plans to files (Excel/PDF)

Default Credentials

After initializing the database (python database/models.py):

  • Admin user
    • Email: admin@example.com
    • Password: admin123

It is recommended to change the default password in production environments.


Notes

  • The application assumes a local PostgreSQL instance.
    For remote or containerized setups, update the connection strings accordingly.
  • All role names and some messages are in Turkish (e.g. "admin", "koordinatör").
  • UI labels and notifications are primarily in Turkish since this is designed for a Turkish university context.

License

This project is provided for educational and institutional use.
Add your preferred license information here (e.g. MIT, GPL, proprietary, etc.).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages