@@ -212,7 +212,7 @@ public function setOptScoreMaxRestricted(float $optscoreMaxRestricted): ScoreCac
212
212
213
213
public function getOptScoreMaxRestricted (): float
214
214
{
215
- return $ this ->optscore_max_restricted ;
215
+ return $ this ->optscore_max_restricted ?? 0 ;
216
216
}
217
217
218
218
public function setOptScoreMaxPublic (float $ optscoreMaxPublic ): ScoreCache
@@ -223,7 +223,7 @@ public function setOptScoreMaxPublic(float $optscoreMaxPublic): ScoreCache
223
223
224
224
public function getOptScoreMaxPublic (): float
225
225
{
226
- return $ this ->optscore_max_public ;
226
+ return $ this ->optscore_max_public ?? 0 ;
227
227
}
228
228
229
229
public function setOptScoreMinRestricted (float $ optscoreMinRestricted ): ScoreCache
@@ -234,7 +234,7 @@ public function setOptScoreMinRestricted(float $optscoreMinRestricted): ScoreCac
234
234
235
235
public function getOptScoreMinRestricted (): float
236
236
{
237
- return $ this ->optscore_min_restricted ;
237
+ return $ this ->optscore_min_restricted ?? 0 ;
238
238
}
239
239
240
240
public function setOptScoreMinPublic (float $ optscoreMinPublic ): ScoreCache
@@ -245,7 +245,7 @@ public function setOptScoreMinPublic(float $optscoreMinPublic): ScoreCache
245
245
246
246
public function getOptScoreMinPublic (): float
247
247
{
248
- return $ this ->optscore_min_public ;
248
+ return $ this ->optscore_min_public ?? 0 ;
249
249
}
250
250
251
251
public function setSubmissionsPublic (int $ submissionsPublic ): ScoreCache
@@ -371,4 +371,20 @@ public function getIsCorrect(bool $restricted): bool
371
371
{
372
372
return $ restricted ? $ this ->getIsCorrectRestricted () : $ this ->getIsCorrectPublic ();
373
373
}
374
+
375
+ public function getMaxOptscore (bool $ restricted ): float
376
+ {
377
+ return $ restricted ? $ this ->getOptScoreMaxRestricted () : $ this ->getOptScoreMaxPublic ();
378
+ }
379
+
380
+ public function getMinOptscore (bool $ restricted ): float
381
+ {
382
+ return $ restricted ? $ this ->getOptScoreMinRestricted () : $ this ->getOptScoreMinPublic ();
383
+ }
384
+
385
+ public function getOptscore (bool $ restricted ): float
386
+ {
387
+ if ($ this ->contest ->getOptScoreOrder () == 'asc ' ) return $ this ->getMinOptscore ($ restricted );
388
+ else return $ this ->getMaxOptscore ($ restricted );
389
+ }
374
390
}
0 commit comments