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