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)
-
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_structurefor detailed seating layout (e.g. 2, 3, 4 seats per bench)
- Manage classrooms with:
-
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_structureto place students only on edge seats in each bench:- 2 seats:
[1 _] - 3 seats:
[1 _ 2] - 4 seats:
[1 _ _ 2]
- 2 seats:
- 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
.qssstyle files
- Language: Python 3.x
- GUI: PyQt5
- Database: PostgreSQL
- Database Driver:
psycopg2
-
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 verificationdepartment_service.py,course_service.py,student_service.pyexam_service.py: Exam schedule generation logicexam_seating_service.py: Seating plan generationexam_classroom_service.py,classroom_service.py,exam_export_service.py
- Business logic / application services:
-
ui/main_window.py: Application entry point and main windowlogin_window.py: Login form UIadmin_panel.py: Admin panel UIcoordinator_panel.py: Coordinator panel UIstyle.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)
- Additional QSS style files (e.g.
- 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
- Database name:
You can change these values in
database/models.py,services/exam_service.py, anddatabase/queries/db_manager.pyif needed.
-
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
- 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.
-
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
- Email:
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)
-
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)
After initializing the database (python database/models.py):
- Admin user
- Email:
admin@example.com - Password:
admin123
- Email:
It is recommended to change the default password in production environments.
- 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.
This project is provided for educational and institutional use.
Add your preferred license information here (e.g. MIT, GPL, proprietary, etc.).