diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 55dc28f6f..69e9f797a 100755
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -345,11 +345,6 @@ def set_users_list_breadcrumb
end
### END HELPERS
- def pluralize(count, singular, plural = nil)
- "#{count || 0} " +
- (count == 1 || count =~ /^1(\.0+)?$/ ? singular : (plural || singular.pluralize))
- end
-
# make_dlist - Creates a string of emails that can be added as b/cc field.
# @param section The section to email. nil if we should email the entire
# class.
diff --git a/app/controllers/assessment/autograde.rb b/app/controllers/assessment/autograde.rb
index c3e047e84..b799ecd9c 100644
--- a/app/controllers/assessment/autograde.rb
+++ b/app/controllers/assessment/autograde.rb
@@ -104,7 +104,7 @@ def regradeBatch
failure_jobs = failed_list.length
if failure_jobs > 0
- flash[:error] = "Warning: Could not regrade #{pluralize(failure_jobs, "submission")}:
"
+ flash[:error] = "Warning: Could not regrade #{ActionController::Base.helpers.pluralize(failure_jobs, "submission")}:
"
failed_list.each do |failure|
if failure[:error].error_code == :nil_submission
flash[:error] += "Unrecognized submission ID
"
@@ -116,7 +116,7 @@ def regradeBatch
success_jobs = submission_ids.size - failure_jobs
if success_jobs > 0
- link = "#{pluralize(success_jobs, "submission")}"
+ link = "#{ActionController::Base.helpers.pluralize(success_jobs, "submission")}"
flash[:success] = ("Regrading #{link}")
end
@@ -151,7 +151,7 @@ def regradeAll
failure_jobs = failed_list.length
if failure_jobs > 0
- flash[:error] = "Warning: Could not regrade #{pluralize(failure_jobs, "submission")}:
"
+ flash[:error] = "Warning: Could not regrade #{ActionController::Base.helpers.pluralize(failure_jobs, "submission")}:
"
failed_list.each do |failure|
if failure[:error].error_code == :nil_submission
flash[:error] += "Unrecognized submission ID
"
@@ -163,7 +163,7 @@ def regradeAll
success_jobs = last_submissions.size - failure_jobs
if success_jobs > 0
- link = "#{pluralize(success_jobs, "student")}"
+ link = "#{ActionController::Base.helpers.pluralize(success_jobs, "student")}"
flash[:success] = ("Regrading the most recent submissions from #{link}")
end