From 1671f306d06503ad0226bf73276548c2051f1262 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 28 Apr 2016 00:50:43 -0500 Subject: [PATCH] Make sure to set comments on fresh failing tests. --- lib/kgrader/submission.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/kgrader/submission.rb b/lib/kgrader/submission.rb index 1951151..c7042e5 100644 --- a/lib/kgrader/submission.rb +++ b/lib/kgrader/submission.rb @@ -120,7 +120,8 @@ module KGrader def grade_prep(superscore) @done = false @failed = false - @changed = !superscore || self.status == :ungraded + @fresh = self.status == :ungraded + @changed = !superscore || @fresh @summary = nil @tests = @assignment.tests.clone.each do |test| test[:score] = 0 @@ -205,7 +206,7 @@ module KGrader end score, comments = @fs.jail.run_test test[:script], testlog - if score > test[:score] + if score > test[:score] || (score == test[:score] && @fresh) test[:score] = score test[:comments] = comments @changed = true