disabled approve/reject for abandoned HITs
@@ -358,6 +358,9 @@ class MTurkAgent(Agent):
return False
def approve_work(self):
+ if self.hit_is_abandoned:
+ print('Conversation ID: ' + str(self.conversation_id) + ', Agent ID: ' + self.id + ' - HIT is abandoned and thus not available for review.')
+ else:
if self.manager.get_agent_work_status(assignment_id=self.assignment_id) == ASSIGNMENT_DONE:
self.manager.approve_work(assignment_id=self.assignment_id)
print('Conversation ID: ' + str(self.conversation_id) + ', Agent ID: ' + self.id + ' - HIT is approved.')
@@ -365,6 +368,9 @@ class MTurkAgent(Agent):
print("Cannot approve HIT. Reason: Turker hasn't completed the HIT yet.")
def reject_work(self, reason='unspecified'):
+ if self.hit_is_abandoned:
+ print('Conversation ID: ' + str(self.conversation_id) + ', Agent ID: ' + self.id + ' - HIT is abandoned and thus not available for review.')
+ else:
if self.manager.get_agent_work_status(assignment_id=self.assignment_id) == ASSIGNMENT_DONE:
self.manager.reject_work(assignment_id=self.assignment_id, reason=reason)
print('Conversation ID: ' + str(self.conversation_id) + ', Agent ID: ' + self.id + ' - HIT is rejected.')
