Add state for last skipped question in QuizRunner
This commit is contained in:
@@ -224,6 +224,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
|
|||||||
const [response, setResponse] = useState<any>(null);
|
const [response, setResponse] = useState<any>(null);
|
||||||
const [showResult, setShowResult] = useState(false);
|
const [showResult, setShowResult] = useState(false);
|
||||||
const [lastCorrect, setLastCorrect] = useState(false);
|
const [lastCorrect, setLastCorrect] = useState(false);
|
||||||
|
const [lastSkipped, setLastSkipped] = useState(false);
|
||||||
const [showExplanation, setShowExplanation] = useState(false);
|
const [showExplanation, setShowExplanation] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
@@ -248,6 +249,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
|
|||||||
setResponse(null);
|
setResponse(null);
|
||||||
setShowResult(false);
|
setShowResult(false);
|
||||||
setLastCorrect(false);
|
setLastCorrect(false);
|
||||||
|
setLastSkipped(false);
|
||||||
setShowExplanation(false);
|
setShowExplanation(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -319,6 +321,7 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
|
|||||||
setScore((s) => s + 1);
|
setScore((s) => s + 1);
|
||||||
}
|
}
|
||||||
setLastCorrect(correct);
|
setLastCorrect(correct);
|
||||||
|
setLastSkipped(skip);
|
||||||
setShowResult(true);
|
setShowResult(true);
|
||||||
setShowExplanation(!correct);
|
setShowExplanation(!correct);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user