Browse files

new script for blocking workers

  • Loading branch information...
1 parent b078031 commit 201cfd295bfd2fc934af4ae2b9d8e507e65ef7c4 @kachok committed Feb 29, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 process/src/block_workers.py
View
12 process/src/block_workers.py
@@ -88,12 +88,12 @@
print "blocking worker: ", mturk_worker_id
reason="We are sorry, but you are blocked from working on our HITs. Quality of your work is less than 50%, meaning you failed more than half of controls embedded into our tasks."
- mturk_conn.block_worker(mturk_worker_id, reason)
+ #mturk_conn.block_worker(mturk_worker_id, reason)
cur2=conn.cursor()
#select open assignmetns that belongs to banned workers
- sql2="SELECT a.id, a.mturk_assignment_id, a.data_status, a.worker_id, a.mturk_status FROM assignments a WHERE a.worker=%s;"
+ sql2="SELECT a.id, a.mturk_assignment_id, a.data_status, a.worker_id, a.mturk_status FROM assignments a WHERE a.id=%s;"
cur2.execute(sql2, (worker_id,))
rows2=cur2.fetchall()
for row2 in rows2:
@@ -109,7 +109,7 @@
try:
reject_feedback='Thank you for working on this assignment. Unfortunately, we had to reject it because you are blocked from performing our tasks. Quality of your work is less than 50%, meaning you failed more than half of controls embedded into our tasks.'
- mturk_conn.reject_assignment(mturk_assignment_id, feedback=reject_feedback)
+ #mturk_conn.reject_assignment(mturk_assignment_id, feedback=reject_feedback)
print "rejected", mturk_assignment_id, reject_feedback
except boto.mturk.connection.MTurkRequestError, err:
print "mturk api error while rejecting assignment"
@@ -120,9 +120,9 @@
data_status=0
#update assignment mturk_status and status based on local vars in database
- sql2="UPDATE assignments SET mturk_status=%s, status=%s, data_status=%s, data_quality=%s WHERE id=%s;"
- cur2.execute(sql2, (mturk_status, status, data_status, data_quality, assignment_id))
- conn.commit()
+ #sql2="UPDATE assignments SET mturk_status=%s, status=%s, data_status=%s, data_quality=%s WHERE id=%s;"
+ #cur2.execute(sql2, (mturk_status, status, data_status, data_quality, assignment_id))
+ #conn.commit()
logging.info("assignment %s processed in full" % (assignment_id))
conn.close()

0 comments on commit 201cfd2

Please sign in to comment.