LCOJ (Luyện Code Online Judge) is a free, practice-focused online judge and learning platform. It offers a large bank of programming problems with instant online grading, organized by difficulty and topic, so learners can immediately verify whether their solutions are correct — from beginner exercises to competitive-programming and technical-interview prep.
This repository is the Django application that powers LCOJ. It is a fork of VNOJ (VNOI's online judge), which is itself a fork of DMOJ. See License & attribution below for how credit is preserved across this fork chain.
This codebase is deployed to more than one site. Each production site is tracked on its own prod/* branch:
| Site | URL | Branch |
|---|---|---|
| LCOJ | luyencode.net | prod/luyencode |
| Cô Thi Lập Trình | code.cothilaptrinh.vn | prod/cothilaptrinh |
Feature work happens on feature/*/feat/* branches off main/master and is merged into the relevant prod/* branch(es) to ship.
Check out the base feature set here. On top of that, LCOJ adds its own features on feature/* branches (e.g. the quiz system under quiz/).
Refer to the LCOJ install documentation here.
This repo is typically deployed via a separate Docker Compose setup that wraps manage.py commands and mounts this repo at /site/.
-
You have to define
DMOJ_PROBLEM_DATA_ROOTinlocal_settings.py, which should be the path to the directory that contains your problems' tests. -
Regarding disabling full-text search, please read this issue for more information.
-
To sync the judge server and the site's cache, change the cache framework (
CACHES) tomemcachedorredisinstead of the default (local-memory caching). -
If you use
python3 manage.py loaddata demo, the home button in the admin dashboard (/admin) links you tolocalhost:8081, there are 2 ways to change that:- You can change that in demo.json
- You can go to the admin page, scroll down to find the
Sitessetting and changelocalhost:8081to your domain.
-
To support
testlib.h, you need to copy testlib.h tog++'s include path in the judge server. To speed up compile time, you can also create a precompiled header fortestlib.h.
Take a look at our contribution guideline.
If you find a bug, please open an issue on this repo.
Pull requests are welcome as well. Before you submit your PR, please check your code with flake8 and format it if needed. There's also prettier if you need to format JS code (in websocket/).
Translation contributions are also welcome.
LCOJ is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0), the same license used by its upstream projects. This project builds on the work of:
- DMOJ: Modern Online Judge — the original online judge platform this is forked from.
- VNOJ: VNOI Online Judge — VNOI's fork of DMOJ, from which this repository was in turn forked, and whose additions this project continues to build on.
As required by the AGPL, the full source of this repository (including modifications) is available, and any network-accessible deployment of this code (such as the sites listed above) must likewise make its complete corresponding source available to its users.