From e378e5c8d13436476d286b285f1cb31d1310d6b9 Mon Sep 17 00:00:00 2001 From: thanhluong Date: Sat, 2 Jan 2021 16:49:12 +0900 Subject: [PATCH 1/8] Update README --- README.md | 90 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a742684..47826cb 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,85 @@ -# online-judge -### 1. Activate virtualenv: +LQDOJ: Le Quy Don Online Judge +=== + +[![](https://github.com/DMOJ/online-judge/workflows/build/badge.svg)](https://lqdoj.edu.vn/) +[![Python](https://img.shields.io/pypi/pyversions/tensorflow.svg?style=plastic)](https://python.org) +[![OS](https://img.shields.io/badge/Ubuntu-16.04%20%7C%2018.04%20%7C%2020.04-brightgreen)](https://ubuntu.com/download) + +## Overview + +Homepage: [https://lqdoj.edu.vn](https://lqdoj.edu.vn) + +Supported languages: + +- Assembly (x64) +- AWK +- C +- C++03 / C++11 / C++14 / C++17 +- Java 11 +- Pascal +- Perl +- Python 2 / Python 3 + +## Installation + +Activate virtualenv: +```bash source dmojsite/bin/activate -### 2. Remember to change the local_settings +``` -### 3. Run server: +Remember to update the `local_settings.py`. + +Run server: +```bash python manage.py runserver 0.0.0.0:8000 +``` -### 4. Create configure file for judge: +Create configure file for judge: +```bash python dmojauto-conf +``` -### 5. Create folder for problems, change the dir in judge conf file and local_settings.py +Create folder for problems, change the dir in judge conf file and `local_settings.py`. -### 6. Connect judge: -+ python manage.py runbridged -+ dmoj 0.0.0.0 -p 9999 -c judge/conf1.yml (depend on port in the local_settings.py and directory of conf file) +Connect judge: +```bash +python manage.py runbridged +dmoj 0.0.0.0 -p 9999 -c judge/conf1.yml (depend on port in the local_settings.py and directory of conf file) +``` -### 7. Update vietnamese translation: - - go to locale/vi - - modify .po file - - python manage.py compilemessages - - python manage.py compilejsi18n +Update vietnamese translation: + - go to `locale/vi` + - modify `.po` file + - ```bash python manage.py compilemessages``` + - ```bash python manage.py compilejsi18n``` -###8. Run chat server: +Run chat server: +```bash docker run -p 6379:6379 -d redis:2.8 +``` + +## Screenshots + +### Leaderboard + +Leaderboard with information about contest rating, performance points and real name of all users. + +![](https://i.imgur.com/ampxHXM.png) + +### Admin dashboard + +Admin dashboard helps you easily managing problems, users, contests and blog posts. + +![](https://i.imgur.com/iccr3mh.png) + +### Statement editor + +You can write the problems' statement in Markdown with LaTeX figures and formulas supported. + +![](https://i.imgur.com/CQVC754.png) + +### Chat + +Users can communicate with each other and can see who's online. + +![](https://i.imgur.com/y9SGCgl.png) \ No newline at end of file From 975c975e695c440d03665ffcf589cfcd4f91e8ae Mon Sep 17 00:00:00 2001 From: thanhluong Date: Sat, 2 Jan 2021 16:55:04 +0900 Subject: [PATCH 2/8] Update acknowledgement --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 47826cb..c542a8c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ LQDOJ: Le Quy Don Online Judge Homepage: [https://lqdoj.edu.vn](https://lqdoj.edu.vn) +Based on [DMOJ](https://dmoj.ca/). + Supported languages: - Assembly (x64) From 390b6632e68fc456b11c17eaaa12f7979173b78d Mon Sep 17 00:00:00 2001 From: thanhluong Date: Sat, 2 Jan 2021 17:12:18 +0900 Subject: [PATCH 3/8] Update README --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c542a8c..c817a4d 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,19 @@ Supported languages: - Perl - Python 2 / Python 3 +Support plagiarism detection via [Stanford MOSS](https://theory.stanford.edu/~aiken/moss/). + ## Installation +Check out the install documentation at [docs.dmoj.ca](docs.dmoj.ca). Remember to update the `local_settings.py`. + +## Usage + Activate virtualenv: ```bash source dmojsite/bin/activate ``` -Remember to update the `local_settings.py`. - Run server: ```bash python manage.py runserver 0.0.0.0:8000 From 5116e142577817e56959de656bd76a2ae12de6e1 Mon Sep 17 00:00:00 2001 From: Phuoc Dinh Le <47278241+cuom1999@users.noreply.github.com> Date: Sat, 2 Jan 2021 02:29:58 -0600 Subject: [PATCH 4/8] Update README.md --- README.md | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c817a4d..d996a5e 100644 --- a/README.md +++ b/README.md @@ -26,44 +26,55 @@ Support plagiarism detection via [Stanford MOSS](https://theory.stanford.edu/~ai ## Installation -Check out the install documentation at [docs.dmoj.ca](docs.dmoj.ca). Remember to update the `local_settings.py`. +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. ## Usage -Activate virtualenv: +Suppose you finished all the installation. Everytime you want to run a local server, follow these steps: + +1. Activate virtualenv: ```bash source dmojsite/bin/activate ``` -Run server: +2. Run server: ```bash python manage.py runserver 0.0.0.0:8000 ``` -Create configure file for judge: -```bash -python dmojauto-conf -``` - -Create folder for problems, change the dir in judge conf file and `local_settings.py`. - -Connect judge: +3. Create a bridge (this is opened in a different terminal with the second step if you are using the same machine) ```bash python manage.py runbridged -dmoj 0.0.0.0 -p 9999 -c judge/conf1.yml (depend on port in the local_settings.py and directory of conf file) ``` -Update vietnamese translation: +4. Create a judge (another terminal) +```bash +dmoj 0.0.0.0 -p 9999 -c +``` +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. + +## Deploy +Most of the steps are similar to Django tutorials. Here are two usual steps: + +1. Update vietnamese translation: - go to `locale/vi` - modify `.po` file - ```bash python manage.py compilemessages``` - ```bash python manage.py compilejsi18n``` -Run chat server: -```bash -docker run -p 6379:6379 -d redis:2.8 -``` - +2. Update styles (using SASS) + - Change .css/.scss files in `resources` folder + - ```bash ./make_styles && python manage.py collectstatic``` + - Sometimes you need to `Ctrl + F5` to see the new user interface in browser. + ## Screenshots ### Leaderboard @@ -88,4 +99,4 @@ You can write the problems' statement in Markdown with LaTeX figures and formula Users can communicate with each other and can see who's online. -![](https://i.imgur.com/y9SGCgl.png) \ No newline at end of file +![](https://i.imgur.com/y9SGCgl.png) From c292c1433dba237d56e8163b327c57207dd1f516 Mon Sep 17 00:00:00 2001 From: Phuoc Dinh Le <47278241+cuom1999@users.noreply.github.com> Date: Sat, 2 Jan 2021 02:34:51 -0600 Subject: [PATCH 5/8] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index d996a5e..ec141a8 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,18 @@ dmoj 0.0.0.0 -p 9999 -c ``` 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** + +5. Run celery worker (This is server's queue. It may be necessary in some functions) +```bash +celery -A dmoj_celery worker +``` + +6. Run a live event server (So everything is updated lively like in the production) +```bash +node websocket/daemon.js +``` + ## Deploy Most of the steps are similar to Django tutorials. Here are two usual steps: From 9e40830ff5758a8b48c85d3586a217192f38126e Mon Sep 17 00:00:00 2001 From: Phuoc Dinh Le <47278241+cuom1999@users.noreply.github.com> Date: Sat, 2 Jan 2021 02:37:07 -0600 Subject: [PATCH 6/8] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec141a8..187356f 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ node websocket/daemon.js 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, ```bash python manage.py makemessages``` - go to `locale/vi` - modify `.po` file - ```bash python manage.py compilemessages``` @@ -84,7 +85,7 @@ Most of the steps are similar to Django tutorials. Here are two usual steps: 2. Update styles (using SASS) - Change .css/.scss files in `resources` folder - - ```bash ./make_styles && python manage.py collectstatic``` + - ```bash ./make_style && python manage.py collectstatic``` - Sometimes you need to `Ctrl + F5` to see the new user interface in browser. ## Screenshots From 878f4480732a15a837dec2b5d4619f5e43fb8f41 Mon Sep 17 00:00:00 2001 From: Phuoc Dinh Le <47278241+cuom1999@users.noreply.github.com> Date: Sat, 2 Jan 2021 02:38:57 -0600 Subject: [PATCH 7/8] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 187356f..8d0a7fa 100644 --- a/README.md +++ b/README.md @@ -77,15 +77,15 @@ node websocket/daemon.js 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, ```bash python manage.py makemessages``` + - If you add any new phrases in the code, ```python manage.py makemessages``` - go to `locale/vi` - modify `.po` file - - ```bash python manage.py compilemessages``` - - ```bash python manage.py compilejsi18n``` + - ```python manage.py compilemessages``` + - ```python manage.py compilejsi18n``` 2. Update styles (using SASS) - Change .css/.scss files in `resources` folder - - ```bash ./make_style && python manage.py collectstatic``` + - ```./make_style && python manage.py collectstatic``` - Sometimes you need to `Ctrl + F5` to see the new user interface in browser. ## Screenshots From b3694baafe47cbea8a3b1a5f9ca35c450fec99e1 Mon Sep 17 00:00:00 2001 From: Luong Doan Date: Sat, 2 Jan 2021 20:23:11 +0900 Subject: [PATCH 8/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8d0a7fa..4b0b3ad 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ LQDOJ: Le Quy Don Online Judge [![](https://github.com/DMOJ/online-judge/workflows/build/badge.svg)](https://lqdoj.edu.vn/) [![Python](https://img.shields.io/pypi/pyversions/tensorflow.svg?style=plastic)](https://python.org) [![OS](https://img.shields.io/badge/Ubuntu-16.04%20%7C%2018.04%20%7C%2020.04-brightgreen)](https://ubuntu.com/download) +[![License](https://img.shields.io/badge/license-AGPL--3.0-blue)](https://www.gnu.org/licenses/agpl-3.0.en.html) ## Overview