Skip to content

Commit 32b3a72

Browse files
committed
Display Question
1 parent 2c3e5b8 commit 32b3a72

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/App.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,34 @@ function App() {
1515
return <Loading></Loading>;
1616
}
1717

18-
return <main>quiz</main>;
18+
const { correct_answer, incorrect_answers, question } = questions[index];
19+
const answers = [...incorrect_answers, correct_answer];
20+
21+
return (
22+
<main>
23+
{/* <Modal></Modal> */}
24+
<section className="quiz">
25+
<p className="correct-answers">
26+
correct answers : {correct}/{index}
27+
</p>
28+
<article className="container">
29+
<h2 dangerouslySetInnerHTML={{ __html: question }}></h2>
30+
<div className="btn-container">
31+
{answers.map((answer, index) => {
32+
return (
33+
<button
34+
key={index}
35+
className="answer-btn"
36+
dangerouslySetInnerHTML={{ __html: answer }}
37+
></button>
38+
);
39+
})}
40+
</div>
41+
</article>
42+
<button className="next-question">next question</button>
43+
</section>
44+
</main>
45+
);
1946
}
2047

2148
export default App;

0 commit comments

Comments
 (0)