diff --git a/webapp/src/Service/DOMJudgeService.php b/webapp/src/Service/DOMJudgeService.php index 2eb8f99fc0..137bb94e42 100644 --- a/webapp/src/Service/DOMJudgeService.php +++ b/webapp/src/Service/DOMJudgeService.php @@ -23,6 +23,7 @@ use App\Entity\Problem; use App\Entity\ProblemAttachment; use App\Entity\QueueTask; +use App\Entity\ScoreCache; use App\Entity\Rejudging; use App\Entity\Submission; use App\Entity\Team; @@ -1039,6 +1040,7 @@ public function getTwigDataForProblemsAction( $problems = []; $samples = []; $clars = []; + $problemStatuses = []; if ($contest && ($forJury || $contest->getFreezeData()->started())) { $problems = $this->em->createQueryBuilder() ->from(ContestProblem::class, 'cp') @@ -1053,6 +1055,26 @@ public function getTwigDataForProblemsAction( ->getQuery() ->getResult(); + if ($teamId) { + $scoreCache = $this->em->createQueryBuilder() + ->from(ScoreCache::class, 's') + ->select('s') + ->andWhere('s.contest = :contest') + ->andWhere('s.team = :team') + ->setParameter('contest', $contest) + ->setParameter('team', $this->getTeam($teamId)) + ->getQuery() + ->getResult(); + + foreach ($scoreCache as $scoreRow) { + $problemStatuses[$scoreRow->getProblem()->getProbid()] = [ + 'is_correct' => $scoreRow->getIsCorrectRestricted(), + 'submissions' => $scoreRow->getSubmissionsRestricted(), + 'solvetime' => $scoreRow->getSolvetimeRestricted(), + ]; + } + } + $samplesData = $this->em->createQueryBuilder() ->from(ContestProblem::class, 'cp') ->join('cp.problem', 'p') @@ -1099,6 +1121,7 @@ public function getTwigDataForProblemsAction( 'timeFactorDiffers' => $timeFactorDiffers, 'clarifications' => $clars, 'team' => $teamId ? $this->em->getRepository(Team::class)->find($teamId) : null, + 'problemStatuses' => $problemStatuses, ]; if ($contest && $this->config->get('show_public_stats')) { diff --git a/webapp/templates/partials/problem_list.html.twig b/webapp/templates/partials/problem_list.html.twig index 8414498602..76e1240083 100644 --- a/webapp/templates/partials/problem_list.html.twig +++ b/webapp/templates/partials/problem_list.html.twig @@ -36,7 +36,17 @@ {% set numsamples = 0 %} {% endif %}