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
80
81
82
|
# File 'app/models/task_status.rb', line 80
def is_lesson?
task.bit_core_content_module.instance_of? ContentModules::LessonModule
end
|
#mark_complete ⇒ Object
72
73
74
75
76
77
78
|
# File 'app/models/task_status.rb', line 72
def mark_complete
if completed_at
save!
else
update_attributes(completed_at: DateTime.current)
end
end
|
#notify_today? ⇒ Boolean
84
85
86
87
|
# File 'app/models/task_status.rb', line 84
def notify_today?
today = Time.now
start_day == ((today.to_date - membership.start_date.to_date).to_i + 1)
end
|
#provider_viz? ⇒ Boolean
68
69
70
|
# File 'app/models/task_status.rb', line 68
def provider_viz?
try(:bit_core_content_module).try(:is_viz)
end
|