FINAL
CS320, Spring 2011


Please upload your files to CSNS. The files should include all the source code, documentation (if any), and an HTML file final.html which contains a link to your application deployed on the CS3 server. Note that file uploading will be disabled automatically after 4:00PM, and late submission will not be accepted.

[Online Poll]

In this exam you are going to create a web application that manages online polls like the following:

Which topic do you prefer for the last lecture?

Introductory PHP

More Java EE

No preference

For simplicity we assume that an online poll consists of only one question and exactly three possible answers. Users may take a poll by selecting one of the three answers.

[List Polls]

The main page of the application lists the existing polls. For example:

Create a Poll

Polls  
Which topic do you prefer for the last lecture? Take the Poll | Results
Who is the greatest basketball player of all time? Take the Poll | Results

[Create a Poll]

When a user clicks on the link Create a Poll, the application shows the following page where the user can create a new poll:

Question:
Answer 1:
Answer 2:
Answer 3:

Clicking on the Create button should save the poll and take the user back to the main page.

[Take a Poll]

When a user click on the link Take the Poll, the application shows the poll and records which answer the user selects. For simplicity (and ease of testing) we allow a user to take a poll multiple times.

[Display Results]

When a user clicks on the link Results, the application displays the results of the poll, i.e. the number of times each answer is selected. For example:

Which topic do you prefer for the last lecture?

Back to Polls

Clicking on the link Back to Polls should take the user back to the main page.

[Requirements]

Your application must use a database to store the polls and the user responses. You must submit an SQL script file  final.sql file which contains the statements to create all the tables for the application. 

In your application, servlets (if you use any) cannot be used to generate HTML content, and no scripting elements are allowed in JSP pages. For simplicity, we assume that all user input are correct so you do not need to do input validation.

[Grading Criteria]