Giter VIP home page Giter VIP logo

oj's Introduction

VNOJ: VNOI Online Judge Build Status AGPL License Discord link

As a fork of DMOJ, VNOJ serves as VNOI's official online judge and hosts its programming contests.

See it live at oj.vnoi.info!

Features

Check out its features here.

Installation

Refer to the install documentation here. Almost all installation steps remain the same as the docs, but there are several minor differences, including cloning this repo instead of DMOJ's repo.

Additional installation steps

  • You have to define DMOJ_PROBLEM_DATA_ROOT in local_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) to memcached or redis instead of the default (local-memory caching).

  • If you use python3 manage.py loaddata demo, the home button in the admin dashboard (/admin) links you to localhost:8081, there are 2 ways to change that:

    1. You can change that in demo.json
    2. You can go to the admin page, scroll down to find the Sites setting and change localhost:8081 to your domain.
  • To support testlib.h, you need to copy testlib.h to g++'s include path in the judge server. To speed up compile time, you can also create a precompiled header for testlib.h.

Contributing PR's Welcome

Take a look at our contribution guideline.

If you find any bug, please feel free to contact us via Discord Discord Chat or open an issue.

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.

oj's People

Contributors

carson-tang avatar dmoj-build avatar ducanhgh avatar ehhthing avatar fataleagle avatar fluix-dev avatar hieplpvip avatar hung3a8 avatar injust avatar int-y1 avatar jalsol avatar kevinjycui avatar kiritofeng avatar leduythuccs avatar magnified103 avatar ngkan avatar ninjaclasher avatar outloudvi avatar phoenix1369 avatar pichu2405 avatar puffyshoggoth avatar quantum5 avatar riolku avatar slightlyskepticalpotat avatar trantuyet avatar walle256 avatar winprn avatar xiaowuc1 avatar xyene avatar zecookiez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oj's Issues

Dev: ICPC frozen ranking checklist

Here is a list of features that we need to implement before launching a testing ICPC contest:

  • Show frozen ranking (added in #212)
  • Cache ranking (the ranking page will have a lot of traffic)
  • Highlight first solved (added in #211)
  • TBD

Known issues & limitation

This is a list of issues that should be fixed before release a stable build:

List of known limitations (not required to fix before the stable build, but nice to be fixed):

  • Cannot change problem's code for manually managed problems
  • Edit history of problems, blogs, contests, etc., is not shown in the admin panel if edited from UI.
  • Edit ticket message.
  • The submission score is not updated when we edit the contest problem score.
  • Upload test progress bar
  • Documenting for #226
  • Documenting for VNOI-Admin/judge-server#23

Lỗi khi chấm scratch

Xây dựng site thành công, khi chấm các ngôn ngữ khác bình thường, tuy nhiên chấm scratch đang bị lỗi:

Một lỗi hệ thống vừa xảy ra trong quá trình chấm bài. Admin VDcoder đã được thông báo về lỗi này.
Bạn có thể thử nộp lại bài trong vài giây nữa

Thông tin về lỗi
Traceback (most recent call last):
File "/judge/dmoj/judge.py", line 406, in _worker_process_main
ipc_msg = next(case_gen)
^^^^^^^^^^^^^^
File "/judge/dmoj/judge.py", line 441, in _grade_cases
self.grader = problem.grader_class(
^^^^^^^^^^^^^^^^^^^^^
File "/judge/dmoj/graders/base.py", line 11, in init
self.binary = self._generate_binary()
^^^^^^^^^^^^^^^^^^^^^^^
File "/judge/dmoj/graders/standard.py", line 104, in _generate_binary
return executors[self.language].Executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/judge/dmoj/executors/SCRATCH.py", line 28, in init
super().init(problem_id, source_code, **kwargs)
File "/judge/dmoj/executors/script_executor.py", line 13, in init
self.create_files(problem_id, source_code)
File "/judge/dmoj/executors/SCRATCH.py", line 79, in create_files
source_code = download_source_code(
^^^^^^^^^^^^^^^^^^^^^
File "/judge/dmoj/utils/helper_files.py", line 122, in download_source_code
r = requests.get(link, stream=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/env/lib/python3.11/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/env/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/env/lib/python3.11/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/env/lib/python3.11/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/env/lib/python3.11/site-packages/requests/models.py", line 368, in prepare
self.prepare_url(url, params)
File "/env/lib/python3.11/site-packages/requests/models.py", line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL '/submission_file/aplusb/1/09b3bdf0-3eeb-47f7-8d74-83bca68f7be1.json': No scheme supplied. Perhaps you meant https:///submission_file/aplusb/1/09b3bdf0-3eeb-47f7-8d74-83bca68f7be1.json?

Mình nghĩ là phần cài đặt site để chấm scratch đang sai ở đâu đó, rất mong admin chỉ giúp cách sửa lỗi này?

Buttons on the toolbar when replying to a comment not working

UPDATE: The bug mentioned happens to all buttons on the toolbar. I will still keep the rest of the report to the Image button to act as an example.

Describe the bug

This button does not open a pop-up to paste the image URL as expected.
Note: The button does not work only when replying to another comment (the title underlined being "Replying to comment"). It behaves normally when creating a new comment.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any existing comment, and click on the Reply button
  2. Click on the Image button

Expected behavior
The following pop-up to allow entering the image URL should appear.

Potentially upstreaming some site changes to DMOJ

Hi!

I'm one of the authors of DMOJ, love what you've done with VNOJ!

Over the years, you've added many features and fixed many bugs on top of the DMOJ branch, great job on that. Some of them are features we have open tickets for upstream, and some are bugs we also have. (Whoops.)

What are your thoughts on upstreaming some of your changes?

Hopefully, that should also reduce your maintenance burden in the long run, with merge conflicts becoming less likely. We'd of course greatly appreciate this too--most of our effort nowadays goes into the administrative parts of running https://dmoj.ca and making sure the judge chugs along, and less on feature work.

Having skimmed through the changelog, I've listed some changes that stood out to me as "wow I wish we had this upstream" below:

  • The (virtual competitor count) display on the contest list
  • Contest search; dc4c112
  • Option for auto-activating users, this is one of the most frequent support requests we get; 2242a35
  • Faster judge problem updates; a860684
  • Bugfix for minimum time limit; 17550f3
  • Frozen scoreboards

And some that sound relevant, but I wasn't sure applied to upstream:

  • Avoid leaking submission feedback when leaving contest; 7beb7f3
  • Fix submit button when using back button (what were the symptoms here?); 57a8be1
  • Make organization slug unique; a34e284
  • Fix IOI contest format; c2cc300
  • Fix event server leaking data; 1ce5bb9

As well as anything else you think I missed here.

Let me know what you think, I'm happy to chat more.

Contest notification

Currently, we are not able to send contest notifications to the users. We can create a problem clarification but users need to refresh the problem page to see it.

We can use the notification system of codeforces (show alert to all tab)

Manage problem test data via UI

In the edit test data, if the problem test data is manually copied to the problem folder, then the UI will not load the data.
image

Edit About page

The current About page is a blank page, we need to add more information to that page.
We also need a guide for problem setters.

Suggesting Update

I suggest these features:
[1] / Top users today
[2] /problems/ Recent 20 unsolved problems
[3] /problems/ Show problem with editorials
[4] /submissions/ Sort by problem
[5] /contests/ Sort on problem (priority: score -> time) (order: rank / asc / dsc)
[6] /contests/Show followers (type: only followers / highlight with full ranking)
[7] /contests/Rating Change
[8] /contests/Highlight First To AC (Priority) <- Highlight Fastest Highest-Score (None-AC)
[9] /contests/Number of users / page
[10] /contests/Freeze Mode (No render update) (type: All / Except Myself)
[11] /contests/Point to me (On page X -> Line Y)
[12] /contests/Highlight myself
[13] /contests/Popup message when changes
[14] /users/ Highlight myself
[15] /contributors/ Highlight myself
[16] /organizations/ Highlight my organizations
[17] /problem/* Except for main-tests from some contests. There should be additional test-cases, hack-tests. And we can select either main-tests or all-tests.
[18] /contests/ Minimalism Mode (Only allow to read popup message, make-read ticket, read clarification, submit-read problem, copy-read my submissions, see total score + total time + remaining time)

========================================

Em suggest feature:
[1] / Top thành viên trong ngày hôm nay
[2] /problems/ Recent 20 unsolved problems
[3] /problems/ Hiển thị bài có lời giải
[4] /submissions/ Lọc theo bài nộp
[5] /contests/ Sort on problem (priority: score -> time) (order: rank / asc / dsc)
[6] /contests/Show followers (type: only followers / highlight with full ranking)
[7] /contests/Rating Change
[8] /contests/Highlight First To AC (Priority) <- Highlight Fastest Highest-Score (None-AC)
[9] /contests/Số người hiển thị / trang
[10] /contests/Chế độ đóng băng (ko render update) (type: tất cả / trừ bản thân)
[11] /contests/ (On page X -> Line Y) [12] /contests/Highlight bản thân [13] /contests/Tin nhắn thông báo khi thay đổi [14] /users/Highlight bản thân [15]/contributors/Highlight bản thân [16]/organizations/Highlight nhóm chứa bản thân [17]/problem/*Ngoài test chính thức, còn có test bổ sung và test hack (có thể chọn chỉ chạy test chính thức hoặc thêm test) [18]/contests/` Minimalism Mode (Chỉ cho thấy thông báo, tạo ticket, đọc ticket, đọc giải thích, nộp bài, đọc đề, copy/đọc bài nộp của bản thân, xem tổng điểm, xem tổng thời gian, thời gian còn lại)

"Hide problems I've solved" box does not work

Describe the bug
On the Statistic tab of another user's page, the "Hide problems I've solved" box does not hide problems I have solved.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a user's profile
  2. Click on "Statistic"
  3. Check "Hide problems I've solved"
  4. Page gets reloaded, the query string "hide_solved=1" appears but nothing changes otherwise.

Expected behavior
Problems that I have solved should be hidden after the box is checked.

Screenshots

Box unchecked, problem appears

Box unchecked, problem appears

Box checked, problem still appears

Box checked, problem still appears

Problem solved by user

Problem solved by user

Desktop:

  • OS: Archcraft (5.10.88-2-lts)
  • Browser: Brave Browser / Mozilla Firefox
  • Version: 96.1.34.53 beta / 95.0.2

Additional context
Tested on both normal and Incognito mode of both browsers.

Top Weekly/Monthly Coders

Mô phỏng cách hoạt động của tính năng

  • Dựa theo tuần/tháng, tạo ra 3 bảng xếp hạng theo tuần/tháng:
    • Bảng 1 xếp theo số điểm nhận được trong tuần/tháng (tie-break khi số bài nộp AC có chênh lệch, có thể tie)
    • Bảng 2 xếp theo số lần nộp AC (tie-break dựa trên số điểm)
    • Bảng 3 xếp theo rating nhận được trong tuần/tháng (tie-break dựa trên thứ hạng của contest được rate)

Lý do lập tính năng

  • Khuyến khích các coder tích cực code để đạt top

"Chương trình tâm lý"

  • Có Blog tuyên dương coder theo mỗi kỳ (4 tháng)
  • Tổng hợp để đưa vào top ưu tiên trong việc tham gia VNOI-CUP mỗi năm.

Show problem link on contest page

Currently, only the admin can view the problem link on the contest page if that problem is private. I think this is fine but: When the participants join the contest, it still won't give the problem link, they have to go to "https://oj.vnoi.info/problems/" to view the problem:

  • Contest page:
    image
  • Problem page:
    image

I think it would be better if we can show the problem link while the contest is running, and we should not use "https://oj.vnoi.info/problems/" to show to contest problem

Enable full text search

If you search with the full-text search option, an error will occur because the default database not support full text search. You have to do it by hand:

ALTER TABLE judge_problem ADD FULLTEXT(code, name, description);

Or you can set Enable_FTS to False in the local_settings
Source: DMOJ/docs#100

Allow submit non-text files

Some languages cough scratch cough is not submittable via text (actually yes but not user friendly). We need to allow users to submit via file.

However, the current database schema is not able to do it, and I think we should not mess with it.

Here is a solution:

Site server:

  • Create a new field in the Problem model (for example: allow_file_submit).
  • With problems that allow submitting via file, we allow users to upload a file into a folder. We create an URL to download that file
  • Send that URL to judge the server

Judge server:

  • Download the submission file by that URL, and then continue to judging.

Add "Official Contest Ongoing" Mode

To support the Official Contests, we need to add a new mode: Official Contest Ongoing

In this mode:

  • Must have:
    • No one can view any submissions, even their own submissions.
    • To prevent solution spoilers, no one can add new comments.
    • To prevent spam that can overload the judge server, except the contestants, no one can submit submissions.
  • Optional:
    • Disable viewing old blogs, comments, editorial of old problems.

Clear cache of flatpage after edited

Currently, the site is caching all flat pages in 1 day. There should be a feature to clear the cache of the flat page automatically after we edited it.

404 on own submission page

If a user clicks to the "my submission" in a contest that they haven't participated in, the site will throw an 404 error.
image

This because of this line views/submission.py#L640 and this views/submission.py#L610

I have 2 solutions for this issue, but it depend on n what we want to do:

  1. Don't show the "my submission" tab if the user hasn't joined the contest
  2. Just remove the 2 lines above -> this way, if the user hasn't joined the contest, the submission page will be empty (don't have any submission)

Misleading submission verdict

When a submission receives partial points for a test case, the verdict is showing as AC. That could make users think that they got AC if they are not carefully read the points.

Perhaps we should change the color of the verdict?

image

By the way, the submission verdict always shows as the short name (AC instead of Accepted). I think we should show the full name here?

Users can view Submission List of others in contest time

Describe the bug
Users can view Submission List of others in contest time even if the show_submission_list is set to false.

To Reproduce
Steps to reproduce the behavior:

  1. Create a private problem A
  2. Create a contest containing A (set show_submission_list to false)
  3. User join that contest
  4. User cannot see others submissions in /contest/<contest_id>/submissions/ but they still can see others submission in problem/A/submissions/

Expected
User cannot see others submissions in /contest/<contest_id>/submissions/ and problem/A/submissions/

Unexpected # in block code

The site adds 2 # automatically if # is at the beginning of a line to offset the heading.

But it should not add # if the # is in a block code:
image

This happened because of this: 08575ab

Error when running pip3 install -r requirements.txt

Hi all,

I'm following the setup instruction of DMOJ to setup on source VNOJ but when I ran command 'pip3 install -r requirements.txt', I got an error in the following image:

image

I'm not good at Python so I don't know this error is a bug or my setup was wrong in any step. Please help me!

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.