Class: Course::ExperiencePointsRecord

Inherits:
ApplicationRecord show all
Defined in:
app/models/course/experience_points_record.rb

Instance Method Summary collapse

Instance Method Details

#active?Boolean

Checks if the current record is active, i.e. it has been granted by a course staff.

This is necessary for records to be created but not graded, such as that of assessments.

Returns:

  • (Boolean)

20
21
22
# File 'app/models/course/experience_points_record.rb', line 20

def active?
  points_awarded.present?
end

#manually_awarded?Boolean

Checks if the given record is a manually-awarded experience points record.

Returns:

  • (Boolean)

27
28
29
# File 'app/models/course/experience_points_record.rb', line 27

def manually_awarded?
  actable_type.nil? && actable.nil?
end