Create a basic autograder (helloworld)
The autograder is the name for the code package you write which will grade the student submission code and give back a grade, among other types of feedback. The best way to explain how to build an autograder is to show an example – in this case we will be building an autograder which tests a student’s ability to print out “Hello World” to standard output. The example will be in Java code.
Refer
here to get a sense of the components involved
- First, you must create the two grading files: autograde.tar and autograde-Makefile
- autograde.tar
- The tarfile contains our “grader code” which needs at least one file with a “main” function to execute.
- See our example TestHelloWorld.java here: (link)
- The essential steps to include are to:
- Read in the student submission file (which likely must match some exact filename or class name)
- Run the student file and run as many tests against it as you wish (more on the intricacies of testing in this way later)
- Calculate a final score and then print it in the needed format (link needed)
- Create the tarfile through whatever means you wish:
- autograde-Makefile
- The makefile is meant to mostly do the following:
- Extract the tarfile package (autograde.tar)
- Compile therelevant files found therein
- Execute the test class (the main entry point into the autograder code)
- It will will look something like the below:
- You now have an autograde.tar and an autograde-Makefile — these should be uploaded into your assessment via:
- Assessment home page -> Admin Options -> Edit Assessment -> Modules Used -> Autograder (hit the plus sign to create, or pencil sign to edit) -> Click the buttons to upload your files
- You can then return here via: Admin Options -> Autograder Setting