• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MarkUsProject / Markus / 18783844054

24 Oct 2025 03:06PM UTC coverage: 91.574% (+0.06%) from 91.516%
18783844054

Pull #7697

github

web-flow
Merge d198c3871 into 22805cd2d
Pull Request #7697: Add scheduled visibility for assessments

787 of 1638 branches covered (48.05%)

Branch coverage included in aggregate %.

193 of 198 new or added lines in 10 files covered. (97.47%)

55 existing lines in 4 files now uncovered.

42751 of 45906 relevant lines covered (93.13%)

121.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.75
/app/models/assessment_section_properties.rb
1
# Represents properties of an assessment specific to a given section.
2
class AssessmentSectionProperties < ApplicationRecord
1✔
3
  belongs_to :section
1✔
4
  belongs_to :assessment, inverse_of: :assessment_section_properties
1✔
5

6
  has_one :course, through: :assessment
1✔
7
  validate :courses_should_match
1✔
8
  validates :visible_on, date: true, allow_nil: true
1✔
9
  validates :visible_until, date: true, allow_nil: true
1✔
10
  validate :visible_dates_are_valid
1✔
11

12
  # Returns the dute date for a section of an assignment. Defaults to the global
13
  # due date of the assignment.
14
  def self.due_date_for(section, assignment)
1✔
15
    return assignment.due_date unless assignment.section_due_dates_type
17✔
16

17
    section_due_date =
18
      where(section_id: section.id, assessment_id: assignment.id).first
16✔
19
    section_due_date.try(:due_date) || assignment.due_date
16✔
20
  end
21

22
  def visible_dates_are_valid
1✔
23
    return if visible_on.nil? || visible_until.nil?
261✔
24
    if visible_on >= visible_until
10✔
NEW
25
      errors.add(:visible_until, 'must be after visible_on')
×
26
    end
27
  end
28
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc