canvas-lms/db/migrate/20160504154220_populate_sub...

17 lines
453 B
Ruby
Raw Normal View History

class PopulateSubmissionCommentDraftField < ActiveRecord::Migration[4.2]
autosave comments on navigating to different user in speedgrader closes CNVS-28529 While in SpeedGrader, if you have something entered in the comments field and, without submitting those comments, you navigate to a different user or otherwise navigate away from SpeedGrader, your comments will now automatically be saved as "draft" comments for that user's submission. Draft comments * don't show up anywhere other than while grading * are invisible to users whether or not the assignment is muted * are only "submittable" by the author of the draft comment test plan: 1. Create a course, with at least two students 2. Add a quiz with at least one essay type question 3. As each student, take the quiz 4. As the teacher, grade the quiz and start up SpeedGrader 5. Enter comments for the first student's submission but do *not* submit them 6. Navigate to the next student 7. You should see a message telling you your comment was auto-saved 8. Go back to the previous student 9. You should see your comment styled differently with a red asterisk before it, indicating a draft comment (also using aria-label for a11y goodness) 10.Enter another comment and this time submit it 11.You should see your comment styled normally without a red asterisk before it, indicating a normal (non-draft) comment 12.Try steps 5 through 11 with different ways of leaving that student in step #6 e.g. using the drop down, or quitting SpeedGrader altogether and you should see the same results for draft comments 13.Go back to a submission with a draft comment. 14.Click on the button labelled "Publish" next to your draft comment. 15.Watch your comment change in appearance from a draft comment to a regular comment 16.Delete any comment and watch it disappear from the comment list. 17.Go to the next student 18.Go back to the previous student for whose submission you deleted the comment 19.Notice the deleted comment remains missing from the comment list. 20.Verify that, if logged in as a student, you never see draft comments Change-Id: If32294a7bed6f847709b54d4c8e4fc21fb2a6eca Reviewed-on: https://gerrit.instructure.com/77133 Reviewed-by: Spencer Olson <solson@instructure.com> Reviewed-by: Neil Gupta <ngupta@instructure.com> Tested-by: Jenkins QA-Review: Amber Taniuchi <amber@instructure.com> Product-Review: Christi Wruck
2016-04-14 05:02:28 +08:00
tag :postdeploy
def self.up
DataFixup::PopulateSubmissionCommentDraftField.send_later_if_production_enqueue_args(
:run,
priority: Delayed::LOW_PRIORITY,
strand: "populate_submission_comment_draft_field_fixup_#{Shard.current.database_server.id}",
max_attempts: 1
)
end
def self.down
raise ActiveRecord::IrreversibleMigration
end
end