feat(test): add jump to question functionality

This commit is contained in:
shafin-r
2026-01-29 18:30:55 +06:00
parent 5df438f474
commit 57f27ed399
6 changed files with 184 additions and 24 deletions

View File

@ -34,6 +34,7 @@ interface SatExamState {
startExam: () => void;
nextQuestion: () => void;
prevQuestion: () => void;
goToQuestion: (index: number) => void;
startBreak: () => void;
skipBreak: () => void;
@ -82,6 +83,15 @@ export const useSatExam = create<SatExamState>()(
}
},
goToQuestion: (index: number) =>
set((state) => {
const total = state.currentModuleQuestions?.questions.length ?? 0;
if (index < 0 || index >= total) return state;
return { questionIndex: index };
}),
startBreak: () => {
const endTime = Date.now() + BREAK_DURATION * 1000;