MyQuiz is a simple, beginner-friendly Solidity smart contract that stores and verifies users' quiz results on-chain. It saves each user's highest score with a timestamp so results are transparent, tamper-proof, and publicly verifiable.
This repository is ideal for newcomers learning how to write, deploy, and interact with smart contracts using Remix and MetaMask.
Github Project Link : https://github.com/soumik-27/MyQuiz
The mission of MyQuiz is to provide a simple, secure, and transparent way to store quiz results on the blockchain. By recording only each user’s highest score along with a timestamp, the project ensures results are tamper-proof and publicly verifiable. MyQuiz aims to make learning data trustworthy and easily accessible through a beginner-friendly smart contract.
There is a need for a simple blockchain-based system that allows users to store their quiz results in a transparent, tamper-proof, and publicly verifiable way. Traditional systems store quiz scores off-chain, which can be manipulated or hidden, and they often do not keep reliable records of users' best performance.
The solution to the problem of securely storing quiz results is implemented through a simple and efficient Solidity smart contract named MyQuiz. This contract leverages blockchain technology to ensure that all stored data is transparent, tamper-proof, and permanently recorded. Unlike traditional centralized databases, this on-chain system prevents unauthorized modifications, making every user's quiz performance fully trustworthy.
The contract allows users to submit their quiz scores, but instead of storing every attempt, it saves only the highest score achieved by each user. This design ensures efficiency while still highlighting every user’s best performance. Whenever a user submits a score, the contract checks if the new score is higher than the previously stored one. If it is, the contract updates the score and records the timestamp of the update, creating a reliable history of when the user last achieved their best result.
To maintain transparency, all stored scores and timestamps are publicly accessible. Anyone can query the contract using a wallet address and instantly view the best score and the date it was recorded. This removes the possibility of hidden or manipulated results and ensures that all quiz achievements are always verifiable by anyone on the network.
Additionally, the contract emits a ScoreSubmitted event each time a higher score is recorded. These events can be monitored by user interfaces or analytics tools, allowing front-end applications to update dashboards or leaderboards in real-time. This makes the contract not only secure and transparent but also efficient for building interactive Web3 applications.
Overall, the MyQuiz smart contract offers a robust, beginner-friendly, and decentralized solution to storing quiz results. By combining immutability, public verifiability, and event-driven updates, it ensures that users’ top performances are accurately recorded and accessible, fulfilling the need for trustworthy on-chain quiz data storage.