-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented submit-feature #341
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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({ | |
/> | ||
</div> | ||
{activeQuestion && renderAnswers(activeQuestion, buttons)} | ||
<div style={{display:'flex', justifyContent: 'space-between'}}> | ||
{ | ||
!endQuiz? | ||
<div style={{ display: 'flex',marginRight:'auto'}}> | ||
Comment on lines
+463
to
+466
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use inline styles |
||
<button | ||
onClick={() => {submitQuiz()}} | ||
style={{ display: 'flex', justifyContent: 'center', backgroundColor: 'green',color:'white' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use inline styles |
||
className="quitQuizBtn btn" | ||
type="button" | ||
> | ||
Submit | ||
</button> | ||
</div> | ||
:null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. simply use |
||
} | ||
{(showNextQuestionButton || allowNavigation) && ( | ||
<div className="questionBtnContainer"> | ||
{allowNavigation && currentQuestionIndex > 0 && ( | ||
|
@@ -477,6 +496,7 @@ function Core({ | |
</button> | ||
</div> | ||
)} | ||
</div> | ||
</> | ||
) : ( | ||
<span className="timerPauseScreen dark:text-white text-black"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code is same as
handleTimeUp
. don't duplicate it. revise the function and use for both case.