move an outcome group to another group, fixes #11512, #11513, #11517

test plan:
- create multiple outcome groups, either nested or siblings, and
  either new or existing
- move some of the groups to siblings or up or down the hierarchy of
  groups

Change-Id: Ib2009ea1a3ebc292b6ca0d6504b147867c6f6eb4
Reviewed-on: https://gerrit.instructure.com/14844
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
auto scrolling in outcomes should not jump around.
fixes #11499, #11501, #11506

Change-Id: I6c04de369ff2e2af67ceea1b8f5753609c9b3f51
Reviewed-on: https://gerrit.instructure.com/14845
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
update the respondus_soap_endpoint plugin for ruby 1.9

A fix had to be made to soap4r-middleware, and it also now uses the
soap4r-ruby1.9 gem instead of the old soap4r gem. Despite the name, this
new gem also works in ruby 1.8.7.

test plan: the existing specs cover the api endpoint well. manual
testing will require installing the respondus 4.0 desktop client and
making calls to upload quizzes to your test canvas instance.

Change-Id: I14b3c61753f67a00da755cec9cb9603bc41922b3
Reviewed-on: https://gerrit.instructure.com/14876
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
VDD: use most lenient due_at/lock_at/unlock_at

instead of "most specific"

Change-Id: I0b585de78dfb8ed7597e326610856aec331ed9f6
test-plan:
 - create an assignment with a section override and an adhoc override,
   and a student to which both overrides apply
 - set the assignment's due_at and the section override's due_at, then
   set the adhoc override's due_at to be later than both the section
   override's and the assignment's; the value of
   assignment.overridden_for(student).due_at should be that of the adhoc
   override
 - set the section override's due_at later than the adhoc override's;
   the overridden due_at should be that of the section override
 - set the adhoc override's due_at to be nil (but still overridden); the
   overridden due_at should be nil
 - set the adhoc override's due_at back later than the section
   override's and set the assignment's due_at to nil; the overridden
   due_at should be the adhoc override's
 - overridden all_day and overridden all_day_date should track with the
   overridden due_at
 - repeat for unlock_at and lock_at, but expect the *earliest* date for
   unlock_at, rather than the latest
Reviewed-on: https://gerrit.instructure.com/14853
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
fix quiz form translation key error

fixes #11569

we changed a translation key in a quiz form from having two interpolated values
to having four, without changing the name of the key.  this caused the page to
break when a locale was used that hadn't updated their translations.

this fix changes the key, and uses a better style of html interpolation for the
strings.

test plan:
- set your course to russian
- create a new quiz
- it should work
- in any language numerical answer quiz questions should still function exactly
  the same as before (specifically providing answer possibilities either exact
  with error margin or in a range)

Change-Id: Ia9754c797a894569eae5bccc6e534b3459dce683
Reviewed-on: https://gerrit.instructure.com/14879
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
fix content_participation_counts cross-shard

Change-Id: I032b346077365f69de321223ae4e67b48e3f42b9
Reviewed-on: https://gerrit.instructure.com/14908
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
escape the entered email address for display

fixes #11478

test plan: on the login screen, put html tags in the forgot password box
and submit -- the flash notice that pops up should display the tags
escaped, rather than evaluating them.

Change-Id: If5681ef1ec8e110b9fbac3d9406fa7dd807eddc4
Reviewed-on: https://gerrit.instructure.com/14889
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
migrator for page views db -> cassandra

This is meant to be a one-time run, when setting up a new cassandra
cluster for page views and you want to migrate all your current page
views sitting in your db to that cluster.

test plan: generate some db page views, then switch configuration to
cassandra page views. run rake db:migrate_pageviews_to_cassandra and the
existing db page views should now be in cassandra, including showing up
in the user's page view history.

Change-Id: Ib1b1aa4277c306c1c651e9ca587d3654ab0d00d3
Reviewed-on: https://gerrit.instructure.com/14687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
fix shuffling of answers on fill in multiple blank questions

Fixes #10375

Test plan:
1. Create a quiz, add a 'fill in multiple blanks' question with a few blanks,
   and check 'shuffle answers.'
2. Save and preview the quiz, and fill in the right answers.
3. The answers in the input boxes should appear in the same order as you
   filled them in. Before this fix, they were appearing in random order
   and did not match up with the order in which you typed them.

Change-Id: I5668f3c32a5f6f0253457566a3b05ea073e00294
Reviewed-on: https://gerrit.instructure.com/14670
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Amber Taniuchi <amber@instructure.com>
show parent group on outcome delete. fixes #11508

after deleting an outcome or outcome group, the outcome
detail pane previously displayed the "Setting up outcomes"
view. now it displays the deleted item's parent group.

test plan:
  * create an outcome group that contains both an outcome
    and another outcome group;
  * delete both of the nested items and verify that their
    parent group is focused and displayed;
  * delete the parent group and verify that the "Setting
    up outcomes" info is displayed.

Change-Id: Ied88a5739e98b84c3ca8a4ffda193cd52284bbc5
Reviewed-on: https://gerrit.instructure.com/14874
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
fix preview icons not being available in submission previews

test plan:
  1. create an assignment that can accept file uploads/online entries
  2. as a student in that class, submit the assignment with a file
  3. as the student again, go to assignments, the assignment you
  created, and on the right hand side you should see a message saying
  you've already submitted the assignment. Click the "Submission
  Details" link.
  4. Play with the width of the window, ensuring that the preview icon
  is always visible and can be clicked. Be sure to test with Firefox.

fixes #10928

The preview icon should now always be visible. Right now, it always
floats underneath the file name. This will be fixed in a future release
that uses the new style guide.

Users can now access previews in scribd or crocodoc, assuming those
services are available for the submisison.

Change-Id: I0d0148a45b56e8d1ab90ff1a7bb575a33bbf26ea
Reviewed-on: https://gerrit.instructure.com/14837
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
refactor cassandra page view history helper into PaginatedCollection

This functionality can be useful other places where we want a
willpaginate-compatible collection as well.

test plan: cassandra page view history at /users/X should work same as
before.

Change-Id: I0f57ce57efa56d518195f2fce90074ab0b42c1e5
Reviewed-on: https://gerrit.instructure.com/14861
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
don't point directly to gradebook1 in speed grader

Fixes #10793

Test plan:
1. Go to the gradebook and verify the gradebook version you are on.
2. Go to an assignment and load up the speedgrader.
3. Click the 'Gradebook' link at the top of the page.
4. You should be on the same version of the gradebook as you were
   originally. Repeat steps 1-3 after switching to the other gradebook.
   Previously, you were always taken to gradebook 1.

Other notes:
* Adds a 'gradebook_url_for' helper that accepts a user, context, and
  assignment and constructs a URL based on the user's preference

Change-Id: I596202d448c61046efae1e13ab8c9e87c3f7768b
Reviewed-on: https://gerrit.instructure.com/14666
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Clear shared secret when in settings dialog

fixes #11321

The shared secret field was not behaving consistantly
so it will now always be cleared when saving, updating
or clicking cancel in the dialog box.

Test Plan:
  1. Create a course
  2. Go to the settings page
  3. Go to the external tools tab
  4. Click 'Add External Tool'
  5. Enter in bogus data it it's fields but be sure to
     add a shared secret.
  6. Click "Save tool settings" then edit the saved External Tool
     The Shared Secret should not appear in the input field.
  7. Repeat steps 1-5, it should remain clear.
  8. Try any other scenario you can think of and it should still
     be clear!

Change-Id: Ibd7b4353c2989d9ce07a14f7a162dd0ce55472a9
Reviewed-on: https://gerrit.instructure.com/14779
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
clarify/fix outcome API permissions

fixes #11504

Change-Id: If7c480bfac9b0339f9ce9f0ec6d5705dafbcb037
test-plan:
 - global outcomes should be visible to:
   - any logged in user
 - outcomes defined in an account should be visible to:
   - admins in subaccounts
   - enrollees in the account's courses
   - enrollees in the account's subaccounts' courses
 - outcomes defined in a course should be visible to:
   - any user that can view the course
 - global outcomes should not be visible without being logged in
 - managing outcomes should require the same permissions as before
Reviewed-on: https://gerrit.instructure.com/14910
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
include enrollments from all shards closes #6900

also change all_pseudonyms and accounts to use the new
HasManyAssociation#with_each_shard hawtness

test plan:
 * enroll the same user in courses in multiple shards
 * favorites don't work yet; be sure to reset them before
   continuing
 * courses from all shards should show up in your menu
 * courses from all shards should show up in your all courses
   page
 * when enrolled as a student in a course not on the user's shard,
   permissions should be correct (particularly, you should be able
   to participate as a student - turn in assignments)
 * enroll the user in groups from multiple shards
 * all groups should show up in home menu

Change-Id: I84fffa39ebf3dee093ecff145670a29296da29a1
Reviewed-on: https://gerrit.instructure.com/14722
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
spec: fix encoding spec in ruby 1.9

We explicitly want an invalid utf-8 string here, so we have to force 1.9
to do so.

Change-Id: Idf15a8ebcdb810197c06881ece56f63c6125b407
Reviewed-on: https://gerrit.instructure.com/14944
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
mark submission comments as unread for correct user

fixes #11539

- as a teacher, leave a comment on an already graded submission
- as a student you should get an indicator in the left nav and a blue dot
- after viewing the grades page, these should both clear
- repeat (should get another blue dot + indicator)

Change-Id: I6d980cae5246e58e225cb6ae531be6c2d7c78549
Reviewed-on: https://gerrit.instructure.com/14913
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
fix overflow on scheduler event details. fixes #11445

test plan:
  * create a scheduler event that allows for multiple
    participants and enroll users in it;
  * add a long description to the event;
  * in the calendar, view the event details and verify
    that the description is 30px tall and overflows
    properly w/o pushing content outside of the detail
    popup.

Change-Id: I97f5c6705a69b96f60e28f282d5e43ee755dfd88
Reviewed-on: https://gerrit.instructure.com/14696
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
add "ok" button to criterion edit form. fixes #11510.

when editing a criterion, include an "ok" button that
returns the criterion to its non-editable state.

test plan:
  * as a teacher or admin, edit a criterion and verify
    that an "ok" button now exists next to the "delete"
    button;
  * verify that clicking the "ok" button makes the criterion
    non-editable but does not save it to the server;
  * verify that any changes made to the criterion are reflected
    in the non-editable display of it;
  * verify that the delete button still works as expected;

Change-Id: I96bed59d3f15c2241151842d95a93d7126666e99
Reviewed-on: https://gerrit.instructure.com/14836
Reviewed-by: Mark Ericksen <marke@instructure.com>
Reviewed-by: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>