Class: Playground

Inherits:
QueriableChallenge show all
Defined in:
app/models/exercise/playground.rb

Constant Summary

Constants inherited from Exercise

Exercise::BASIC_RESOURCE_FIELDS, Exercise::RANDOMIZED_FIELDS

Instance Method Summary collapse

Methods included from Queriable

#run_query!, #submit_query!

Methods inherited from Challenge

#extra, #reset!

Methods included from WithLayout

#input_kids?

Methods inherited from Exercise

#choice?, #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!, #reset!, #results_hidden?, #search_tags, #settings, #sibling_at, #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, #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?, #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 included from WithDescription

#description_teaser

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

#save_query_results!(assignment) ⇒ Object



10
11
12
13
14
15
# File 'app/models/exercise/playground.rb', line 10

def save_query_results!(assignment)
  unless assignment.passed?
    assignment.passed!
    assignment.notify!
  end
end

#setup_query_assignment!(assignment) ⇒ Object



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

def setup_query_assignment!(assignment)
  assignment.running!
end