This repository contains the Rails application used to run 6.470 hackathons.
The 6.470 hackathon software is broken up into a Web front-end that keeps track of users, submissions and scores, and one or many grading endpoints that implement the problem-specific grading code. The endpoints are stateless.
The front-end talks to the endpoints using a HTTP-based protocol. Each submission is sent to a grading endpoint via a POST request with the following parameters:
task
is a problem name, such asjs-console
; endpoints have complete control over the problem names, and the front-end admin UI allows the hackathon staff to set up the names sent to the endpointscode
is the contestant-submitted code
The grading endpoint returns a HTTP response with the following headers.
X-Grader-Score
is an integer between 0 and the maximum possible scoreX-Grader-Maxscore
is an integer indicating the maximum score that the endpoint awards for this problem set; this doesn't need to be the same as the user-visible scoreX-Grader-Verdict
is a brief (one-line) explanation of the score
The body of the grader's HTTP response is saved and made available to the
contestants. The response should help contestants understand the verdict, and
should be a static HTML page with no external references (use inline CSS
styles, data:
image URLs, etc.) and no JavaScript.
The following extensions might be implemented in future protocol versions.
X-Grader-Warning
flagging submissions that seem to break into the grading system, and should be reviewed- A GET request for obtaining the list of problems implemented by a grading endpoint, as well as the problem text in Markdown
First, follow the installation instructions for the sample grading endpoint. The endpoint shares many requirements with the front-end. The endpoint should be running during the setup process.
Get the code and its required libraries.
git checkout [email protected]:csail/mit6470-hackathon.git
cd mit6470-hackathon
bundle install
Set up the development database.
bundle exec rake db:create db:migrate db:seed
Start a development server at http://localhost:10000.
bundle exec foreman start
The initial setup is similar to the development setup.
git checkout [email protected]:csail/mit6470-hackathon.git
cd mit6470-hackathon
bundle install
RAILS_ENV=production bundle exec rake db:create db:migrate
The application should be set up as a system daemon.
sudo foreman export systemd /etc/systemd/system --procfile=Procfile.prod --env=config/production.env --user=$USER --port=12300
sudo foreman export upstart /etc/init --procfile=Procfile.prod --env=config/production.env --user=$USER --port=12300