File tree 2 files changed +5
-13
lines changed
2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,6 @@ export default function App() {
10
10
const [ showAnswer , setShowAnswer ] = useState ( false )
11
11
const userAnswers = useRef ( [ ] )
12
12
13
- function checkAnswers ( ) {
14
- setShowAnswer ( true )
15
- }
16
-
17
13
function handleAnswers ( hold , correct , index ) {
18
14
if ( hold . choice === correct && ! hold . hold ) {
19
15
userAnswers . current [ index ] = 'Correct'
@@ -62,7 +58,10 @@ export default function App() {
62
58
{ questionsElement }
63
59
< div className = 'check-answers-container' >
64
60
{ ! showAnswer ? (
65
- < button onClick = { checkAnswers } className = 'check-answer' >
61
+ < button
62
+ onClick = { ( ) => setShowAnswer ( true ) }
63
+ className = 'check-answer'
64
+ >
66
65
Check Answers
67
66
</ button >
68
67
) : (
@@ -79,7 +78,7 @@ export default function App() {
79
78
{
80
79
userAnswers . current . filter ( ( correct ) => correct === 'Correct' )
81
80
. length
82
- } { ' ' }
81
+ }
83
82
/ { questions . length }
84
83
</ h2 >
85
84
) : null }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments