From 7c60e736e514ffb81b12f5ccd45e36c8fcdcaffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Akal=C4=B1n?= Date: Mon, 10 Aug 2015 10:53:52 +0200 Subject: Add code to check for typos --- monkey/test.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'monkey/test.py') 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): -- cgit v1.2.1