← ACARA Digital Technologies Years 5–6

Maths quiz algorithm with harder and easier questions

An algorithm that repeats questions, adds 1 to a score variable for each right answer, and picks harder or easier questions depending on that score.

Understanding Maths quiz algorithm with harder and easier questions in ACARA Digital Technologies Years 5–6

What it does: A loop with a stopping condition makes the quiz repeat. It stops when the count of questions reaches 5. The counter variable needs a starting value. 0 means no right answers yet. Adding 1 to score each time keeps count of the correct answers. Setting it to 0 would wipe out the count. A quiz repeats the 'ask and check' steps. That repeating is iteration. IF ... THEN is branching. The algorithm picks a different path depending on whether the condition is true. Set the score to 0 once at the start. If it were reset inside the loop, the score would never grow past 1.

Common mistakes: The score should go up when the answer is right. The line should be IF answer is right THEN, so that score ← score + 1 only runs for a right answer. The student has not answered anything yet, so the wrong counter must start at 0. It should be wrong ← 0.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 120–132) and word search (Modules 106–132).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A quiz algorithm keeps a variable called score. What should happen to score when the student gives a RIGHT answer?
score ← score + 1score ← 0
Matches
IF answer = correct THEN score ← 1
↓
This sets score to 1 instead of adding 1. The score will never go above 1. It should be score ← score + 1.
Applying
Meanings
Term
quiz algorithm
Meaning
An algorithm that repeats questions, adds 1 to a score variable for each right answer, and picks harder or easier questions depending on that score.
Practice
score ← 0
Testing
Gaps
5 TIMES
Check Answer
Spots
3 ASK a maths question
4 IF answer is wrong THEN

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'African Wild Dog' badge — Savannah Streak, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A quiz algorithm keeps a variable called score. What should happen to score when the student gives a RIGHT answer?
A. score ← score + 1 ✓
B. score ← 0
Adding 1 to score each time keeps count of the correct answers. Setting it to 0 would wipe out the count.
2. Which step belongs inside the loop so the quiz keeps asking questions?
A. REPEAT: ask a question, check the answer ✓
B. Ask one question, then stop
A quiz repeats the 'ask and check' steps. That repeating is iteration.
3. The quiz has this rule: IF the student gets two wrong answers in a row THEN ask an easier question. What kind of step is this?
A. Sequence only, because every student gets the same steps
B. Branching, because the algorithm chooses a path based on a condition ✓
IF ... THEN is branching. The algorithm picks a different path depending on whether the condition is true.
4. Where should the line 'score ← 0' go in a quiz algorithm?
A. At the start, before the first question ✓
B. Inside the loop, after every question
Set the score to 0 once at the start. If it were reset inside the loop, the score would never grow past 1.
5. A student answers 7 × 8 and gets it wrong. What happens to the score variable?
A. It goes up by 1
B. It stays the same ✓
Only a right answer adds 1. A wrong answer leaves the score unchanged.

Match the Pairs

IF answer = correct THEN score ← score + 1 → If the answer is right, add 1 to the score variable
IF wrongInRow = 2 THEN use easier question → After two wrong answers in a row, switch to an easier question
The quiz repeats the question steps until 5 questions have been asked → REPEAT UNTIL questionsAsked = 5
The quiz starts with a score variable set to 0 before any questions are asked → score ← 0
IF answer = correct THEN score ← 1 → This sets score to 1 instead of adding 1. The score will never go above 1. It should be score ← score + 1.
IF wrongInRow = 2 THEN score ← 0 → The branch resets the score instead of choosing an easier question. It should pick an easier question when wrongInRow is 2.

Key Term

quiz algorithm
An algorithm that repeats questions, adds 1 to a score variable for each right answer, and picks harder or easier questions depending on that score.

Fill in the Blanks

1. SET score ← 0 REPEAT 5 TIMES ASK a maths question
Hint: Type the keyword that starts a loop so the quiz keeps asking questions.
2. IF answer = correct THEN SET score ← score + 1 END IF
Hint: Type the operator that adds to the score when the answer is right.
3. IF answer = correct THEN SET score ← score + 1 END IF
Hint: Type the name of the variable that keeps count of the right answers.
4. IF wrong = 2 THEN ASK an easier question END IF
Hint: Type the number of wrong answers that makes the quiz switch to an easier question.
5. IF score >= 4 THEN ASK a harder question END IF
Hint: Type the comparison operator that means the score is at least this number.

Spot the Error

Question 1
A score ← 0
B REPEAT 5 TIMES
C ASK a maths question
D IF answer is wrong THEN
E score ← score + 1
Line D — The score should go up when the answer is right. The line should be IF answer is right THEN, so that score ← score + 1 only runs for a right answer.
Question 2
A score ← 0
B wrong ← 1
C ASK a maths question
D IF answer is right THEN
E score ← score + 1
Line B — The student has not answered anything yet, so the wrong counter must start at 0. It should be wrong ← 0.
Question 3
A score ← 0
B ASK a maths question
C IF answer is right THEN
D score ← score - 1
Line D — A right answer adds 1 to the score. It should be score ← score + 1, not minus 1.
Question 4
A score ← 0
B REPEAT 5
C ASK a maths question
D IF answer is right THEN
Line B — The repeat line must say how many times to repeat. It should be REPEAT 5 TIMES.
Question 5
A score ← 0
B wrong ← 0
C IF answer is wrong
D wrong ← wrong + 1
E IF wrong = 2 THEN
Line C — An IF line needs the word THEN at the end. It should be IF answer is wrong THEN.

Student with a class code? Join your class →