Next, drag the pick random from 1 to 10 from the Operators section into the 0 spot in the set number to 0 block. Change the 10 to 3. This will mean that a random number between 1 and 3 will be picked. Now drag a say block from the Looks section and place it under the other blocks. “Hello!” Then drag the number block from the Data section into the part of the say block. “Hello!” Your scripts should now look like the image below: When you run the program, the cat will say a message this number!” and then say a “Tap random number. If you try this a few times, you’ll notice that this random number changes each time. Handling Input The next step is to add sound effects that play when you press one of the buzzers. To upload these, click on the Sounds tab, highlighted in the image below: Click the upload file button, which looks like this: , and a dialog for uploading the file will open. Upload the and files from the resources zip file “correct_answer.wav” “wrong_answer.wav” you downloaded earlier. You should see these sound clips appear in the Sounds menu, under the sound clip. “meow” Now, return to the Scripts tab. From the Control section, drag a wait until block and place it at the bottom of your blocks (after the say number block). Place a in the block’s slot. On the key pressed? wait until key pressed?, “space” “space” select from the dropdown (where is). The bottom 2 blocks should now look “any” “space” like this: We are now to add blocks that will decide whether the player has pressed the correct buzzer. To do this, we need to use if then else blocks. These blocks are used to run different blocks, depending on some condition. In this quiz we want to check the random number that has been generated (for example, 1) and check whether the player has pressed the correct buzzer.
Next, drag the pick random from 1 to 10 from the Operators section into the 0 spot in the set number to 0 block. Change the 10 to 3. This will mean that a random number between 1 and 3 will be picked. Now drag a say “Hello!” block from the Looks section and place it under the other blocks. Then drag the number block from the Data section into the “Hello!” part of the say block. Your scripts should now look like the image below: When you run the program, the cat will say a message “Tap this number!” and then say a random number. If you try this a few times, you’ll notice that this random number changes each time. Handling Input The next step is to add sound effects that play when you press one of the buzzers. To upload these, click on the Sounds tab, highlighted in the image below: Click the upload file button, which looks like this: , and a dialog for uploading the file will open. Upload the “correct_answer.wav” and “wrong_answer.wav” files from the resources zip file you downloaded earlier. You should see these sound clips appear in the Sounds menu, under the “meow” sound clip. Now, return to the Scripts tab. From the Control section, drag a wait until block and place it at the bottom of your blocks (after the say number block). Place a key “space” pressed? in the wait until block’s slot. On the key “space” pressed?, select “any” from the dropdown (where “space” is). The bottom 2 blocks should now look like this: We are now to add blocks that will decide whether the player has pressed the correct buzzer. To do this, we need to use if then else blocks. These blocks are used to run different blocks, depending on some condition. In this quiz we want to check the random number that has been generated (for example, 1) and check whether the player has pressed the correct buzzer.
quiz_activity.docx