From c4e0aaf6b8475fb1e2de4c12a1bee9d571820bd3 Mon Sep 17 00:00:00 2001 From: Ilter Canberk Date: Wed, 4 Feb 2015 12:51:01 -0500 Subject: [PATCH] Fixed the loop that traverses live jobs --- app/controllers/assessment/autograde.rb | 2 +- app/controllers/jobs_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/assessment/autograde.rb b/app/controllers/assessment/autograde.rb index 977767898..44e97e173 100644 --- a/app/controllers/assessment/autograde.rb +++ b/app/controllers/assessment/autograde.rb @@ -32,7 +32,7 @@ def autogradeAfterHandin(submission) flash[:error] = "There was an error (#{job}) submitting your autograding job. " + "Please contact your instructor." else - link = "'jobs')}\">Job ID = #{job}" + link = ""jobs", :action=>"getjob", :id=>job)}\">Job ID = #{job}" flash[:success] = ("Submitted file #{@submission.filename} (#{link}) for autograding." + " Refresh the page to see the results.").html_safe end diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb index c1ee8080e..1cdc61237 100755 --- a/app/controllers/jobs_controller.rb +++ b/app/controllers/jobs_controller.rb @@ -95,13 +95,13 @@ def getjob is_live = false if raw_live_jobs and raw_dead_jobs then for item in raw_live_jobs do - if item[:id] == job_id then + if item["id"] == job_id then rjob = item is_live = true break end end - if not rjob then + if rjob.nil? then for item in raw_dead_jobs do if item["id"] == job_id then rjob = item