Solved another bug with the TrueFalse
This commit is contained in:
@@ -30,7 +30,7 @@ interface Props {
|
||||
|
||||
export default function ExamPage({page}: Props) {
|
||||
const [hasBeenUploaded, setHasBeenUploaded] = useState(false);
|
||||
const [moduleIndex, setModuleIndex] = useState(-1);
|
||||
const [moduleIndex, setModuleIndex] = useState(0);
|
||||
const [sessionId, setSessionId] = useState("");
|
||||
const [exam, setExam] = useState<Exam>();
|
||||
const [isEvaluationLoading, setIsEvaluationLoading] = useState(false);
|
||||
@@ -64,6 +64,10 @@ export default function ExamPage({page}: Props) {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [selectedModules.length]);
|
||||
|
||||
useEffect(() => {
|
||||
if (showSolutions) setModuleIndex(-1);
|
||||
}, [showSolutions]);
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
if (selectedModules.length > 0 && exams.length > 0 && moduleIndex < selectedModules.length) {
|
||||
|
||||
Reference in New Issue
Block a user