Improved a bit more of the responsiveness and solved a bug
This commit is contained in:
@@ -57,13 +57,13 @@ export default function Page() {
|
||||
const [sessionId, setSessionId] = useState("");
|
||||
const [exam, setExam] = useState<Exam>();
|
||||
const [isEvaluationLoading, setIsEvaluationLoading] = useState(false);
|
||||
const [showAbandonPopup, setShowAbandonPopup] = useState(false);
|
||||
|
||||
const [exams, setExams] = useExamStore((state) => [state.exams, state.setExams]);
|
||||
const [userSolutions, setUserSolutions] = useExamStore((state) => [state.userSolutions, state.setUserSolutions]);
|
||||
const [showSolutions, setShowSolutions] = useExamStore((state) => [state.showSolutions, state.setShowSolutions]);
|
||||
const [selectedModules, setSelectedModules] = useExamStore((state) => [state.selectedModules, state.setSelectedModules]);
|
||||
const [showAbandonPopup, setShowAbandonPopup] = useState(false);
|
||||
const setHasExamEnded = useExamStore((state) => state.setHasExamEnded);
|
||||
const reset = useExamStore((state) => state.reset);
|
||||
|
||||
const {user} = useUser({redirectTo: "/login"});
|
||||
|
||||
@@ -330,8 +330,7 @@ export default function Page() {
|
||||
abandonPopupDescription="Are you sure you want to leave the exercise? You will lose all your progress."
|
||||
abandonConfirmButtonText="Confirm"
|
||||
onAbandon={() => {
|
||||
setExam(undefined);
|
||||
setSelectedModules([]);
|
||||
reset();
|
||||
setShowAbandonPopup(false);
|
||||
}}
|
||||
onCancel={() => setShowAbandonPopup(false)}
|
||||
|
||||
@@ -60,12 +60,13 @@ export default function Page() {
|
||||
const [sessionId, setSessionId] = useState("");
|
||||
const [exam, setExam] = useState<Exam>();
|
||||
const [isEvaluationLoading, setIsEvaluationLoading] = useState(false);
|
||||
const [showAbandonPopup, setShowAbandonPopup] = useState(false);
|
||||
|
||||
const [exams, setExams] = useExamStore((state) => [state.exams, state.setExams]);
|
||||
const [userSolutions, setUserSolutions] = useExamStore((state) => [state.userSolutions, state.setUserSolutions]);
|
||||
const [showSolutions, setShowSolutions] = useExamStore((state) => [state.showSolutions, state.setShowSolutions]);
|
||||
const [selectedModules, setSelectedModules] = useExamStore((state) => [state.selectedModules, state.setSelectedModules]);
|
||||
const [showAbandonPopup, setShowAbandonPopup] = useState(false);
|
||||
const reset = useExamStore((state) => state.reset);
|
||||
|
||||
const {user} = useUser({redirectTo: "/login"});
|
||||
|
||||
@@ -332,8 +333,7 @@ export default function Page() {
|
||||
abandonPopupDescription="Are you sure you want to leave the exercise? You will lose all your progress."
|
||||
abandonConfirmButtonText="Confirm"
|
||||
onAbandon={() => {
|
||||
setExam(undefined);
|
||||
setSelectedModules([]);
|
||||
reset();
|
||||
setShowAbandonPopup(false);
|
||||
}}
|
||||
onCancel={() => setShowAbandonPopup(false)}
|
||||
|
||||
Reference in New Issue
Block a user