Skip to content

Commit

Permalink
Remove custom pluralize method in application_controller.rb (autolab#…
Browse files Browse the repository at this point in the history
…2082)

* Remove custom pluralize code as it is unnecessary and causing errors

* remove pluralize again (got readded in merge)

(cherry picked from commit 102a9a9)
  • Loading branch information
20wildmanj authored and NicholasMy committed Jan 9, 2025
1 parent d238c45 commit 4678526
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/assessment/autograde.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")}:<br>"
flash[:error] = "Warning: Could not regrade #{ActionController::Base.helpers.pluralize(failure_jobs, "submission")}:<br>"
failed_list.each do |failure|
if failure[:error].error_code == :nil_submission
flash[:error] += "Unrecognized submission ID<br>"
Expand All @@ -116,7 +116,7 @@ def regradeBatch

success_jobs = submission_ids.size - failure_jobs
if success_jobs > 0
link = "<a href=\"#{url_for(controller: 'jobs')}\">#{pluralize(success_jobs, "submission")}</a>"
link = "<a href=\"#{url_for(controller: 'jobs')}\">#{ActionController::Base.helpers.pluralize(success_jobs, "submission")}</a>"
flash[:success] = ("Regrading #{link}")
end

Expand Down Expand Up @@ -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")}:<br>"
flash[:error] = "Warning: Could not regrade #{ActionController::Base.helpers.pluralize(failure_jobs, "submission")}:<br>"
failed_list.each do |failure|
if failure[:error].error_code == :nil_submission
flash[:error] += "Unrecognized submission ID<br>"
Expand All @@ -163,7 +163,7 @@ def regradeAll

success_jobs = last_submissions.size - failure_jobs
if success_jobs > 0
link = "<a href=\"#{url_for(controller: 'jobs')}\">#{pluralize(success_jobs, "student")}</a>"
link = "<a href=\"#{url_for(controller: 'jobs')}\">#{ActionController::Base.helpers.pluralize(success_jobs, "student")}</a>"
flash[:success] = ("Regrading the most recent submissions from #{link}")
end

Expand Down

0 comments on commit 4678526

Please sign in to comment.