More navigation bugs and fixed broken modal during transition
This commit is contained in:
@@ -75,10 +75,10 @@ const useExamNavigation: UseExamNavigation = ({
|
||||
|
||||
// when navbar is used
|
||||
useEffect(()=> {
|
||||
if(startNow && partIndex !== 0) {
|
||||
if(startNow && !showPartDivider && partIndex !== 0) {
|
||||
setStartNow(false);
|
||||
}
|
||||
} , [partIndex, startNow])
|
||||
} , [partIndex, startNow, showPartDivider])
|
||||
|
||||
useEffect(() => {
|
||||
if (!showSolutions && hasDivider(exam, isPartExam ? partIndex : exerciseIndex) && !seenParts.has(partIndex)) {
|
||||
@@ -161,8 +161,7 @@ const useExamNavigation: UseExamNavigation = ({
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(modalBetweenParts);
|
||||
if (modalBetweenParts && !answeredEveryQuestion(exam as PartExam, userSolutions) && !keepGoing && setShowBlankModal && !showSolutions && !preview) {
|
||||
if (modalBetweenParts && !seenParts.has(partIndex + 1) && !answeredEveryQuestion(exam as PartExam, userSolutions) && !keepGoing && setShowBlankModal && !showSolutions && !preview) {
|
||||
if (modalKwargs) modalKwargs();
|
||||
setShowBlankModal(true);
|
||||
return;
|
||||
@@ -197,7 +196,7 @@ const useExamNavigation: UseExamNavigation = ({
|
||||
|
||||
const previousPartExam = () => {
|
||||
|
||||
if (partIndex === 0 && exerciseIndex === 0 && !startNow) {
|
||||
if (!showPartDivider && partIndex === 0 && exerciseIndex === 0 && questionIndex === 0 && !startNow) {
|
||||
setStartNow(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user