Sha256: 7368eebf7498213faab3730332e469794e103628e7dc105392225dd22529a214

Contents?: true

Size: 1.24 KB

Versions: 32

Compression:

Stored size: 1.24 KB

Contents

module GuideContainer
  extend ActiveSupport::Concern
  include Container

  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

  # Tells if this guide container
  # hides the results for students
  def results_hidden_for?(_exercise)
    false
  end

  def timed?
    false
  end

  def start!(user)
  end

  def resettable?
    true
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
mumuki-domain-8.3.1 app/models/concerns/guide_container.rb
mumuki-domain-8.2.0 app/models/concerns/guide_container.rb
mumuki-domain-8.1.3 app/models/concerns/guide_container.rb
mumuki-domain-8.1.2 app/models/concerns/guide_container.rb
mumuki-domain-8.1.1 app/models/concerns/guide_container.rb
mumuki-domain-8.1.0 app/models/concerns/guide_container.rb
mumuki-domain-8.0.0 app/models/concerns/guide_container.rb
mumuki-domain-7.12.2 app/models/concerns/guide_container.rb
mumuki-domain-7.12.1 app/models/concerns/guide_container.rb
mumuki-domain-7.12.0 app/models/concerns/guide_container.rb
mumuki-domain-7.11.1 app/models/concerns/guide_container.rb
mumuki-laboratory-7.11.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-c92f2a7212e2/app/models/concerns/guide_container.rb
mumuki-laboratory-7.11.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-2e15c3330133/app/models/concerns/guide_container.rb
mumuki-domain-7.11.0 app/models/concerns/guide_container.rb
mumuki-domain-7.10.1 app/models/concerns/guide_container.rb
mumuki-domain-7.10.0 app/models/concerns/guide_container.rb
mumuki-laboratory-7.9.2 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-7082a83493eb/app/models/concerns/guide_container.rb
mumuki-domain-7.9.2 app/models/concerns/guide_container.rb
mumuki-laboratory-7.9.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-b162dc91aa77/app/models/concerns/guide_container.rb
mumuki-domain-7.9.1 app/models/concerns/guide_container.rb