class Typingpool::Amazon::HIT::Assignment
Attributes
id[R]
See the RTurk documentation and Amazon
Mechanical Turk API documentation for more on these fields.
status[R]
See the RTurk documentation and Amazon
Mechanical Turk API documentation for more on these fields.
submitted_at[R]
See the RTurk documentation and Amazon
Mechanical Turk API documentation for more on these fields.
worker_id[R]
See the RTurk documentation and Amazon
Mechanical Turk API documentation for more on these fields.
Public Class Methods
new(rturk_hit)
click to toggle source
Constructor. Takes an RTurk::Hit instance.
# File lib/typingpool/amazon/hit/assignment.rb, line 12 def initialize(rturk_hit) if assignment = rturk_hit.assignments[0] #expensive! @id = assignment.id @status = assignment.status @worker_id = assignment.worker_id @submitted_at = assignment.submitted_at if answers = assignment.answers @answers = answers.to_hash end end end
Public Instance Methods
answers()
click to toggle source
Returns the answers associated with this assignment as a hash. If there are no answers, returns an empty hash.
# File lib/typingpool/amazon/hit/assignment.rb, line 26 def answers @answers ||= {} end
at_amazon()
click to toggle source
Returms an RTurk::Assignment object corresponding to this assignment.
# File lib/typingpool/amazon/hit/assignment.rb, line 37 def at_amazon RTurk::Assignment.new(@id) end
body()
click to toggle source
Returns the transcription submitted by the user as raw text.
# File lib/typingpool/amazon/hit/assignment.rb, line 31 def body (answers['transcription'] || answers['1']).to_s end