Gradebook: classes, weighted grading, assignments, grades, student role
- Migration: student role, students.user_id, grade_categories/grade_scale (school defaults + per-class override), assignments, grades + RLS - Classes area (nav): list/create classes, class page with Gradebook / Roster / Grading setup tabs; teachers see their classes, admins all - Weighted-category grade calc -> letter scale (shared helper) - Roster assignment (admin), assignment + grade entry (teacher/admin) - Student profile: view-only Grades tab (parents/students) - Portal access: create parent OR student logins linked to the student Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import { useEffect, useState } from "react";
|
||||
import type { User } from "@supabase/supabase-js";
|
||||
import { supabase } from "@/integrations/supabase/client";
|
||||
|
||||
export type Role = "admin" | "teacher" | "parent";
|
||||
export type Role = "admin" | "teacher" | "parent" | "student";
|
||||
|
||||
export interface AuthState {
|
||||
user: User | null;
|
||||
@@ -52,5 +52,6 @@ export function highestRole(roles: Role[]): Role | null {
|
||||
if (roles.includes("admin")) return "admin";
|
||||
if (roles.includes("teacher")) return "teacher";
|
||||
if (roles.includes("parent")) return "parent";
|
||||
if (roles.includes("student")) return "student";
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user