Sha256: b0df605533f03bd7a382d80551de2b3ce92e4250c6b263f7ea64b9f3b2162a71

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

module GuideContainer
  extend ActiveSupport::Concern
  include WithContent

  included do
    associated_content :guide

    delegate :name,
             :slug,
             :language,
             :search_tags,
             :exercises,
             :first_exercise,
             :next_exercise,
             :stats_for,
             :exercises_count, to: :guide
  end

  def index_usage!(organization = Organization.current)
    organization.index_usage_of! guide, self
  end

  def friendly
    defaulting_name { "#{navigable_parent.friendly}: #{name}" }
  end

  def validate_accessible_for!(user)
  end

  # Tells the number of remaning
  # attemps for a given assignment that belongs to this
  # container, or `nil`, if this container does not impose
  # any limit to the number of submissions
  def attempts_left_for(assignment)
    nil
  end

  # Tells if this guide container
  # imposes any kind of limit to the number of submission
  # to its assignments, which may depend on the exercise's type
  def limited_for?(exercise)
    false
  end

  def timed?
    false
  end

  def start!(user)
  end

  def resettable?
    true
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mumuki-domain-7.3.2 app/models/concerns/guide_container.rb
mumuki-domain-7.3.1 app/models/concerns/guide_container.rb
mumuki-domain-7.2.3 app/models/concerns/guide_container.rb
mumuki-domain-7.3.0 app/models/concerns/guide_container.rb
mumuki-domain-7.2.2 app/models/concerns/guide_container.rb
mumuki-domain-7.2.1 app/models/concerns/guide_container.rb
mumuki-domain-7.2.0 app/models/concerns/guide_container.rb