# Past Papers and Past Paper Solutions

Copy updated source files, preserve live environment configuration and private uploads, then Ctrl+F5. No additional SQL migration is needed for this feature: it uses existing past_papers and file_assets records.

Past Papers now displays compact course cards with course code, exam year, semester and solution availability. Search by course/department and filter by year. Past Paper Solutions replaces the Requests navigation entry and displays linked worked solutions with the same design. Existing request records and backend handlers remain preserved; the old Requests page URL now opens the solutions library. HOD and student navigation also includes Solutions.

Open paper or Open solution launches the dedicated reader within the authenticated portal. PDFs use the browser PDF toolbar for pages, zoom and printing. DOCX uses a safe text-only reader and requires PHP ZIP and XML; original page layout, tables and images are available by downloading the document. Legacy DOC cannot be previewed and offers a clear download fallback; publish PDF for the complete reader experience. Source documents remain private and access is checked for each request. No document is sent to external viewer services.

Assigned HODs retain their Upload paper form, including an optional solution. Administrators and authorised HODs can Publish solution for an existing paper; the selector can be searched by course, code or year. Replacing a solution checks its previous ID to prevent overwriting a concurrent publication. Students and staff cannot publish solutions. Existing department access rules remain; HOD paper access additionally checks the paper asset campus. Students see their department papers and solutions. Libraries show up to 300 most recent accessible papers.

Checks passed: PHP syntax, card search/filter tests, solutions-only listings, in-system PDF routes, safe DOCX text rendering and Student Projects/Collaborations UI regressions. Live database authorization, uploads and PDF/browser rendering require verification on your server. Test command: node tests/papers_ui.cjs.
