File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ default_nicknames_path = os.path.expanduser('~/.boto_mturkcli_hit_nicknames')
40
40
nicknames = {}
41
41
nickname_pool = set (string .ascii_lowercase )
42
42
43
+ get_assignments_page_size = 100
44
+
43
45
time_units = dict (
44
46
s = 1 ,
45
47
min = 60 ,
@@ -281,10 +283,20 @@ but apparently, it does.'''
281
283
nicknames = {k : v for k , v in nicknames .items () if v != hit }
282
284
283
285
def list_assignments (hit , only_reviewable = False ):
284
- assignments = map (digest_assignment , con .get_assignments (
285
- hit_id = hit ,
286
- page_size = 100 ,
287
- status = 'Submitted' if only_reviewable else None ))
286
+ # Accumulate all relevant assignments, one page of results at
287
+ # a time.
288
+ assignments = []
289
+ page = 1
290
+ while True :
291
+ rs = con .get_assignments (
292
+ hit_id = hit ,
293
+ page_size = get_assignments_page_size ,
294
+ page_number = page ,
295
+ status = 'Submitted' if only_reviewable else None )
296
+ assignments += map (digest_assignment , rs )
297
+ if len (assignments ) >= int (rs .TotalNumResults ):
298
+ break
299
+ page += 1
288
300
if interactive :
289
301
print json .dumps (assignments , sort_keys = True , indent = 4 )
290
302
print ' ' .join ([a ['AssignmentId' ] for a in assignments ])
You can’t perform that action at this time.
0 commit comments