Objective: Students will use conditionals to ask questions and respond one way if the answer is correct, and a different way if the answer is wrong.
Expected Outcome:
Students will be able to:
Objectives/Outcome
Quiz Game
Prerequisites:
Students should have foundational understanding of:
Vocabulary
Conditionals
Algorithm
Event
A sprite asks questions. If you get the answer correct, it moves towards a reward.
Step-by-Step
Go to Clever
Open Code HS
Select the Quiz Game
Project Sample
conditional
conditional
What are Conditionals?
New Blocks - Conditionals
| If the condition is true, the blocks held inside it will run. If the condition is false, the blocks held inside will be ignored. The condition is only checked once. |
| Use one of the many diamond shaped sensing blocks or operators to fill in the condition of the “if” statement. |
| This conditional is an if/then/else conditional. When the script runs it will check if the condition is met. If the condition is true, the first section of code will run. If the condition is false, the “else” section will run |
| A common error with conditionals is not understanding that the condition is only checked once. To make the program repeatedly check a condition, it needs to be in some kind of loop. |
Conditional blocks are used to check to see if a condition is true or false. If it is true, then an action will happen. Block are only checked once (unless contained in a forever loop). They can be used to compare values, check for input (i.e. mouse click/color sensing), control objects, etc.
What are some of the code blocks I need?
Quiz Game
Decompose
Add sprite
Code a conditional to check the answer.
Make sprite move toward a goal if the answer is correct.
Make sprite ask a question.
Add more questions.
Note: Not all blocks that might be used are shown here. There are multiple ways to code this project.
Code a conditional to check if goal is reached.
HINT: right click a stack of code and select “Duplicate” to speed up your coding.
Student Paced Option
Recommended: Share this slide deck with students so they can work at their own pace. They can do Split Screen mode and view code samples on the side
(put tutorial slide deck in slideshow mode)
Tutorials
Optional: Printable Cards
Step-by-Step
1. Add a sprite.
2. Add a background.
Step-by-Step
3. Create an algorithm to make the sprite ask a question and wait for the user to input an answer.
Step-by-Step
4. Code a conditional to perform one action IF the answer is correct, ELSE do a different action.
Step-by-Step
5. Add another sprite to represents a goal/reward.
Step-by-Step
6. Add to the original algorithm so the sprite moves toward the goal if the answer is correct.
Step-by-Step
7. Create a separate algorithm with a conditional to check if the goal is reached. Include a celebration if the goal is reached.
8. Add more questions.
Extension
Variables and random operators to generate questions
Extension (Advanced)
Revise
Can you add a scorekeeping variable?
Can you make the sprite give instructions for the game?
Can you add animation to the sprite as it moves toward the goal?
Quiz Game - Extensions
Can you add a more elaborate celebration?
Debug
Does everything work the way you want it to?
Is there anything you want to change?
score
5
Can you make the questions random? (see sample code slide 7)
CODE BLOCKS
When flag clicked
ask
if/else
move
say
if/then
if touching/then
SKILLS
VOCABULARY
Conditionals
Algorithm
Event
Vocabulary
Code Blocks
Skills
Standards
STANDARDS
CS 3AP-3b Create programs that include sequences, events, loops, and conditionals
CS 3AP-4a Break down (deconstruct) algorithms and list the steps needed to solve a problem into a sequence of tasks and sub-tasks.
CS 3AP-5e Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.
Math Standard 3.OA.7 Fluently multiply and divide.
Additional Resources
Quiz Game
Sample Project: https://scratch.mit.edu/projects/512487184
Variations: https://scratch.mit.edu/projects/512525016
https://scratch.mit.edu/projects/505700678/
Video inspiration: https://www.youtube.com/watch?v=TVFshKMTLV4&t=922s&ab_channel=JackieChambers