@@ -330,10 +330,9 @@ public function importProblemsData(Contest $contest, array $problems, array &$id
330
330
->setTimelimit ($ problemData ['time_limit ' ] ?? 10 )
331
331
->setExternalid ($ problemData ['id ' ] ?? $ problemData ['short-name ' ] ?? $ problemLabel ?? null );
332
332
333
- $ hasErrors = false ;
334
- $ errors = $ this ->validator ->validate ($ problem );
335
- if ($ errors ->count ()) {
336
- $ hasErrors = true ;
333
+ $ errors = $ this ->validator ->validate ($ problem );
334
+ $ hasProblemErrors = $ errors ->count ();
335
+ if ($ hasProblemErrors ) {
337
336
/** @var ConstraintViolationInterface $error */
338
337
foreach ($ errors as $ error ) {
339
338
$ messages ['danger ' ][] = sprintf (
@@ -353,9 +352,9 @@ public function importProblemsData(Contest $contest, array $problems, array &$id
353
352
->setProblem ($ problem )
354
353
->setContest ($ contest );
355
354
356
- $ errors = $ this ->validator ->validate ($ contestProblem );
357
- if ( $ errors ->count ()) {
358
- $ hasErrors = true ;
355
+ $ errors = $ this ->validator ->validate ($ contestProblem );
356
+ $ hasContestProblemErrors = $ errors ->count ();
357
+ if ( $ hasContestProblemErrors ) {
359
358
/** @var ConstraintViolationInterface $error */
360
359
foreach ($ errors as $ error ) {
361
360
$ messages ['danger ' ][] = sprintf (
@@ -367,7 +366,7 @@ public function importProblemsData(Contest $contest, array $problems, array &$id
367
366
}
368
367
}
369
368
370
- if ($ hasErrors ) {
369
+ if ($ hasProblemErrors || $ hasContestProblemErrors ) {
371
370
return false ;
372
371
}
373
372
0 commit comments