summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-04-10 13:25:23 +0200
committerAleš Smodiš <aless@guru.si>2015-08-11 14:26:03 +0200
commit1c7369e1ca3f9cc8db5bc4090bdb7ce15e473450 (patch)
treeedbaf1af46f5835e31f162a7e11b6bd767d03ff4
parentf019acddc6e300dcc36e898f258d67fe242a2c7d (diff)
Ignore attempts from all non-student users
-rw-r--r--monkey/edits.py3
-rwxr-xr-xmonkey/test.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/monkey/edits.py b/monkey/edits.py
index fc95e8b..42e339a 100644
--- a/monkey/edits.py
+++ b/monkey/edits.py
@@ -248,8 +248,7 @@ if __name__ == '__main__':
print(problem.name)
pid = problem.pk
attempts = Attempt.objects.filter(problem=problem, done=True) \
- .exclude(user__username='admin') \
- .exclude(user__username='test')
+ .exclude(user__groups=None)
traces = [a.trace for a in attempts]
edits[pid], submissions[pid], queries[pid] = get_edits_from_traces(traces)
diff --git a/monkey/test.py b/monkey/test.py
index ce7df93..1909f8d 100755
--- a/monkey/test.py
+++ b/monkey/test.py
@@ -31,8 +31,7 @@ problem = Problem.objects.get(pk=pid)
aux_code = get_aux_code(user=User.objects.get(pk=1), problem=problem)
attempts = Attempt.objects.filter(problem=problem) \
- .exclude(user__username='admin') \
- .exclude(user__username='test')
+ .exclude(user__groups=None)
# Load hint database stored in edits.pickle.
edits = tutor_apps.get_app_config('tutor').edits[problem.pk]