Make a Quiz in Scratch.

About this lesson

This lesson will help you code a quiz program for your users!

Step 1
Add a new Sprite that will host the quiz!

Step 2
Add this code to create your first question:

Step 3
Now, add this code. It will forever ask the question until the user types the correct answer.

Step 4
Add this code too. If the user types the correct answer, the game will say "Correct!", or else it will say "Try Again".

Step 5
Now combine the previous two steps into one chunk of code. Also, add a "When Green Flag Clicked" block. Like this:

Step 6
So far, your program should function like this:

Step 7
Let's add a message block here (We are setting up the code to switch scenes when the user types the correct answer).

Step 8
Rename this message to "Go_scene1". Play video:

Step 9
Add a new backdrop.

Step 10
Add this code to the BACKDROP.

Step 11
Awesome Job! Your program should look like this. Next, let's add a second question!

Step 12
Great! Let's add a new sprite. We will ask the user to guess what bug this is.

Step 13
Add this code to the bug. We will show it when we are at Scene 1.

Step 14
Click on your main sprite.

Step 15
Let's add this code to the main sprite. This will be our second question. It will be asked when the user gets to Scene 1

Step 16
Great! Now, add this code to the main character, too.

Step 17
Awesome! Now, assemble the previous two steps into one block of code. Like this:

Step 18
Good. Now, create a new message block that says "Go_scene2". Place it in the 'if /else' statement. Like this:

Step 19
Let's hide the beetle when Scene 2 comes. Like this:

Make a Quiz in Scratch. Info

Account

MVCode Clubs

Created By

matie

Access Level

public

For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach