closes TALLY-653
flag = none
With Post Policies, this notification is no longer sent.
If the build passes with this commit, it is likely safe
to merge. But a sanity check would be below.
test plan:
1. Have a student with notifications enabled
2. Mute an assignment in SRGB
3. Assign the student to the muted assignment
4. Unmute the assignment in SRGB
5. Verify the world is not on fire
Change-Id: Ie1bc03b0ac8f0279f2b6ea91a6ce1a65963fc43c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/228993
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Nick Pitrak <npitrak@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
With post policies active, we update an assignment's muted status
dynamically based on whether it has any remaining unposted submissions.
When the last student in a course took a quiz, we were attempting to set
the assignment's muted status to false, but another piece of code
attempted to save changes to the associated quiz, resulting in an error
to the effect that the quiz was marked as read-only. When we're only
muting/unmuting by way of posting/hiding submissions, don't attempt to
save changes to the quiz.
fixes GRADE-2306
Test plan:
- Have new gradebook/post policies enabled
- Have a course with a small number of students
- Create a quiz
- Take the quiz with all but one student
- As the last student, take the quiz (to switch the assignment's muted
from true to false)
- It should complete successfully and not cause an error
Change-Id: I8c97d02033f86158d66ce98b7ad9b32ce8edb43c
Reviewed-on: https://gerrit.instructure.com/201553
Reviewed-by: Derek Bender <djbender@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
Product-Review: Keith Garner <kgarner@instructure.com>
QA-Review: James Butters <jbutters@instructure.com>
For any assignment that is not manually posted (or muted, pre-post
policies), update a submission's posted_at date when an instructor
leaves a grade or (student-visible) comment, and subject the submission
to the standard posted/unposted workflow.
closes GRADE-1954
Test plan:
- Have a course with some assignments, including a manually-posted
assignment (e.g., an anonymously-graded assignment)
- With the Post Policies feature flag ENABLED:
- For an assignment with an associated manual post policy:
- Issuing a grade or leaving a comment on a submission should not
set the submission's posted_at date
- For an auto-posting assignment (i.e., post_manually = false):
- For an unposted submission (i.e., posted_at = nil):
- Issuing a grade should set the posted_at date to now
- Same with an instructor leaving a (non-draft/non-hidden) comment
- A draft or non-instructor comment should not set posted_at
- For an already-posted submission (posted_at != nil):
- The above actions should leave the posted_at date as is
- With the Post Policies feature flag DISABLED:
- Muted assignments should behave like manually posted assignments
- (grading/commenting should *not* set posted_at)
- Unmuted assignments should behave like auto-posted assignments
- (grading/commenting *should* set posted_at)
Change-Id: I66bbd845d9fdca0c979a8a365b153377ee72fce9
Reviewed-on: https://gerrit.instructure.com/180613
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
Allow an assignment to post/unpost an arbitrary set of submissions, and
use this workflow for muting/unmuting. When post policies are enabled,
determine an assignment's muted? status based on whether it has any
unposted submissions (and update it as submissions are posted/unposted).
When the user manually mutes/unmutes an assignment, adjust its post
policy accordingly.
closes GRADE-1875
Test plan:
- For a course with the the Post Policies feature flag enabled:
- Create some assignments to play around with
- Creating an anonymous or moderated assignment (or changing an
existing one) should automatically create an associated
PostPolicy object with post_manually set to true
- Otherwise, a PostPolicy should not automatically be created
- (To check this, you'll need to look at assignment.post_policy
in a console; it's not visible in the UI yet)
- Muting an assignment (from the UI or using mute!) should:
- Save a post_policy for the assignment with post_manually set to
true (if not already set)
- Set posted_at for all active submissions to nil
- Do the usual other stuff like hiding submission comments
- Have no effect if all submissions are already unposted
- Unmuting an assignment (from the UI or using unmute!) should:
- Save a post_policy for the assignment with post_manually set to
false (if not already set)
- Set posted_at for all active submissions to the current date
- Do the usual other stuff like showing submission comments
- Have no effect if all submissions are already posted
- In a Rails console, find an assignment/some submissions to test with
> assignment.post_submissions(submissions: submissions)
- This should post the given submissions (i.e., set posted_at,
show comments, etc.) but no others
> assignment.unpost_submissions(submissions: submissions)
- This should unpost only the given submissions
- Both methods should update the assignment's muted attribute
automatically:
- Muted should be set to true if any active submissions on the
assignment remain unposted, and false if all are posted
- Note: setting the posted_at time on an individual submission
will NOT auto-update the assignment's muted status (as of this
patchset)
- For a course with the the Post Policies feature flag *disabled*:
- Muting/unmuting an assignment should work as usual, and should
*not* attempt to create a post policy on the assignment
- It should, however, still set or unset the posted_at date on
all the assignment's submissions
- In a Rails console:
- The muted? attribute should behave like before (i.e., it should
not be dynamically updated if a subset of submissions is posted
or unposted)
Change-Id: I317dee609fe92cf2832d36bff54511abeb72137c
Reviewed-on: https://gerrit.instructure.com/179361
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Jenkins
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
When an peer review-based assignment is muted, show peer reviewers'
comments to the student.
fixes GRADE-1678
Test plan:
- Have a course with some students
- Create an assignment with online submissions and enable peer review
- Assign some peer reviews
- At least one student (S1) should be reviewed by multiple peers
- Mute the assignment
- Logged in as S1:
- Submit something
- Leave a comment
- As a teacher, comment on S1's submission without unmuting
- As the peer-reviewing students, comment on S1's submission
- The following should hold:
- Peer reviewers should see their own comments and no one else's
- The student being reviewed should see their own comments and all
peer reviewers' comments
- Teachers should see all comments
- Unmute the assignment
- The student should now additionally see comments from the teacher
- Peer reviewers should still only see their own comments
- Smoke test comment visibility with some other assignment types to
make sure nothing has broken:
- Moderated (with some comments by provisional graders)
- Anonymous (muted and unmuted)
- Non-anonymous (muted and unmuted)
Change-Id: I121bce0aef199729215704016edff44f162bf919
Reviewed-on: https://gerrit.instructure.com/175078
Tested-by: Jenkins
Reviewed-by: Keith Garner <kgarner@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Jonathan Fenton <jfenton@instructure.com>
If an assignment is muted after comments are already left, this
patchset make canvas hide the teacher comments during muting.
fixes GRADE-1084
test plan:
- Have a course with a teacher, two students, and 2 assignments. Make
one of the assignments a group assignment.
- For the non-group assignment:
- As a teacher, leave a comment on the submission for one student
via the student submission page or speedgrader
- As the student, visit the student submission page and note the
teachers comment is present
- Mute the assignment
- As the student, visit the student submission page and note the
teachers comment isn't present
- Repeat the steps above for the group assignment checking both students
Change-Id: Ib51d92173cdf4cee467362636c7dd6db9f665563
Reviewed-on: https://gerrit.instructure.com/149999
Tested-by: Jenkins
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
test plan:
* have a muted assignment with a submission
* as a teacher, make a submission comment
* unmute the assignment
* the submission comments should show on the
student's conversations inbox page
closes #CNVS-18916
Change-Id: I05fcfdfb6c06ea71f4626d22e32bed32ee966dfa
Reviewed-on: https://gerrit.instructure.com/108166
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
test plan:
* create an assignment
* as a student,
submit to the assignment and add a submission comment
* mute the assignment
* dashboard notifications for instructors should still be shown
* adding another submission comment while still muted should also
show another dashboard notification
closes #CNVS-30670
Change-Id: I734ca0a53699bb6b0ba7bd6a76dc919b9ccf56d9
Reviewed-on: https://gerrit.instructure.com/86724
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
refs #CNVS-21596
Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes CNVS-21979
particularly, if an assignment is already unmuted, don't trigger "just
unmuted" broadcast events when "unmute!" is called
test-plan:
- have your account configured to receive unmute notification
- edit an unmuted assignment in a published course you're enrolled in
- save it with the "Mute" checkbox still off
- don't receive an unmute notification
Change-Id: I948b5f1b2176e574ecf43fcde187019d7eadb50d
Reviewed-on: https://gerrit.instructure.com/58788
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Ben Bolton <bbolton@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
also random spec file tweak
refs #CNVS-21596
Change-Id: Ia009265af517e7902cd915b48eb8d08d75ee1d74
Reviewed-on: https://gerrit.instructure.com/57828
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes CNVS-12330, CNVS-9234, CNVS-8099
before you check out
- configure a user to use old conversations
test plan
- ensure that everyone get new conversations, always, even if
they explicitly told us that they really like old conversations
better
- as a student with an existing conversation with a teacher,
make an assignment submission and a submission comment
- as the teacher, ensure that your unread message count did not
increase because of the submission comment
Change-Id: If5ae7143abbc5cf5e035f5ed9ea2e5728f70cd45
Reviewed-on: https://gerrit.instructure.com/34343
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
this was removed from the UI in Mar 2011 but was never completely ripped out.
we'd like to remove it now since it was adding extra complexity for no benefit.
closes CNVS-5929
refs #3974
test plan:
- create/update/delete an assignment from the index page, and the show page
- grade an assignment (with and without muting)
- test assignment notifications (with and without muting)
- creating an assignment
- editing an assignment
- changing a due date (after 3 hours of being edited)
- grading an assignment
Change-Id: Ie455bed41154018b5bd2c9c0e69e1e3285a0ac09
Reviewed-on: https://gerrit.instructure.com/20778
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
fixes CNVS-1171
test plan:
* full conversations regression test
* initiate a conversation with a user from another shard
* reply to that conversation from both the sender and the
receiver
* repeat for a group conversation involving two or more
shards
* repeat for huge batch conversations with hundreds of
users and two or more shards
* known NOT working yet:
* re-using the correct cross-shard private conversation
* probably the tagging of messages with Course x,
Group y, etc.
Change-Id: I52549039875941cd518077cea4e28bfd2bc10dbf
Reviewed-on: https://gerrit.instructure.com/16523
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
two major pieces:
* use context_type/context_id instead of context_code for
three relations so that sharding extensions will
automatically work
* deserialize stream item data as actual AR objects instead
of OpenObject (for similar reasons)
test plan:
* run the predeploy migration, but not the postdeploy one
* view your dashboard on a shard other than your home shard;
it should be identical to your home shard
* view courses that you are enrolled in with the same id but on
different shards. the activity stream should have the correct
data for the course in that shard, for both courses (i.e.
no mixing of data from the two shards)
* do actions that generate new stream items, and verify the new
items appear correctly for the above two steps
* run the postdeploy migration, wait for the job to finish, then
repeat the test plan
Change-Id: I8d5fcadb8d971acf7388a12e9151a3e927751f44
Reviewed-on: https://gerrit.instructure.com/15462
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
this commit makes submission first-class citizens in conversations. this
means that when submission comments are added/deleted, or assignments are
unmuted, conversations and messages will be updated accordingly
the main impacts in the ui are:
1. submissions can be deleted from conversations. if a new comment is
added, they will reappear
2. submissions factor into the message total for the conversation. each
submission counts as a single message, even if there are multiple
comments
3. submission messages affect unread-ness, and are reflected in the
timestamp and text in the conversation preview
test plan:
1. confirm submissions appear in the appropriate conversations, i.e.
* submissions with no comments should not appear in any conversations
* submissions where there are comments but not by instructors:
* should appear in each instructor's private conversation with the
submitter
* should not appear in the submitter's private conversations with
anyone
* submissions where there are comments by instructors:
* should appear in each commenting instructor's private conversation
with the submitter
* should appear in submitter's private conversations with each
commenting instructor
adding or removing submission comments should update private
conversations accordingly (e.g. when one teacher comments on a
submission, it should be removed from the other teachers' private
conversations with the submitter).
2. for each scenario above where the submission comments are added and
appear in conversations, ensure that the submission as a whole behaves
like a single conversation message, i.e.
* the unread conversations count is incremented and the private
conversation is marked as unread (if it didn't exist or was already
read)
* the latest submission comment and timestamp should be reflected in
the conversation pane on the left side
* you can delete the submission from the conversation. if new comments
are posted on the submission, the submission should reappear in the
conversation (provided it still matches the criteria in 1.). note
that submission can not be forwarded to other conversations.
3. submissions should differ from traditional conversation messages in
that:
* they should not trigger conversation notifications
* they should not create/bump conversation stream items. if a
conversation has non-submission messages, the submission and its
comments should appear in the stream item, but they should not
cause it to jump to the top
migration:
existing submissions/comments will be migrated in, but not necessarily
through a traditional rails migration. to bring in those messages, run
the following from the rails console:
Submission.find_each{ |s| s.create_or_update_conversations!(:migrate) }
Change-Id: I06dcb8728402a6c4c613d445b80432a1f2973b73
Reviewed-on: https://gerrit.instructure.com/8086
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
test plan:
* As a teacher, create a graded assignment. Grade a student.
* As the student, see that the notification is in your dashboard stream
* As the teacher, mute the assignment
* As the student, see that the notification is no longer in your stream
* As the teacher, unmute the assignment
* As the student, see tha the notification is back in your stream
Change-Id: I70484f0c7b7ffb6e2deb4014e3ecf4f2eec4f96c
Reviewed-on: https://gerrit.instructure.com/7424
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
"Mute Assignment" links in gradebook and speedgrader
stop all announcements, emails, and stream items for grades
and comments from appearing until the teacher unmutes the
assignment.
Change-Id: Id74b305b568ff86e2a0e6f9319cfa40bb98b1bcd
Reviewed-on: https://gerrit.instructure.com/5779
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Zach Pendleton <zachp@instructure.com>