multiple contexts per appointment group

closes #7561

Test plan:
  - create some appointment groups:
    - make one with multiple courses
    - make one with a course, and then add more courses after saving
    - make one restricted to some (not all) sections in a course [1]
    - make one that has students sign up in groups [1]
  - make sure that only students that match the above criteria are able
    to see/reserve those appointment groups

  [1] you can only choose the group-signup option or restrict
      appointment groups to certain sections on creation (these options
      won't be availabe when editing later)

Change-Id: I1cff5fb4ed233882c2061f8fd8a7ba6f2d4959b0
Reviewed-on: https://gerrit.instructure.com/9407
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
don't display un-dated assignments first fixes #7859

also added sorting by assignment title after sorting
by due_at

test plan:

  1. create an assignment with a due date
  2. create an assignment don't give it a due date
  3. as a student go to /courses/[course.id]/assignments
  4. notice the undated assignments don't sort first
  5. notice assignments sort by first due

Change-Id: I57401c0a4c6c3faf60460ce6fd079c192da2e49b
Reviewed-on: https://gerrit.instructure.com/10387
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
improve quiz grading while new version in progress

fixes #8314
fixes #8315

fix the interplay between submission and quiz_submission when manually grading
a quiz_submission's questions or fudge points while another version of the
quiz_submission is currently in progress. we overcorrected slightly in the last
fix.

test plan:
- on a quiz that allows multiple submissions (try with both keep-highest and
  keep-latest settings)
- as a student, complete this quiz, then start taking it again and leave the
  page
- as a teacher, try grading it from the quiz history page or the speedgrader.
  change question points and fudge points. changes should save across reload
  and the score should be in the gradebook.
- also try changing the grade directly in gradebook. and check that the change
  is mirrored in the quiz history page
- as the student, finish the second attempt and start a third.
- repeat the above checks as the teacher, ensuring that the appropriate score
  (highest or latest) comes through in the gradebook.

Change-Id: Id5c0b60c9d0c5f56aae625c3192bd50f93d671b8
Reviewed-on: https://gerrit.instructure.com/10373
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
allow saml configurations to use the eppn

Schools want to be able to specify a saml attribute used for the user's login
instead of NameId. Usually that will be the EPPN (or the portion before the
@). This adds a Login Attribute settings to the SAML settings page, with
options for NameID (the default and historic behavior), the
eduPersonPrincipalName, and the eduPersonPrincipalName with the domain part
stripped.

test plan:
 * Set up Shibboleth... just kidding. Better to just look at the spec.
   Standing up your own shib instance is a ton of work.

Change-Id: I04e32022b940da4cb82ea5f9a59012eb48de2ab6
Reviewed-on: https://gerrit.instructure.com/10120
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
use display name for files in downloaded zips fixes #6731

test plan:
 * upload a file
 * rename it via the ui
 * download the folder as a zip
 * the file should be named what it is in the UI

Change-Id: I61c29d18d5384d24303e6ce57423fb055884e5ec
Reviewed-on: https://gerrit.instructure.com/10418
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
update ruby-saml-mod and libxml gems

Change-Id: I2d0e4f457c684641edeb8beba945b1a67ca91b38
Reviewed-on: https://gerrit.instructure.com/10438
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
pull submit_homework javascript out of view; refs #8145

test-plan:
- make sure assignment submissions still work

Change-Id: I13789f059ce2aae36d1b7f2b0ad81e290c707e95
Reviewed-on: https://gerrit.instructure.com/10035
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
spec: add qUnit spec for fixDialogButtons

Change-Id: I48c22080ec8148dac1e706367244b5ba26647208
Reviewed-on: https://gerrit.instructure.com/10346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
markup only hide/show toggling of element/dialog

Change-Id: I5434111e98c0186971fb38089db0fa232c9557b6
Reviewed-on: https://gerrit.instructure.com/9499
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
add all of twitter bootstrap

Change-Id: I5123b29e8509c39d3bf2cacdca9d5860f0d9e20e
Reviewed-on: https://gerrit.instructure.com/10293
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
use bootstrap for 'alert' style blocks

in places where we were trying to do a 'alert' style
box (like the "you've been invited to a course",
account notifications, "you can sign up for this" in
scheduler) we were doing things that were sometimes
ugly and always inconsistent. this change moves
them all to twitter bootstrap '.alert's

test plan:
* go to: /accounts/x/settings#tab-announcements and
  create a new global announcement. make sure that
  page looks good (like this: http://cl.ly/2p05312y0N1N2W261s1N ).
  then go to your dashboard and make sure it looks
  good there like this: http://cl.ly/0P1X3y2c2422082v222c

* as a student go to scheduler and make sure it looks
  like http://cl.ly/311h1b1V0H321k0C0t3p

Change-Id: If077402a0ee9fd43976ce86918848ca5b21b41b8
Reviewed-on: https://gerrit.instructure.com/10294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
prettier notifications in discussions replies

test plan:
* on discussion page add a reply
* look at the "saving reply", "an error while saving"
  and "reply saved, go to it" make sure they look good
* hit 'x' in "reply saved, go to it", it should close

Change-Id: Icfbd68a2b790bdf7947157c5e79d34ef2865110c
Reviewed-on: https://gerrit.instructure.com/10295
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
spec: add coverage for admin merge feature

Change-Id: I4d154a18fbefc63ac12ebea1ce19c5c8af5aa6ff
Reviewed-on: https://gerrit.instructure.com/10442
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
infer attachment namespace on-demand

Change-Id: I7e3ca3ad6c05894a9489e96be33dadf8fa628c46
Reviewed-on: https://gerrit.instructure.com/10445
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
don't allow date-inactive teachers to get read-only access to courses

fixes #8389

test plan:
 * create a course
 * invite and accept a teacher (or create and add a teacher via SIS)
 * change the dates for the term the course is in to the future
 * the teacher should not be able to get read-only access to the course

Change-Id: I0474e6d5a46fd3b95a319281d18f9115371c8d75
Reviewed-on: https://gerrit.instructure.com/10425
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Show term info when you show course name, fixes #6837

affected pages:
- courses in this account /accounts/:id
- account users /accounts/:id/users/:id
- course home page /courses/:id

test plan:
- ensure there is a course with a term other than the default term
- look at the affected pages to verify that the term name is visible

Change-Id: I681bd20545a462643564899511adab0b8b71d3db
Reviewed-on: https://gerrit.instructure.com/9852
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
show peer reviewers their previous rubric comments fixes #7841

test plan:
 * add two students to a course
 * create an online upload assignment with manual peer reviews
   and a rubric
 * submit the assignment for both students
 * as teacher/admin, assign one student to peer review the other
 * as that student, do the peer review, including rubric comments
 * reload the page; the student should still be able to see their
   previous rubric comments

Change-Id: I605945023d8ce61f7faf6552e1606c1b3410d465
Reviewed-on: https://gerrit.instructure.com/10449
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
don't rename assignment to match subtopic; fixes #7357

test plan:
 * create a discussion assignment
 * edit the assignment, changing its name and making it
   a group assignment
 * ensure, after saving the assignment, that its name is not
   appended with a group name

Change-Id: I87806eba91888680c153c551a21d3829b3fe26e8
Reviewed-on: https://gerrit.instructure.com/10388
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
allow setting date overrides for designers fixes #8289

test plan:
 * create a term that starts in the future, but has an override
   for designers to access now
 * create and invite designer to a course in that term
 * the designer should be able to create content in that course

Change-Id: If1a55d5d7ed8693c4fb792baffbf3dfb6d92772c
Reviewed-on: https://gerrit.instructure.com/10426
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
fix horizontal scrollbar in firefox 12, fixes #8352

the latest version of firefox has a problem with large positioning
offsets. removing a digit brings back the horizontal scrollbar in the old
gradebook.

see https://bugzilla.mozilla.org/show_bug.cgi?id=749699

test plan:
1. go to the gradebook in a course with a lot of assignments
2. confirm that the scrollbars work

Change-Id: Ic4975336aa6d30fd65e92d7b869dc802b7d4603c
Reviewed-on: https://gerrit.instructure.com/10463
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>