Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
b843b96
Rework at-risk page layout
k2the4 Aug 29, 2026
b7559f6
Add at-risk page layout styling
k2the4 Aug 29, 2026
d68afee
Polish At Risk layout and controls
k2the4 Aug 29, 2026
4e9083b
Fix At Risk filters, chart interaction, and status labels
k2the4 Aug 29, 2026
9176da6
Polish At Risk filter layout and chart controls
k2the4 Aug 29, 2026
a844ec3
Fix At Risk table JSX syntax
k2the4 Aug 29, 2026
c680c2f
Refine At Risk top students and filter layout
k2the4 Aug 29, 2026
9489d64
Align At Risk filter controls
k2the4 Aug 29, 2026
8eeb56a
Fix At Risk score color consistency
k2the4 Aug 29, 2026
40f2e4e
Fix at-risk filter sizing and excellent status color
k2the4 Aug 29, 2026
09fe7b7
Fix attendance trend metric and at-risk apply flow
k2the4 Aug 29, 2026
5bff14d
Fix academic table controls, colors, and apply behavior
k2the4 Aug 29, 2026
5ba8940
Fix overall basic and moderated mark colors
k2the4 Aug 29, 2026
9ab2dde
Redesign teacher dashboard
k2the4 Aug 29, 2026
670405d
Seed ECE batches and semester subjects
k2the4 Aug 29, 2026
8036e69
Reuse legacy ECE 7th-semester class in seed
k2the4 Aug 29, 2026
bb4ffdb
Add complete ECE batch curriculum seed
k2the4 Aug 29, 2026
a0c545f
Add teacher-scoped subject analysis chooser
k2the4 Aug 29, 2026
4041419
Fix subject analysis class scoping
k2the4 Aug 29, 2026
f14de4e
Route dashboard Subject Analysis through teacher chooser
k2the4 Aug 29, 2026
30803ab
test assignment update
k2the4 Aug 29, 2026
80ae7f4
Assign Geetanjali to six ECE classes
k2the4 Aug 29, 2026
a807061
Add theory and lab subject types
k2the4 Aug 29, 2026
e43dbcc
Seed ECE faculty and theory/lab subjects
k2the4 Aug 29, 2026
2cab1bc
Fix Geetanjali ECE 2 Sem 7 assignment
k2the4 Aug 29, 2026
958180a
Run Geetanjali assignment fix after seed
k2the4 Aug 29, 2026
8d1cea0
Seed ECE 2 Sem 7 students
k2the4 Aug 29, 2026
4fcd085
Run ECE 2 Sem 7 student seed
k2the4 Aug 29, 2026
c86f263
Merge main ClassPulse updates
k2the4 Aug 29, 2026
7af9380
Add themed Class Analysis class selector
k2the4 Aug 30, 2026
d8faa96
Use ECE-2 class naming in Subject Analysis
k2the4 Aug 30, 2026
e2a7046
Route legacy class analysis URLs through selector
k2the4 Aug 30, 2026
b739f76
Fix dashboard Class Analysis navigation to selector
k2the4 Aug 30, 2026
3681809
Restore existing Class Analysis experience after selector
k2the4 Aug 30, 2026
c49b117
Fix class analysis routing to existing section analysis
k2the4 Aug 30, 2026
3360489
Fix Class Analysis section routing and authorization
k2the4 Aug 30, 2026
318c692
Restore working section analysis route
k2the4 Aug 30, 2026
a831390
Route class analysis to authorized section
k2the4 Aug 30, 2026
c31f65b
Resolve class and section IDs for analysis access
k2the4 Aug 30, 2026
ae1862b
style class analysis like subject analysis shell
k2the4 Aug 30, 2026
9dd4ed6
remove unused analysis nav import
k2the4 Aug 30, 2026
ee12cb0
Restyle class attendance analysis to match Subject Analysis theme
k2the4 Aug 30, 2026
d76ff1f
Match Class Analysis sidebar and navbar to Subject Analysis theme
k2the4 Aug 30, 2026
39244e9
Fix Class Analysis shell spacing to match Subject Analysis
k2the4 Aug 30, 2026
e370238
Match Class Analysis view spacing to Subject Analysis
k2the4 Aug 30, 2026
784f3ef
Fix class-to-section analysis authorization resolution
k2the4 Aug 30, 2026
d0ee096
Fix class analysis routing to use class IDs
k2the4 Aug 30, 2026
081ac1f
Make class analysis navbar match subject analysis
k2the4 Aug 30, 2026
d8aa249
Copy subject analysis structure to class analysis attendance
k2the4 Aug 30, 2026
c1a69d3
Match class academic layout to subject analysis
k2the4 Aug 30, 2026
6edb5d0
Add combined academic view to class analysis
k2the4 Aug 30, 2026
6303bcc
Add combined academic score and sort filters
k2the4 Aug 30, 2026
2a8d266
Fix max score basis for combined grading
k2the4 Aug 30, 2026
4ed2c9f
Add performance grade column to class combined view
k2the4 Aug 30, 2026
ff72a4f
Keep class academic table columns and add combined grade
k2the4 Aug 30, 2026
d806529
Widen class academic table to avoid horizontal scrolling
k2the4 Aug 30, 2026
d0ed585
Load academic table layout fix
k2the4 Aug 30, 2026
1749a35
Fix class academic table layout
k2the4 Aug 30, 2026
f6efd9e
Restore class academic grade column and vertical table scroll
k2the4 Aug 30, 2026
fcd9bd0
Fix class academic grade column visibility
k2the4 Aug 30, 2026
104febe
Fix combined class academic maximum
k2the4 Aug 30, 2026
0940ed1
Add rank column when sorting class academic data
k2the4 Aug 30, 2026
b6eb501
Add class overall at-risk analysis view
k2the4 Aug 31, 2026
6e0e359
Fix class overall analysis chart markup
k2the4 Aug 31, 2026
bec0765
Fix class analysis overall authorization
k2the4 Aug 31, 2026
196bc95
Add Raw Data to analysis sidebars
k2the4 Aug 31, 2026
7472640
Fix class-level analysis authorization
k2the4 Aug 31, 2026
d50324d
Fix class overall routing authorization
k2the4 Aug 31, 2026
30ca4a3
Match class overall shell to subject analysis
k2the4 Aug 31, 2026
72eb2fc
Limit class overall analysis to six theory subjects
k2the4 Aug 31, 2026
b038f8f
Fix class overall at-risk subjects, totals, limits and mark colors
k2the4 Aug 31, 2026
a06f715
Fix class overall JSX build error cleanly
k2the4 Aug 31, 2026
7107eb5
Fix overall filter to use average marks
k2the4 Aug 31, 2026
a8b35fd
Redesign student report page
k2the4 Aug 31, 2026
221623c
Polish student report data binding
k2the4 Aug 31, 2026
b7a1e4d
Fix student report internal mark data
k2the4 Aug 31, 2026
4a232a0
Redesign Class Analysis student report
k2the4 Aug 31, 2026
c072199
Refine student report header and internal marks table
k2the4 Aug 31, 2026
c2306df
Remove overlapping search icon from student report
k2the4 Aug 31, 2026
8cf02b2
Improve academic student table columns and spacing
k2the4 Aug 31, 2026
c6d49ba
Refine Midsem student table layout
k2the4 Aug 31, 2026
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
11 changes: 7 additions & 4 deletions app/globals.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 23 additions & 41 deletions components/AnalysisNav.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
import Link from "next/link";
import { useRouter } from "next/router";
import { BarChart3, FileText, GraduationCap, LayoutDashboard } from "lucide-react";

type Props = {
sectionId: string;
};
type Props = { sectionId: string };

const items = [
{ label: "Attendance", icon: BarChart3, path: "attendance" },
{ label: "Academic", icon: GraduationCap, path: "academic" },
{ label: "Overall", icon: LayoutDashboard, path: "overall" },
{ label: "Student Report", icon: FileText, path: "students" },
];

export default function AnalysisNav({ sectionId }: Props) {
const router = useRouter();

const items = [
{
label: "Attendance",
href: `/section-analysis/${sectionId}/attendance`,
},
{
label: "Academic",
href: `/section-analysis/${sectionId}/academic`,
},
{
label: "Overall",
href: `/section-analysis/${sectionId}/overall`,
},
{
label: "Student Report",
href: `/section-analysis/${sectionId}/students`,
},
];

return (
<nav className="flex gap-1 border-b border-gray-200 mb-8 overflow-x-auto">
{items.map((item) => {
const active = router.asPath === item.href;

return (
<Link
key={item.href}
href={item.href}
className={`px-4 py-3 text-sm whitespace-nowrap border-b-2 transition-colors ${
active
? "border-gray-900 text-gray-900 font-medium"
: "border-transparent text-gray-500 hover:text-gray-900"
}`}
>
{item.label}
</Link>
);
})}
<nav className="subject-analysis-nav" aria-label="Class analysis sections">
<div className="subject-analysis-nav__rail">
{items.map(({ label, icon: Icon, path }) => {
const href = `/section-analysis/${sectionId}/${path}`;
const active = router.pathname.endsWith(`/${path}`);
return (
<Link key={path} href={href} className={`subject-analysis-nav__item ${active ? "is-active" : ""}`}>
<Icon size={17} strokeWidth={1.8} />
<span>{label}</span>
</Link>
);
})}
</div>
</nav>
);
}
}
13 changes: 11 additions & 2 deletions components/AnalysisWidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ export function RawDataButton({ sheetId }: { sheetId: string | null }) {
return;
}

if (!window.location.pathname.startsWith("/subject-analysis/")) return;
// Class Analysis uses its own sidebar markup, so attach Raw Data to the
// same navigation by locating its Class Analysis link.
const classAnalysisLink = document.querySelector<HTMLElement>('nav a[href="/class-analysis"]');
const classAnalysisNav = classAnalysisLink?.closest("nav") as HTMLElement | null;
if (classAnalysisNav) {
setSideNav(classAnalysisNav);
return;
}

if (!window.location.pathname.startsWith("/subject-analysis/") && !window.location.pathname.startsWith("/section-analysis/")) return;

const root = document.querySelector<HTMLElement>("#\\_\\_next > div.min-h-screen.max-w-\\[1900px\\]")
|| document.querySelector<HTMLElement>("div.min-h-screen.max-w-\\[1900px\\]")
Expand Down Expand Up @@ -78,7 +87,7 @@ export function RawDataButton({ sheetId }: { sheetId: string | null }) {
</div>
<nav className="analysis-side-nav analysis-standalone-nav">
<a href="/dashboard"><LayoutDashboard size={18} />Dashboard</a>
<a href="/classes"><BookOpen size={18} />Class Analysis</a>
<a href="/class-analysis"><BookOpen size={18} />Class Analysis</a>
<a className="is-active" href={window.location.pathname}><GraduationCap size={18} />Subject Analysis</a>
{rawLink}
</nav>
Expand Down
22 changes: 10 additions & 12 deletions lib/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,18 @@ export async function assertTeacherCanViewClass(userId: string, role: string, cl
return !!teaches;
}

// Section access: the class proctor, or anyone teaching a subject within
// this specific section.
// Section-based analysis pages are used by Class Analysis, whose purpose is
// to show the complete class/section view across all subjects. A teacher who
// has access to the class (as proctor or by teaching any subject in it) must
// therefore be allowed to open the section analysis pages as well.
export async function assertTeacherCanViewSection(userId: string, role: string, sectionId: string) {
if (role === "ADMIN") return true;
const section = await prisma.section.findUnique({ where: { id: sectionId } });
const section = await prisma.section.findUnique({ where: { id: sectionId }, select: { classId: true } });
if (!section) return false;
return assertTeacherCanViewClass(userId, role, section.classId);
}

const proctorMatch = await prisma.class.findFirst({
where: { id: section.classId, proctorId: userId },
});
if (proctorMatch) return true;

const teaches = await prisma.assignment.findFirst({
where: { teacherId: userId, subject: { sectionId } },
});
return !!teaches;
// Kept as an explicit alias for class-level overall analysis callers.
export async function assertTeacherCanViewOverall(userId: string, role: string, sectionId: string) {
return assertTeacherCanViewSection(userId, role, sectionId);
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "next start",
"prisma:migrate": "prisma migrate dev",
"prisma:studio": "prisma studio",
"seed": "ts-node prisma/seed.ts"
"seed": "ts-node prisma/seed.ts && ts-node prisma/fix-geetanjali-assignments.ts && ts-node prisma/seed-ece2-sem7-students.ts"
},
"dependencies": {
"@prisma/client": "^5.18.0",
Expand All @@ -35,6 +35,6 @@
"wait-on": "^9.1.0"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"
"seed": "ts-node prisma/seed.ts && ts-node prisma/fix-geetanjali-assignments.ts && ts-node prisma/seed-ece2-sem7-students.ts"
}
}
1 change: 1 addition & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import GlobalButtonLoading from "../components/GlobalButtonLoading";
import "../styles/globals.css";
import "../app/globals.css";
import "../styles/overall-analysis-fixes.css";
import "../styles/academic-table-fix.css";

export default function App({ Component, pageProps: { session, ...pageProps } }: AppProps) {
return (
Expand Down
Loading