Interactive Frontend Quiz App

Solution retrospective
What I’m Most Proud Of:
- Dynamic Question Handling: The showQuestion() function effectively updates the displayed question and options based on the current question index.
- Answer Validation: The logic in submitButton.addEventListener('click', ...) for checking the selected answer and providing visual feedback (correct/incorrect icons)
What I’d Do Differently Next Time:
- Improve Event Delegation
- Improve mobile responsiveness
-
Handling Dynamic Data for Questions: I structured the question data into separate objects for each subject (stored in questionSets) and used event listeners on subject buttons to trigger the startQuiz() function, dynamically updating the questions and category-related content based on the selected subject.
-
Preventing User from Skipping Questions: I added validation in the submitButton click handler to check if an answer was selected. If no option was selected, a warning message was shown, ensuring that the user had to make a selection before moving forward.
Handling Text Overflow in Buttons. Some answer buttons have long text, especially on mobile.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Kumanan Eswaran's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord