From 31d1712b158791e45fe075b609125a7b1c3d9065 Mon Sep 17 00:00:00 2001 From: kiragrammel Date: Wed, 15 Nov 2023 11:25:43 +0100 Subject: [PATCH] Set submission to nil if error occured during calculate_score --- app/controllers/remote_evaluation_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/remote_evaluation_controller.rb b/app/controllers/remote_evaluation_controller.rb index d6cdac13c..1c4967909 100644 --- a/app/controllers/remote_evaluation_controller.rb +++ b/app/controllers/remote_evaluation_controller.rb @@ -78,9 +78,11 @@ def create_and_score_submission(cause) end rescue Runner::Error::RunnerInUse => e Rails.logger.debug { "Scoring a submission failed because the runner was already in use: #{e.message}" } + @submission = nil {message: I18n.t('exercises.editor.runner_in_use'), status: 409} rescue Runner::Error => e Rails.logger.debug { "Runner error while scoring submission #{@submission.id}: #{e.message}" } + @submission = nil {message: I18n.t('exercises.editor.depleted'), status: 503} end