Graded Programming Activity
PA5 - Creating a Trivia Game
Topic Covered
- Lists
Introduction
In this activity we would like you to use lists to create some variation on a trivia contest, gameshow, or personality quiz. List are a helpful element of a program like this because you have different types of data
- the question
- answer choices
- a "key"
where the position in the list of items organizes what goes together. For example, in our lesson activity we explored creating a state capital trivia game where "Iowa" was the 15th item in the state list and "Des Moines" was the 15th item in the capital list. One could easily imagine a collection of six lists - question, answerA, answerB, answerC, answerD, key. And the 2nd item in these lists might be "Which sport uses a hoop", "Baseball", "Basketball", "Football", "Soccer", and "B" respectively.
While you need not follow this model exactly, in this assignment you will make a "trivia game" with several questions, each of which has several answers to choose from.
To earn a 3
- Write a program called "PA5"
- Your program should "run" when the green flag is pressed.
- When your program runs you should make sure that the program does a proper "setup"/"places everyone. The program should run correctly regardless of when the green flag is pressed - even in the middle of the program running.
- The general program should be some form of multiple choice, trivia/quiz game.
- Your program must:
- Ask at least five questions
- Use lists to store elements of the game
- The example above lists six lists.
- There are a number of variations that might use more or fewer.
- The number is up to you but I suspect that you will need to use at least two lists to organize your data - one for the question and one for the answer key.
- Display both the question and the answer options at the same time
- This is the one that gets misunderstood by students the most frequently. I want to see a multiple choice quiz. Options include:
- or
- Wait for the user to give an answer
- This can be done any way that makes sense to you. The two most obvious are probably using the ask block and having the user type in a letter/word answer, or having the user click on sprites representing the answers.
- Provides feedback
- In MOST cases this would involve immediately displaying information on right/wrong and would leave the question/choices visible.
- Then the quiz asks the next question.
Suggestions
- Don't rush to the computer too quickly. Think through the process before you start.
- What kind of trivia game are you building?
- What is it's content?
- How will answers be entered?
- How will your program detect right/wrong answers?
- How will you keep track of progress?
To earn a 4
First, you must make effective use of lists by using one or more loops. If you just have a long sequence of code, you don't understand the benefits of a list.
Second, you must add at least one of the following
- Ask the questions in a random order.
- There is some sort of "result" at the end:
- The most obvious is a final score
- However, you could make a variation on the popular "personality quizzes" that are all over Facebook and the internet. For example, a multi-question quiz that predicts what Harry Potter house you would be sorted into or what European country you are most meant to live in, etc. Notice that the concept of an "answer key" is very different here than it is in a traditional "Who Wants to be a Millionaire" style quiz.
- CHALLENGE:Provide an "editor" mode that allows a user to add additional items (question/answers/key). However, this feature should be provided in the program NOT by simply editing the code.
Getting Credit
To submit your assignment for peer review you should:
- Make sure you have met all of the requirements listed above in the grading rubric.
- "Share" your program publicly on the Scratch website by clicking on the share button in the upper right hand corner of the create screen.
- Navigate to the studio for this project -https://scratch.mit.edu/studios/33689877/
- Select the "Browse Projects" button at the right edge of the studio page.
- A list of all of your "shared" programs will appear at the bottom of the screen. Select the assignment that you just completed.