Skip to content

Commit 5e72dae

Browse files
committed
chore: ignore automated comments from tutor showing up in moderation
1 parent 8fe360a commit 5e72dae

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/models/unit.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,14 @@ def tasks_for_moderation(user)
22452245
if mt.escalation?
22462246
[task, Time.zone.at(0)]
22472247
else
2248-
tutor_comments = task.comments.select { |c| c.user == task.tutor }
2248+
# Ignore automated comments sent from the tutor
2249+
tutor_comments = task.comments.select do |c|
2250+
c.user == task.tutor &&
2251+
c.content_type != "assessment" &&
2252+
!c.comment&.include?("**Automated comment**: Some tests did not pass for this submission.") &&
2253+
!c.comment&.include?("**Automated Comment**: Something went wrong with your submission")
2254+
end
2255+
22492256
next nil if tutor_comments.empty?
22502257

22512258
most_recent = tutor_comments.max_by(&:created_at)

0 commit comments

Comments
 (0)