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
#lesson? ⇒ Boolean
94
95
96
|
# File 'app/models/task_status.rb', line 94
def lesson?
task.bit_core_content_module.instance_of? ContentModules::LessonModule
end
|
#mark_complete ⇒ Object
86
87
88
89
90
91
92
|
# File 'app/models/task_status.rb', line 86
def mark_complete
if completed_at
save!
else
update_attributes(completed_at: DateTime.current)
end
end
|
#notify_today? ⇒ Boolean
98
99
100
101
|
# File 'app/models/task_status.rb', line 98
def notify_today?
today = Time.zone.now
start_day == ((today.to_date - membership.start_date.to_date).to_i + 1)
end
|
#provider_viz? ⇒ Boolean
82
83
84
|
# File 'app/models/task_status.rb', line 82
def provider_viz?
try(:bit_core_content_module).try(:is_viz)
end
|