-
Notifications
You must be signed in to change notification settings - Fork 9
Documents
Download latest version from https://github.com/hit-moodle/onlinejudge/archives/master
Untar/unzip, rename dirname to onlinejudge and put it into <Installed Moodle Directory>/mod/assignment/type/
Linux only. Windows users skip to next step.
Requirement: Linux 2.6.x, gcc 4.x and make
In mod/assignment/type/onlinejudge/sandbox/, run:
$ makeThe last line of make’s output must be All testcases are OK.
Users who want to use ideone.com should do this step. Windows users can use ideone.com only
Requirement: php with soap extension
# register here: http://ideone.com/account/register # After activation, login and set *API password* here: http://ideone.com/account/ # Open config.php and add the following lines:
$CFG->assignment_oj_ideone_username = 'change_me_to_ideone_username';
$CFG->assignment_oj_ideone_password = 'change_me_to_ideone_API_password'; There are two recommended routines to make the judge work. The first is the most recommended but it works in Linux only.
(Linux only)
Setup moodle’s cron job to be called by php cli. In crontab, put a command which is similar with:
php -q /PATH/TO/MOODLE/admin/cron.phpThat’s all! Read http://docs.moodle.org/en/Cron for detail about how to setup moodle cron job triggered by php cli (Not wget, curl and etc.).
If it works, a judge daemon would be created. Use
ps -FC phpto ensure the daemon is running.
If you can NOT trigger cron through php cli or are using Windows, then use this method.
Run the following command to create judge daemon:
sudo -u APACHE-USER php /PATH/TO/MOODLE/mod/assignment/type/onlinejudge/judged.phpThe APACHE-USER means the username of apache in your system. It is www-data in debian, apache in fedora. Perhaps `ps aux|grep apache` or `ps aux|grep httpd` can help you getting the correct username.
Use
ps -FC phpto ensure the daemon is running.
# Overwrite the directory, onlinejudge/, with latest version. # Repeat step 2-4 in Installation # Routine 5.1 can apply the upgrade automatically. # If you are using routine 5.2, kill the existing daemon and do the routine again.
The same as other standard assignment types. Follow its inline help.
See [OnlineJudgeFAQ]