Giving AI Context · scripted
Assignment: Build a Smart Quiz Game
Assignment: Build a Smart Quiz Game
In the lecture, we saw that everything in the conversation is context AI can use, and that AI cannot know anything about our situation unless the conversation contains it. In this exercise you will build a quiz game that turns that idea into something useful: a quiz that pays attention to how you are doing and decides what to ask next based on your answers.
The game works like this. You give AI your notes on something you are studying. AI asks you one question at a time. Whether you get each question right or wrong, and how you got it wrong, becomes context. AI uses that context to choose the next question: it probes the things you missed, it keeps asking about a weak topic until you get it right, and when you are doing well, it moves on to find out what else you do and do not know. Nothing about your strengths and weaknesses was in the conversation when it started. AI builds that context by conversing with you and testing you.
You are not playing a game someone else built. You are building it. The starting prompt below is deliberately rough. Your job is to decide the rules it leaves out, write them into the prompt, play it, and explain what happened.
The starting prompt
Start a new conversation and send this as your first message, followed by your notes as a separate message.
Starting prompt · Version 1
Play at least five questions before you change anything. Notice what the game does well and where it is unclear, repetitive, or easy to break. Try answering in a way the prompt did not plan for, such as typing a whole paragraph or asking it to do something else, and see what happens.
What the starting prompt leaves out
The starting prompt says nothing about the kind of questions, the way you answer, what happens when you type something unexpected, or how exactly the next question is chosen. When context like that is missing, AI guesses, and it guesses differently every time you play. Your job is to replace those guesses with rules.
Decisions the game needs you to make
| Decision | Questions you have to answer |
|---|---|
| Question types and format | Multiple choice, short answer, true or false, fill in the blank, or a mix? How is each question laid out on the screen? How are answer choices labeled? |
| How you answer | Do you type a letter, a word, a number, or a sentence? What counts as a valid answer? |
| Invalid input | What does the game do when you type something that is not a valid answer? For example: “Sorry, that is an error. Choose one of the options: A, B, C, or D.” |
| Off-task input | What does the game do when you type a bunch of text, ask a question, or try to give it a new task in the middle of the quiz? Ignore it? Remind you that you are in a quiz and repeat the question? Let you quit with a specific word? |
| Choosing the next question | How does the game use your answers? What counts as a weak topic? How many correct answers in a row does it take before the game moves on? What does it do when you get something partly right? |
| A game element | What makes it a game and not a worksheet? |
Student instructions
Each improvement is a change to the starting prompt, not something you say during a round. Keep your notes in a separate message from the prompt.
- 1Step 1: Choose your notes.Pick a page of notes on something you are studying or want to learn: a unit from a class, the rules of a game, vocabulary in a language you are learning, or anything else you have notes for. The notes should be long enough to support at least ten different questions. You will send them as the message right after your prompt.
- 2Step 2: Define the question types and format.Decide what kinds of questions the game asks and write the format into the prompt. If you use multiple choice, decide how many choices and how they are labeled. If you use short answer, decide how long an answer should be. Write out exactly how a question should look on the screen.
- 3Step 3: Define how you answer, and what happens on invalid input.Write a rule for what a valid answer looks like, and a rule for what the game says when your input is not valid. Be specific about the wording the game should use.
- 4Step 4: Define what happens on off-task input.Write a rule for what the game does when you type a paragraph, ask it something unrelated, or try to change the task. Decide whether it ignores the message, reminds you that you are in a quiz and repeats the question, or something else. Then decide whether there is a way to end the game on purpose, and what it is.
- 5Step 5: Define how the next question is chosen.Rewrite rule 3 of the starting prompt so it is precise. Say how the game should treat a wrong answer, a partly right answer, and a run of right answers. Say when it should keep probing a topic and when it should move to a new one. Say what it should do when it has run out of new material in your notes.
- 6Step 6: Add a game element of your own.Design at least one rule that makes it a game, and write it into the prompt. Some ideas: on every correct answer, the game describes in one paragraph the battle your character just won and the treasure they found; on every correct answer, the game draws an ASCII map showing your character one step closer to the castle; the game keeps a score, shows your current streak of correct answers, and gives bonus points for getting a previously missed topic right. Invent your own if you prefer. Write down why you chose it.
- 7Step 7: Play the finished game twice.Play two full games of at least ten questions each with your final prompt. In at least one game, get a few questions wrong on purpose and watch what the game does with that. Try invalid and off-task input at least once in each game. Save both conversations.
What to turn in
Your final prompt. The complete text of your improved quiz game prompt, plus the notes you used.
Two sample games. The full conversations from Step 7.
A written explanation. Answer each of the following in a few sentences.
- Point to one place in a sample game where the game chose a question because of an earlier answer of yours. What was the earlier answer, and how did the game use it?
- Point to one place where the game handled invalid or off-task input. Did it do what your rule said?
- What did the game learn about what you know and do not know? Where in the conversation is that context, and how did it get there?
- What context did you have to add to the starting prompt before the game worked the way you wanted? Which missing rule caused the most trouble before you wrote it?
Your work should show that you can decide what context a program needs, write it into the prompt, and recognize when AI is using context that was built up during the conversation.
Submitting sample conversations
Follow your teacher’s instructions for sharing a conversation link or copying the text. Include the starting prompt, your notes, and every question and answer.