summaryrefslogtreecommitdiff
path: root/monkey/test.py
diff options
context:
space:
mode:
authorMehmet Akalın <mehmet.akalin@ceng.metu.edu.tr>2015-08-10 10:53:52 +0200
committerAleš Smodiš <aless@guru.si>2015-08-11 14:26:03 +0200
commit7c60e736e514ffb81b12f5ccd45e36c8fcdcaffa (patch)
treee3f54e1ee35ce25cf91a548257a01b1de6de32ea /monkey/test.py
parent8c1ad089121249c1f81838ce6871f3beb86787da (diff)
Add code to check for typos
Diffstat (limited to 'monkey/test.py')
-rwxr-xr-xmonkey/test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/monkey/test.py b/monkey/test.py
index 6549c1b..bb28e9b 100755
--- a/monkey/test.py
+++ b/monkey/test.py
@@ -36,6 +36,7 @@ attempts = Attempt.objects.filter(problem=problem) \
edits = tutor_apps.get_app_config('tutor').edits[problem.pk]
submissions = tutor_apps.get_app_config('tutor').submissions[problem.pk]
queries = tutor_apps.get_app_config('tutor').queries[problem.pk]
+names = tutor_apps.get_app_config('tutor').names[problem.pk]
# Find incorrect submissions.
incorrect_all = []
@@ -135,6 +136,11 @@ elif sys.argv[2] == 'info':
for (before, after), cost in sorted(changes.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 submissions not (yet) corrected.
elif sys.argv[3] == 'unsolved':
for p in sorted(incorrect):