diff --git a/app/models/course.rb b/app/models/course.rb index e9bd4b6..f65b361 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -1,5 +1,5 @@ class Course < ApplicationRecord - has_many :lectures, dependent: :destroy + has_many :lectures, -> { order("start_time") }, dependent: :destroy has_many :work_items, dependent: :destroy # A course has a standalone connection to its recordings. To be displayed they must be associated with a lecture but diff --git a/app/models/lecture.rb b/app/models/lecture.rb index 5dc4f9b..72ffa64 100644 --- a/app/models/lecture.rb +++ b/app/models/lecture.rb @@ -41,7 +41,7 @@ class Lecture < ApplicationRecord # NAIVE: Assumes that lectures are 50 minutes long, this is true currently but not assured. def end_time - start_time + 50.hour + start_time + 50.minutes end def is_live? diff --git a/app/views/attendance_tracker/_lecture_status_icons.html.erb b/app/views/attendance_tracker/_lecture_status_icons.html.erb index a3233c4..78f1cf5 100644 --- a/app/views/attendance_tracker/_lecture_status_icons.html.erb +++ b/app/views/attendance_tracker/_lecture_status_icons.html.erb @@ -44,4 +44,4 @@ <% end %> - \ No newline at end of file + diff --git a/app/views/lectures/_lecture.html.erb b/app/views/lectures/_lecture.html.erb index 9a303f0..dc743ac 100644 --- a/app/views/lectures/_lecture.html.erb +++ b/app/views/lectures/_lecture.html.erb @@ -4,9 +4,24 @@ }) %>">