Quiz API

Liked this post? Share with others!

Personal Project - Quiz API

During my Grade 12 studies, one of my assessments involved creating a website that connected to the Open Trivia API (https://opentdb.com). For the user interface, I designed a child-friendly, game-like appearance with a green theme to make the experience engaging and approachable.

The website’s functionality was built around sending requests to the Open Trivia Database API for a set number of questions, tailored by difficulty or category. Once the JSON data was received, it dynamically presented questions to the user. At the end of the quiz, the results were added to a scoreboard.

To enhance the user experience, the project also included a login system, ensuring that each user’s scores were tied to their individual account. This feature provided a personal and competitive element to the platform.

How the code works

To link the scoreboard to each user, I utilized Microsoft’s ASP Application Users package. This allowed me to integrate a simple user authentication system, where each user’s score was securely tied to their account. Whenever a user logged in, their scores were fetched from the database, ensuring that their progress was always saved and accessible.

When displaying the scoreboard, I ensured fairness by implementing filters for both categories and difficulty levels. This way, users could compare their scores within the same category and difficulty, making the leaderboard more competitive and balanced. For instance, a user who completed a quiz on science questions at a hard difficulty wouldn’t unfairly compete with someone who completed an easy-level sports quiz. The filtering system made sure that comparisons were meaningful and relevant, enhancing the overall gaming experience.

This project not only helped me strengthen my coding skills but also gave me the opportunity to integrate various essential web development techniques like API integration, user authentication, and dynamic data handling. Building this trivia website was a great exercise in creating an engaging, functional platform while ensuring smooth user interactions. As I continue to build my portfolio, this project remains one of my favorites, showcasing both my technical abilities and my attention to user experience.

Subscribe to our newsletter

Collect visitor’s submissions and store it directly in your Elementor account, or integrate your favorite marketing & CRM tools.

Do you want to boost your business today?

This is your chance to invite visitors to contact you. Tell them you’ll be happy to answer all their questions as soon as possible.