Refactor components to remove Layout wrapper and pass it in the App component , implemented a skeleton feedback while loading page and improved API calls related to Dashboard/User Profile
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { Module } from "@/interfaces";
|
|
import { InstructorGender } from "./exam";
|
|
import { Stat } from "./user";
|
|
|
|
export type UserResults = { [key in Module]: ModuleResult };
|
|
|
|
interface ModuleResult {
|
|
exams: string[];
|
|
score: number;
|
|
total: number;
|
|
}
|
|
|
|
export interface AssignmentResult {
|
|
user: string;
|
|
type: "academic" | "general";
|
|
stats: Stat[];
|
|
}
|
|
|
|
export interface Assignment {
|
|
id: string;
|
|
name: string;
|
|
assigner: string;
|
|
assignees: string[];
|
|
results: AssignmentResult[];
|
|
exams: { id: string; module: Module; assignee: string }[];
|
|
instructorGender?: InstructorGender;
|
|
startDate: Date;
|
|
endDate: Date;
|
|
teachers?: string[];
|
|
archived?: boolean;
|
|
released?: boolean;
|
|
// unless start is active, the assignment is not visible to the assignees
|
|
// start date now works as a limit time to start the exam
|
|
start?: boolean;
|
|
autoStart?: boolean;
|
|
entity?: string;
|
|
}
|
|
|
|
export type AssignmentWithCorporateId = Assignment & { corporateId: string };
|
|
|
|
export type AssignmentWithHasResults = Assignment & { hasResults: boolean };
|