reset password

Please deploy your application on CS3, and upload all source files to CSNS. The source files should include all the source code, documentation (optional), and an HTML file final.html which contains a hyperlink to your application on the CS3 server. Note that file uploading will be disabled automatically after the due time, and late submission will not be accepted.


In this exam you are going to develop a simplified StackOverflow.

Your application must use a database to store the data, and you must submit an SQL script file final.sql which contains the statements to create and populate all the tables for the application. Your implementation must follow the MVC architecture and use JDBC for database access.

The main page of the application displays the questions and the number of answers for each question. For example:

Ask a Question

# of Answers Question
0 Which version of Tomcat should I choose?
3 How do I find the parent element using jQuery?

A user may click on Ask a Question to ask a new question. For example:

Question
Details

After a question is added, the user should be redirected back to the main page.

A user may click on a question to see the details and the answers (if any) of a question as shown below:

Back to Questions | Answer

Question: How do I find the parent element using jQuery?

Details: I want to locate the parent <tr> inside the click handler of a <td>. How do I do it in jQuery?

Answer #1: Use $(this).find("tr")

Answer #2: The first answer is incorrect. It should be $(this).closest("tr")

Answer #3: You can also do $(this).parent()

Clicking on Back to Questions should take the user back to the main page. A user can also click on Answer to answer the questions:

Question How do I find the parent element using jQuery?
Answer

After an answer is added, the user should be redirected back to the page displaying the question and its answers.


Grading