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