Giter Site home page Giter Site logo

zhaospei / online-judge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lqdjudge/online-judge

0.0 0.0 0.0 13.47 MB

LQD Online Judge

Home Page: https://lqdoj.edu.vn

License: GNU Affero General Public License v3.0

Shell 0.01% JavaScript 33.96% Python 34.84% CSS 10.78% HTML 18.29% SCSS 2.12%

online-judge's Introduction

LQDOJ: Le Quy Don Online Judge

Python OS License

Overview

Homepage: https://lqdoj.edu.vn

Based on DMOJ.

Supported languages:

  • Assembly (x64)
  • AWK
  • C
  • C++03 / C++11 / C++14 / C++17 / C++20
  • Java 11
  • Pascal
  • Perl
  • Python 2 / Python 3
  • PyPy 2 / PyPy 3

Support plagiarism detection via Stanford MOSS.

Installation

Most of the setup are the same as DMOJ installations. You can view the installation guide of DMOJ here: https://docs.dmoj.ca/#/site/installation. There is one minor change: Instead of git clone https://github.com/DMOJ/site.git, you clone this repo git clone https://github.com/LQDJudge/online-judge.git.

Some frequent difficulties when installation:

  1. Missing the local_settings.py. You need to copy the local_settings.py in order to pass the check.
  2. Missing the problem folder in local_settings.py. You need to create a folder to contain all problem packages and configure in local_settings.py.
  3. Missing static folder in local_settings.py. Similar to problem folder, make sure to configure STATIC_FILES inside local_settings.py.
  4. Missing configure file for judges. Each judge must have a seperate configure file. To create this file, you can run python dmojauto-conf. Checkout all sample files here https://github.com/DMOJ/docs/blob/master/sample_files.
  5. Missing timezone data for SQL. If you're using Ubuntu and you're following DMOJ's installation guide for the server, and you are getting the error mentioned in LQDJudge#45, then you can follow this method to fix:
mysql
-- You may have to do this if you haven't set root password for MySQL, replace mypass with your password
-- SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');
-- FLUSH PRIVILEGES;
exit
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -D mysql -u root -p 
mysql -u root -p -e "flush tables;" mysql
  1. Missing the chat secret key, you must generate a Fernet key, and assign a variable in local_settings.py like this
CHAT_SECRET_KEY = "81HqDtbqAywKSOumSxxxxxxxxxxxxxxxxx="

Usage

Suppose you finished all the installation. Everytime you want to run a local server, follow these steps:

  1. Activate virtualenv:
source dmojsite/bin/activate
  1. Run server:
python3 manage.py runserver 0.0.0.0:8000
  1. Create a bridge (this is opened in a different terminal with the second step if you are using the same machine)
python3 manage.py runbridged
  1. Create a judge (another terminal)
dmoj 0.0.0.0 -p 9999 -c <path to yml configure file>

Here we suppose you use the default port 9999 for bridge in settings.py. You can create multiple judges, each should be in a seperate terminal.

Optional

  1. Run celery worker (This is server's queue. It may be necessary in some functions)
celery -A dmoj_celery worker
  1. Run a live event server (So everything is updated lively like in the production)
node websocket/daemon.js
  1. To use subdomain for each organization, go to admin page -> navigation bar -> sites, add domain name (e.g, "localhost:8000"). Then go to add USE_SUBDOMAIN = True to local_settings.py.

Deploy

Most of the steps are similar to Django tutorials. Here are two usual steps:

  1. Update vietnamese translation:
  • If you add any new phrases in the code, python3 manage.py makemessages
  • go to locale/vi
  • modify .po file
  • python3 manage.py compilemessages
  • python3 manage.py compilejsi18n
  1. Update styles (using SASS)
  • Change .css/.scss files in resources folder
  • ./make_style.sh && python3 manage.py collectstatic
  • Sometimes you need to press Ctrl + F5 to see the new user interface in browser.

Screenshots

Leaderboard

Leaderboard with information about contest rating, performance points and real name of all users.

Admin dashboard

Admin dashboard helps you easily managing problems, users, contests and blog posts.

Statement editor

You can write the problems' statement in Markdown with LaTeX figures and formulas supported.

Chat

Users can communicate with each other and can see who's online.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.