reset password

CS520 Grading Homework

The main part of grading is to deploy and run the webapp. Since you are going to grade 20~30 students per class, you'd want to do it as efficiently as possible. This guide will describe what I usually do, and if you find a more efficient way, please let me know. The instructions are for Windows with Cygwin command line console. Using regular Windows command line should be quite similar, but in either case you need to make sure the commands you want to run are included in the PATH environment variable.

Preparation

1. Download the latest Tomcat 7 zip package and unzip it to a local folder $TOMCAT. Edit $TOMCAT/conf/tomcat-users.xml to add a user with the manager-gui role. For example:

<user username="cysun" password="abcd" roles="manager-gui" />

Double click $TOMCAT/bin/startup.bat. This will start a Tomcat server on the localhost at port 8080. You can edit $TOMCAT/conf/server.xml to change the port number if necessary.

Open a browser and go to http://localhost:8080. Click on Manager App, enter the username and password of the manager-gui user to access the Tomcat Webapp Manager interface.

2. Create an empty PostgreSQL database (and a MySQL database if the students are allowed to use MySQL). For this quarter it should be ttt with username ttt and password abcd.

3. Download all the submissions from CSNS as a zip file and unzip it to a local folder $HW.

Grading

Open a command line console and change directory to $HW. The following steps are all performed on command line:

> cd <student>
> unzip ttt-src.zip
> cd ttt
> psql ttt < src/main/scripts/ttt-create.sql
> mvn package

Deploy the webapp by uploading $HW/<student>/ttt/target/ttt.war in the War file to deploy section of Tomcat Manager. If the deployment is successful, the webapp will appear in the Applications section with its Running status being true. You can then click on its path to go to the webapp.

After you are done grading the webapp, undeploy it by clicking on Undeploy in Tomcat Manager, then clear the content of the database and change the directory back to $HW:

> psql ttt < src/main/scripts/ttt-drop.sql
> cd ../..

To grade another submission, simply repeat the step above.

Notes

1. Tomcat cannot reclaim all the memory used by a webapp after the webapp is undeployed. What this means is that after deploy/undeploy a few times you'll see an OutOfMemory error. I suggest that you restart Tomcat every time after you grade two submissions. To restart Tomcat, simply double click $TOMCAT/bin/shutdown.bat to shut it down, then double click $TOMCAT/bin/startup.bat to start it up again.

2. If every student follows the homework instructions exactly, the grading process should be relatively smooth, but unfortunately there are always people who don't follow instructions. Here are some common problems:

  • There are errors in the db-create script. Give 0 for the assignment and ask the student to send you the correct db script for a regrade; -5pt after regrade.
  • There are errors in the db-drop script. -3pt for the first time; -5pt in each subsequent assignment if it's not corrected.
  • Wrong database name or database uername/password. Edit src/webapp/WEB-INF/applicationContext.xml to change it.
  • "mvn package" fails at the testing phase. This usually happens when a student updated the data models but forgot to update the test cases accordingly. You can edit pom.xml to skip testing. -3pt for the first time; -5pt in each subsequent assignment if it's not corrected.
This page has been viewed 1910 times.