Test My Code ("TMC") is a tool to automate most of the exercise checking when teaching programming. It runs code submitted by students, gives feedback if tests fail and maintains a scoreboard. This allows for lots of small exercises without the need for course instructors to manually go through all of them.
The system has been used with great success by the University of Helsinki CS Dept. in several elementary programming and data structures courses with hundreds of users.
Very rought setup instructions below.
The following programs should be installed first: git
, zip
, unzip
, convert
(from ImageMagick), javac
, java
, ant
, mvn
.
An X server is currently needed for tests to pass (required by capybara-webkit). Xvfb
will do, but remember to set your DISPLAY
.
We assume you use RVM. If you don't, then replace rvmsudo
with sudo
below.
(note: RVM 1.17.x may have some problems with rvmsudo)
- Download submodules with
git submodule update --init --recursive
- Install dependencies with
gem install bundler && bundle install
- Edit
config/site.yml
based onconfig/site.defaults.yml
. - Install PostgreSQL 9.x+. See
config/database.yml
for database settings. - Initialize the database with
env RAILS_ENV=production rake db:reset
- Go to
ext/tmc-sandbox
and compile it withsudo make
. See its readme for dependencies. - Go to
ext/tmc-sandbox/web
and install dependencies withbundle install
. Compile extensions withrake ext
and run tests withrvmsudo rake test
. - Compile the other suff in
ext
by doingrake compile
. - Run the test suite with
rvmsudo rake spec
.
After you get the test suite to pass, you can set up start background services.
- Recheck your comet server config in
site.yml
and then dorvmsudo rake comet:config:update
. - Install init scripts:
rvmsudo rake comet:init:install
,rvmsudo rake reprocessor:init:install
. - Start the services:
sudo /etc/init.d/tmc-comet start
,sudo /etc/init.d/tmc-submission-reprocessor start
. - If you use Apache, then make sure
public/
andtmp/
are readable and install mod_xsendfile. Configure XSendFilePath to thetmp/cache
directory of the application.
The application should not be deployed into a multithreaded server! It often changes the current working directory, which is a process-specific attribute. Each request should have its process all to itself. If you use Apache with, say, Passenger, then use the prefork MPM.
rails server
or some other RoR setup.- Go to
ext/tmc-sandbox/web
and dorackup --port 3001
or some other Rack setup. rake dev:comet:run
script/submission_reprocessor start
Alternatively use script/dev_env
to do all of the above in
screen.
The default user account is admin
/admin
.
- Run
rvmsudo rake init:install
to install the init script for the submission rerunner. - Do the same in
ext/tmc-sandbox/web
to install the init script for the sandbox.
The project started as a Software Engineering Lab project at the University of Helsinki CS Dept. but has since been gradually almost completely rewritten. The original authors of the server component were
- Patrik Marjanen
- Jarno Mynttinen
- Martti Rannanjärvi (mrannanj)
- Katri Rantanen
Another team wrote a NetBeans plugin for the system.
The course instructor and current maintainer of the project is Martin Pärtel (mpartel). Other closely involved instructors were
- Matti Luukkainen (mluukkai)
- Antti Laaksonen
- Arto Vihavainen
- Jaakko Kurhila
C support was incuded in another Software Engineering Lab project at the University of Helsinki CS Dept. Authors in this project were