/Blockchain-Quiz-Website

This is a Blockchain Quiz Website made by using HTML, JS, CSS and Blockchain technologies such as Solidity and Truffle. This is in collaboration with Lian Rebello and Vivek Pinto and was done as our Blockchain Mini Project

Primary LanguageJavaScriptMIT LicenseMIT

Blockchain-Quiz-Website

This is a blockchain quiz website made by using HTML, JS, CSS and Blockchain technologies such as Solidity and Truffle.

This Readme Contains

Introduction

The ability to take the quiz anytime and anywhere is provided by our quiz application. The user doesn't have to wait for the result since it's displayed once he/she answers one question thus time is saved. All users/students get the correct answer after he/she has answered. We have created a blockchain-based solution that enables students to complete online quiz without worrying about their privacy or security. HTML and CSS are used to construct user interfaces, and JavaScript and Solidity are used to execute and deploy smart contracts. The user can see how many have chosen which answer without knowing who chose what. Once the user answers a question, he/she cannot answer it again. The score of correct answers is displayed at the end.

Technologies Used:

  • NodeJs
  • Solidity
  • Truffle
  • HTML
  • CSS
  • Javascript
  • Ganache (For testing ethers)
  • Metamask

Steps to Run

  • We first install all the prerequisites ie. NodeJs, Metamask, Truffle (Note: Truffle has to be downloaded by running the command 'npm install -g truffle' in the terminal)
  • Open ganache. It gives us ten accounts for development purposes.
  • Connect Metamask to Ganache Network (Note: If first time then click on the add network option and then click add a new network manually. RPC Server Id will be in Ganache. Chain id should be 1337. currency will be ETH).
  • Then import account in metamask from ganache (Note: Click on the key icon besides the account to get the private key).
  • In the terminal type 'truffle migrate --reset' (Note: If for this step you are getting error 'cannot be loaded because running scripts is disabled on this system.' then
  1. Open PowerShell as an administrator. Right-click on the PowerShell icon and select "Run as administrator."

  2. In the PowerShell window, run the following command to check the current execution policy:

    Get-ExecutionPolicy

  3. If the execution policy is set to "Restricted" or "AllSigned," it means that PowerShell scripts are blocked by default. To change the execution policy, run the following command:

    Set-ExecutionPolicy Unrestricted

  4. You will be prompted to confirm the change. Type Y and press Enter.

  5. After changing the execution policy, try running the script again.)

  • Then type 'npm run dev' to run it
  • Check metamask and see whether the account is connected to the website. If it's not connected, connect it by clicking on the 'connect site manually' option and then refresh

Activity Diagram

Screenshots

Capture0 Capture1 Capture2 Capture3 Capture4 Capture5 Capture6 Capture7

References