diff --git a/app/messages/assignment_unmuted.email.erb b/app/messages/assignment_unmuted.email.erb deleted file mode 100644 index 5e9b98c3e46..00000000000 --- a/app/messages/assignment_unmuted.email.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% define_content :link do %> - <%= polymorphic_url([asset.context, asset]) %> -<% end %> - -<% define_content :subject do %> - <%= t :subject, "Assignment Unmuted: %{title}, %{course}", :title => asset.title, :course => asset.context.name %> -<% end %> - -<%= t :body, <<-BODY, :title => asset.title, :course => asset.context.name, :url => content(:link) -Your instructor has released grade changes and new comments for %{title}. These changes are now viewable. - -You can view it here: -%{url} -BODY -%> diff --git a/app/messages/assignment_unmuted.email.html.erb b/app/messages/assignment_unmuted.email.html.erb deleted file mode 100644 index eb00a1ad303..00000000000 --- a/app/messages/assignment_unmuted.email.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% define_content :link do %> - <%= polymorphic_url([asset.context, asset]) %> -<% end %> - -<% define_content :subject do %> - <%= t :subject, "Assignment Unmuted: %{title}, %{course}", :title => asset.title, :course => asset.context.name %> -<% end %> - -<% define_content :footer_link do %> - - <%= t :link, "You can view it here" %> - -<% end %> - -

<%= t :body, "Your instructor has released grade changes and new comments for %{title}. These changes are now viewable.", :title => asset.title %>

diff --git a/app/messages/assignment_unmuted.sms.erb b/app/messages/assignment_unmuted.sms.erb deleted file mode 100644 index b7e529fb5e7..00000000000 --- a/app/messages/assignment_unmuted.sms.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= t :body, <<-BODY, :title => asset.title, :course => asset.context.name, :website => HostUrl.context_host(asset.context) -Your instructor has released grades and comments for %{title}, %{course}. - -More info at %{website} -BODY -%> diff --git a/app/messages/assignment_unmuted.summary.erb b/app/messages/assignment_unmuted.summary.erb deleted file mode 100644 index 1c4c874fd84..00000000000 --- a/app/messages/assignment_unmuted.summary.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% define_content :link do %> - <%= polymorphic_url([asset.context, asset]) %> -<% end %> - -<% define_content :subject do %> - <%= t :subject, "Grades and comments released for: %{title}, %{course}", :title => asset.title, :course => asset.context.name %> -<% end %> diff --git a/app/messages/notification_types.yml b/app/messages/notification_types.yml index d815606e701..14d0c3580f8 100644 --- a/app/messages/notification_types.yml +++ b/app/messages/notification_types.yml @@ -126,8 +126,6 @@ notifications: - name: Assignment Graded delay_for: <%= 15*60 %> - - name: Assignment Unmuted - delay_for: 0 - name: Submission Graded delay_for: <%= 60*60 %> - name: Submission Grade Changed diff --git a/app/models/assignment.rb b/app/models/assignment.rb index 1bfc94b4c5b..da99859bc6e 100644 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -1123,16 +1123,6 @@ class Assignment < ActiveRecord::Base assignment.overridden_for(user, skip_clone: true) } - p.dispatch :assignment_unmuted - p.to { |assignment| - BroadcastPolicies::AssignmentParticipants.new(assignment).to - } - p.whenever { |assignment| - BroadcastPolicies::AssignmentPolicy.new(assignment). - should_dispatch_assignment_unmuted? - } - p.data { course_broadcast_data } - p.dispatch :submissions_posted p.to { |assignment| assignment.course.participating_instructors @@ -3391,7 +3381,6 @@ class Assignment < ActiveRecord::Base previously_unposted_submissions.each do |submission| submission.grade_posting_in_progress = true - # Need to broadcast assignment_unmuted here. submission.broadcast_notifications submission.grade_posting_in_progress = false end diff --git a/app/models/broadcast_policies/assignment_policy.rb b/app/models/broadcast_policies/assignment_policy.rb index 7f3ffa7b710..38f906d3e24 100644 --- a/app/models/broadcast_policies/assignment_policy.rb +++ b/app/models/broadcast_policies/assignment_policy.rb @@ -48,13 +48,6 @@ module BroadcastPolicies (assignment.saved_change_to_workflow_state? && assignment.published?) end - def should_dispatch_assignment_unmuted? - # This is handled by individual submissions in the Post Policies era. - return false if assignment.context.post_policies_enabled? - context_sendable? && - assignment.recently_unmuted - end - def should_dispatch_submissions_posted? return false unless assignment.context.post_policies_enabled? context_sendable? && assignment.posting_params_for_notifications.present? diff --git a/app/models/broadcast_policies/submission_policy.rb b/app/models/broadcast_policies/submission_policy.rb index a41d53d1a0a..c256192b6a3 100644 --- a/app/models/broadcast_policies/submission_policy.rb +++ b/app/models/broadcast_policies/submission_policy.rb @@ -73,8 +73,6 @@ module BroadcastPolicies end def should_dispatch_submission_posted? - # When Post Policies aren't enabled, the assignment handles notifications - # via the Assignment Unmuted notification. return false unless assignment.course.post_policies_enabled? && submission.grade_posting_in_progress && context_sendable? diff --git a/app/models/notification.rb b/app/models/notification.rb index 80bfd3ce6ae..55cd4d91fdb 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -487,7 +487,6 @@ EOS Includes: * Assignment/submission grade entered/changed -* Un-muted assignment grade * Grade weight changed EOS when 'Late Grading' diff --git a/lib/mutable.rb b/lib/mutable.rb index e2c0fcdb429..0f6efec89fd 100644 --- a/lib/mutable.rb +++ b/lib/mutable.rb @@ -16,26 +16,6 @@ # with this program. If not, see . module Mutable - - attr_accessor :recently_unmuted - - def self.included(base) - base.extend(ClassMethods) - end - - module ClassMethods - def declare_mutable_broadcast_policy(options) - policy = options[:policy] - participants = options[:participants] - - policy.dispatch :assignment_unmuted - policy.to { participants } - policy.whenever do |record| - @recently_unmuted - end - end - end - def mute! return if muted? self.update_attribute(:muted, true) @@ -48,18 +28,11 @@ module Mutable def unmute! return unless muted? self.update_attribute(:muted, false) - broadcast_unmute_event post_submissions if respond_to?(:post_submissions) ensure_post_policy(post_manually: false) if respond_to?(:ensure_post_policy) true end - def broadcast_unmute_event - @recently_unmuted = true - self.save! - @recently_unmuted = false - end - protected def clear_sent_messages self.clear_broadcast_messages if self.respond_to? :clear_broadcast_messages diff --git a/spec/lib/mutable_spec.rb b/spec/lib/mutable_spec.rb index f91d74b5848..33c33274aad 100644 --- a/spec/lib/mutable_spec.rb +++ b/spec/lib/mutable_spec.rb @@ -60,17 +60,5 @@ describe Mutable do expect(@mutable).to receive(:update_attribute).never @mutable.unmute! end - - it "broadcasts unmute event if currently muted" do - expect(@mutable).to receive(:muted?).and_return(true) - expect(@mutable).to receive(:broadcast_unmute_event).once - @mutable.unmute! - end - - it "skips unmute event if not muted" do - expect(@mutable).to receive(:muted?).and_return(false) - expect(@mutable).to receive(:broadcast_unmute_event).never - @mutable.unmute! - end end end diff --git a/spec/models/assignment_spec.rb b/spec/models/assignment_spec.rb index e4bfd7123ba..c16813cdd10 100644 --- a/spec/models/assignment_spec.rb +++ b/spec/models/assignment_spec.rb @@ -5107,43 +5107,6 @@ describe Assignment do end end - context "assignment unmuted" do - let(:assignment) { @course.assignments.create! } - - before :once do - @assignment_unmuted_notification = Notification.create(name: "Assignment Unmuted") - @student.update!(email: "fakeemail@example.com") - @student.email_channel.update!(workflow_state: :active) - end - - it "should create a message when an assignment is unmuted" do - assignment.mute! - - expect { - assignment.unmute! - }.to change { - DelayedMessage.where( - communication_channel: @student.email_channel, - notification: @assignment_unmuted_notification - ).count - }.by(1) - end - - it "should not create a message in an unpublished course" do - @course.update!(workflow_state: "created") - assignment.mute! - - expect { - assignment.unmute! - }.not_to change { - DelayedMessage.where( - communication_channel: @student.email_channel, - notification: @assignment_unmuted_notification - ).count - } - end - end - context "varied due date notifications" do before :once do @teacher.communication_channels.create(:path => "teacher@instructure.com").confirm! diff --git a/spec/models/broadcast_policies/assignment_policy_spec.rb b/spec/models/broadcast_policies/assignment_policy_spec.rb index 07683adde6c..789358b9f1b 100644 --- a/spec/models/broadcast_policies/assignment_policy_spec.rb +++ b/spec/models/broadcast_policies/assignment_policy_spec.rb @@ -117,30 +117,6 @@ module BroadcastPolicies specify { wont_send_when { allow(assignment).to receive(:saved_change_to_points_possible?).and_return false } } end - describe '#should_dispatch_assignment_unmuted?' do - before do - allow(assignment).to receive(:recently_unmuted).and_return true - end - - it 'is true when the dependent inputs are true' do - expect(policy.should_dispatch_assignment_unmuted?).to be_truthy - end - - it "returns false when post policies are enabled" do - allow(context).to receive(:post_policies_enabled?).and_return true - expect(policy.should_dispatch_assignment_unmuted?).to be false - end - - def wont_send_when - yield - expect(policy.should_dispatch_assignment_unmuted?).to be_falsey - end - - specify { wont_send_when { allow(context).to receive(:available?).and_return false } } - specify { wont_send_when { allow(assignment).to receive(:recently_unmuted).and_return false } } - - end - describe "#should_dispatch_submissions_posted" do let(:posting_params) { { graded_only: false } }