Loading...
Hello, my name is Ms. Powell and welcome to Computing.
I'm so pleased that you decided to join me today.
In today's lesson, we're going to be learning how to make our own quiz programme following our own design.
Let's get started.
Welcome to today's lesson from the unit "Building sequences in programmes." This lesson is called "Designing and creating a quiz programme." And by the end of today's lesson, you'll be able to create a quiz programme from a design.
We'll be using these keywords through today's lesson.
The first word is design.
Design, a plan for what you want your programme to do.
The next word is algorithm.
Algorithm, a precise set of ordered steps that a human or computer can follow to complete a task.
Lesson outline, designing and creating a quiz programme.
Today's lesson is split into two sections.
In the first section, we'll look at designing a programme.
And in the second section, we'll have a go at building a programme.
Let's get started with the first section, designing a programme.
In this lesson you'll be designing and then making your own quiz programme.
Watch this video of a quiz.
I'll play it now.
<v Instructor>This is a quiz question programme.
</v> The first question is, which animal is taller? If I press on the snake, let's see what happens.
Oh, I got it wrong.
Let's see what happens when I press on the pig.
It says, "Yes," I got it right.
Onto the next question.
This question reads, which animal can fly? Let's see what happens when I press on the dog.
Oh, I got it wrong.
What about the bat? It said, "Yes," I got it right, and now it's back to the beginning of the programme.
<v ->This design was followed to make a quiz in ScratchJr.
</v> Let's take a look at it together.
What do you notice here in the design? I can see in the first step there's a question asked.
The first question is, which animal is taller? It looks like that happens on the farm background.
There are two sprites, a snake and pig, on that page.
Step four, let's look at the algorithm.
So the question was, which animal is taller? We have a snake and a pig animal.
The pig is circled and the algorithm says tap, say "Yes," change page.
The pig is the taller animal.
The algorithm for the snake says tap, say "No," hide, and end.
The snake is not taller.
It hides and the programme ends.
Let's look at the second question.
Which animal can fly? This happens on the beach background and there are two sprites, a bat and a dog.
The bat is circled.
If you think of the question, which animal can fly? The bat is circled and the dog is not.
The bat is the correct answer.
The algorithm says tap, say "Yes," and change page for the bat.
For the dog, it says start on tap, say "No," hide, and end.
The dog is the incorrect answer for that question.
In today's lesson, you can decide what your quiz will be about.
The player will answer questions by tapping a sprite.
Let's look at this question.
Which of these animals comes first in the alphabet? I can see that I've got two animals here.
There's a zebra and a monkey.
The first letter for zebra is Z, and the first letter for monkey is M.
What do you think? What would be the correct answer? Which of these animals comes first in the alphabet? Pause the video and have a think.
Let's tap on the monkey.
The monkey comes first in the alphabet.
The monkey says, "Yes." That answer is correct.
After a correct answer, the quiz will take the player to a new page where there'll be a new question.
Let's look at this question together.
Who has the most legs? If I'm looking at my sprites here, I can see I've got two alien sprites.
Which one has the most legs? Pause the video and see if you can work that out.
I'm going to tap on the orange sprite.
This sprite says, "Yes." It does have the most legs.
Well done for having a try.
Here's Sam.
Sam's thinking of a question for his quiz.
Sam says, "My question will be, which animal can fly?" Sam has two sprites here on his page.
There's a bird and a camel.
What do you think would be the correct answer to this question? Pause the video and have a think.
Let's tap on the bird.
The bird says, "Yes." That's the correct answer to Sam's question.
This is Jacob, and Jacob has a question.
"My question will be, which animal is taller?" Jacob has two animals here, a snake and a pig.
Which animal do you think we should tap on to get the correct answer? Pause the video and have a think.
I'm gonna tap on the pig, I think the pig is the taller animal.
The pig says, "Yes." That was the correct answer for the question.
This is the design for this quiz.
It is where you'll record your ideas for your programme.
First, you'll write down the question that we'll use for the first page.
Can you see this space there in step one for your question? This is Jacob's question.
"My question is, which animal is taller?" Next, record the background and sprites you're going to use.
Use two sprites for each question.
Circle the sprite that is the correct answer.
This is Jacob's design.
Jacob says, "I will use the farm background and the snake and pig sprites." He's filled that information out on his design template.
The pig is the right answer, so I'll circle it.
If you think about Jacob's question, which animal is taller? Is it the snake or the pig? Jacob has circled pig.
That's the right answer for his question.
You need to write an algorithm for each sprite.
Think about your quiz question and what you want to happen when the player taps on a sprite.
Let's tap on the snake.
The snake says, "No." It is not the taller animal.
So my algorithm would be start on tap, say "No," hide, and then end.
For the incorrect answer, the sprite should say "No," then the sprite should hide and the programme should end.
When you tap on the snake, it should say "No" and hide.
The programme should then stop.
That's because the snake is the incorrect answer.
The snake is not the taller animal.
Here's the algorithm.
Start on tap, say "No," hide, end the programme.
For the correct answer, the sprite should say "Yes," then the quiz should go to the next page.
Jacob says, "When you tap on the pig, it should say 'Yes.
' Then the quiz should change to the next page." Let's tap on the pig.
The pig says, "Yes," it's the correct answer, so my algorithm would be start on tap, say "Yes," change page.
Well done.
That's fantastic listening.
I'd like your help.
True or false? An algorithm is a command block that you use when creating a programme.
What do you think? Is that true or false? Pause the video and have a think.
The answer is false.
Why is that? An algorithm is a precise set of ordered steps that a human or computer can follow to complete a task.
What do you want your sprite to do when it is tapped on? Remember your question.
Let's go back to our design.
The question is, which animal is taller? So for my pick, I want my sprite to say "Yes" and I want the page to change.
But for my snake, I want my snake to say "No" and then I want it to hide and the programme to end.
Think about your ideas for the rest of the design and the second page.
You should have a different question for your second page.
Here's Jacob, and Jacob's finishing his design.
"For my next question, I will ask, which animal can fly?" This is happening on the beach background.
Jacob has two sprites, a bat and a dog.
Which of those can fly? Jacob has circled bat.
That's the correct answer.
Jacob's algorithm is start on tap, say "Yes," and change page.
The dog cannot fly, it's the incorrect answer to Jacob's question.
The algorithm for the dog is start on tap, say "No," hide, and the programme will end.
If you have any other ideas for your quiz, you can add them into your algorithm.
I'd love for you to experiment.
For example, you might want to use the Gets Bigger command.
Perhaps your sprite could get bigger before hiding.
I need your help.
What do you think the answer could be to this question? True or false? You should start coding without a design.
Is that true or is that false? Pause the video to have a think.
The answer is false.
Did you think that? Why is that? Without a clear design, your programme might not do what you expect it to do.
Well done for having a try at this question.
Now it's time to do our task.
I'd like you to record your design.
You must include two quiz questions.
For example, who lives here? Which of these animals comes first in the alphabet? Which animal's name has the most letters? Who has the most legs? I'd like you to include two backgrounds, two sprites per page, and an algorithm for each sprite.
Don't forget to record your design for the quiz programme using the template that we've done together.
Pause the video to complete the task.
Well done, you've done really well recording your design for your quiz programme.
You've probably got a really good idea now of how you're going to programme your sprites.
Does your design look a little bit like mine? I bet we've got some really interesting quiz programmes, I can't wait to see them.
Well done, you've done so well designing and creating a quiz programme.
Let's now move on to the second section of the lesson where we get to build a programme.
Let's jump in.
Build a programme.
Which command blocks will you need for your quiz programme? Pause the video and have a think.
You will definitely need these.
Start on Tap, Say block, Hide block, Change Page block, and the End block.
You may use other blocks in your programme to make it more interesting.
These will be ideas that you've included in your algorithm in the design.
I need your help.
Start on Tap is an example of.
Do you think, A, an event block; B, a motion block; or C, a looks block.
Pause the video and choose an answer.
Did you get A, an event block? Start on Tap is a block that will trigger an event to start.
Well done for having a go.
What do you think this sequence will do? If we look at the blocks, we can read them from left to right, just like a sentence, and try to work out what they'll do.
What do you see here? It looks like we've got the Start on Tap block, then a Say block next to it, the Hide block, and the End block.
Pause the video to see if you can work out what the blocks will do.
When the sprite is tapped, it will say "No" in a speech bubble, then hide so it cannot be tapped again.
The programme will then stop.
Well done for having a try.
What do you think this sequence will do? Let's look at the blocks.
How many do you see there? I can see five blocks.
The first looks like Start on Tap.
The second is a Say block.
We've got a Turn block, and another Turn block.
Finally, a Change Page block.
What do you think this sequence will do? Pause the video and have a think.
When the sprite is tapped, it will say "Yes" in a speech bubble, then wiggle side to side like it's dancing.
The background will then change.
Those Turn blocks will make it look like it's wiggling and dancing.
I think that's very funny.
Well done.
What do you think this block will do? Pause the video to have a guess.
This is a green Sound block.
It has a speaker icon on it.
When you trigger it, a sound will play.
I wonder what sound will play for this block.
It looks as if it says "Pop." What do you think this sequence will do? Let's read our blocks from left to right and see if we can work it out.
Looks like we've got the Start on Tap block, a Say block, a Sound block, and an End block.
What do you think will happen when the programme is run? When the sprite is tapped, it will say "No" in a speech bubble, then a pop sound will play.
The programme will then end.
Is that what you thought? Well done for having a try.
What do you think this block is? A, a motion block.
B, an event block.
Or C, a sound block.
Can you remember what it's called? Pause the video and have a guess.
Did you remember that it's a sound block? It does look a little bit like a speaker.
When your programme is completed, you can name it.
Naming a programme makes it easier to find.
Here's an example of my programme.
I wonder what I should name it.
Press this shape in the corner, tap on the white space, and type in a sensible name, "Animal Quiz." The name of a programme is just like the title of a story.
I think the name "Animal Quiz" makes sense for this programme.
Press the blue tick, and then your project's saved.
To see your project's name, go to the main menu by using the house icon.
When I press on the house icon, I can see "Animal Quiz." That's one of my saved projects.
I've now got a task for you, I hope you're ready to give it a try.
I'd like you to build a programme.
Use your design to help you create your quiz.
Your quiz must have two pages, two backgrounds, two questions, two sprites per page.
You can use other command blocks to add more detail to your programme.
Well done for having a go at making your own programme.
I bet you've made a really interesting quiz.
I've got another task here for you.
I'd like you to review the quiz questions programme video.
Let's watch it together now.
<v Instructor>This is a programme</v> that is a quiz questions programme, so I'm going to be following my design for this.
First step is to go and get my first background.
I'm going to choose the farm.
Add it in.
Next, I'm going to go and get my sprites using the menu on the left.
I'm going to choose the snake.
My second sprite is the pig.
So I'm going to use a movement block here just to make the pig look the other way, I'm going to use Move Left just once just so that the sprite can face the other direction.
Right, let's look at page two.
Add a new page.
Add the background for the page.
Let's get the beach for this one.
There we go.
And let's add the sprites, so they're up in the left menu there again.
I'm going to add the bat because my second question is all about flying, and a dog for this one.
So let's put the dog in and the bat.
I think I'm gonna turn the dog around like I did on the other page.
Yeah, I'm gonna use the Move Left block, that looks better.
Let's put the dog in position so that they're facing each other.
All right, I think we're ready to add the coding for this, so let's start on.
Well, they all need these blocks, let's start on the snake first.
I'm going to use the Start on Tap, and then my design says my next block is the Say block.
It's the purple one.
I need to change the text, tap on the text, and then use my keyboard to type in my "No," because if the player is going to select the snake, they're going to be wrong.
So the snake will say "No" and then hide and end the programme there.
But the pig will be the correct answer.
So when I look at the pig's blocks now, I'm going to add the same Start on Tap and the same Say block, but the word is going to be different.
I'm gonna backspace this out.
I'm going to put "Yes" in here because the pig will be the correct answer for which animal is taller.
And if you get the answer right, it takes you to the next page, so I'm using the Change Page block there.
Let's do the coding for page two.
So let's start on the bat, yeah.
So the bat will have Start on Tap.
The bat's going to be the correct answer.
The question for the second page will be, who can fly? So it'll be the bat.
I need to use Say, and the answer is going to be "Yes." That's what the sprite will say when you tap on it.
Then I'm going to use the go to page one, because the programme will repeat, it will go back to the first page if I get it right.
For the dog, I'm gonna use Start on Tap, I'm going to use the Say block, and the dog is going to say "No" because the dog is the wrong answer for this one.
And then the dog is going to hide and the programme will end, so I need an End block here.
Let's test this all out.
I'm going to make this full screen.
The question for the first page is, which animal is taller? So if I tap on the snake, the answer will be wrong.
Let's test that.
Okay, the snake said "No" and hid, that's good.
So the pig should be the right answer.
If I tap on the pig, it should say "Yes" and go to the next page, there we go.
Page two's question is, which animal can fly? So the dog will be the wrong answer.
If I tap on the dog, it should say "No" and hide, that's great.
And then if I tap on the bat, it should say "Yes" and take me back to the beginning.
This programme is all finished.
<v ->Fantastic, you've done so well in today's lesson.
</v> Let's summarise, "Designing and creating a quiz programme." A design is a plan for what you want your programme to do.
Plans are important because without a clear plan, your programme might not do what you expect it to do.
Algorithms are a set of clear instructions that can be followed by a human and used to make a programme.
By using algorithms in a plan, you can create a programme that is unique and matches your ideas.
Well, that brings us to the end of today's lesson, and you've done really well.