-
Notifications
You must be signed in to change notification settings - Fork 278
Basic implementation of partial scoring. #3047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This follows the legacy spec in: https://icpc.io/problem-package-format/spec/legacy.html#graders We might decided at a later point whether we want to support this or just the new (currently draft) spec, but basic constructs of the change should be the same. Not yet implemented: - any form of testing - anything on the team interface - shadowing Part of DOMjudge#2518
3821281
to
5c9d385
Compare
Some notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial round of review done. Of course there are the todos and comments from PHPStan / PHPCS
@@ -211,6 +211,11 @@ class Problem extends BaseApiEntity implements | |||
#[Serializer\Exclude] | |||
private Collection $languages; | |||
|
|||
#[ORM\ManyToOne(inversedBy: 'problems')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing this reverse relation? And should it be manytoone? When does a testcasegroup have many problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for me calling it "parent testcase group" sounds weird, maybe "root testcase group"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did push the change for the reverse relation.
@@ -1855,6 +1859,10 @@ protected function importRun(Event $event, EventData $data): void | |||
->setRuntime($runTime) | |||
->setResult($judgementTypeId === null ? null : $verdictsFlipped[$judgementTypeId]); | |||
|
|||
if (isset($data->score)) { | |||
$run->setScore($data->score); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment from PHPStan is not lying 😛
@@ -259,6 +260,8 @@ public function calculateScoreRow( | |||
|
|||
$contestStartTime = $contest->getStarttime(); | |||
|
|||
$pointsJury = "0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not $scoreJury
? We have points already for multipoint problems, so this might be confusing?
/** | ||
* Returns a two-element array: | ||
* - The score for the testcase group, or null if not all results are ready. | ||
* - The result for the testcase group, or null if not all results are ready. | ||
* @return array{string|null, string|null} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would return a string indexed array to make this more clear:
/** | |
* Returns a two-element array: | |
* - The score for the testcase group, or null if not all results are ready. | |
* - The result for the testcase group, or null if not all results are ready. | |
* @return array{string|null, string|null} | |
*/ | |
/** | |
* Returns a two-element array: | |
* - The score for the testcase group, or null if not all results are ready. | |
* - The result for the testcase group, or null if not all results are ready. | |
* @return array{score: string|null, result: string|null} | |
*/ |
…the scoreboard cache
I changed this to show the total number of submissions. I wonder if this is what we want? Say you have 5 submissions:
Do we want 3 or 5 tries? And what if the fourth one is AC, score = 100? Also please check my logic. Basically I do not stop processing submissions after the first correct one for scoring problems (and have changed the FTS logic since this was dependent on this assumption).
Fixed I also fixed some other things:
|
This follows the legacy spec in:
https://icpc.io/problem-package-format/spec/legacy.html#graders
We might decided at a later point whether we want to support this or just the new (currently draft) spec, but basic constructs of the change should be the same.
Not yet implemented:
Part of #2518