From 23833ef7ff80a6aa520442af0e7f2aad28bd90fe Mon Sep 17 00:00:00 2001 From: Stephan Krusche Date: Tue, 15 Oct 2019 22:53:59 +0200 Subject: [PATCH] make sure manual results are updated immediately in the client through the websocket channel --- .../java/de/tum/in/www1/artemis/service/ResultService.java | 3 +-- .../java/de/tum/in/www1/artemis/web/rest/ResultResource.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/service/ResultService.java b/src/main/java/de/tum/in/www1/artemis/service/ResultService.java index c93ef077401b..2ff4d2b23cbf 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/ResultService.java +++ b/src/main/java/de/tum/in/www1/artemis/service/ResultService.java @@ -287,7 +287,6 @@ public void createNewManualResult(Result result, boolean isProgrammingExerciseWi result.setHasFeedback(isProgrammingExerciseWithFeedback); } - // TODO: in this case we do not have a submission. However, it would be good to create one, even if it might be "empty" User user = userService.getUserWithGroupsAndAuthorities(); result.setAssessmentType(AssessmentType.MANUAL); @@ -304,7 +303,7 @@ public void createNewManualResult(Result result, boolean isProgrammingExerciseWi Result savedResult = resultRepository.save(result); // if it is an example result we do not have any participation (isExampleResult can be also null) - if (result.isExampleResult() == Boolean.FALSE) { + if (result.isExampleResult() == Boolean.FALSE || result.isExampleResult() == null) { try { result.getParticipation().addResult(savedResult); participationService.save(result.getParticipation()); diff --git a/src/main/java/de/tum/in/www1/artemis/web/rest/ResultResource.java b/src/main/java/de/tum/in/www1/artemis/web/rest/ResultResource.java index 2e09773e3354..d68488307388 100644 --- a/src/main/java/de/tum/in/www1/artemis/web/rest/ResultResource.java +++ b/src/main/java/de/tum/in/www1/artemis/web/rest/ResultResource.java @@ -151,7 +151,6 @@ else if (!result.getFeedbacks().isEmpty() && result.getFeedbacks().stream().filt * * @param planKey the plan key of the plan which is notifying about a new result * @return the ResponseEntity with status 200 (OK), or with status 400 (Bad Request) if the result has already an ID - * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping(value = "/results/{planKey}") @Transactional