Fruit_quiz
question1: what color the apple have? 
answer: red 
wrong: blue
wrong: purple
wrong: orange
when were bananas discovered?
answer: 327 BC
wrong: 1997
wrong: 1792
wrong 2020 BC
what one is a fruit? 
answer: strawberries
wrong: melon
wrong: tomato
wrong: strawberries

If answer is wrong, there is one chance to redo and if there is two incorrect, the player cannot take the quiz. If player solve the question with at least one incorrect, they can retake the quiz.
var total = 0;
var i = 1;
function myFunction() {
  onEvent("button1", "click", function( ) {
  setScreen("screen2");
    });
  onEvent("button2", "click", function( ) {
  setScreen("screen4");
    });
  onEvent("button3", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button4", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button5", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button6", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button7", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button9", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button8", "click", function( ) {
  setScreen("screen5");
    });
  onEvent("button10", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button11", "click", function( ) {
  setScreen("screen7");
    });
  onEvent("button12", "click", function( ) {
  setScreen("screen6");
    });
  onEvent("button13", "click", function( ) {
  setScreen("screen7");
    });
}
function games() {
  onEvent("button1", "click", function( ) {
    setScreen("screen2");
  });
  onEvent("button2", "click", function( ) {
    setScreen("screen4");
    total = total + 1;
  });
  onEvent("button3", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen2");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button4", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen2");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button5", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen2");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button6", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen4");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button7", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen3");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button9", "click", function( ) {
    onEvent("button15", "click", function( ) {
      setScreen("screen3");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button8", "click", function( ) {
    setScreen("screen5");
    total = total + 1;
  });
  onEvent("button10", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen5");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button11", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen5");
      myFunction();
      total = total - 1;
    });
  });
  onEvent("button12", "click", function( ) {
    setScreen("screen6");
    total = total + 1;
  });
  onEvent("button13", "click", function( ) {
    setScreen("screen3");
    onEvent("button15", "click", function( ) {
      setScreen("screen5");
      myFunction();
      total = total - 1;
    });
  });
}
games();
onEvent("button2", "click", function( ) {
  playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3", false);
});
onEvent("button8", "click", function( ) {
  playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3", false);
});
onEvent("button12", "click", function( ) {
  playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3", false);
});
onEvent("button14", "click", function( ) {
  write("you got" + total);
});
onEvent("button16", "click", function( ) {
  setScreen("screen1");
  total = 0;
  games();
});