Unit 2 · Programming 1 · Lessons 2.17–2.18 · Mini-Project

Quiz Bot

Two days. Build an interactive quiz that keeps score and reacts to how the player did — then write the paragraph that turns it into Create PT practice.

Big Idea 3 — Algorithms & Programming2 days · 20 points
This page is the instructions. You write your code in your editor and your paragraph on the paper packet you get in class. Keep this open beside them.
1

The Task

Write a program that asks the player a series of questions, keeps a running score, and finishes with a personalized result that depends on how they did. Everything from Unit 2 comes together here: input, variables, strings, and — the star of the show — conditionals.

The bot has to react, not just tally. A program that prints “You scored 4” is a counter. A program that prints “4/5 — nicely done, you passed!” is making a decision. The decision is the point of this project.
2

Requirements — read before you start

Your Quiz Bot must have

□ A purpose sentence comment at the top.

□ At least five questions, each read with input().

□ A running score variable that starts at 0 and goes up by 1 for each correct answer (score = score + 1).

□ At least one compound condition using and or or (2.14).

□ A personalized final message built with an f-string that changes based on the score.

Pairs allowed, but the writing is solo. You may build the code with a partner (driver / navigator, swap every 10 minutes). But each student writes their own purpose statement and their own “how my conditional works” paragraph. That paragraph is graded like a real AP written response — see Step 5.
3

The Model

Copy the shape. Then write your own questions and your own result rules:

Python — skeleton (2 of 5 questions shown)

# A quiz on ___ that scores the player and
# gives a personalized result.
score = 0
a1 = input("Capital of France? ")
if a1 == "Paris":
    score = score + 1
a2 = input("2 + 2 * 3 = ? ")
if a2 == "8":
    score = score + 1
# ... three more questions ...
if score >= 4 and score <= 5:
    print(f"{score}/5 — you passed!")
else:
    print(f"{score}/5 — keep studying!")

Where each requirement lives

# purpose: what + why
#
# running score starts at 0
# question 1 (input)
# check the answer...
# ...and count it
# question 2
# note: input is text, so
# compare to "8", not 8
# five total
# COMPOUND condition (and)
# personalized f-string
# the other branch
# also personalized

Hover or tap a line to light its twin. Line 6 is the classic trap: input() returns text, so compare to "8" (quotes), not the number 8. Make yours a quiz on something you actually know.

4

See One Run

Here is a finished Quiz Bot behaving the way yours should — a running score and a result that changes with it. Answer and watch the score climb.

score = 0
5

The Writing — graded like an AP response

One paragraph, 5–7 sentences, titled “How my conditional works.” Pick the most interesting conditional in your program — usually the compound one that decides the final result — and explain it precisely. Your teacher grades this with real PT language.

Your paragraph must do all three

□ Identify the condition exactly — the actual Boolean expression, e.g. “score >= 4 and score <= 5” — not “it checks if they did well.”

□ Describe the result of BOTH branches — what happens when the condition is True, and what happens when it is False.

□ Use the terms correctly — condition, Boolean, and branch, each doing real work in the sentence.

Weak

“My program checks the score and tells the user how they did. If they get a lot right it says they passed. It uses an if statement.”

Strong

“The condition score >= 4 and score <= 5 is a compound Boolean that is True only when the score is 4 or 5. When it is True, that branch runs and prints the passing message with the score in an f-string; when it is False, the else branch runs and prints the ‘keep studying’ message instead. Exactly one branch runs, because the condition has one value.”
What the strong version does. It quotes the real condition, says what happens in both directions, and uses condition, Boolean, and branch to mean what they actually mean. That precision — not fancier code — is what the AP written responses reward all year.
6

How the 20 Points Split

Half the project is the paragraph. Plan your two days so writing isn’t squeezed into the last five minutes.

Working program — 5+ questions, running score, compound condition, personalized f-string result10
Paragraph — identifies the actual condition precisely3
Paragraph — describes the result of both branches3
Paragraph — uses condition, Boolean, branch correctly2
Purpose sentence — present and accurate2
Total20
7

Why This Is on the Exam

The Create Performance Task asks you to identify and explain a “selection” in your own program — a conditional — and to describe what it does. That is exactly the paragraph in Step 5, a full school year early. Students who practice explaining their own conditionals precisely now find the PT’s written responses almost routine in the spring.

The running-score pattern also previews Unit 3’s accumulator — a variable that builds up a result across many steps. You’re meeting the idea here with five questions; soon you’ll do it with a loop over hundreds.

8

Challenge — only after everything else is done

Add difficulty levels: ask the player “easy or hard?” at the start and use that answer in a condition to change which questions or thresholds apply. That means a conditional whose result depends on earlier input — a genuine step up.

Or: take one of your questions and rewrite its logic in AP Pseudocode by hand, correctly. Good practice for the exam’s pseudocode traces.

← 2.16 Testing & Pseudocode Gym