[BetNBA]
This quarter we are going to implement an online betting game called BetNBA, which allows users to bet on the results of NBA basketball games. Of course, there won't be any money involved, only bragging rights.
BetNBA supports two types of users: admin users and regular users. An admin user can create games for the regular users to bet on, and an admin user is also responsible for entering the results of games after the games are played. A regular user can bet on a game before the game is played by choosing the winner of the game. If the user is correct, the user gets 1 point; if the user is wrong or the user didn't bet on that game, the user gets no point. At the end of a basketball season, the users with the most points will be declared the winners of BetNBA.
For this assignment, you are going to implement the admin interface of BetNBA. The admin interface consists of three pages, as described below. You may use one or more servlets, or a combination of servlets and HTML pages to create the admin interface.
1. (30pt) The Game List page shows the list of the games that are currently in the system:
BetNBA - Admin | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Add Game |
2. (30pt) When an admin user clicks on the Add Game link, the application shows the Add Game page where the user can add a new game:
BetNBA - Add Game | ||||||
|
||||||
The application should check the input to make sure the information about the game is valid. In particular, a) the names of the teams and the date cannot be empty, b) the names of the teams cannot be the same, and c) the date is in the format of mm/dd/yyyy, e.g. 09/29/2008. If the input is valid, a new game is created and the user is redirected to the Game List page where the new game is displayed; otherwise the Add Game page will be displayed again with an error message telling the user to re-enter the information.
3. (30pt) When an admin user clicks on the Enter Result link, the application shows the Game Result page where the user can choose the winner of game. For example:
BetNBA - Game Result |
The winner of Game 4 is: |
After the user clicks the Save button, the user is redirected to the Game List page. Note that after the result of a game is entered, the Enter Result link in the Winner column of the game should be replaced with the name of the winning team.
[NOTES]