cms-dev / cms-dev/cms

Phase management issues

Open
#1,584 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
412
Avg merge
6d 10h
Merged PRs (30d)
3

Description

Description:
The phase management algorithm ignores delays when deciding upon the contest phase,
when starting_time is none, so the delays have no effect at all when starting USACO style contests
(when contest window starts, all users can press the start button, even if they have delay_time,
and when contest window stops, there is no start button, even if the user has delay_time).

On the other hand, once a contestant presses the start button, and starting_time is configured, he cannot see the questions until delay_time seconds pass, which I believe is not the desired behaviour.

In addition, in regular contests (no per_user_time), a timer to the original contest start time is displayed for all users, regardless of their delay_time (though the explicit time written as "contest start" includes the delay_time and isn't synchronized with the timer).
When there is delay_time, once the timer reachs 00:00 (contest start), it's updated to delay_time and starts counting down again (upon changing the phase from -2 to -1), and the text says "contest started in contest_start + delay_time" even when this time is in the future.

Expected:
In regular contests, the timer should count down until contest_start + delay_time from the beginning.
In USACO-style contests, I believe for most uses delay_time should be zero.
But if we want to configure a delay_time, it probably means the entire contest window should move by delay_time for that user, and it should be added to the actual real start_time.

There were a few comments in the code regarding manually configured future start_times by the admin, but in such a case a "start" button still appears and overrides start_time, so it doesn't replace the delay_time functionallity.

Suggested solution
I've implemented a change in our local repo, if you think it's relevant for the main CMS branch I can open a PR here as well:
https://github.com/ioi-isr/cms/pull/23/commits

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the phase management algorithm and the local implementation linked in the issue at github.com/ioi-isr/cms/pull/23/commits. Trace regular and USACO-style contests with delay_time, starting_time, and per_user_time, then verify that timers, start buttons, contest phases, and visible questions follow the expected delayed window behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.