Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiz exercises: Fix an issue when automatically evaluating a live quiz #9988

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,13 @@ else if (quizExercise.isQuizEnded()) {
// avoid LazyInitializationException
participation.setResults(Set.of(result));

var course = quizExercise.getCourseViaExerciseGroupOrCourseMember();
sendQuizResultToUser(quizExerciseId, participation);
if (course != null) {
// This is required, as sendQuizResultToUser removes the course from the quizExercise
// TODO: This should be fixed by using DTOs in the future
quizExercise.setCourse(course);
}
Hialus marked this conversation as resolved.
Show resolved Hide resolved
});
quizStatisticService.recalculateStatistics(quizExercise);
// notify users via websocket about new results for the statistics, filter out solution information
Expand All @@ -198,7 +204,7 @@ private void sendQuizResultToUser(long quizExerciseId, StudentParticipation part
websocketMessagingService.sendMessageToUser(user, "/topic/exercise/" + quizExerciseId + "/participation", participation);
}

// Use a DTO instead of removing data from the entity
// TODO: Use a DTO instead of removing data from the entity
@Deprecated
private void removeUnnecessaryObjectsBeforeSendingToClient(StudentParticipation participation) {
if (participation.getExercise() != null) {
Expand Down
Loading