From 3d6a57f17b5aa40e09874860cd7cc90bb83c9014 Mon Sep 17 00:00:00 2001 From: "Espen A. Kristiansen" Date: Sun, 24 Jul 2011 22:23:54 +0200 Subject: [PATCH] script.create_testgroups: Set correct deadline. This makes deadline profiles work again, which gives far more logical number of deliveries and feedbacks. --- devilry/scripts/create_testgroups.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/devilry/scripts/create_testgroups.py b/devilry/scripts/create_testgroups.py index cd1f9969d3..1e1c1a0912 100755 --- a/devilry/scripts/create_testgroups.py +++ b/devilry/scripts/create_testgroups.py @@ -204,6 +204,8 @@ def create_example_assignmentgroup(assignment, students, examiners, student=User.objects.get(username=student)) for examiner in examiners: group.examiners.add(User.objects.get(username=examiner)) + fakedeadline = group.deadlines.all()[0] + fakedeadline.deadline = datetime(1970, 1, 1) group.deadlines.create(deadline=deadline) logging.info("Created {0} (id:{1})".format(group, group.id)) return group @@ -256,14 +258,14 @@ def create_example_deliveries_and_feedback(group, quality_percents, # More than two weeks since deadline - should have feedback on about all if deadline < two_weeks_ago: - logging.debug("Very old deadline (14 days +)") + logging.info(" Very old deadline (14 days +)") if randint(0, 100) <= 3: # Always a 3% chance to forget giving feedback. return autocreate_feedbacks(delivery, group_quality_percent, max_percent) # Less than two weeks but more that 5 days since deadline elif deadline < five_days_ago: - logging.debug("Old deadline (5-14 days)") + logging.info(" Old deadline (5-14 days)") if randint(0, 100) <= 10: # 10% of them has no feedback yet return @@ -272,7 +274,7 @@ def create_example_deliveries_and_feedback(group, quality_percents, # Recent deadline (2-5 days since deadline) # in the middle of giving feedback elif deadline < two_days_ago: - logging.debug("Recent deadline (2-5 days)") + logging.info(" Recent deadline (2-5 days)") if randint(0, 100) <= 50: # Half of them has no feedback yet return @@ -280,7 +282,7 @@ def create_example_deliveries_and_feedback(group, quality_percents, # Very recent deadline (0-2 days since deadline) elif deadline < now: - logging.debug("Very recent deadline (0-3 days)") + logging.info(" Very recent deadline (0-3 days)") if randint(0, 100) <= 90: # 90% of them has no feedback yet return @@ -288,7 +290,7 @@ def create_example_deliveries_and_feedback(group, quality_percents, # Deadline is in the future else: - logging.debug("Deadline is in the future. Made deliveries, but "\ + logging.info(" Deadline is in the future. Made deliveries, but "\ "no feedback") pass # No feedback