From 3fdf5f5d67199af9b7d33361d8d9f11999b2a81f Mon Sep 17 00:00:00 2001 From: Rohith Kumar Date: Sat, 5 Oct 2024 00:05:50 +0530 Subject: [PATCH] Implemented submit-feature --- src/lib/Core.jsx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lib/Core.jsx b/src/lib/Core.jsx index ddd145c..2baf36c 100644 --- a/src/lib/Core.jsx +++ b/src/lib/Core.jsx @@ -368,7 +368,11 @@ function Core({ formatTime(seconds) }${seconds}`; }; - + const submitQuiz = () => { + setIsRunning(false); + setEndQuiz(true); + getUnansweredQuestions(); + } const handleTimeUp = () => { setIsRunning(false); setEndQuiz(true); @@ -456,6 +460,21 @@ function Core({ /> {activeQuestion && renderAnswers(activeQuestion, buttons)} +
+ { + !endQuiz? +
+ +
+ :null + } {(showNextQuestionButton || allowNavigation) && (
{allowNavigation && currentQuestionIndex > 0 && ( @@ -477,6 +496,7 @@ function Core({
)} +
) : (