def grant_bonus(worker, experiment, reward): mturk = connect(experiment) reason = 'Additional reward for second image labeling task' return mturk.grant_bonus( worker.id , worker.assignment_id , Price(cents_to_dollars(reward)) , reason )
def create_hit(url, experiment): mturk = connect(experiment) return mturk.create_hit( question=ExternalQuestion(url, experiment.hit_frame_height) , title=experiment.hit_title , description=experiment.hit_description , lifetime=experiment.hit_lifetime , max_assignments=experiment.hit_max_assignments , keywords=experiment.hit_keywords , duration=experiment.hit_duration , approval_delay=experiment.hit_approval_delay , reward=cents_to_dollars(experiment.t1_reward) , response_groups=['Minimal', 'HITDetail', 'HITQuestion', 'HITAssignmentSummary'] )
def __init__(self, experiment, groups): self.aws_access_key_id = experiment.aws_access_key_id self.aws_secret_access_key = experiment.aws_secret_access_key self.aws_hostname = experiment.aws_hostname self.hit_title = experiment.hit_title self.hit_description = experiment.hit_description self.hit_lifetime = experiment.hit_lifetime self.hit_max_assignments = experiment.hit_max_assignments self.hit_keywords = ', '.join(experiment.hit_keywords) self.hit_duration = experiment.hit_duration self.hit_approval_delay = experiment.hit_approval_delay self.hit_frame_height = experiment.hit_frame_height self.t1_image = Image(experiment.t1_image_url) self.t1_reward = cents_to_dollars(experiment.t1_reward) self.t2_image = Image(experiment.t2_image_url) self.groups = groups