Skip to content

A free and open source online judge system for programming courses

License

GPL-3.0, OSL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
OSL-3.0
CI_LICENSE
Notifications You must be signed in to change notification settings

ferdianexe/Sharif-Judge

 
 

Repository files navigation

SharIF Judge

Build Status

SharIF Judge is a free and open source online judge for C, C++, Java and Python programming courses. SharIF Judge is a fork of the original SharIF Judge beautifully created by @mjnaderi. This forked version contain many improvements, mostly due to the needs by our faculty at @ftisunpar.

The web interface is written in PHP (CodeIgniter framework) and the main backend is written in BASH.

Python in SharIF Judge is not sandboxed yet. Just a low level of security is provided for python. If you want to use SharIF Judge for python, USE IT AT YOUR OWN RISK or provide sandboxing yourself.

The full documentation is at https://github.com/ftisunpar/Sharif-Judge/tree/docs

Download the latest release from https://github.com/ftisunpar/Sharif-Judge/releases

Features

  • Multiple user roles (admin, head instructor, instructor, student)
  • Sandboxing (not yet for python)
  • Cheat detection (similar codes detection) using Moss
  • Custom rule for grading late submissions
  • Submission queue
  • Download results in excel file
  • Download submitted codes in zip file
  • "Output Comparison" and "Tester Code" methods for checking output correctness
  • Add multiple users
  • Problem Descriptions (PDF/Markdown/HTML)
  • Rejudge
  • Scoreboard
  • Notifications
  • Lock Student's Display Name
  • Archived Assignment
  • Hall of Fame
  • 24-hour Logs
  • ...

Requirements

For running SharIF Judge, a Linux server with following requirements is needed:

  • Webserver running PHP version 5.3 or later with mysqli extension
  • PHP CLI (PHP command line interface, i.e. php shell command)
  • MySql or PostgreSql database
  • PHP must have permission to run shell commands using shell_exec() php function (specially shell_exec("php");)
  • Tools for compiling and running submitted codes (gcc, g++, javac, java, python2 and python3 commands)
  • It is better to have perl installed for more precise time and memory limit and imposing size limit on output of submitted code.

Installation

  1. Download the latest release from download page and unpack downloaded file in your public html directory.
  2. [Optional] Move folders system and application somewhere outside your public directory. Then save their full path in index.php file ($system_path and $application_folder variables).
  3. Create a MySql or PostgreSql database for SharIF Judge. Do not install any database connection package for C/C++, Java or Python.
  4. Set database connection settings in application/config/database.php.
  5. Make application/cache/Twig writable by php.
  6. Open the main page of SharIF Judge in a web browser and follow the installation process.
  7. Log in with your admin account.
  8. [IMPORTANT] Move folders tester and assignments somewhere outside your public directory. Then save their full path in Settings page. These two folders must be writable by PHP. Submitted files will be stored in assignments folder. So it should be somewhere not publicly accessible.
  9. [IMPORTANT] Secure SharIF Judge

After Installation

Running The Testing

  1. Clone the project first git clone https://github.com/ferdianexe/Sharif-Judge.git
  2. If you dont have MySQL install it first.
  3. Create new database in MySQL. [IMPORTANT] For testing you need to run the test in new database, otherwise ALL data will be lost.
  4. Run composer install. [IMPORTANT] Install composer to your system if it the system doesn't already have composer.
  5. Make sure the files application/config/database.php and application/config/secrets.php exist in the config folder. If it doesn't exist, make a copy of respectively application/config/database.example.php or application/config/secrets.example.php and rename it.
  6. Set new database connection settings in application/config/database.php.
  7. Make application/cache/Twig writable by php, if it isn't already.
  8. Create a folder in root directory for example reports-dev. The test report and code coverage will be rendered in this folder [See step 11].
  9. Create a new folder in directory restricted/ and give the folder name assignments
  10. Run the migrations first in terminal php index.php tests/Migrations [IMPORTANT] You dont need to do this if you already have a database for testing.
  11. In controllers/test/RunTest.php. check this line of code $writer->process($this->coverage, '`reports-dev`/code-coverage'); and file_put_contents('`reports-dev`/test_report.html', $this->unit->report()); change ONLY reports-dev to the folder that you made in the step 8.
  12. If you want to render the code coverage result, set const ENABLE_COVERAGE value in controllers/test/RunTest.php to TRUE [IMPORTANT] xdebug needed.
  13. To run the test in terminal, run the command php index.php tests/RunTest. The test result will be printed in the terminal.

License

GPL v3

About

A free and open source online judge system for programming courses

Resources

License

GPL-3.0, OSL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
OSL-3.0
CI_LICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 70.2%
  • PHP 27.6%
  • JavaScript 1.1%
  • CSS 0.7%
  • Perl 0.2%
  • Shell 0.1%
  • Other 0.1%