Skip to content

Commit

Permalink
make sure manual results are updated immediately in the client throug…
Browse files Browse the repository at this point in the history
…h the websocket channel
  • Loading branch information
Stephan Krusche committed Oct 15, 2019
1 parent 47e172b commit 23833ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23833ef

Please sign in to comment.