CS 185C/286 - Homework 7

In this assignment, you will add a server component to homework 2, extending that from the last lab.

First make http://localhost:8080/testbank/rest/quiz/current return the quiz with the largest ID number. You won't know what's in the database that is used for testing, so be sure to implement this correctly. You can make a MAX query in JPQL.

Also add a POST query to send the user's reply to the server when the user has made a selection. The server should track how many answers were made to each choice (by someone--no need to track who). Use POST because this the RESTful way of updating the database. Use JAXB to turn all query results into XML. (It doesn't have to be the same XML as in homework 2.) In the client, display the counts for all selections made by any users so far after choice has been made. Color the correct choice in green and, if the user showed a different one, color the user's choice in red. When the user hits the back button, the list of questions should be redisplayed. As in homework 2, an answered question cannot be selected again.

Put report.txt into the workspace/hw07 directory. 1) Explain how you find the quiz with the largest ID. 2) Explain how you implemented the POST query. 3) Describe what you needed to do to generate XML query results. 4) Describe which websites you visited for help, and which problems they helped you solve. Describe at least two such problems. Extra credit for each question that you asked. (Provide the URLs.).

Submit your work in two subfolders hw7client and hw7server of the workspace directory.

Due date: Mon. May 13 18:00