# Student Learning Practical System (SLPS)

The Student Learning Practical System (SLPS) is a department-focused, multi-campus practical learning system for Rockview University. The attached `studentbox.zip` was used as the visual reference; its green-and-gold palette, header, sidebar, dashboard cards, and responsive layout are carried through the SLPS panels. Every tab keeps its panel's full left navigation, with larger text for readability. The reference ZIP's unrelated content and folder layout were not reused.

## Package structure

- `authentication/` — student registration and account sign-in.
- `management/` — staff and top management screens, campus management and HOD account management.
- `hod/` — HOD workspace.
- `students/` — student workspace.
- `staff/` — staff and top management workspace.
- `shared/` — shared visual assets, dashboard behavior, role-scoped module pages, file handling and module APIs.
- `database/` — the MySQL schema and setup notes.
- `docs/SLPS_PROPOSAL.md` — the complete revised proposal.
- `storage/` — placeholder only. Uploaded content is kept outside the application/web root by default.

## Status

The system is under development pending top management guidance and approval. The suggested departments are a first phase and more can be added. Staff and Top Management each have 15 modules; HOD and Student panels each have the 16 modules listed in the proposal. Campus and HOD management, role-scoped records, groups, practical assignments, guides, past papers, ZIP submissions and code previews, grades, logbooks, manual attendance, announcements, requests, and direct messages are connected to MySQL.

## Technical direction

- Database access uses MySQLi prepared statements (`mysqli`) with strict exceptions; this project does not use PDO. Database errors are written to the PHP/server error log while the interface shows a safe, readable message.
- Database IDs remain internal so records keep their relationships. Staff and students choose people, assignments, groups, requests and departments by readable names and student numbers; they do not need to look up or type record IDs.
- The interface is built with project-owned CSS and JavaScript. It does not load Bootstrap; shared styles use the login form's Rockview green and gold palette.

## Setup requirements

- PHP 8.1 or newer with `mysqli`, `fileinfo`, and `ZipArchive` enabled.
- MySQL 8.0 or newer. See `database/README.md` for schema import and account setup.
- Configure `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, and `DB_PASSWORD` for the MySQL connection.
- Set `SLPS_PRIVATE_STORAGE` to a writable directory outside the web root. The default is a sibling directory named `slps-private` beside the project folder.
- Configure SMTP using the supported `SMTP_*` and `AUTH_MAIL_FROM` environment settings to send registration and HOD account emails.
- Mail is sent through `authentication/api/email.php`, with settings in `authentication/api/emailsetup.php`; direct requests to both files are blocked. Follow [`docs/GMAIL_SMTP_SETUP.md`](docs/GMAIL_SMTP_SETUP.md) for Gmail SMTP setup on XAMPP or production hosting.
- Signed-in users can message any active SLPS account. Shared department files are private to the department and visible to its students and assigned HODs; staff can upload to their assigned department and administrators can select a department.

Some proposal integrations need service credentials or hosting support before production use: Firebase push delivery, a third-party AI model, QR code generation/scanning, and automated database backup. SLPS stores in-system notifications and attendance; these integrations are not represented as configured when their credentials are absent. Do not expose the private file-storage directory through a web server.

The database is MySQL. Passwords are stored as hashes; plain-text account passwords are not embedded in this package.


## Code Online
The Groups navigation entry now opens Code Online. See docs/CODE_ONLINE_SETUP.md for runtime discovery, runner authorization/self-hosting and server configuration. Public execution requires access approval; an anonymous test returned HTTP 401. No new database migration is needed for Code Online.

## Students Projects update

Analytics now opens Students Projects. Before using it on an existing installation, import `database/migrations/20261015_student_projects.sql`. Enable PHP ZIP, verify HTTP 403 protection for the bundled storage/private directory, and read `docs/STUDENT_PROJECTS_SETUP.md`. RAR extraction additionally requires PECL rar. Existing submission/assignment records remain separate.
