@@ -59,25 +59,33 @@ def mark_task_completed(self, batch_index, task_id, task_group_id):
5959 self .batches [batch_index ]["status" ][task_group_id ] = True
6060 log .debug (msg = "task %d is complete" % task_group_id )
6161
62- def mark_task_incomplete (self , batch_index , task_id , task_group_id ):
62+ def mark_task_incomplete (self , batch_index , task_id , task_group_id , taskworker_id ):
6363 if task_group_id in self .batches [batch_index ]["status" ]:
64- self .batches [batch_index ]["submissions" ][task_group_id ] = self .batches [batch_index ]["submissions" ][
65- task_group_id ] - 1
64+ self .batches [batch_index ]["submissions" ][task_group_id ] = self .batches [batch_index ]["submissions" ][task_group_id ] - 1
6665 self .batches [batch_index ]["status" ][task_group_id ] = False
6766 log .debug (msg = "task %d is NOT complete" % task_group_id )
6867
68+ data = self .batches [batch_index ]["aggregated_data" ]
69+
70+ aggregate = []
71+ for taskworker in data :
72+ if taskworker ["data" ]["taskworker_id" ] != taskworker_id :
73+ aggregate .append (taskworker )
74+
75+ self .batches [batch_index ]["aggregated_data" ] = aggregate
76+
6977 def is_batch_complete (self , batch_index ):
7078 is_complete = all (self .batches [batch_index ]["status" ].values ())
71- log .debug (msg = "batch %d is %s complete" % (batch_index , '' if is_complete else 'NOT' ))
79+ log .debug (msg = "batch %d is %s complete" % (batch_index + 1 , '' if is_complete else 'NOT' ))
7280 return is_complete
7381
7482 def mark_batch_completed (self , batch_index ):
75- log .debug (msg = "batch %d is complete" % batch_index )
83+ # log.debug(msg="batch %d is complete" % batch_index)
7684
7785 self .batches [batch_index ]["is_complete" ] = True
7886
7987 def mark_batch_incomplete (self , batch_index ):
80- log .debug (msg = "batch %d is NOT complete" % batch_index )
88+ # log.debug(msg="batch %d is NOT complete" % batch_index)
8189
8290 self .batches [batch_index ]["is_complete" ] = False
8391
@@ -94,6 +102,7 @@ def all_reviews_complete(self):
94102
95103 def aggregate (self , batch_index , task_id , task_group_id , taskworker_id , task_data ):
96104 task_data ["taskworker_id" ] = taskworker_id
105+
97106 self .batches [batch_index ]["aggregated_data" ].append ({
98107 "task_id" : task_id ,
99108 "task_group_id" : task_group_id ,
0 commit comments