AI Builder Series — Workshop 2
by Brendon Thiede
quiz-game on GitHubIf your Codespace was deleted, your work is safe — it's pushed to your fork on GitHub.
What happens when everything is tangled together?
Your entire quiz is one giant file — questions, scoring, colors, and HTML all mixed together.
Your task: Make wrong answers show up in red.
Each part of your code should have one job.
Identify each concern in your code.
Stretch, grab water, and come back ready to refactor.
If you could only change one part of your quiz, what would it be?
Extract the question data.
"Move the questions array into a separate file called questions.js. Don't change anything else."
Separate logic and styling.
"Extract the score tracking and answer checking into their own functions. Don't change the questions or the HTML."
Test with Playwright after.
"Move all the CSS from the style tag into a separate style.css file. Don't change any functionality."
Test with Playwright after.
What happens if you ask AI to "refactor everything at once"?
quiz-game/
index.html ← display
style.css ← styling
questions.js ← data
app.js ← logic
Each file has one job.
git add .
git commit -m "Refactored quiz into separate concerns"
git push
Your live site at github.io/quiz-game/ updates
within a minute.
Save Points
Now that your code is organized, we'll learn to save our progress before experimenting — so we can always go back.