Sha256: 777699ba096ada2dd0fbfd79de1e9d059f16efb35b00b679444c396b40eaf07c

Contents?: true

Size: 1.1 KB

Versions: 33

Compression:

Stored size: 1.1 KB

Contents

module GuideContainer
  extend ActiveSupport::Concern

  included do
    validates_presence_of :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

33 entries across 33 versions & 2 rubygems

Version Path
mumuki-laboratory-7.0.12 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-74da3d4af98c/app/models/concerns/guide_container.rb
mumuki-domain-7.0.6 app/models/concerns/guide_container.rb
mumuki-domain-7.0.5 app/models/concerns/guide_container.rb
mumuki-domain-7.0.4 app/models/concerns/guide_container.rb
mumuki-domain-7.0.3 app/models/concerns/guide_container.rb
mumuki-laboratory-7.0.11 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-f892f79c60f0/app/models/concerns/guide_container.rb
mumuki-domain-7.0.2 app/models/concerns/guide_container.rb
mumuki-domain-7.0.1 app/models/concerns/guide_container.rb
mumuki-domain-7.0.0 app/models/concerns/guide_container.rb
mumuki-domain-6.7.2 app/models/concerns/guide_container.rb
mumuki-domain-6.7.1 app/models/concerns/guide_container.rb
mumuki-domain-6.7.0 app/models/concerns/guide_container.rb
mumuki-domain-6.6.2 app/models/concerns/guide_container.rb
mumuki-domain-6.6.1 app/models/concerns/guide_container.rb
mumuki-domain-6.6.0 app/models/concerns/guide_container.rb
mumuki-domain-6.5.1 app/models/concerns/guide_container.rb
mumuki-domain-6.5.0 app/models/concerns/guide_container.rb
mumuki-domain-6.4.3 app/models/concerns/guide_container.rb
mumuki-domain-6.4.2 app/models/concerns/guide_container.rb
mumuki-domain-6.4.1 app/models/concerns/guide_container.rb