예제 #1
0
 def open_recruitment(self, n=1):
     if self.is_in_progress:
         # Already started... do nothing.
         return None
     conn.incr('num_recruited', n)
     to_recruit = max(n, 10)
     return super(MTurkLargeRecruiter, self).open_recruitment(to_recruit)
예제 #2
0
 def recruit(self, n=1):
     if not self.config.get('auto_recruit', False):
         logger.info('auto_recruit is False: recruitment suppressed')
         return
     to_recruit = n
     if int(conn.get('num_recruited')) < 10:
         num_recruited = conn.incr('num_recruited', n)
         logger.info('Recruited participant from preallocated pool')
         if num_recruited > 10:
             to_recruit = num_recruited - 10
         else:
             to_recruit = 0
     else:
         conn.incr('num_recruited', n)
     if to_recruit:
         return super(MTurkLargeRecruiter, self).recruit(to_recruit)