Class: TaskStatus
Overview
Holds the completion status of a task for each participant
Constant Summary
collapse
- LESSON_MODULE_TYPE =
ContentModules::LessonModule.to_s
Instance Method Summary
collapse
#accessible?, #available_for_learning_on
Instance Method Details
#is_lesson? ⇒ Boolean
89
90
91
|
# File 'app/models/task_status.rb', line 89
def is_lesson?
task.bit_core_content_module.instance_of? ContentModules::LessonModule
end
|
#mark_complete ⇒ Object
81
82
83
84
85
86
87
|
# File 'app/models/task_status.rb', line 81
def mark_complete
if completed_at
save!
else
update_attributes(completed_at: DateTime.current)
end
end
|
#notify_today? ⇒ Boolean
93
94
95
96
|
# File 'app/models/task_status.rb', line 93
def notify_today?
today = Time.zone.now
start_day == ((today.to_date - membership.start_date.to_date).to_i + 1)
end
|
#provider_viz? ⇒ Boolean
77
78
79
|
# File 'app/models/task_status.rb', line 77
def provider_viz?
try(:bit_core_content_module).try(:is_viz)
end
|