Module: Course::Condition::ConditionsHelper

Included in:
Achievement::ControllerHelper, Assessment::AssessmentsHelper
Defined in:
app/helpers/course/condition/conditions_helper.rb

Instance Method Summary collapse

Instance Method Details

#component_enabled?(class_name) ⇒ Boolean

Checks if component of current condition is enabled. ie. If Achievements is disabled, checking component_enabled? for achievement conditions returns false.

Parameters:

  • class_name (String)

    Class name of the condition

Returns:

  • (Boolean)

    Returns whether the component is enabled or disabled


8
9
10
# File 'app/helpers/course/condition/conditions_helper.rb', line 8

def component_enabled?(class_name)
  !current_component_host[conditions_component_hash[class_name]].nil?
end