Class: Problem

Inherits:
QueriableChallenge show all
Includes:
Solvable, WithEditor, WithExpectations
Defined in:
app/models/exercise/problem.rb

Instance Method Summary collapse

Methods included from WithExpectations

#expectations=, #expectations_yaml, #expectations_yaml=

Methods included from WithEditor

#choice?, #editor_with_defaults?, #pretty_choices

Methods included from Solvable

#run_tests!, #submit_solution!

Methods included from Queriable

#run_query!, #submit_query!

Methods inherited from Challenge

#extra, #extra_preview

Methods inherited from Exercise

#console?, #description_context, #description_task, #ensure_type!, #friendly, #guide_done_for?, #import_from_json!, #messages_path_for, #messages_url_for, #new_solution, #pending_siblings_for, #previous, #reclassify!, #search_tags, #sibling_at, #slug, #slug_parts, #splitted_description, #structural_parent, #used_in?

Methods included from SiblingsNavigation

#navigable_name, #next_for, #restart

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

#assigned_to?, #assignment_for, #current_content_for, #default_content_for, #extra_for, #files_for, #find_or_init_assignment_for, #has_messages_for?, #interpolate_for, #last_submission_date_for, #messages_for, #replace_content_reference, #solved_by?, #status_for, #submissions_count_for

Methods included from FriendlyName

#friendly_name, #to_param

Methods included from WithDescription

#description_teaser

Methods inherited from ApplicationRecord

aggregate_of, all_except, defaults, name_model_as, numbered, #save, #save_and_notify!, #save_and_notify_changes!, #update_and_notify!, update_or_create!

Instance Method Details

#evaluation_criteria?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/models/exercise/problem.rb', line 32

def evaluation_criteria?
  manual_evaluation? || expectations.present? || test.present?
end

#expectationsObject



24
25
26
# File 'app/models/exercise/problem.rb', line 24

def expectations
  super + guide_expectations
end

#guide_expectationsObject



28
29
30
# File 'app/models/exercise/problem.rb', line 28

def guide_expectations
  guide.expectations
end

#reset!Object



18
19
20
21
22
# File 'app/models/exercise/problem.rb', line 18

def reset!
  super
  self.test = nil
  self.expectations = []
end

#save_query_results!(assignment) ⇒ Object



15
16
# File 'app/models/exercise/problem.rb', line 15

def save_query_results!(assignment)
end

#setup_query_assignment!(assignment) ⇒ Object



12
13
# File 'app/models/exercise/problem.rb', line 12

def setup_query_assignment!(assignment)
end