Class: Problem
- Inherits:
-
QueriableChallenge
- Object
- ActiveRecord::Base
- ApplicationRecord
- Exercise
- Challenge
- QueriableChallenge
- Problem
- Includes:
- Solvable, WithEditor, WithExpectations
- Defined in:
- app/models/exercise/problem.rb
Constant Summary
Constants inherited from Exercise
Instance Method Summary collapse
- #evaluation_criteria? ⇒ Boolean
- #expectations ⇒ Object
- #guide_expectations ⇒ Object
- #reset! ⇒ Object
- #save_query_results!(assignment) ⇒ Object
- #setup_query_assignment!(assignment) ⇒ Object
Methods included from WithExpectations
#ensure_expectations_format, #expectations=, #expectations_yaml, #expectations_yaml=, #own_expectations
Methods included from WithEditor
#choice?, #editor_with_defaults?, #pretty_choices
Methods included from Solvable
#run_tests!, #submit_solution!
Methods included from Queriable
Methods inherited from Challenge
Methods inherited from Exercise
#choice_index_for, #choice_values, #console?, #custom?, #description_context, #description_task, #ensure_type!, #files_for, find_transparently!, #friendly, #guide_done_for?, #import_from_resource_h!, #inspection_keywords, #limited?, locate!, #messages_path_for, #messages_url_for, #new_solution, #pending_siblings_for, #previous, #reclassify!, #search_tags, #settings, #sibling_at, #splitted_description, #structural_parent, #submission_for, #to_resource_h, #transparent_id, #transparent_params, #try_submit_solution!, #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
Methods included from WithAssignments
#assignment_for, #find_assignment_for, #has_messages_for?, #messages_for, #status_for
Methods included from FriendlyName
Methods included from Assistable
Methods included from WithRandomizations
#randomizer, #seed, #seed_with!
Methods included from WithDiscussions
#discuss!, #submission_for, #try_solve_discussions
Methods included from WithDescription
Methods inherited from ApplicationRecord
aggregate_of, all_except, defaults, #delete, #destroy!, numbered, organic_on, resource_fields, #save, #save_and_notify!, #save_and_notify_changes!, serialize_symbolized_hash_array, #update_and_notify!, update_or_create!, whitelist_attributes
Instance Method Details
#evaluation_criteria? ⇒ Boolean
32 33 34 |
# File 'app/models/exercise/problem.rb', line 32 def evaluation_criteria? manual_evaluation? || own_expectations.present? || test.present? end |
#expectations ⇒ Object
24 25 26 |
# File 'app/models/exercise/problem.rb', line 24 def expectations own_expectations + guide_expectations end |
#guide_expectations ⇒ Object
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 |