MIDTERM
CS320, Spring 2011


Please upload your files to CSNS. The files should include all the source code, documentation (optional), and an HTML file midterm.html which contains links to the two pages of your application deployed on the CS3 server. Note that file uploading will be disabled automatically after 3:30PM, and late submission will not be accepted.

[Problem Description]

In this exam you are going to develop an online voting application for American Idol. Your application  must use the MVC architecture as discussed in class, and the application must meet the following requirements:

The application should consist of a Voting page and a Contestants page. The Voting page allows a user to vote on a contestant, as shown below:

Haley  
Jacob
James
Lauren
Scott

After a user casts a vote, the application should record the vote, then redirect the user back to the voting page with the message "Thank you for your vote. Please keep voting.", as shown below:

Thank you for your vote. Please keep voting.

Haley  
Jacob
James
Lauren
Scott

A user can vote for whoever they want for as many times as they want.

The Contestants page should show the contestants and the numbers of votes they received. For example:

Contestant Votes
Haley 10
James 9
Jacob 7
Lauren 5
Scott [Voted Off] 5

The contestants should be ordered by the number of votes they received in descending order. The contestants with the same number of votes should be ordered alphabetically. There should be a Voted Off link beside the last-place contestant, and clicking on this link will remove the contestant from the application. Note that if a contestant is voted off, their name should be removed from the Voting page too.

[Grading Criteria]