fix "add login" logout error in rails 3

test plan:
* logged in as an account admin, visit the user page for
 a given user other than yourself
* use the "Add Login" dialog to create a login and
password for the user
* should not log you out and login the edited user

fixes #CNVS-13883

Change-Id: I6104b64dfd9a9557b1f6943bad14e1dcba2168f3
Reviewed-on: https://gerrit.instructure.com/37290
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Workaround for a chrome bug where active pseudo class stays on inactive elements

Chrome has a nice bug where clicking on block element
inside an inline element will force the inline element
to keep the :active pseudo class.
this causes tooltips to stay open since our tooltips
show if the tooltip element has the :active pseudo class
a bug has been filed at https://code.google.com/p/chromium/issues/detail?id=391254

fixes CNVS-10808

test plan:
- using chrome
- Click the attach file icon
- Make sure the tooltip disappears

Change-Id: I86ff3bc9b2d309382c63b8fa4183bfc9b9162af6
Reviewed-on: https://gerrit.instructure.com/37255
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
get rid of count(*) overrides query

refs CNVS-6763

Test plan:
  basic overrides regression test

Change-Id: I0874db750299709345b241c197a0973e31569cc5
Reviewed-on: https://gerrit.instructure.com/28799
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
add helper method for incomplete registration

fixes CNVS-13526

test plan:
- test along with the demo site changes
- this is needed to verify the demo site tracking pixel changes

Change-Id: Ice12d7248e75e24c3694d3df5cccda7e8ba18881
Reviewed-on: https://gerrit.instructure.com/36972
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Drew Bowman <dbowman@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
add limiting period to grade export report

***test plan
  1. through the api pass parameters['include_deleted'] = true
    and parameters['limiting_period'] = some number of days
  2.  Make sure enrollments that have been deleted or concluded within
  specified # of days from above are returned in report
  3.  Make sure enrollments that are not concluded / deleted within
  specified number of days are not returned in the report

refs: PS-1698

Change-Id: Id24c58954dba2aed0a92cd5dea1946ef0764dc1a
Reviewed-on: https://gerrit.instructure.com/36612
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
fix date shifting for re-imported items

(also keep track of other imported items as well)

test plan:
* import a canvas export package (such as the one
referenced in the ticket) with assignments and graded
discussions
* import them into a course
* delete the assignments, etc. from the course
* re-import the package, while shifting the dates
* the re-imported (i.e. undeleted) assignments should
 have their dates shifted

fixes #CNVS-13252

Change-Id: I396059cdcf58fe3386f21cc7cffe62ac8951cd05
Reviewed-on: https://gerrit.instructure.com/36743
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
keep quiz stats in beta only for now

closes CNVS-14001

test plan:

  - quiz stats feature should be available in beta
  - quiz stats feature should not be available in prod

Change-Id: If094589558b44b11b989b0b0e38b36359a1edfb3
Reviewed-on: https://gerrit.instructure.com/37347
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
Revert "get rid of count(*) overrides query"

This reverts commit b5c63024e0790cb3e8ef793d342bfe0411b734dd.

fixes CNVS-14018

test plan:
- specs should pass

Change-Id: I021598d81fb9462d6470e3b3a038e96b3d8060b4
Reviewed-on: https://gerrit.instructure.com/37366
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
fix qti question bank selection

test plan:
* import a qti file into a course and select a question
 bank to import
* should import into the correct bank

closes #CNVS-1965

Change-Id: I4f4647cedf28b931225986b757688c8794dfa1d4
Reviewed-on: https://gerrit.instructure.com/37321
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
spec: bump rspec

closer to 3.0, which we probably don't want to go to until
we can drop rspec 1 (rails 2)

Change-Id: I8affc4882bfc927a6d3b9bcc9c43fe5ab92cd3b7
Reviewed-on: https://gerrit.instructure.com/37326
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Updated en-GB translation
toggleClass expects a boolean, not a truthy value for 2nd param

Previously we were passing in undefined, which was fine until you toggled
true, then wanted to go back.
see: http://api.jquery.com/toggleclass/#toggleClass-className-switch

fixes CNVS-5365

test plan:
- have a user with a submitted assignment that hasnt been graded
- in GradeBook, open the message students who...
- select "scored less than"
- select "Haven't submitted yet"
- select "Haven't been graded yet"
	- without fix, null will be displayed by the user
	- with the fix, everything will look normal

Change-Id: Ic05b8c2eec513ef26f8f3cdf26d8b328c7a850e1
Reviewed-on: https://gerrit.instructure.com/37206
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
insert CountsReport errors on the default shard

fixes CNVS-6375

Change-Id: I0771b55ead6fa04d8fa19cfd58addce36758863c
Reviewed-on: https://gerrit.instructure.com/37332
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
bump switchman

Change-Id: I95163638f9db1fc3ec9447d94f2f86c1ed24468d
Reviewed-on: https://gerrit.instructure.com/37319
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
get rid of weird before_quiz_submission_types attr

Test plan: specs pass

Change-Id: Ibfcaf313345277daa2a1f2f50741b7e3131fc9ec
Reviewed-on: https://gerrit.instructure.com/37365
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Quiz Submission Questions - fix serializer lookup

Closes CNVS-14021

TEST PLAN
---- ----

  - create a quiz with a question
  - try answering the quiz using the QSQ API (see docs)
  - verify that your answer is recorded

Change-Id: I667671f639ac0b5c6bc469477b638e70f90f37ff
Reviewed-on: https://gerrit.instructure.com/37372
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
run domain substitutions on module item and external tool urls

test plan:
* create a course with external link module items,
and external tools with links pointing to a given
domain (e.g. "http://www.example.com/somewhere")

* in the rails console, manually configure the account settings
as follows, (replacing COURSEID with the id of the course):
 a = Course.find(COURSEID).root_account
 h1 = {"http://www.example.com" => "https://www.not-example.com"}
 h2 = {:domain_substitution_map => h1}
 a.settings[:default_migration_settings] = h2
 a.save!

* copy the course
* the links should all be translated to the new domain
 (e.g. "https://www.not-example.com")

fixes #CNVS-13512

Change-Id: I4472fec4c2633827409967cc76652e7395fb8e0f
Reviewed-on: https://gerrit.instructure.com/37356
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
simplify can_do

adheres_to_policy has equivalent caching internally now, so no need
to bother with externally

also, OpenObjects went the way of the dodo a long time ago
(StreamItems always reconstitute the actual AR object)

Change-Id: I9f2e04700c8897d0fe539a58dcbd6ec829e6f023
Reviewed-on: https://gerrit.instructure.com/36310
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
update string in SIS text

fixes CNVS-13991

test plan
 - specs should pass

Change-Id: Ie689f634e5ec51f85e07bdd4b1af21a311af97ad
Reviewed-on: https://gerrit.instructure.com/37328
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ken Romney <kromney@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Dana Danger <dana@instructure.com>
update verbiage on recent feedback

fixes CNVS-995

test plan
 - on dashboard recent feedback should read "past
   two weeks" instead of "next two weeks"

Change-Id: Ic31055ef02c323b4c3899a1eba853afccd542f0c
Reviewed-on: https://gerrit.instructure.com/37299
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>