Outline

This is our blog for code.org 3 question quiz. fruit quiz 4 different choices, 1 correct answer, for each question. getting a correct answer will play a nice sound if a question is wrong you will be brought to a screen that tells you that your wrong, and can move on to the next question. At the end of the quiz will be 2 buttons. one writes the player's score, and the other allows the player to retake the quiz. fruit image at the start image corresponding with each choice display score at the end question 1: what color is an apple? answer: red wrong: orange wrong: blue wrong: purple question 2: when were bananas discovered? answer: 327 BC wrong: 1999 wrong: 1782 wrong: 2020 BC question 3: which one is not a fruit? answer: mushroom wrong: tomato wrong: melon wrong: strawberry struggles: adding the ability to see score at the end of the quiz was challenging, as we hadn't worked with javascript before and were confused by what to do, but eventually got it with a variable that adds onto itself each time the correct answer is selected. Working with code.org sometimes felt frustrating, as it was sometimes slower to use blocks than to type out code, but it is useful for learning javascript, as it gives us everything we need to start with. no need to look up things.

what

onEvent("button1", "click", function() {
  setScreen("screen2");
});
var x = 0;
onEvent("button3", "click", function( ) {
  x = x+1;
  setScreen("screen4");
  playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3");
});
onEvent("button4", "click", function( ) {
  setScreen("screen3");
});
onEvent("button2", "click", function( ) {
  setScreen("screen3");
});
onEvent("button5", "click", function( ) {
  setScreen("screen3");
});
onEvent("button13", "click", function( ) {
  setScreen("screen6");
  playSound("sound://category_achievements/peaceful_win_8.mp3");
  x = x+1;
});
onEvent("button7", "click", function( ) {
  setScreen("screen5");
  playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3");
  x = x+1;
});
onEvent("button6", "click", function( ) {
  setScreen("screen4");
});
onEvent("button15", "click", function( ) {
  setScreen("screen5");
});
onEvent("button10", "click", function( ) {
  setScreen("screen7");
});
onEvent("button16", "click", function( ) {
  setScreen("screen5");
});
onEvent("button12", "click", function( ) {
  setScreen("screen8");
});
onEvent("button14", "click", function( ) {
  setScreen("screen8");
});
onEvent("button11", "click", function( ) {
  setScreen("screen8");
});
onEvent("button16", "click", function( ) {
  setScreen("screen6");
  playSound("sound://category_achievements/peaceful_win_2.mp3");
});
onEvent("button17", "click", function( ) {
  write("you got " + (x + " right"));
});
onEvent("button9", "click", function( ) {
  setScreen("screen7");
});
onEvent("button8", "click", function( ) {
  setScreen("screen7");
});
onEvent("retake", "click", function( ) {
  setScreen("screen1");
});