diff options
Diffstat (limited to 'monkey')
-rwxr-xr-x | monkey/test.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/monkey/test.py b/monkey/test.py index bb49948..9267782 100755 --- a/monkey/test.py +++ b/monkey/test.py @@ -144,13 +144,9 @@ elif sys.argv[2] == 'info': # Print all observed edits and their costs. elif sys.argv[3] == 'edits': - for (path, before, after), cost in sorted(edits.items(), key=lambda x: x[1]): + for (path, before, after), (cost, uids) in sorted(edits.items(), key=lambda x: x[1]): print(' {:.4f}\t{} → {}'.format(cost, stringify(before) if before else 'ε', stringify(after) if after else 'ε')) - # Print all observed edits and their costs. - elif sys.argv[3] == 'names': - for name, count in sorted(names.items(), key=lambda x: x[1]): - print(' {:.4f}\t{}'.format(count, name)) # Print all student queries and their counts. elif sys.argv[3] == 'queries': @@ -162,6 +158,6 @@ elif sys.argv[2] == 'info': which = None if len(sys.argv) > 4: which = sys.argv[4] == 'good' - for (code, correct), count in submissions.most_common(): + for (code, correct), uids in reversed(sorted(submissions.items(), key=lambda x: len(x[1]))): if which is None or correct == which: - print('{}\t{}'.format(count, code)) + print('{}\t{}'.format(len(uids), code)) |