Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Using conditions to build quiz questions

      Lesson details

      Learning outcome

      I can explain how selection directs the flow of the program.

      Key learning points

      1. Conditions can be used to control program flow.
      2. A condition can direct program flow in one of two ways.
      3. Selection in the form of if...then...else statements can be used to check conditions

      Keywords

      • Selection - part of a program where if a condition is met, then a set of commands is run

      • Condition - a statement that can be either True or False

      • Outcome - the actions that come from a condition being True or False

      Common misconception

      The program understands that 'twelve' is the same as '12' in the user input.

      The user's input needs to be an exact match to what you put in the condition.

      Teacher tip

      Guide pupils to use the �if� then� else�� structure to control the flow of their quiz and to determine which response is shown depending on the user�s input.

      Equipment

      Pupils will need access to a device with block-based programming software. Examples in this lesson use Scratch https://oak.link/scratch

      Licence

      This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      What is the main purpose of using repetition in a program?

      to make the code shorter
      to create colourful graphics
      Correct answer: to run a section of code multiple times
      to check spelling

      Q2.
      Which of these describes an infinite loop?

      a loop that runs only once
      a loop that stops after a set number of times
      a loop that skips instructions
      Correct answer: a loop that never ends

      Q3.
      In programming, what is an outcome?

      Correct answer: the result of a decision in a program
      the code you write
      the number of lines in a program
      the name of the programmer

      Q4.
      What is the name of the block in programming that repeats a set of instructions without stopping?

      Correct Answer: forever

      Q5.
      Match each keyword to its description:

      Correct Answer:repetition,running the same instructions more than once

      running the same instructions more than once

      Correct Answer:infinite loop,a section of code that runs forever

      a section of code that runs forever

      Correct Answer:outcome,the actions that come from a condition being True or False

      the actions that come from a condition being True or False

      Correct Answer:selection,part of a program where if a condition is met, then commands run

      part of a program where if a condition is met, then commands run

      Q6.
      In an if... then... else... statement, what happens if the condition is not met?

      The program ends.
      The outcome for True is carried out.
      Correct answer: The outcome for False is carried out.

      6 Questions

      Q1.
      What does a condition in a program do?

      Correct answer: It decides which part of the program runs next.
      It draws a picture.
      It changes the colour of the screen.
      It makes the program louder.

      Q2.
      Why might a program not accept "twelve" as being the same as "12" when checking user input?

      The program only checks for numbers, not words.
      The program cannot read any words.
      The program ignores all user input.
      Correct answer: The program needs the input to match exactly what is in the condition.

      Q3.
      What part of a program checks if something is True or False?

      Correct Answer: condition

      Q4.
      Which of these is a condition?

      Correct answer: "If score equals 10"
      "Say hello"
      "Draw a circle"
      "Repeat five times"

      Q5.
      Match the examples to the keywords:

      Correct Answer:if... then... else...,If score equals 10 then show message.

      If score equals 10 then show message.

      Correct Answer:outcome,The answer is shown when the condition is met.

      The answer is shown when the condition is met.

      Correct Answer:condition,The program checks if the user's input matches the rule.

      The program checks if the user's input matches the rule.

      Correct Answer:selection,The program chooses between two actions.

      The program chooses between two actions.

      Q6.
      Put these steps of an if... then... else... statement in the correct order:

      1 - The condition is checked.
      2 - If the condition is True, do the corresponding action.
      3 - If the condition is False, do the corresponding action.
      4 - The statement ends.

      To help you plan your 5 computing lesson on: Using conditions to build quiz questions, download all teaching resources for free and adapt to suit your pupils' needs...