Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/public/OU-IPMS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions client/src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ function Layout() {
<div className="App">
<header className="app-header">
<div className="logo-container">
<img src="/OU-Logo.svg" alt="OU Logo" className="ou-logo" />
<h1 style={{ marginLeft: "-25px" }}>IPMS</h1>
<img src="/OU-IPMS.png" alt="OU Logo" className="ou-logo" />
</div>
<nav className="main-nav">
<ul>
Expand Down Expand Up @@ -45,4 +44,4 @@ function Layout() {
);
}

export default Layout;
export default Layout;
353 changes: 353 additions & 0 deletions client/src/pages/A4PresentationEvaluationForm.jsx

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions client/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React from "react";
import { createBrowserRouter } from "react-router-dom";
import A1InternshipRequestForm from "./pages/A1InternshipRequestForm";


// Layout
import Layout from "./components/Layout";

Expand All @@ -14,6 +13,7 @@ import NotFound from "./pages/NotFound";
import WeeklyProgressReportForm from "./pages/WeeklyProgressReportForm";
import A3JobEvaluationForm from "./pages/A3JobEvaluationForm";
import ActivateAccount from "./pages/ActivateAccount";
import A4PresentationEvaluationForm from "./pages/A4PresentationEvaluationForm";
import SupervisorDashboard from "./pages/SupervisorDashboard";
import CoordinatorDashboard from "./pages/CoordinatorDashboard";

Expand Down Expand Up @@ -48,6 +48,10 @@ const router = createBrowserRouter([
path: "activate/:token",
element: <ActivateAccount />,
},
{
path: "presentation",
element: <A4PresentationEvaluationForm />,
},
{
path: "supervisor-dashboard",
element: <SupervisorDashboard />,
Expand All @@ -60,5 +64,4 @@ const router = createBrowserRouter([
},
]);


export default router;
11 changes: 2 additions & 9 deletions client/src/styles/A3JobEvaluationForm.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
/* Custom color for checked Bootstrap radio button */
/* .form-check-input:checked {
background-color: #9d2235;
border-color: #9d2235;
accent-color: #9d2235;
} */

.custom-table input[type="radio"]:checked {
background-color: #9d2235;
border-color: #9d2235;
box-shadow: 0 0 0 1px #9d2235;
}



.custom-table thead th {
color: white !important;
background-color: #9d2235
Expand Down Expand Up @@ -53,6 +46,6 @@
justify-content: center;
flex-direction: column;
align-items: center;
min-height: 100vh;
min-height: 80vh;
padding: 10px;
}
4 changes: 2 additions & 2 deletions client/src/styles/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ body {
}

.ou-logo {
width: 60px;
width: auto;
height: auto;
margin-right: 15px;
}
Expand Down Expand Up @@ -529,4 +529,4 @@ select.form-control {
.illustration {
display: none;
}
}
}
5 changes: 5 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ app.post("/api/evaluation", async (req, res) => {
}
});

//Form A.4

const presentationRoutes = require("./routes/presentationRoutes");
app.use("/api/presentation", presentationRoutes);


// Graceful shutdown (async Mongoose support)
process.on("SIGINT", async () => {
Expand Down
57 changes: 57 additions & 0 deletions server/models/PresentationEvaluation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const mongoose = require("mongoose");

const signatureSchema = new mongoose.Schema({
type: { type: String, enum: ["text", "draw"], required: true },
value: { type: String, required: true },
font: { type: String } // used only if type is 'text'
}, { _id: false });

const evaluationItemSchema = new mongoose.Schema({
category: {
type: String,
required: true,
enum: ["Presentation Content", "Delivery and Communication", "Answering Questions"]
},
rating: {
type: String,
enum: ["Satisfactory", "Unsatisfactory"],
required: true
},
comment: {
type: String,
default: ""
}
}, { _id: false });

const presentationEvaluationSchema = new mongoose.Schema({
interneeName: { type: String, required: true },
interneeID: { type: String, required: true }, // Sooner ID (9-digit)
interneeEmail: { type: String, required: true },

companyName: { type: String, required: true },
companyWebsite: { type: String },
companyPhone: { type: String },

advisorName: { type: String, required: true },
advisorTitle: { type: String, required: true },
advisorEmail: { type: String, required: true },

presentationDate: { type: Date, required: true },

evaluations: {
type: [evaluationItemSchema],
validate: [arr => arr.length === 3, "All 3 evaluation categories must be filled"]
},

coordinatorSignature: {
type: signatureSchema,
required: true
},

submittedAt: {
type: Date,
default: Date.now
}
});

module.exports = mongoose.model("PresentationEvaluation", presentationEvaluationSchema);
32 changes: 32 additions & 0 deletions server/routes/presentationRoutes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const express = require("express");
const router = express.Router();
const PresentationEvaluation = require("../models/PresentationEvaluation");

// POST: Submit Form A.4
router.post("/a4/submit", async (req, res) => {
try {
const data = req.body;
const newRecord = new PresentationEvaluation(data);
await newRecord.save();
res.status(201).json({ message: "Form A.4 submitted successfully!" });
} catch (error) {
console.error("Error saving A.4:", error);
res.status(500).json({ error: "Failed to save Form A.4" });
}
});

// GET: Fetch A.4 form by Internee Email (or Sooner ID)
router.get("/a4/find", async (req, res) => {
try {
const { interneeEmail, interneeID } = req.query;
const filter = interneeEmail ? { interneeEmail } : { interneeID };
const record = await PresentationEvaluation.findOne(filter);
if (!record) return res.status(404).json({ message: "No Form A.4 found" });
res.json(record);
} catch (error) {
console.error("Error retrieving A.4:", error);
res.status(500).json({ error: "Failed to fetch Form A.4" });
}
});

module.exports = router;