Skip to content

Make penalty time a per contest setting#3347

Open
nickygerritsen wants to merge 2 commits intoDOMjudge:mainfrom
nickygerritsen:penalty-time-per-contest
Open

Make penalty time a per contest setting#3347
nickygerritsen wants to merge 2 commits intoDOMjudge:mainfrom
nickygerritsen:penalty-time-per-contest

Conversation

@nickygerritsen
Copy link
Member

For score contests we use 0, since the spec says "Only relevant if scoreboard_type is pass-fail.".

Copy link
Member

@vmcj vmcj left a comment

Choose a reason for hiding this comment

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

I get that the spec specifies this as only needed for pass-fail but I think the code is much easier if we don't have those branches if we're not forced to need them.

So instead of not allowing it, setting it to 0 by default for scoring contests and checking in the other sections if it's non 0 and if so to display the extra penalty.


public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE contest ADD penalty_time INT UNSIGNED DEFAULT 20 NOT NULL COMMENT \'Penalty time in minutes per wrong submission (if eventually solved)\' AFTER scoreboard_type');
Copy link
Member

Choose a reason for hiding this comment

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

You pick our default here, but someone might have set this to another value. I wonder if we should keep the global setting and just force it to 0 for Scoring contests?

This way they would need to (re)set this value each time.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't follow what you mean. For migrated contests we pick what they configured. For new contests we use 20 as default but allow to set it

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't agree that allowing it makes sense. Then all of a sudden we have to take it into account on the scoring scoreboard. I don't think the branches are complicated but if others think it makes more sense to do it I can do it

Copy link
Member

Choose a reason for hiding this comment

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

I don't follow what you mean. For migrated contests we pick what they configured. For new contests we use 20 as default but allow to set it

In case someone configured 30min or 1h (or whatever) it would be applied for all contests, both current and future.
Your code fixes the current ones but not the future ones as you set it to 20 instead of the current value. I think in case someone picks another value as the current one they have a reason for that and probably prefer it for newer ones also.

Copy link
Member

Choose a reason for hiding this comment

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

My suggestion to improve the changelog message then to make it more clear and not carry that legacy over.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I agree

@meisterT
Copy link
Member

if so to display the extra penalty.

There is no time displayed for scoring contests anywhere in the interface

@vmcj
Copy link
Member

vmcj commented Jan 24, 2026

if so to display the extra penalty.

There is no time displayed for scoring contests anywhere in the interface

And the point I'm trying to make that instead of having a scoreboard per contest type we should try to generalize such things and use sane defaults. But if I'm the only one (and it seems to be I am) I'm fine with just duplicating all situations everywhere.

@meisterT
Copy link
Member

And the point I'm trying to make that instead of having a scoreboard per contest type we should try to generalize such things and use sane defaults

I am with you on generalizing and using sane defaults where it makes sense. There is just nothing to generalize here since penalty time is not a thing for scoring.

For score contests we use `0`, since the spec says "Only relevant if scoreboard_type is pass-fail.".
@nickygerritsen nickygerritsen force-pushed the penalty-time-per-contest branch from 47fae19 to 69f3fbb Compare January 27, 2026 12:45
@nickygerritsen
Copy link
Member Author

And the point I'm trying to make that instead of having a scoreboard per contest type we should try to generalize such things and use sane defaults

I am with you on generalizing and using sane defaults where it makes sense. There is just nothing to generalize here since penalty time is not a thing for scoring.

Yeah I don't see how we would do this. And then I think it doesn't make sense showing a value that doesn't get used.

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.

3 participants