Skip to content

i_1286 Validate user-entered freeze duration in ContestInformationPane - #1288

Open
johnbrvc wants to merge 1 commit into
pc2ccs:developfrom
johnbrvc:i1286_freeze_duration_validation
Open

i_1286 Validate user-entered freeze duration in ContestInformationPane#1288
johnbrvc wants to merge 1 commit into
pc2ccs:developfrom
johnbrvc:i1286_freeze_duration_validation

Conversation

@johnbrvc

Copy link
Copy Markdown
Collaborator

Description of what the PR does

Make sure the user entered a valid freeze duration when an attempt is made to save (update) the settings. Throw an exception if it's bad. In the future, additional fields can easily be validated and throw an exception as well.

Cleaned up some comments and dunsel code.

Issue which the PR addresses

Fixes #1286

Environment in which the PR was developed (OS,IDE, Java version, etc.)

Windows 11
java version "1.8.0_321"
Java(TM) SE Runtime Environment (build 1.8.0_321-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.321-b07, mixed mode)

Precise steps for testing the PR (i.e., how to demonstrate that it works correctly)

  1. Load a new contest such as clics_sumithello
  2. Start the administrator1 client up
  3. On the Configure Contest->Settings tab, enter an invalid Scoreboard Freeze Length, such as a:30:00 and press Update.
  4. Note that a message dialog is displayed indicating the value is bad:
image

Previously, this incorrect value was accepted and set.
5. Dismiss the message box.
6. Enter a value such as 25:00 and press Update.
7. Note the value changes in the text field to "0:25:00" (which is the normalized format).
image

Note: The freeze length entered will be normalized. That is, a value of 160:00 will be normalized to 2:40:00 since 160 minutes is 2 hours and 40 minutes. In addition, entering a freeze length of 3600 would set the freeze time to 1:00:00. This behavior is by design (existing methods were used to perform this normalization process). Feel free to try it.

Make sure the user entered a valid freeze duration and throw an exception if it's bad.
Cleaned up some comments and dunsel code.
@johnbrvc johnbrvc added this to the 9.11.0 milestone Aug 10, 2026
@johnbrvc johnbrvc self-assigned this Aug 10, 2026

@SamanwaySadhu SamanwaySadhu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual input of freeze time is not formatted properly

2 participants