Skip to content

Commit

Permalink
update for no sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
barais committed Feb 12, 2024
1 parent 731496a commit 03340a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/fr/istic/web/rest/ExtendedAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -1888,15 +1888,15 @@ public Response getExamStatusFinish(@PathParam("examId") final long examId, @Con
return Response.status(403, "Current user cannot access this ressource").build();
}

final MarkingExamStateDTO result = new MarkingExamStateDTO();
final List<StudentResponse> stdResponses = StudentResponse.getAll4ExamId(examId).list();
final Map<Long, List<StudentResponse>> byQuestion = stdResponses.stream()
.collect(Collectors.groupingBy(StudentResponse::getQuestionNumero));

var nbreSheet = ExamSheet.getAll4ExamId(examId).count();
var res = byQuestion.keySet().stream().allMatch(e-> byQuestion.get(e).size()==nbreSheet);
log.error("" +result);

if (nbreSheet ==0){
res = false;
}
return Response.ok(res).build();
}

Expand Down

0 comments on commit 03340a4

Please sign in to comment.