Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Interactive Frontend Quiz App

Kumanan Eswaran•160
@KumananEswaran
A solution to the Frontend Quiz app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

What I’m Most Proud Of:

  1. Dynamic Question Handling: The showQuestion() function effectively updates the displayed question and options based on the current question index.
  2. 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:

  1. Improve Event Delegation
  2. Improve mobile responsiveness
What challenges did you encounter, and how did you overcome them?
  1. 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.

  2. 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.

What specific areas of your project would you like help with?

Handling Text Overflow in Buttons. Some answer buttons have long text, especially on mobile.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License