Difference between revisions of "CISC181 S2019 Lab8"
(Created page with "===Preliminaries=== * Make a new '''Android''' project with ''n'' = 8 following the instructions from last week's lab. ===Instructions=== You will create a simple trivial q...") |
|||
Line 9: | Line 9: | ||
* '''<tt>MainActivity</tt>''' | * '''<tt>MainActivity</tt>''' | ||
** This is the title screen, so you should print your game's name and its author (you) here | ** This is the title screen, so you should print your game's name and its author (you) here | ||
− | ** There are two options: | + | ** There are two options: quiz topic (e.g., "geography" or "movies" or "history"), and answer type (multiple choice vs. free response) |
** A button to start the game. This should start the <tt>QuestionActivity</tt>, with the option values added to the <tt>Intent</tt> as extras | ** A button to start the game. This should start the <tt>QuestionActivity</tt>, with the option values added to the <tt>Intent</tt> as extras | ||
** A button to quit | ** A button to quit | ||
* '''<tt>QuestionActivity</tt>''' | * '''<tt>QuestionActivity</tt>''' | ||
− | ** Here you will progress through | + | ** Here you will progress through a set number of questions (say, 5) from the topic indicated in the <tt>Intent</tt> that started the activity, and display them in the format chosen by the user |
*** If the answer type option is multiple choice, the choices are shown in a <tt>ListView</tt> beneath the question and the user clicks one to pick it | *** If the answer type option is multiple choice, the choices are shown in a <tt>ListView</tt> beneath the question and the user clicks one to pick it | ||
*** If the option is free response, the answers are not shown and the user must type a string into an <tt>EditText</tt> view. Just eliminate capitalization and don't worry about spelling errors before doing a string comparison | *** If the option is free response, the answers are not shown and the user must type a string into an <tt>EditText</tt> view. Just eliminate capitalization and don't worry about spelling errors before doing a string comparison | ||
Line 22: | Line 22: | ||
** Have a button to take the user back to the <tt>MainActivity</tt> | ** Have a button to take the user back to the <tt>MainActivity</tt> | ||
− | You will need an external file to store at least | + | You will need an external file to store at least 3 topics with 10 questions per topic and 2-4 possible answers per question. This should be read by your program and turned into a data structure that <tt>QuestionActivity</tt> can easily use. The 5 questions that you present to the user for a given quiz should be randomly chosen from the overall pool. |
You can make up these questions yourself or find them online. Here's [https://github.com/ComputerScienceHouse/trivia-bot/tree/master/questions a set I found] that you can grab to save time. | You can make up these questions yourself or find them online. Here's [https://github.com/ComputerScienceHouse/trivia-bot/tree/master/questions a set I found] that you can grab to save time. |
Latest revision as of 13:00, 1 May 2019
Preliminaries
- Make a new Android project with n = 8 following the instructions from last week's lab.
Instructions
You will create a simple trivial quiz game Android app. The app will have 3 activities: MainActivity, QuestionActivity, and ScoreActivity that work together in the following way:
- MainActivity
- This is the title screen, so you should print your game's name and its author (you) here
- There are two options: quiz topic (e.g., "geography" or "movies" or "history"), and answer type (multiple choice vs. free response)
- A button to start the game. This should start the QuestionActivity, with the option values added to the Intent as extras
- A button to quit
- QuestionActivity
- Here you will progress through a set number of questions (say, 5) from the topic indicated in the Intent that started the activity, and display them in the format chosen by the user
- If the answer type option is multiple choice, the choices are shown in a ListView beneath the question and the user clicks one to pick it
- If the option is free response, the answers are not shown and the user must type a string into an EditText view. Just eliminate capitalization and don't worry about spelling errors before doing a string comparison
- After each answer is given, use a Toast to tell the user if they are right or wrong, and go on to the next question
- After the last question is answered, automatically start the ScoreActivity. Pass the total number of questions and the number of correct answers as extras in the Intent
- Here you will progress through a set number of questions (say, 5) from the topic indicated in the Intent that started the activity, and display them in the format chosen by the user
- ScoreActivity
- Report the user's score and, based on their percentage correct, write an appropriate evaluation message (e.g., "Wow, 100%! You are smart!" or "Hmmm...you need to study more")
- Have a button to take the user back to the MainActivity
You will need an external file to store at least 3 topics with 10 questions per topic and 2-4 possible answers per question. This should be read by your program and turned into a data structure that QuestionActivity can easily use. The 5 questions that you present to the user for a given quiz should be randomly chosen from the overall pool.
You can make up these questions yourself or find them online. Here's a set I found that you can grab to save time.
For simplicity, don't use images or other multimedia resources in your questions and/or answers.
Submission
Submit your entire project directory (code + resources) to Canvas. Please zip or tar it before submission.