Autograder is a program for automatically checking and grading students' programming projects
Follow these instructions to download the code for autograder and install the required dependencies:
wget https://github.com/rhomeister/autograder/archive/master.zip
unzip master.zip
cd autograder
sudo apt-get -y install python-setuptools
sudo python setup.py install
Note: these need to be written. Currently inviting help from users
Install dependencies:
If you don't have brew and wget, you install them with the following commands:
-
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
brew install wget
If you don't have Python with Setuptools & Pip:
brew install python
Note: MacOS has a python version installed by default, but it doesn't have Setuptools & Pip by default
Install Autograder:
wget https://github.com/rhomeister/autograder/archive/master.zip
unzip master.zip
cd autograder
sudo python setup.py install
Troubleshooting
If you have any issues during installation, most likely its an issue installing a dependency or you haven't set up the local info. Most of the time it can be solved with the next steps.
-
Change the ownership from your Python Library
sudo chown -R $USER /Library/Python/
-
Install ez_setup
sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | python
-
Add the required exports to your bash or zsh profile:
nano ~/.bash_profile
Paste at the end of the file:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
-
Reload your bash profile
source ~/.bash_profile
-
Retry installing/running Autograder
Note: after reading these instructions, it is highly recommended you try creating a dummy submission to the example assignment below.
Setup your Git identity. Every team member must do this, because every team member will contribute to the code. Follow these steps:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
For a project to be autograder compatible, it must satisfy the following requirements:
- It must be a git repository
- It must contain the following files in the root of the project:
- a simple text file
team.txt
with the names of all team members, one per line - a file
report.pdf
with the report - a script/program
run
which runs your program. This file will be called with no arguments (see next item)
- a simple text file
- The program should read the problem description from stdin, and output to
stdout. This means that your program will be called using:
run < problem.in
. Below are some links to pages that explain how to do this in a couple different languages:- Python: (http://stackoverflow.com/questions/13001212/read-n-test-cases-from-file-in-python)
- Java: (http://codeforces.com/blog/entry/7018)
- C++: (https://sites.ualberta.ca/~hbrausen/basics/inputoutput.html)
- (Inviting suggestions for examples for other languages...)
- The program must be correct. This is verified by checking your program against
a number of test cases. Autograder searches for these testcases in the
testcases
directory. These test cases can be provided by the teacher, but you can also create your own. Test cases come in pairs:[filename].in
containing the input supplied to your program[filename].out
containing the expected output of your program
To verify that your submission satisfies all these requirements, commit your
work (locally is sufficient) and run autograder
from the root directory
of your project.
Before submitting your project, do a final check:
- Commit your code and push it to the git repository
- Run autograder against the repository using
autograder [URL]
, whereURL
is the clone URL of your project.
Note Depending on the class policies, your submission can be rejected if there are any errors or failed test cases.
To check a students' submission, run:
autograder --testcasedir [TESTCASEDIR] [URL]
TESTCASEDIR
: the directory with input/output pairs (see above) containing problem descriptions you want to test the students' submission against.URL
: the URL of the git repository.
Note: this means that in order to submit their projects, students can simply send you the URL of their git repository.
For an example assignment, see this repository.
For an example submission based on the example assignment, see this repository.
Result of executing:
autograder https://github.com/rhomeister/autograder-example-submission