handle assignments where user applied due_at is nil

Fixes an issue where if an assignment had an applied due date of `nil`,
User#upcoming_events would throw an exception when trying to sort a list
of events/assignments, because comparing nil against Time/TimeWithZone
objects made the sorting invalid ("Comparison of Array with Array
failed").

test plan:
  - Make a course with a student. the student shouldn't be in the
    default section for the course.
  - As a teacher, create two assignments.
  - For the first assignment, have a a section that does not have a due date
    (blank due date when editing the assignment form). Make sure the
    student is in this section that has no due date.
  - For the second assignment, create as many overrides as you like,
    ensuring that each override has a real due date.
  - View the dashboard. The right side bar should load without you
    getting any errors.
  - View the course home page (/courses/:course_id). It should load
    without any errors as well.

Change-Id: I0547ce16354ec1f735b5b16c1937853e245f790b
Reviewed-on: https://gerrit.instructure.com/18482
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
strip bad UTF8 byte seqs from versioned quiz submissions

Test Plan:
  - with an existing quiz submission with bad UTF8 byte sequences,
    update the quiz submission
  - no errors should be raised and the version of the quiz submission
    should be updated

fixes CNVS-4421

Change-Id: I5288021a3b400a0bd59c4d70437ef737058bec18
Reviewed-on: https://gerrit.instructure.com/18346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
preserve html line breaks in discussion entry emails.

fixes CNVS-4514

test plan:
  * set up a student or teacher with asap notifications
    on discussion entries;
  * as a student or teacher that shares a class with the
    first user, reply to an existing discussion topic and
    include some line breaks in your response;
  * verify that the first user's discussion entry
    notification and verify that line breaks are preserved.

Change-Id: Iabfbc8db55e883d01621434400ce234a9b3a0e33
Reviewed-on: https://gerrit.instructure.com/18467
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fix incorrect media_recording submission types

fixes CNVS-4588

test plan:
- enable the kaltura plugin
- find an old assignment that is set up to accept media recordings
- make sure that 'online media recording' is checked in the assignment view
- create a new assignment that accepts media recordings
- make sure the show page says "a media recording" under 'submitting'

Change-Id: Ia166c532f5ede0390afb2226d3cf4fb335814cf2
Reviewed-on: https://gerrit.instructure.com/18525
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
kill gradebook rss feed

closes CNVS-4565

test plan:
- before checking out this ps, find a gradebook rss feed url
  (it'll look like /feeds/gradebooks/<enrollment_uuid>) and you
  can probably find it on the gradebook1 page (or gradebook history)
- now check out the patch set
- that feed show no longer work, and the pages shouldn't advertise
  them anymore

Change-Id: I0c7cc4183da64ec51c62d5e850384ff05ce91db2
Reviewed-on: https://gerrit.instructure.com/18503
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
fix graded discussion form validation

fixes CNVS-4530

test plan:
- on both an assignment and a graded discussion
- select group category, and close the dialog without creating one so that the
  form element says [New Category]
- submit the form
- you should get an error box saying you need a group
- do the same with assignment groups

Change-Id: I7c72fe4d1a973dff5e30a6d1ac9f6581fbc36356
Reviewed-on: https://gerrit.instructure.com/18491
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>

Conflicts:

	app/coffeescripts/views/ValidatedFormView.coffee
	spec/selenium/assignments_spec.rb
show a warning to unsupported browsers, fixes CNVS-4579

test plan:
1. use canvas in any supported browser (including mobile)
2. you should not see a warning
3. use canvas in an unsupported browser (e.g. ie8, old firefox)
4. you should see an orangish warning at the top of every page
5. it should not be dismissable

Change-Id: I092455c416a754d102ddadbda99280856b4082de
Reviewed-on: https://gerrit.instructure.com/18524
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>

Conflicts:

	spec/selenium/users_spec.rb
fix problem with unicode characters in wiki page titles

test plan:
* make a wiki page with a title that includes a unicode
  character, such as an accented "a" or "e"
* save the page
* accented characters should be replaced by plain-ascii
  equivalents in the url (e.g., "é" -> "e")
  * but not in the title, of course!
* also test weird stuff like fraction characters ('¼')
  and interrobangs ('‽') to make sure question marks
  and slashes don't end up in the url
* it can also transliterate katakana and stuff, but I
  don't know how smart the rules are for that

fixes #CNVS-4540

Change-Id: I6a6076af1bed138599592430adc69c3b92d65d89
Reviewed-on: https://gerrit.instructure.com/18507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
add undelete option to course batch update api

fixes CNVS-4056

test plan:
 - delete some courses via the UI or API
 - use the course batch update API with event=undelete to bring
   them back

note: while you can undelete a course via its sis id, this only
works if the course was _deleted_ via sis.  if you delete a course
via the UI or API, its sis ID is cleared.  this is by design:
https://gerrit.instructure.com/#/c/3520/

Change-Id: I402dd1e0bdfc6ae639e1781f16ae5e629ca9f87a
Reviewed-on: https://gerrit.instructure.com/18062
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Revert "show a warning to unsupported browsers, fixes CNVS-4579"

This reverts commit 61c394ff0387bf96c149e77a8721c9b684247243.
show re-publish button when editing a quiz question group

Notes:
* Editing a question group now marks a quiz as having unpublished
  changes
* Reordering questions or moving questions in/out of a group also
  marks the quiz as changed

Test Plan:
* Create a quiz with question groups
* Publish the quiz
* Add, edit, or delete a question group
* Save quiz
* Re-publish button should be present

fixes CNVS-4567

Change-Id: I1a2990df869809f0e7139eaea20b5e6fae0063e1
Reviewed-on: https://gerrit.instructure.com/18593
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
fixed issue where google doc collaboration links are broken

i was unable to re-create this bug, however on the live server i
was able to step through the code and determine the failure point.

fixes CNVS-4404

Change-Id: Ied185dc829ec1e2b972a102da9426ffab6541895
Reviewed-on: https://gerrit.instructure.com/18423
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
update Japanese translation to prevent error pages

Some of the countable translation keys were not (and still are not)
correct in the translation file. This update will prevent Canvas
from giving page errors when the translation keys are missing.
(meanwhile, looking in to the incorrect countables in translation)

Test Plan:
  - Canvas pages with countable translations (e.g. "1 student" vs
    "3 students") should not be a page error.

fixes CNVS-4533

Change-Id: I6c076805c590f13b1381b8d870a943f80077e835
Reviewed-on: https://gerrit.instructure.com/18563
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
treesame commit of origin/stable/2013-03-09

Treesame-Commit-Id: 006ff3cdc34b062786a90b936caabb790bc16563