Show up to three submissions for teachers and add overview to table

This commit is contained in:
Sebastian Serth
2020-05-08 11:35:11 +02:00
parent 72c59c3816
commit 413ec9f956
7 changed files with 33 additions and 11 deletions

View File

@ -27,7 +27,7 @@ class Submission < ApplicationRecord
scope :within_grace_period, -> { joins(:exercise).where('(submissions.updated_at > exercises.submission_deadline) AND (submissions.updated_at <= exercises.late_submission_deadline OR exercises.late_submission_deadline IS NULL)') }
scope :after_late_deadline, -> { joins(:exercise).where('submissions.updated_at > exercises.late_submission_deadline') }
scope :latest, -> { order(updated_at: :desc).limit(1) }
scope :latest, -> { order(updated_at: :desc).first }
scope :in_study_group_of, ->(user) { where(study_group_id: user.study_groups) unless user.admin? }