diff --git a/app/helpers/quizzes_helper.rb b/app/helpers/quizzes_helper.rb index 96b46c28f7d..8611ebe76d4 100644 --- a/app/helpers/quizzes_helper.rb +++ b/app/helpers/quizzes_helper.rb @@ -173,4 +173,17 @@ module QuizzesHelper match.sub(%r{( "less than 1 minute", + :one => "1 minute", + :other => "%{count} minutes" }, + :count => duration_minutes) + end end diff --git a/app/views/quizzes/_quiz_right_side.html.erb b/app/views/quizzes/_quiz_right_side.html.erb index 62ccf1e678b..6df87587764 100644 --- a/app/views/quizzes/_quiz_right_side.html.erb +++ b/app/views/quizzes/_quiz_right_side.html.erb @@ -27,7 +27,7 @@ <%= before_label(:time, "Time") %> - <%= time_ago_in_words(Time.now - ((@submission.finished_at || @submission.end_at || @submission.started_at) - @submission.started_at)) %> + <%= duration_in_minutes((@submission.finished_at || @submission.end_at || @submission.started_at) - @submission.started_at) %> <% unless @quiz.assignment.present? && @quiz.assignment.muted? %> diff --git a/app/views/quizzes/_quiz_submission.html.erb b/app/views/quizzes/_quiz_submission.html.erb index 43c7d441125..63920bdb2ba 100644 --- a/app/views/quizzes/_quiz_submission.html.erb +++ b/app/views/quizzes/_quiz_submission.html.erb @@ -93,7 +93,7 @@ <% end %>
- <%= t(:attempt_duration, "This attempt took %{duration}.", :duration => time_ago_in_words(Time.now + @submission.duration)) %> + <%= t(:attempt_duration, "This attempt took %{duration}.", :duration => duration_in_minutes(@submission.duration)) %>
<% if @quiz.require_lockdown_browser && @quiz.require_lockdown_browser_for_results && !@lockdown_browser_authorized_to_view && !can_do(@quiz, @current_user, :grade) %>

diff --git a/app/views/quizzes/_quiz_summary.html.erb b/app/views/quizzes/_quiz_summary.html.erb index e42344437a0..b73bf28c120 100644 --- a/app/views/quizzes/_quiz_summary.html.erb +++ b/app/views/quizzes/_quiz_summary.html.erb @@ -61,7 +61,7 @@ <%= before_label(:quiz_due, "Due") %> <%= datetime_string(q.due_at) %>
<% end %> <% if q.time_limit %> - <%= before_label(:quiz_time_limit, "Time Limit") %> <%= time_ago_in_words(Time.now - q.time_limit.minutes) %>
+ <%= before_label(:quiz_time_limit, "Time Limit") %> <%= duration_in_minutes(q.time_limit.minutes) %>
<% end %> <% if q.allowed_attempts && q.allowed_attempts != 1 %> <% if q.allowed_attempts > 0 %>