make the slave read block on public_feed smaller

This avoids issues with get_all_pertinent_contexts, which may want to do
writes, for example in the case where a course has no assignment groups
yet.

refs #9647

test plan: with a slave configured for reading, enroll yourself in a
course that has no assignment groups (maybe created via SIS) and get
your user calendar .ics feed. you shouldn't get an error.

Change-Id: I05fb543d4d1b0e2a9018f72e347119c920f74a2b
Reviewed-on: https://gerrit.instructure.com/13741
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
modules api, closes #10404

also modifies the discussion topic and assignment API
controllers to make sure "must_view" requirements are
fulfilled

test plan:
 * check the API documentation; ensure it looks okay
 * create a course with module items of each supported type
 * set completion criteria of each supported type
 * create another module, so you can set prerequisites
 * use the list modules API and verify its output matches
   the course and the documentation
   * as a teacher, "state" should be missing
   * as a student, "state" should be "locked", "unlocked",
     "started", or "completed"
 * use the show module API and verify the correct information
   is returned for a single module
 * use the list module items API and verify the output
   * as a teacher, the "completion_requirement" omits the
     "completed" flag
   * as a student, "completed" should be true or false,
     depending on whether the requirement was met
 * use the show module API and verify the correct information
   is returned for a single module item
 * last but not least, verify "must view" requirements can
   be fulfilled through the api_data_endpoints supplied
   for files, pages, discussions, and assignments
   * files are viewed when downloading their content
   * pages are viewed by the show action (where content
     is returned)
   * discussions are viewed when marked read via the
     mark_topic_read or mark_all_read actions
   * assignments are viewed by the show action
     (where description is returned).  they are not viewed
     if the assignment is locked and the user does not
     have access to the content yet.

Change-Id: I0cbbbc542f69215e7b396a501d4d86ff2f76c149
Reviewed-on: https://gerrit.instructure.com/13626
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
api: maintain query parameters in pagination links

fixes #10491

test plan:
- make an api call to a paginated endpoint that has a query parameter as part
  of the call (courses/<id>/users with enrollment_type=student is a good one)
- the pagination link header links that come back should maintain the query
  parameter (in the example above, they would include enrollment_type=student)
- also try one that has an "include[]=" type parameter
- read the api pagination documentation (linked from the api sidebar) and make
  sure it makes sense.

Change-Id: I6c1649513553bb2ac9c1cfc137ff16c21e50a6a3
Reviewed-on: https://gerrit.instructure.com/13641
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Rails.cache.fetch takes :expires, not :expires_in

Change-Id: I9e6c215503b5b17a3cb9db694bcae64c912ed374
Reviewed-on: https://gerrit.instructure.com/13744
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
change module api field names to match convention

html_url for Canvas web links
url for API endpoints

test plan: field names should match the above convention
refs #10404

Change-Id: Idba0cd491d10cc67795a4ee7336ebe72d00f66a0
Reviewed-on: https://gerrit.instructure.com/13745
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
scope column headers in student grade table. fixes #9195

add scope="col" to the headers on the student grades table to
improve navigation for users with screen readers.

test plan:
  * as a student, navigate to the grades page of a course;
  * view source and verify that scope="col" is present on table
    headers.

Change-Id: I2c9e0d1a1036b1129211a1b4c4d0dd34a3fa82ec
Reviewed-on: https://gerrit.instructure.com/13465
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
focus course wizards when they first display. fixes #10381

when a link is clicked to display a course wizard, move focus
to the wizard to accommodate users using screen readers.

test plan:
  * using voiceover or another screen reader, navigate to the
    assignments page;
  * click the "How Do I...?" link in the right sidebar and verify
    that focus is assigned to the wizard popup box.
  * click the close link in the wizard and verify that focus is
    returned to the "How Do I...?" link.

Change-Id: Ie3b09e2fc43439f6c09c87694a6f6150a62f9982
Reviewed-on: https://gerrit.instructure.com/13474
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
log account with LDAP errors, and show it in error_reports

test plan:
 * set up an LDAP config with invalid filter syntax
 * try to log in with a user that exists
 * go to /error_reports; you should see the error, report, and it
   should have a link to the account

Change-Id: I2d89befbfeb4672fc6fdcb5653b16bd5f04fd795
Reviewed-on: https://gerrit.instructure.com/13761
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
renamed View::filter to View::afterRender

Change-Id: If7a19ad055966f2147c173b02ea9011fc4741ee9
Reviewed-on: https://gerrit.instructure.com/13730
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
revert several grade calculation changes

Revert "make grade_summary page use GradeCalculator"

This reverts commit 4776cb28806098895c74c12eca09b778956cfaaa.

Revert "fix gradebook bug in ie8"

This reverts commit c9272374581c4eb21676b7db1d3035868d45f7d0.

Revert "gb2: don't lie about which assignments are dropped"

This reverts commit da379330794322efd5e956c301e2dbbef7f0c656.

Revert "fix ruby calculation of grades (grade-dropping)"

This reverts commit 63f75597a2983379c5c36afe3efcf26f36cdef56.

Revert "fix grade-dropping in gradebooks"

This reverts commit 4a4a2f53c1d86fb87c9525204bab35127e2b1a03.

Conflicts:

	spec/selenium/grading_standards_spec.rb

Change-Id: I597d777fee23c4dc57bb915c6cbe5185dc18d0af
Reviewed-on: https://gerrit.instructure.com/13716
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
validate ldap filter in search test

test plan:
 * enter valid ldap settings, except for filter
 * test them, but don't put in a username and password
 * you should get an error about invalid filter syntax

Change-Id: I61339085cbd902ba6e1234a098181db32cd42385
Reviewed-on: https://gerrit.instructure.com/13754
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
eportfolio direct-to-s3 upload, fixes #10572

don't proxy uploads through canvas

also fix ui so that file picker goes away after saving

test plan:
1. w/ s3 file store, edit an eportfolio
2. add a file/image
3. it should work
4. repeat steps 1-3 for local file store
5. edit an eportfolio
6. add a file from your existing user files
7. it should work

Change-Id: I1518e06dec495180371eef75af2e6659d49d36b1
Reviewed-on: https://gerrit.instructure.com/13692
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
add account setting to only allow calendar2

closes #10292

Test plan:
  1) enable calendar2 on an account
  2) set up a user to prefer the old calendar
  3) set the 'calendar2_only' setting to true on the account
  4) go to the calendar as the user from step 2, you should be
     redirected to calendar2
     * there should be no way to get to the old calendar

Change-Id: I6280caf2878d04ef3f73efdbc61187906aeb5113
Reviewed-on: https://gerrit.instructure.com/13756
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
clear associated_enrollment between rows; fixes #10652

test plan:
 * create a SIS import that enrolls a student after an observer
 * the student's enrollment should not have an associated user ID

Change-Id: I6b05e1c7cc4a634a77795b5d8ddc7ba269810479
Reviewed-on: https://gerrit.instructure.com/13776
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
filter discussion search results after every key press in IE

fixes: #10342

also fixed css so it looks good in firefox and IE

the ticket also mentioned that "the x button to
clear search also does not display" but not going
to fix that, it is because IE does not have any native
special styling for input type=search.

test plan:
 * make sure that the box looks good in IE, firefox,
   and chrome.  (like this: http://cl.ly/image/1p2g0Q2L2a2w )
 * make sure results are filtered after you press a
   a key in in IE

Change-Id: I690fa5a06b1cbd0e7195070e7ef0109094742ac2
Reviewed-on: https://gerrit.instructure.com/13635
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
fix discussion reordering and allow dragging to top and bottom

fixes: #10327

test plan:
* Create at least 5 discussion topics in a course
* Go to the discussion topics page
* Drag an item in the middle of the list to the bottom
* make sure it stays where you put it
* reload page make sure the order stays
* repeat but put it on top of list
* repeat putting it in middle of list

Change-Id: Ib838a3fba7812d999c1bb8ac8f3f772933bdb92f
Reviewed-on: https://gerrit.instructure.com/13636
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
fix server error when non-enrolled admin comments on submission

refs #10595

test plan: try to comment on a submission to an assignment
as a site admin user who is not enrolled in the course

Change-Id: I60a5bdad6e0771fe19e74bf75cd42d86f3ffebe1
Reviewed-on: https://gerrit.instructure.com/13755
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
make it so if you hit enter in jqUI dialog it submits form

fixes: #10247

test plan:
hit Start A New Course on dashboard
Name the course and hit enter
should do the same as hitting the submit button

Change-Id: I76a45edb723ddc33d1bd0708551e35744b1db0b7
Reviewed-on: https://gerrit.instructure.com/13650
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
allow /grades page to link to gradebook2, fixes: #9387

test plan:
as a teacher, go to /grades
click on the link for one of the courses you teach,
it should go to the gradebook you have set as default.
(specifically to test this fix, have gb2 as the default
and click it, it should go to gb2)

Change-Id: I5ef7284ba4379acd6c40801aa8d57ca5139def7a
Reviewed-on: https://gerrit.instructure.com/13706
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
add GA tracking to help links

closes #10610

test plan: with google analytics enabled, click the help link and verify
the event is sent to GA. also try on an account that has a custom help
link configured.

Change-Id: I26ba5b2d01437f015f447b00325e1c0e8f9c607d
Reviewed-on: https://gerrit.instructure.com/13763
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>