Homework 2
CS320, Spring 2011


Due: Thursday, April 21

Please upload your files to CSNS. The files should include all the source code, documentation (optional), and an HTML file hw2.html which contains a link to your application deployed on the CS3 server. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.


[Readings]

[CS320Answers] 

In this assignment you are going to continue to work on the application CS320Answers. All features described in Homework 1 must work properly; otherwise there will be a credit penalty of up to 60%.

1. (40pt) Security.

Implement security so that all users can view questions and answers, but only authenticated users (i.e. users who have already logged in) can post questions and answers. In particular, your implementation must meet the following requirements:

Note that a few changes must be made to the user interface as part of the security implementation:

2. (50pt) Vote on Answers.

An authenticated user may give an answer a positive vote (i.e. 1) or a negative vote (i.e. -1) depending on whether the user thinks the answer is helpful or not. Each user can only give one vote to an answer, though the user is allowed to change the vote at any time. A user may not vote on their own answers.

Answers for a question should be displayed in descending order of the sum of their votes. Answers with the same vote sum should be ordered by the time they are posted in descending order.

To receive full credit for this exercise, the user interface for voting on answers should be intuitive and easy to use.