Class: Challenge

Inherits:
Exercise show all
Includes:
WithLayout
Defined in:
app/models/exercise/challenge.rb

Direct Known Subclasses

Interactive, QueriableChallenge

Constant Summary

Constants inherited from Exercise

Exercise::BASIC_RESOURCE_FIELDS, Exercise::RANDOMIZED_FIELDS

Instance Method Summary collapse

Methods included from WithLayout

#input_kids?

Methods inherited from Exercise

#choice?, #choice_index_for, #choice_values, #console?, #content_used_in?, #custom?, default_scope, #description_context, #description_task, #ensure_type!, #files_for, find_transparently!, #friendly, #guide_done_for?, #import_from_resource_h!, #inspection_keywords, #limited?, locate!, #navigable_content_in, #new_solution, #pending_siblings_for, #previous, #reclassify!, #results_hidden?, #search_tags, #settings, #sibling_at, #solvable?, #splitted_description, #structural_parent, #submission_for, #to_expanded_resource_h, #to_resource_h, #transparent_id, #transparent_params, #try_submit_solution!, #used_in?

Methods included from SiblingsNavigation

#navigable_name, #next_for, #pending_siblings_for, #restart, #siblings

Methods included from ParentNavigation

#leave, #navigable_name, #navigable_parent, #navigation_end?

Methods included from Submittable

#find_assignment_and_submit!, #submit!

Methods included from Questionable

#submit_question!

Methods included from WithAssignments

#assignment_for, #find_assignment_for, #has_messages_for?, #has_progress_for?, #messages_for, #status_for

Methods included from FriendlyName

#friendly_name, #to_param

Methods included from Assistable

#assist_with, #assistant

Methods included from WithRandomizations

#randomizer, #seed, #seed_with!

Methods included from WithDiscussions

#discuss!, #new_discussion_for, #submission_for, #try_solve_discussions!

Methods inherited from ApplicationRecord

active_between, aggregate_of, all_except, defaults, #delete, #destroy!, enum_prefixed_translations_for, numbered, organic_on, resource_fields, #save, #save_and_notify!, #save_and_notify_changes!, serialize_symbolized_hash_array, teaser_on, #update_and_notify!, update_or_create!, whitelist_attributes, with_pg_retry, with_temporary_token

Methods included from WithPgLock

#with_pg_lock

Instance Method Details

#extraObject



13
14
15
16
17
18
19
# File 'app/models/exercise/challenge.rb', line 13

def extra
  [guide.extra, own_extra]
    .compact
    .join("\n")
    .strip
    .ensure_newline
end

#own_extraObject



11
# File 'app/models/exercise/challenge.rb', line 11

alias_method :own_extra, :extra

#reset!Object



6
7
8
9
# File 'app/models/exercise/challenge.rb', line 6

def reset!
  super
  self.layout = self.class.default_layout
end