Run the automatic lab grader

1.    Copy the following files to the root of your class folder, e.g., P:\cs256:

ag.jar

tools.jar

2.    Double click ag.jar to run the autograder.

The autograder is a program that uses a test harness to test your java lab. The autograder executes the following steps:

  1. Download the test harness program to your computer.
  2. Compile the test harness and your lab code.
  3. Execute the test harness, which calls your code and tests it.
  4. Gather the results and calculate a grade for your lab.
  5. Send the results back to the server.

To run the autograder, you need to supply both of the following:

You will also be asked for:

Your userID is the same ID you use to log into the SOU network.

You supply all information after you click to run the autograder.

Hints:

System.out.print()

Write all other outputs, including input prompts for the user to:

System.err.print()
"\n"

in the parameter you pass to println(). The autograder does not handle it correctly.

System.exit()

It kills your program and the autograder as well, so the autograder is unable to report your results to the server.

·        If your program is required to read input from the user:

You must declare your Scanner variable in class level scope (outside of any method) as follows:

   private static Scanner scan = new Scanner(System.in);

 

The autograder will throwing a NoSuchElement exception if you declare use a local variable to hold a reference to your Scanner object.

 

Troubleshooting:

Running the autograder on a mac:

The file tools.jar is called classes.jar on macs.  It can be found in a directory similar to /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0/Classes/classes.jar file.

 

Drag classes.jar onto the desktop. This will make a copy.  Rename classes.jar to tools.jar.

 

Drag tools.jar back into /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0/Classes/

 

A message box will pop up that states. "This folder can not be modified." There will be two buttons.  "Okay" and Authenticate.  Select the Authenticate option.  Authenticate with your admin user name and password and it will copy your new tools.jar file into the Classes directory.

 

Run the autograder. 

 

Point the autograder at your files using the Unix path system.  If you are just using your Home Directory the path will look something like /Users/YourName/Documents/CS257 (Hint: Remember Unix is cases sensitive)

 

Point to the new tools.jar file you just created by pasting in /System/Library/Frameworks/JavaVM.framework/Versions/1.8.0/Classes/ you have the option to leave off tools.jar or append it.  The autograder will automatically look for tools.jar in whatever director you point it at. 

 

Run the autograder like normal.

 

Notes on other issues. 

 

Best of luck to you. Please contact Pete Nordquist with questions or comments about the autograder. If you get exceptions that you do not understand, please copy the entire output log into an email message and send it to me. Thank you.

The autograder is licensed under the GNU GPL.
Click here for source code (in zip format) for the autograder.
Click here for a sample test harness.