diff --git a/app/assets/stylesheets/_variables.scss b/app/assets/stylesheets/_variables.scss index bf00289a1..0e52c019b 100644 --- a/app/assets/stylesheets/_variables.scss +++ b/app/assets/stylesheets/_variables.scss @@ -25,3 +25,4 @@ $autolab-selected-gray: #f5f5f5; $autolab-border-gray: #f4f1f1; $autolab-gray-text: #676464; $autolab-highlight-comments: #008000; +$autolab-yellow: #f7e788; diff --git a/app/assets/stylesheets/style.css.scss b/app/assets/stylesheets/style.css.scss index 0a0036ee3..160a9942e 100644 --- a/app/assets/stylesheets/style.css.scss +++ b/app/assets/stylesheets/style.css.scss @@ -1717,4 +1717,14 @@ table.sub td, th { margin-left: 5px; margin-top: 5px; color: $autolab-grey; +} + +.regrade-refresh { + color: $autolab-gray-text; + background-color: rgba($autolab-yellow, 0.3); + border: 1px solid $autolab-yellow; + border-left: 5px solid $autolab-yellow; + padding: 10px; + border-radius: 3px; + font-weight: 500; } \ No newline at end of file diff --git a/app/controllers/assessment/autograde.rb b/app/controllers/assessment/autograde.rb index 5a00a5214..9535fadd2 100644 --- a/app/controllers/assessment/autograde.rb +++ b/app/controllers/assessment/autograde.rb @@ -116,12 +116,6 @@ def regradeBatch end end - success_jobs = submissions.size - failure_jobs - if success_jobs > 0 - link = "#{ActionController::Base.helpers.pluralize(success_jobs, "submission")}" - flash[:success] = ("Regrading #{link}") - end - # For both :success and :error flash[:html_safe] = true diff --git a/app/controllers/submissions_controller.rb b/app/controllers/submissions_controller.rb index 64f7b0e6a..183a81013 100755 --- a/app/controllers/submissions_controller.rb +++ b/app/controllers/submissions_controller.rb @@ -21,12 +21,32 @@ def index .order("created_at DESC") @autograded = @assessment.has_autograder? + grading_jobs = [] + @grading_submissions = [] + + raw_live_jobs = [] + begin + raw_live_jobs = TangoClient.jobs + rescue TangoClient::TangoException => e + flash.now[:error] = "Error while getting job list: #{e.message}" + end + + raw_live_jobs.each do |job| + grading_jobs.push(job["id"]) + end + @submissions_to_cud = {} @submissions.each do |submission| currSubId = submission.id currCud = submission.course_user_datum_id @submissions_to_cud[currSubId] = currCud + if grading_jobs.include?(submission.jobid) + @grading_submissions.push(submission.id) + end end + + @grading = !@grading_submissions.empty? + @submissions_to_cud = @submissions_to_cud.to_json @excused_cids = [] excused_students = AssessmentUserDatum.where( diff --git a/app/views/submissions/index.html.erb b/app/views/submissions/index.html.erb index cb600a770..35edde46c 100755 --- a/app/views/submissions/index.html.erb +++ b/app/views/submissions/index.html.erb @@ -50,6 +50,15 @@ <%= javascript_include_tag "manage_submissions" %> <% end %> +<% if @grading %> +