Sha256: fc2c64fb4c85d1175dfd11ce1c2a6aeff02a0977fc8ca94a8aee3a520d01549a

Contents?: true

Size: 716 Bytes

Versions: 18

Compression:

Stored size: 716 Bytes

Contents

class Mumuki::Domain::Submission::Try < Mumuki::Domain::Submission::ConsoleSubmission
  attr_accessor :query, :cookie

  def try_evaluate_query!(assignment)
    assignment.run_try!(query: query, cookie: cookie).except(:response_type)
  end

  def save_submission!(assignment)
    assignment.query_results = [] if cookie.blank?
    assignment.queries = cookie.insert_last(query)
    assignment.save_submission! self
    assignment.save!
  end

  def save_results!(results, assignment)
    changes = { status: results[:status], result: results[:result] }
    changes.merge! query_results: assignment.query_results.insert_last(results[:query_result]) if results[:query_result]

    assignment.update! changes
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mumuki-domain-9.23.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.22.1 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.22.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.21.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.20.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.19.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.18.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.17.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.16.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.15.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.14.1 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.14.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.13.1 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.13.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.12.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.11.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.10.0 lib/mumuki/domain/submission/try.rb
mumuki-domain-9.9.0 lib/mumuki/domain/submission/try.rb