Class: Course::Settings::SurveyComponent

Inherits:
Component
  • Object
show all
Includes:
EmailSettingsConcern, LessonPlanSettingsConcern
Defined in:
app/models/course/settings/survey_component.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from LessonPlanSettingsConcern

#update_lesson_plan_item_setting

Methods included from EmailSettingsConcern

#email_settings, #update_email_setting

Class Method Details

.component_classObject


21
22
23
# File 'app/models/course/settings/survey_component.rb', line 21

def self.component_class
  Course::SurveyComponent
end

.email_setting_itemsObject


6
7
8
9
10
11
# File 'app/models/course/settings/survey_component.rb', line 6

def self.email_setting_items
  {
    survey_opening: { enabled_by_default: true },
    survey_closing: { enabled_by_default: true }
  }
end

Instance Method Details

#lesson_plan_item_settingsObject


13
14
15
# File 'app/models/course/settings/survey_component.rb', line 13

def lesson_plan_item_settings
  super.merge(component_title: I18n.t('components.surveys.name'))
end

#showable_in_lesson_plan?Boolean


17
18
19
# File 'app/models/course/settings/survey_component.rb', line 17

def showable_in_lesson_plan?
  settings.lesson_plan_items ? settings.lesson_plan_items['enabled'] : true
end