Part and MC question grid jump to, has a bug on next going to refactor the whole thing
This commit is contained in:
@@ -20,6 +20,7 @@ export interface ExamState {
|
||||
inactivity: number;
|
||||
shuffles: Shuffles[];
|
||||
bgColor: string;
|
||||
currentSolution?: UserSolution | undefined;
|
||||
}
|
||||
|
||||
export interface ExamFunctions {
|
||||
@@ -39,6 +40,7 @@ export interface ExamFunctions {
|
||||
setInactivity: (inactivity: number) => void;
|
||||
setShuffles: (shuffles: Shuffles[]) => void;
|
||||
setBgColor: (bgColor: string) => void;
|
||||
setCurrentSolution: (currentSolution: UserSolution | undefined) => void;
|
||||
reset: () => void;
|
||||
}
|
||||
|
||||
@@ -58,7 +60,8 @@ export const initialState: ExamState = {
|
||||
questionIndex: 0,
|
||||
inactivity: 0,
|
||||
shuffles: [],
|
||||
bgColor: "bg-white"
|
||||
bgColor: "bg-white",
|
||||
currentSolution: undefined
|
||||
};
|
||||
|
||||
const useExamStore = create<ExamState & ExamFunctions>((set) => ({
|
||||
@@ -80,6 +83,7 @@ const useExamStore = create<ExamState & ExamFunctions>((set) => ({
|
||||
setInactivity: (inactivity: number) => set(() => ({inactivity})),
|
||||
setShuffles: (shuffles: Shuffles[]) => set(() => ({shuffles})),
|
||||
setBgColor: (bgColor) => set(() => ({bgColor})),
|
||||
setCurrentSolution: (currentSolution: UserSolution | undefined) => set(() => ({currentSolution})),
|
||||
|
||||
reset: () => set(() => initialState),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user