Add total lecture time and improve time representation
In the attendance tracker view, the total times for preparation, in lecture, and review have been humanized for better readability. Also, total time spent on lectures for each week has been included for a quicker overview. A helper method 'humanise_duration' has been added in application helper to convert time into a more readable format. Changes have been done in 'lecture' model for calculation of total time.
This commit is contained in:
@@ -25,6 +25,10 @@ class Lecture < ApplicationRecord
|
||||
tracked_time_entries.preparation.sum(&:duration).seconds
|
||||
end
|
||||
|
||||
def total_overall_time
|
||||
tracked_time_entries.sum(&:duration).seconds
|
||||
end
|
||||
|
||||
def total_attendance_time
|
||||
tracked_time_entries.where(kind: [:concurrent, :catchup]).sum(&:duration).seconds
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user