always send quiz due date changed notifications.

fixes CNVS-5102, CNVS-5255

when a quiz due date has changed, always send notifications
to affected users; don't require the editor to check the
"notify users this quiz has changed" checkbox.

test plan:
  * as a teacher, change the due date of an existing quiz
    and save the change without checking the "notify users
    that this quiz has changed" checkbox;
  * verify that affected students with ASAP notifications
    receive a message.
  * verify that these notifications also work as expected
    for quizzes with multiple due dates.

Change-Id: Iba4bc32c2eb7629fd475201938ba7adb345c0e6a
Reviewed-on: https://gerrit.instructure.com/19609
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
This commit is contained in:
Zach Pendleton 2013-04-15 10:50:53 -06:00
parent 8dce27bda8
commit dddbe43ff7
2 changed files with 3 additions and 3 deletions

View File

@ -484,7 +484,7 @@ class QuizzesController < ApplicationController
# quiz.rb restricts all assignment broadcasts if notify_of_update is
# false, so we do the same here
if @quiz.assignment.present? && notify_of_update
if @quiz.assignment.present? && (notify_of_update || old_assignment.due_at != @quiz.assignment.due_at)
@quiz.assignment.do_notifications!(old_assignment, notify_of_update)
end
@quiz.reload

View File

@ -826,7 +826,7 @@ describe QuizzesController do
@student.messages.detect{|m| m.notification_id == @notification.id}.should_not be_nil
end
it "should not send due date changed if notify_of_update is not set" do
it "should send due date changed if notify_of_update is not set" do
course_due_date = 2.days.from_now
section_due_date = 3.days.from_now
post 'update', :course_id => @course.id,
@ -841,7 +841,7 @@ describe QuizzesController do
}]
}
@student.messages.detect{|m| m.notification_id == @notification.id}.should be_nil
@student.messages.detect{ |m| m.notification_id == @notification.id }.should_not be_nil
end
end
end