Loading...
Hello, my name is Ms. Powell, and welcome to Computing.
I'm so pleased that you decided to join me here today.
In today's lesson, we're going to be using selection to design a quiz.
Let's get started.
Welcome to today's lesson from the unit "Using Selection In Programming To Develop A Quiz".
This lesson is called "Designing A Quiz", and by the end of today's lesson, you'll be able to design a programme that uses selection.
We'll be using these keywords throughout today's lesson.
Let's take a look at them.
The first word is input, input.
This is, in a programme, the text or numbers that a user types in.
The next word is branching algorithm, branching algorithm.
A decision-making flow used to plan a programme with a condition and two outcomes.
Lesson outline, "Designing A Quiz".
This lesson is split into two sections.
In the first section, we'll make a mind map of ideas for a quiz.
And in the second section, we'll create a design for a quiz.
Let's get started with the first section: mind map ideas for a quiz.
What is a quiz? Andeep says, "A quiz is like a mini game with questions." Sam says, "You try to get as many questions right as you can." In this lesson, you will be gathering and recording ideas for a quiz, creating branching algorithms for the quiz, and planning outcomes for a Scratch quiz.
To create a quiz, you'll need: a topic, questions, and answers.
What topic would you like your quiz to be about? Aisha says, "The solar system." Jacob says, "A times table quiz." And Andeep says, "Capital cities." When designing a quiz, it's important to think about your audience.
You need to think about who will be playing your quiz, what kinds of topics they enjoy, and how difficult the quiz will be.
Sam says, "If the quiz is too difficult or too easy, it won't be fun." Fill in the blanks.
A quiz is a game of questions and blank.
A quiz needs an interesting blank that people will enjoy.
If your quiz is too blank or too easy, it won't be fun.
Use the words here in the box: difficult, answers, and topic.
And use them to fill in the blanks.
Pause the video to have a go.
Well done for having a try.
Let's check the answers together.
<v ->A quiz is a game of questions and answers.
</v> A quiz needs an interesting topic that people will enjoy.
If your quiz is too difficult or too easy, it won't be fun.
So I suppose, in that case, you'll need to think of your audience.
Who will be playing your quiz? For example, a child of six or seven might be able to do counting games, but a child of 10 or 11 might find that a bit boring.
Mind map ideas for a quiz.
A mind map is where you think about lots of ideas and record them.
When you're gathering ideas for your quiz, write or record your ideas on a piece of paper.
Write down all your ideas, even if you think some might not be right.
If you can, work together with others.
While thinking about your quiz, remember that you'll be programming your final quiz using Scratch.
If you get ideas about how to show your topic using Scratch, you can write them down.
Aisha says, "My topic is the solar system, so I could use a space backdrop, and have planets or rocket sprites." Your questions will need to work in a Scratch ask and answer block.
This means that they must have one exact answer.
It'll be easier to make your quiz if your answers are true or false, a single word, or number, or yes or no.
Let's take a little look at these blocks here in Scratch.
We've got the event block.
When this sprite clicked, this means the programme will run when the user clicks on the sprite.
Ask, "What is four times three?" and wait.
If answer equals 12, then say correct for two seconds, or else say incorrect for two seconds.
Our condition is, is the answer 12? True or false? If the player does put 12 in, they're correct, and the programme will say correct.
If the player puts in any other number other than 12, then they're incorrect, and the programme will say incorrect.
This works well as there's only one answer to, "What is four times three?" This wouldn't work if there were lots of answers to a question.
For example, the question, "What is your favourite colour?" The player could input many different colours depending on their personal preference, so to get your questions to work in a Scratch ask an answer block, you'll need to try to stick to things that will only have one answer.
Even though coding in Scratch is the final goal, you don't need to do any programming in this lesson.
You're only recording your ideas at this stage.
Aisha says, "I wrote down my ideas for sprites and backdrops, but didn't write any code." I've got a question here for you.
I'd like you to give it a try.
Which questions will be more difficult to programme? Is it A, describe what it would be like to stand on Jupiter.
Is it B, is Mercury the hottest planet in the solar system? Is it C, true or false? Neptune is larger than Saturn.
Or is it D, list the planets in order from the Sun.
Pause the video to have a quick think.
Which questions will be more difficult to programme? Is it A, B, C, or D? There might be more than one answer.
Well done for having a go.
Question A, describe what it would be like to stand on Jupiter, would be more difficult to programme.
That's because there's many different possible answers to this question.
That's the same case for D.
List the planets in order from the Sun.
Even though there is one definitive answer for the order of the planets, it might be difficult to programme, and it might be difficult for your user to input the information in the way that you want.
For example, they might confuse planets, or they might incorrectly spell planets.
Or another issue that they might have is that they might leave spaces, which your code doesn't understand, or they might separate them with lots of commas or dashes, and your code might not understand the answer.
However, B, is Mercury the hottest planet in the solar system? That would be a yes/no response.
And C, true or false? Neptune is larger than Saturn.
That would again be a true or false response.
B and C would be much easier to programme.
A does not have one single correct answer.
And D is complicated.
It's easy to make a mistake when typing in the answer.
I have a task here for you.
I'd like you to gather ideas for your quiz.
First, choose a topic, then write down five possible questions you could use in your quiz.
Then how could you use Scratch to show your topic? For example, what kind of background might you use? Or what kind of sprites might you choose? Number two, share your mind map with others.
Can you think of any more ideas? Can you see any questions that might not work? Pause the video to finish the task.
Fantastic, well done for having a go.
I'd like to give you some feedback.
Gather ideas for your quiz.
Topic: the solar system.
Question one, true or false? Jupiter is the largest planet.
Question two, the third planet from the Sun is blank.
Question three, is Mercury the hottest planet in the solar system? Question four, how many planets are there in the solar system? Question five, true or false? Neptune is larger than Saturn.
Scratch ideas: use a space backdrop, and have planets or rocket sprites.
Two, share your mind map with others.
Andeep says, "You might want to change the how many planets question to make sure users know Pluto isn't counted." Sam said, "You could change the sprite to use to a new costume, that would look good." Lesson outline, "Designing A Quiz".
Well done, you've done so well on the first section: make a mind map of ideas for a quiz.
Let's move on to the second section: create a design for a quiz.
Andeep says, "Planning sometimes feels like a waste of time.
It would be faster to just start coding right away." Why is it useful to spend time planning a coding project? Pause the video and have a quick think.
Aisha says, "Planning your quiz is like drawing a map before you go on a trip.
If you don't know where you are going, it's easy to get lost." And Sam says, "A clear plan helps your coding go faster, and with fewer mistakes, because you already know what your code is supposed to do." The next step is to plan what happens in your quiz using selection.
Jacob says, "What is selection?" Pause the video and have a think.
Sam says, "Selection is part of a programme where, if a condition is met, then a set of commands is run." True or false? Planning a quiz is wasting your time.
Pause the video and have a quick think.
Is that true or false? The answer is false and why? A clear plan helps your coding go faster, and with fewer mistakes, because you already know what your code is supposed to do.
It's also helpful to refer back to your plan if you've got any bugs in your code.
That might make it easier to fix your code if things aren't working.
Look at this example of a branching algorithm.
Ask, "True or false? Jupiter is the largest planet." The answer is true.
If the player types in true, then say correct.
I can follow the line of my branching algorithm here in green.
If the player does not put the answer true, or puts in anything other than that, then that's false, and I can follow the red arrow here in my branching algorithm to say incorrect.
This is the question.
Ask, "True or false? Jupiter is the largest planet." Here's our condition.
Is the answer true? Yes or no? I can follow my branching algorithm to see what outcomes will occur.
If the player puts in true, say correct.
And if the player puts in false, or anything else, for example, Mars, or the Sun, any answer that is not the letters T-R-U-E, or is not the word true, then that is false, and the programme will say incorrect.
When the word input is used, it means the typed text or numbers that the user will enter.
Whatever the input will be checked against the condition here.
Here we can see the input.
In this case, if we look at the code here, we've got when the sprite is clicked, ask, "What is four times three?" and wait.
If the answer equals 12, then say correct for two seconds, or say incorrect for two seconds.
The condition is, is the answer 12? True or false? When the player inputs their answer, it'll be checked against this condition, so if they put in another number, for example 13, that's not the same as 12, so that's false.
Or if they put in another number 1.
2, that again is not the same as 12.
It has to be exactly the same, and matched to this condition.
If the user's input matches the condition, the true outcome will happen.
Say correct, outcome if true.
If anything other than the true outcome is entered, the false outcome will happen.
Outcome if false, say incorrect.
So this would also be the case if the player typed in, "I don't know".
That's not the answer that is being matched against the condition, so it would be false, it would say incorrect.
Or if the player typed in help, then that would still be a false answer, and the programme would still say incorrect.
A branching algorithm can be a great way to plan for a scratch quiz, as it'll help you to plan to use selection and identify the true and the false outcomes.
Each question in your quiz will need a condition and two outcomes.
Look at your questions from the mind map.
For each one think of a condition, a true outcome, and a false outcome.
Aisha says, "My question will be, 'True or false? Jupiter is the largest planet.
' The condition to check against will be 'true'.
The true outcome will be 'Correct!' The false outcome will be 'Incorrect!'" Some of your question ideas might not fit easily into your branching algorithm.
They might not have two clear outcomes for true and false.
They might make the user input a complicated word where it'd be easy to spell it incorrectly.
You should change your questions to fit what your programme will need.
So remember the letters will be matched against a condition.
If there are any spelling mistakes, that will be a false outcome, and your programme will say incorrect.
It might be a little bit upsetting for your player if they've misspelt it, but the programme didn't recognise that it was the correct answer.
I need your help here.
I'd like you to match each word to its definition.
We have here on the left the words: question, answer, condition, and outcome.
And, on the right, we've got: what the user inputs, what happens next, what you ask the user, and what is checked.
Pause the video so you can match the words to the definition.
Question, that's what you ask the user.
Answer, that's what the user inputs.
Condition, that is what is checked.
And outcome, that's what happens next.
Create a design for a quiz.
The quiz design sheet, provided as a downloadable file for this lesson, uses a longer branching algorithm.
This is because your quiz will have more than one question.
After the first question outcome runs, the next question will start.
If we look here at our branching algorithm, we've got the start, then we have our first question, ask the user.
For example, the question could be, "What is five plus five?" If the answer equals 10, true, then say correct, or else false, then say incorrect.
Then ask the user another question.
For example, "What is 10 and 10?" If the answer equals 20, if that's true, then say correct.
Or if that's false, then say incorrect.
You could have something different there.
You could say, if true, then say well done, or else, if false, then say nice try.
It's up to you.
Question one and question two.
For each question, make sure you have completed: ask the user your question, answer equals the condition, this is the correct answer, then what happens when the answer is correct? Add sprite or programme actions.
You could also think about how your sprite moves.
If the answer is correct, could your sprite turn around, or move in some way, or change its costume? Else, what happens when the answer is incorrect? Add sprite or programme actions.
I have a task here for you.
I'd like you to complete the quiz design sheet provided as a downloadable file.
You should have two or more questions.
Each question should have ask, what question you're asking the user, answer, what the true condition is, then outcome if the condition is true, and else outcome if the condition is false.
Pause the video to finish the task.
I'd like to give you some feedback.
Here is an example of a branching algorithm I've completed.
We've got the start.
Ask the user, "True or false? Jupiter is the largest planet." The answer to this question is true.
My condition is, is the answer true? Yes or no? If the player inputs true, then my programme will say correct, and change costume to planet.
If my player inputs anything other than true, so that could be false, or it could be something else like Mars, or Saturn, or Neptune, or I don't know, anything other than true, my programme will say false, and it will say incorrect, and flash the sprite red.
Well done, you've done so well in today's lesson.
Let's summarise "Designing A Quiz".
To create a quiz, you need: a topic, questions, and answers.
Mind mapping is a way of recording ideas that can be used to make the quiz.
Selection can be used to design the logic of the quiz.
The condition is checked against what are user inputs.
So remember spelling matters.
Quiz questions have a condition, which results in two different possible outcomes: true or false.
A branching algorithm is a good way to record a quiz design.
Well done, you've done so well on today's lesson.