diff --git a/webapp/src/Controller/API/BalloonController.php b/webapp/src/Controller/API/BalloonController.php index c3ebd22c3d..0ef708184b 100644 --- a/webapp/src/Controller/API/BalloonController.php +++ b/webapp/src/Controller/API/BalloonController.php @@ -73,7 +73,6 @@ public function listAction( category: $b['data']['category'], categoryid: $b['data']['categoryid'], total: $b['data']['total'], - awards: $b['data']['awards'], done: $b['data']['done'], ); } diff --git a/webapp/src/DataTransferObject/Balloon.php b/webapp/src/DataTransferObject/Balloon.php index f9d5648373..8d8721eb7c 100644 --- a/webapp/src/DataTransferObject/Balloon.php +++ b/webapp/src/DataTransferObject/Balloon.php @@ -24,7 +24,6 @@ public function __construct( public readonly ?int $categoryid, #[Serializer\Type('array')] public readonly array $total, - public readonly string $awards, public readonly bool $done, ) {} } diff --git a/webapp/src/Service/BalloonService.php b/webapp/src/Service/BalloonService.php index ff93e2fddf..eb80ffe0f7 100644 --- a/webapp/src/Service/BalloonService.php +++ b/webapp/src/Service/BalloonService.php @@ -87,7 +87,7 @@ public function updateBalloons( * @return array, - * awards: string, done: bool}}> + * done: bool}}> */ public function collectBalloonTable(Contest $contest, bool $todo = false): array { @@ -97,13 +97,6 @@ public function collectBalloonTable(Contest $contest, bool $todo = false): array $freezetime = $contest->getFreezeTime(); } - // Build a list of teams and the problems they solved first. - $firstSolved = $em->getRepository(ScoreCache::class)->findBy(['is_first_to_solve' => 1]); - $firstSolvers = []; - foreach ($firstSolved as $scoreCache) { - $firstSolvers[$scoreCache->getTeam()->getTeamId()][] = $scoreCache->getProblem()->getProbid(); - } - $query = $em->createQueryBuilder() ->select('b', 's.submittime', 'p.probid', 't.teamid', 's', 't', 't.location', @@ -125,23 +118,14 @@ public function collectBalloonTable(Contest $contest, bool $todo = false): array ->addOrderBy('s.submittime', 'DESC'); $balloons = $query->getQuery()->getResult(); - // Loop once over the results to get totals and awards. - $TOTAL_BALLOONS = $AWARD_BALLOONS = []; + // Loop once over the results to get totals. + $TOTAL_BALLOONS = []; foreach ($balloons as $balloonsData) { if ($balloonsData['color'] === null) { continue; } $TOTAL_BALLOONS[$balloonsData['teamid']][$balloonsData['probshortname']] = $balloonsData[0]->getSubmission()->getContestProblem(); - - // Keep a list of balloons that were first to solve this problem; - // can be multiple, one for each sortorder. - if (in_array($balloonsData['probid'], $firstSolvers[$balloonsData['teamid']] ?? [], true)) { - $AWARD_BALLOONS['problem'][$balloonsData['probid']][] = $balloonsData[0]->getBalloonId(); - } - // Keep overwriting this - in the end it'll - // contain the ID of the first balloon in this contest. - $AWARD_BALLOONS['contest'] = $balloonsData[0]->getBalloonId(); } // Loop again to construct table. @@ -182,15 +166,6 @@ public function collectBalloonTable(Contest $contest, bool $todo = false): array ksort($TOTAL_BALLOONS[$balloonsData['teamid']]); $balloondata['total'] = $TOTAL_BALLOONS[$balloonsData['teamid']]; - $comments = []; - if ($AWARD_BALLOONS['contest'] == $balloonId) { - $comments[] = 'first in contest'; - } elseif (isset($AWARD_BALLOONS['problem'][$balloonsData['probid']]) - && in_array($balloonId, $AWARD_BALLOONS['problem'][$balloonsData['probid']], true)) { - $comments[] = 'first for problem'; - } - - $balloondata['awards'] = implode('; ', $comments); $balloondata['done'] = $done; $balloons_table[] = [ diff --git a/webapp/templates/jury/partials/balloon_list.html.twig b/webapp/templates/jury/partials/balloon_list.html.twig index e48b61395b..4195b59bb6 100644 --- a/webapp/templates/jury/partials/balloon_list.html.twig +++ b/webapp/templates/jury/partials/balloon_list.html.twig @@ -16,7 +16,6 @@ location category total - awards @@ -47,7 +46,6 @@ {{ totalballoon | problemBadge }}  {%- endfor -%} - {{ balloon.data.awards }} {%- if not balloon.data.done -%} {%- set link = path('jury_balloons_setdone', {balloonId: balloon.data.balloonid}) %} diff --git a/webapp/tests/Unit/Controller/API/BalloonsControllerTest.php b/webapp/tests/Unit/Controller/API/BalloonsControllerTest.php index 2780863bb5..62314bd84b 100644 --- a/webapp/tests/Unit/Controller/API/BalloonsControllerTest.php +++ b/webapp/tests/Unit/Controller/API/BalloonsControllerTest.php @@ -37,7 +37,7 @@ public function testBalloonsNoJudgings(): void public function testMarkAsDone(): void { - $expectedBalloon = ['team'=>'t2: Example teamname', 'problem'=>'U', 'awards'=>'first in contest']; + $expectedBalloon = ['team'=>'t2: Example teamname', 'problem'=>'U']; $contestId = $this->getUnitContestId(); $url = "/contests/$contestId/balloons?todo=1"; $this->loadFixtures([BalloonCorrectSubmissionFixture::class,BalloonUserFixture::class]); @@ -70,7 +70,7 @@ public function testMarkInvalidBalloonAsDone(): void public function testMarkAsDoneWrongContest(): void { // BalloonIDs are global so they can be marked done against other contests. - $expectedBalloon = ['team'=>'t2: Example teamname', 'problem'=>'U', 'awards'=>'first in contest']; + $expectedBalloon = ['team'=>'t2: Example teamname', 'problem'=>'U']; $contestId = $this->getUnitContestId(); $url = "/contests/$contestId/balloons?todo=1"; $this->loadFixtures([BalloonCorrectSubmissionFixture::class,BalloonUserFixture::class]);