Part intro's, modals between parts and some fixes

This commit is contained in:
Carlos Mesquita
2024-08-20 18:52:38 +01:00
parent 3299acee36
commit 505df31d6b
19 changed files with 907 additions and 708 deletions

View File

@@ -19,6 +19,7 @@ export interface ExamState {
questionIndex: number;
inactivity: number;
shuffleMaps: ShuffleMap[];
bgColor: string;
}
export interface ExamFunctions {
@@ -37,6 +38,7 @@ export interface ExamFunctions {
setQuestionIndex: (questionIndex: number) => void;
setInactivity: (inactivity: number) => void;
setShuffleMaps: (shuffleMaps: ShuffleMap[]) => void;
setBgColor: (bgColor: string) => void;
reset: () => void;
}
@@ -55,7 +57,8 @@ export const initialState: ExamState = {
exerciseIndex: -1,
questionIndex: 0,
inactivity: 0,
shuffleMaps: []
shuffleMaps: [],
bgColor: "bg-white"
};
const useExamStore = create<ExamState & ExamFunctions>((set) => ({
@@ -76,6 +79,7 @@ const useExamStore = create<ExamState & ExamFunctions>((set) => ({
setQuestionIndex: (questionIndex: number) => set(() => ({questionIndex})),
setInactivity: (inactivity: number) => set(() => ({inactivity})),
setShuffleMaps: (shuffleMaps) => set(() => ({shuffleMaps})),
setBgColor: (bgColor) => set(()=> ({bgColor})),
reset: () => set(() => initialState),
}));