File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -818,6 +818,20 @@ public function importZippedProblem(
818
818
819
819
$ messages ['info ' ][] = sprintf ('Saved problem %d ' , $ problem ->getProbid ());
820
820
821
+ // Only here disable problem submit to make sure the jury submissions
822
+ // do get added above.
823
+ if ($ contestProblem ) {
824
+ $ this ->em ->flush ();
825
+ $ testcases = $ problem ->getTestcases ()->toArray ();
826
+ if (count (array_filter ($ testcases , function ($ t ) { return !$ t ->getDeleted (); }))==0 ) {
827
+ $ messages ['danger ' ][] = 'No testcases present, disabling submitting for this problem ' ;
828
+ $ contestProblem ->setAllowSubmit (false );
829
+ }
830
+ }
831
+
832
+ // Make sure we persisted all changes to DB
833
+ $ this ->em ->flush ();
834
+
821
835
return $ problem ;
822
836
}
823
837
You can’t perform that action at this time.
0 commit comments