This is a post used by me(Lucas) and my parther Aniket to plan our code.org quiz. Creating the quiz will help me understand how to use block code and how code is used to make apps. This blog includes the quiz's topic, format, questions, and the right and wrong answers for the questions made before I started coding. This blog will have the link to the AppLap quiz, the quiz's code, and also talk about the successes, discoveries, and challenges that occurred during the coding process.

Quiz Topic

Fortnite Battle Royale

Format

The quiz will start with a screen of its topic(fortnite) and show a "Start Quiz" button. Once that is pressed, the questions will be given. The quiz will have a total of 3 multiple choiced questions. Each of the questions will have their own screen that will display the correct answer along with 3 incorrect answers. All the choices provided will be matched with an image. The person taking the quiz will need to read the question than click on the image that fixs it. If the correct answer is clicked, a screen will tell them they choice the right answer and to continue to the next question by clicking the "continue" button. It will also add a point to their score that will be displayed at the end of the quiz. If an incorrect answer is clicked, a screen will tell them they choice the wrong answer and to continue to the next question by clicking the "continue" button. After answering all three questions, the final screen will congratulate the quiz player and show them their score.

Questions with the right and wrong answers

What is the most popular location in fortnite battle royale?

  • Correct answer: tilted towers
  • Wrong answers: loot lake, saltly springs, greasy grove.

What is the strongest material in fortnite battle royale?

  • Correct answer: Metal
  • Wrong answers: Wood, Brick, Glass.

What item heals you for full health and shield.

  • Correct answer: Chug Jug,
  • Wrong answers: med-kit, shield pot, slurp fish.

Code

Presented in Javascript Code

var score;                                     //creates the variable to keep track of score
score = 0;                                     //sets the variable to 0
onEvent("StartQuiz", "click", function( ) {    // an action that allows the app to continue
  setScreen("Question1");                      // changes the screen as the result of an action
});
onEvent("tilted", "click", function( ) {
  setScreen("correct1");                      // tells the user that their answer is correct
  score = score + 1;                          // changes the score variable by +1
});
onEvent("continue1", "click", function( ) {
  setScreen("Question2");
});
onEvent("GreasyGrove", "click", function( ) {
  setScreen("incorrect1");                   // tells the user that their answer is incorrect
});
onEvent("SaltlySpring", "click", function( ) {
  setScreen("incorrect1");
});
onEvent("lootlake", "click", function( ) {
  setScreen("incorrect1");
});
onEvent("continue1.1", "click", function( ) {
  setScreen("Question2");
});
onEvent("metal", "click", function( ) {
  setScreen("correct2");
  score = score + 1;
});
onEvent("continue2", "click", function( ) {
  setScreen("Question3");
});
onEvent("wood", "click", function( ) {
  setScreen("incorrect2");
});
onEvent("brick", "click", function( ) {
  setScreen("incorrect2");
});
onEvent("glass", "click", function( ) {
  setScreen("incorrect2");
});
onEvent("Continue2.1", "click", function( ) {
  setScreen("Question3");
});
onEvent("chugjug", "click", function( ) {
  setScreen("correct3");
  score = score + 1;
});
onEvent("continue3", "click", function( ) {
  if (score == 3) {                         // if statement is affected by the score variable
    setScreen("Finished3");                 // each score has their own finish screen
  }
  if (score == 2) {
    setScreen("Finished2");
  }
  if (score == 1) {
    setScreen("Finished1");
  }
  if (score == 0) {
    setScreen("Finished0");
  }
});
onEvent("medkit", "click", function( ) {
  setScreen("incorrect3");
});
onEvent("slurpfish", "click", function( ) {
  setScreen("incorrect3");
});
onEvent("shieldPot", "click", function( ) {
  setScreen("incorrect3");
});
onEvent("continue3.1", "click", function( ) {
  if (score == 3) {
    setScreen("Finished3");
  }
  if (score == 2) {
    setScreen("Finished2");
  }
  if (score == 1) {
    setScreen("Finished1");
  }
  if (score == 0) {
    setScreen("Finished0");
  }
});

Success

The greatest success for me was me being able to easily understand how to make a quiz using block code. The code was basic which resulted in less complex work while also allowing it to be very clear to understand. The next time I use block code, I will remember that it is not too complicated and that I could try to import new ideas into my future codes with more ease.

Discoveries

  • I discovered that block coding and coding done in programs like python are very similar. This has allowed me to look at coding differently. Seeing line code simplified into blocks makes line code look easier to create.
  • I found out that the functions needed to create this quiz were very repetitive which made the coding process take less time. If I create another quiz like the one made here, I will use the same functions in order to have more time to create new ones.
  • Code.org explains what each of their blocks does by hovering over a block with the mouse. This has helped me whenever I got stuck.

Challenges

  • While planning out the quiz with my parter, we were struggling to come up with a topic and then struggled to come up with quesitons for the topic. Thankfully, we got through that stage quickly and were able to get started on code.org. This taught me to choice a larger topic to focus on as it is easier to pull infomation from it.
  • During the coding process, I had trouble trying to display the score variable. I solved this by having each possible score output display its own screen. While this solution worked, I bielieve that there could have been another way that was easier. In the future, I will always make sure I choice the better solution and not just take the first one I find.

To summarize, this project has taught me much about block coding and that knowledge has enhanced my understand of code as a whole but I still have a lot to learn.