@@ -554,8 +554,8 @@ public function updateRankCache(Contest $contest, Team $team): void
554
554
$ scoreIsInSeconds = (bool )$ this ->config ->get ('score_in_seconds ' );
555
555
556
556
// Now fetch the ScoreCache entries.
557
- /** @var ScoreCache[] $scoreCacheRows */
558
- $ scoreCacheRows = $ this ->em ->createQueryBuilder ()
557
+ /** @var ScoreCache[] $scoreCacheCells */
558
+ $ scoreCacheCells = $ this ->em ->createQueryBuilder ()
559
559
->from (ScoreCache::class, 's ' )
560
560
->select ('s ' )
561
561
->andWhere ('s.contest = :contest ' )
@@ -565,21 +565,21 @@ public function updateRankCache(Contest $contest, Team $team): void
565
565
->getQuery ()
566
566
->getResult ();
567
567
568
- // Process all score cache rows .
569
- foreach ($ scoreCacheRows as $ scoreCache ) {
568
+ // Process all score cache cells .
569
+ foreach ($ scoreCacheCells as $ scoreCacheCell ) {
570
570
foreach ($ variants as $ variant => $ isRestricted ) {
571
- $ probId = $ scoreCache ->getProblem ()->getProbid ();
572
- if (isset ($ contestProblems [$ probId ]) && $ scoreCache ->getIsCorrect ($ isRestricted )) {
573
- $ penalty = Utils::calcPenaltyTime ($ scoreCache ->getIsCorrect ($ isRestricted ),
574
- $ scoreCache ->getSubmissions ($ isRestricted ),
571
+ $ probId = $ scoreCacheCell ->getProblem ()->getProbid ();
572
+ if (isset ($ contestProblems [$ probId ]) && $ scoreCacheCell ->getIsCorrect ($ isRestricted )) {
573
+ $ penalty = Utils::calcPenaltyTime ($ scoreCacheCell ->getIsCorrect ($ isRestricted ),
574
+ $ scoreCacheCell ->getSubmissions ($ isRestricted ),
575
575
$ penaltyTime , $ scoreIsInSeconds );
576
576
577
577
$ numPoints [$ variant ] += $ contestProblems [$ probId ]->getPoints ();
578
578
$ totalTime [$ variant ] += Utils::scoretime (
579
- (float )$ scoreCache ->getSolveTime ($ isRestricted ),
579
+ (float )$ scoreCacheCell ->getSolveTime ($ isRestricted ),
580
580
$ scoreIsInSeconds
581
581
) + $ penalty ;
582
- $ totalRuntime [$ variant ] += $ scoreCache ->getRuntime ($ isRestricted );
582
+ $ totalRuntime [$ variant ] += $ scoreCacheCell ->getRuntime ($ isRestricted );
583
583
}
584
584
}
585
585
}
0 commit comments