Skip to content

Use restricted scoreboard on public pages after unfreeze. #2990

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

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions webapp/src/Service/ScoreboardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public function getScoreboard(
if (!$freezeData->started() && !$jury && !$forceUnfrozen) {
return null;
}
$restricted = ($jury || $freezeData->showFinal(false));

$teams = $this->getTeamsInOrder($contest, $jury && !$visibleOnly, $filter);
$teams = $this->getTeamsInOrder($contest, $jury && !$visibleOnly, $filter, $restricted);
$problems = $this->getProblems($contest);
$categories = $this->getCategories($jury && !$visibleOnly);
$scoreCache = $this->getScorecache($contest);
Expand All @@ -95,7 +96,7 @@ public function getTeamScoreboard(Contest $contest, int $teamId, bool $showFtsIn
{
$freezeData = new FreezeData($contest);

$teams = $this->getTeamsInOrder($contest, true, new Filter([], [], [], [$teamId]));
$teams = $this->getTeamsInOrder($contest, true, new Filter([], [], [], [$teamId]), true);
if (empty($teams)) {
return null;
}
Expand Down Expand Up @@ -944,7 +945,7 @@ public function getScoreboardTwigData(
* Get the teams to display on the scoreboard, returns them in order.
* @return Team[]
*/
protected function getTeamsInOrder(Contest $contest, bool $jury = false, ?Filter $filter = null): array
protected function getTeamsInOrder(Contest $contest, bool $jury = false, ?Filter $filter = null, bool $restricted = false): array
{
$queryBuilder = $this->em->createQueryBuilder()
->from(Team::class, 't', 't.teamid')
Expand Down Expand Up @@ -1005,7 +1006,7 @@ protected function getTeamsInOrder(Contest $contest, bool $jury = false, ?Filter

$ret = $queryBuilder
->addOrderBy('tc.sortorder')
->addOrderBy('r.sortKey' . ($jury ? 'Restricted' : 'Public'), 'DESC')
->addOrderBy('r.sortKey' . ($restricted ? 'Restricted' : 'Public'), 'DESC')
->addOrderBy('effectivename')
->getQuery()->getResult();
return $ret;
Expand Down
Loading