Made it so when the timer ends, the module ends
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import {Module} from "@/interfaces";
|
||||
import {Exam, UserSolution} from "@/interfaces/exam";
|
||||
import {Stat} from "@/interfaces/user";
|
||||
import {create} from "zustand";
|
||||
|
||||
export interface ExamState {
|
||||
exams: Exam[];
|
||||
userSolutions: UserSolution[];
|
||||
showSolutions: boolean;
|
||||
hasExamEnded: boolean;
|
||||
selectedModules: Module[];
|
||||
setHasExamEnded: (hasExamEnded: boolean) => void;
|
||||
setUserSolutions: (userSolutions: UserSolution[]) => void;
|
||||
setExams: (exams: Exam[]) => void;
|
||||
setShowSolutions: (showSolutions: boolean) => void;
|
||||
@@ -20,6 +21,7 @@ export const initialState = {
|
||||
userSolutions: [],
|
||||
showSolutions: false,
|
||||
selectedModules: [],
|
||||
hasExamEnded: false,
|
||||
};
|
||||
|
||||
const useExamStore = create<ExamState>((set) => ({
|
||||
@@ -28,6 +30,7 @@ const useExamStore = create<ExamState>((set) => ({
|
||||
setExams: (exams: Exam[]) => set(() => ({exams})),
|
||||
setShowSolutions: (showSolutions: boolean) => set(() => ({showSolutions})),
|
||||
setSelectedModules: (modules: Module[]) => set(() => ({selectedModules: modules})),
|
||||
setHasExamEnded: (hasExamEnded: boolean) => set(() => ({hasExamEnded})),
|
||||
reset: () => set(() => initialState),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user