From e490f99298be22250b0188a623d0edc9bbf63f58 Mon Sep 17 00:00:00 2001 From: David Schuster Date: Sat, 23 May 2020 14:11:59 -0400 Subject: [PATCH] fixed regrade all bug if autograde job fails --- app/controllers/assessment/autograde.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/assessment/autograde.rb b/app/controllers/assessment/autograde.rb index 292a27c48..f2add527c 100644 --- a/app/controllers/assessment/autograde.rb +++ b/app/controllers/assessment/autograde.rb @@ -108,6 +108,7 @@ def regradeAll last_submissions = @submissions.latest + # Now regrade only the most recent submissions. Keep track of # any handins that fail. failed_jobs = 0 @@ -119,15 +120,16 @@ def regradeAll redirect_to([@course, @assessment, :submissions]) && return elsif job < 0 # autograding failed failed_jobs += 1 - failed_list += "#{@submission.filename}: autograding error.
" + failed_list += "#{submission.filename}: #{flash[:error]}.
" end else + # abort submission.inspect failed_jobs += 1 - failed_list += "#{submission.filename}: not found or not readable.
" + failed_list += "NIL submission decteced.
" end end - flash[:error] = "Warning: Could not regrade #{failed_jobs} submission(s):
" + failed_list if failed_jobs > 0 + flash[:error] = "Error: Could not regrade #{failed_jobs} submission(s):
" + failed_list if failed_jobs > 0 success_jobs = last_submissions.size - failed_jobs if success_jobs > 0