File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/main/java/com/moplus/moplus_server/client/submit/dto/response Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,18 @@ public static DayProgress determineDayProgress(List<ProblemSubmitStatus> problem
1111 if (problemStatuses .isEmpty ()) {
1212 return INCOMPLETE ;
1313 }
14- else if (problemStatuses .contains (ProblemSubmitStatus .IN_PROGRESS )) {
15- return IN_PROGRESS ;
16- }
17- else {
14+ boolean allNotStarted = problemStatuses .stream ()
15+ .allMatch (status -> status == ProblemSubmitStatus .NOT_STARTED );
16+
17+ boolean allFinished = problemStatuses .stream ()
18+ .allMatch (status -> status == ProblemSubmitStatus .CORRECT || status == ProblemSubmitStatus .INCORRECT );
19+
20+ if (allNotStarted ) {
21+ return INCOMPLETE ;
22+ } else if (allFinished ) {
1823 return COMPLETE ;
24+ } else {
25+ return IN_PROGRESS ;
1926 }
2027 }
2128}
You can’t perform that action at this time.
0 commit comments