Homework 3
CS520, Fall 2011
Due: Thursday, October 27
Package all the source files of your project into a zip file as you did in Homework 1 and
upload the zip file to CSNS. In addition to the zip file, also upload a text file hw3.txt which lists all the Java class you have created or modified.
Note that file
uploading will be disabled automatically after 11:59PM
of the due date, so please turn in your work on time.
[Readings]
- Java
Persistence with Hibernate
- Hibernate
Annotations
- CSNS2 Source Code
- Model and DAO classes under src/main/java/csns/model
[Rubrics for CSNS2]
This
quarter you are going to add rubrics
support to CSNS2, which will allow instructors to create and manage
rubrics, and grade student assignments using rubrics. You may want to check out the department program assessment page to see what rubrics look like.
[Model and ORM] (40pt)
Create new model classes and/or modify existing ones
and map them to a relational schema using JPA annotations based on the
following requirements:
-
Create a Rubric
class that holds the information about a rubric. This class should be in the csns.model.assessment package.
- A rubric has a name, a rating scale which is either 1-3, or 1-4, or 1-5, and a number of criteria.
- Each criterion has a name, and for each rating value, a description of the performance quality that warrants the rating.
- One or more rubrics can be associated with an assignment. For
example, we may associate an Oral Communication rubric to
the Midterm Presentation assignment in CS520. The instructor
grades a
student's work for the assignment by giving a rating to each
criterion in each rubric associated with the assignment. The ratings
for a rubric is stored in a class RubricScore in the csns.model.assessment package.
Run Maven build mvn process-classes (or the equivalent in Eclipse) to generate a new src/main/scripts/csns.ddl
file and check if the database schema is what you expect.
[Database Scripts] (20pt)
Based on the csns.ddl
file generated in the previous exercise, modify the following database
scripts to to add the rubrics support:
- src/main/scripts/csns-create.sql
- src/main/scripts/csns-drop.sql
Read the database script src/main/scripts/csns-test-insert.sql, understand what it does, complete a quiz about the script on CSNS, and then modify the script as follows:
- Add an assignment Midterm Presentation to the CS520 section in Fall 2011. The assignment id should be 1000450.
- Create an Oral Communication rubric with a rating scale of 1-3 and three criteria. The rubric id should be 1001000.
- Associate the Oral Communication rubric with the Midterm Presentation assignment.
- Give the student John Doe an Oral Communication score of (2,3,2) for the Midterm Presentation assignment.
[Data Access] (20pt)
Add RubricDao and RubricScoreDao to the csns.model.assessment.dao package and RubricDaoImpl and RubricScoreDaoImpl to the csns.model.assessment.dao.jpa
package. Use existing DaoImpl classes as examples to complete the methods in RubricDaoImpl and RubricScoreDaoImpl.
[Testing]
Create a new package csns.model.assessment.dao under src/test/java
and place RubricScoreDaoTest in this package.
Run the test code by using mvn test, or in Eclipse, right click on
testng.xml under src/test/resources and select Run As -> TestNG
Suite. In either case you should not see any errors.
[Subversion]
Commit all the changes to your Subversion repository, and
create a tag called cs520-hw3.