JSFiddle - React, Tailwind, and code Playground

by Matheus Loures

HTML

<body>

  <div id="topbar">Quiz</div>
  <div class="spacer"></div>

  <div id="navContent">

    <div id="game1">
    </div>


    <div id="game2">
    </div>
 

  </div>




</body>

CSS

html,
body {
  margin: 0;
  padding: 0;
  background: grey;
  font-family: Arial, Helvetica, sans-serif;
}

#navContent {
  margin: auto;
  width: 800px;
  height: 400px;
  position: relative;
  overflow: hidden;
}

#game1 {
  margin: auto;
  width: 800px;
  height: 400px;
  right: 0px;
  position: absolute;
}

#game2 {
  margin: auto;
  width: 800px;
  height: 400px;
  right: -800px;
  position: absolute;
}

.questionText {
  font-size: 27px;
  color: #FFF;
}

.option {
  width: 400px;
  height: 30px;
  margin: 15px;
  font-size: 18px;
  color: #FFFFFF;
  padding: 2px;
  padding-left: 10px;
  border: 2px solid white;
  cursor: pointer;
  background-color: #3399FF;
}

.option:hover {
  border: #FC0 solid 2px;
  color: #FC0;
}

#topbar {
  height: 50px;
  margin: auto;
  margin-top: 50px;
  color: #FFF;
  font-size: 36px;
  font-family: Arial, Helvetica, sans-serif;
  width: 800px;
  border-bottom: solid white 1px;
}

.spacer {
  height: 30px;
}

.feedback1 {
  width: 150px;
  padding: 5px;
  font-size: 30px;
  color: #FFFFCC;
  background-color: #009900;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

.feedback2 {
  width: 150px;
  padding: 5px;
  font-size: 30px;
  color: #FFFFCC;
  background-color: #CC3300;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
}

JavaScript

$(document).ready(function() {

  var questionNumber = 0;
  var wordNumber = 0;
  var questionBank = new Array();
  var wordsBank = new Array();
  var stage = "#game1";
  var stage2 = new Object;
  var questionLock = false;
  var numberOfQuestions;
  var score = 0;

  var data = {
    "quizlist": [

      {
        "question": "How much is two plus two?",
        "option1": "Four",
        "option2": "Five",
        "option3": "Two",
      }, {
        "question": "Selecione a sentença correta",
        "option1": "I am a person",
        "option2": "I is a person",
        "option3": "I are a person",

      }, {
        "question": "Select the correct form in the interrogative",
        "option1": "Are you a student?",
        "option2": "Is you a student?",
        "option3": "You are a student?",
   
      }, {
        "question": "How much is one minus one?",
        "option1": "Zero",
        "option2": "Two",
        "option3": "Four",
      }, {
        "question": "He / She / It usam o verbo To Be ...",
        "option1": "is",
        "option2": "are",
        "option3": "am",
      }, {
        "question": "Selecione a frase correta na afirmativa",
        "option1": "We are here.",
        "option2": "Are we here.",
        "option3": "We are not here.",
      }, {
        "question": "Selecione a forma correta na negativa",
        "option1": "He is not here.",
        "option2": "He is not here?",
        "option3": "He are not here.",
      }, {
        "question": "You / We / They usam o Verbo To Be ...",
        "option1": "are",
        "option2": "am",
        "option3": "is",
      }

    ]
  };
  numberOfQuestions = data.quizlist.length;
  for (i = 0; i < numberOfQuestions; i++) {
    questionBank[i] = [];
    questionBank[i].push(data.quizlist[i].question);
    questionBank[i].push(data.quizlist[i].option1);
    questionBank[i].push(data.quizlist[i].option2);
    questionBank[i].push(data.quizlist[i].option3);
  }



  displayQuestion();
 ...