fix use of [model]_loaded? for rails 3 compatibility

Change-Id: Ib3120299b48acaf9ea3af5ca8f938304ce288348
Reviewed-on: https://gerrit.instructure.com/27435
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
active record extensions for rails 3

Change-Id: I6740be8a35ec7a955d1714b4049527e113ce7a21
Reviewed-on: https://gerrit.instructure.com/27020
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
avoid select submissions.* when we're explicitly asking for certain columns

test plan:
 * sanity check on final grades when grades are changed

Change-Id: I1c40eaec666426a4a200ebb9de7aa1f3c96e9ba2
Reviewed-on: https://gerrit.instructure.com/27280
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
fix truncate_all_tables for rails 3

Change-Id: Ib035e63de191617946be167a1645aab182a7ced6
Reviewed-on: https://gerrit.instructure.com/27434
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
optimize random group assignment

fixes CNVS-9457

test plan:
* regression testing of random group assignment
* verify that the assignment is much faster

Change-Id: Icfc72f6041f6367e43561d8b8240e6a2ffde4801
Reviewed-on: https://gerrit.instructure.com/26568
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
remove duplicate unlock-at text

fixes CNVS-9963

test plan:
 - should not see the unlock date above and below the locked module

Change-Id: I91c489a2e331daff2cb7a324852636ab975d5f33
Reviewed-on: https://gerrit.instructure.com/27492
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
normalize hide_from_students value via value_to_boolean

fixes CNVS-9954

test plan:
 - with draft state OFF,
  - using the API, perform a PUT on a page, ending the query
    with wiki_page[hide_from_students]=
    (nothing after the =)
  - in the result, hide_from_students should be false
    (not null)

Change-Id: Ic48143ee84411f7b099354e82bfd19d053bf4435
Reviewed-on: https://gerrit.instructure.com/27516
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
add with_each_shard for rails 3 relations

Change-Id: Ic907525d7ff1a1d3db927de3453475ff972ff516
Reviewed-on: https://gerrit.instructure.com/27540
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
change conclude to completed on sis_export report

closes CNVS-2470

test plan
- have a concluded course
- run sis export{courses, include deleted objects}
- csv should have concluded course as completed

Change-Id: I13242e4e5b9a0ab2e68d3e801a29214ec0af182e
Reviewed-on: https://gerrit.instructure.com/27538
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
show total columsn in GB1 when draft state is enabled

fixes CNVS-9951

test plan:
- enable draft state
- go to gradebook 1
- total columns should be visible

Change-Id: I99b50a04583e84c8762d3b83889e551cae486cd2
Reviewed-on: https://gerrit.instructure.com/27325
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
don't clear sis_id when deleting a course

fixes CNVS-9903

test plan
 * delete a course that has an sis_id
 * the sis_id should still be there

Change-Id: Icf884f798e8be1c4b528ee9fcd6911cd107aaa9a
Reviewed-on: https://gerrit.instructure.com/27165
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
added ic-actions to replace kyleMenu in ember apps

closes CNVS-9982, CNVS-9980

also updated ember/shared infrastructure to
support it

Change-Id: I1cbf4529124af16bb09aab47682c6254d5cff0ed
Reviewed-on: https://gerrit.instructure.com/27448
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
fix url transforms in user content

The api_user_content function was returning absolute urls when
adding the verifier parameter, but HtmlRewriter only works
properly with relative urls (doing a regex gsub). This was
causing corruption of existing absolute urls (which were
probably introduced by a prior bug).

Fortunately, the api_user_content function translates relative
urls into absolute urls in a later step, so this just fixes a
bug and doesn't change the interface of api_user_content
function.

fixes CNVS-9882

test plan:
 - put a link to an image in the course's files a discussion
   topic and save.
 - inspect the image element; the src attribute should be a
   relative link
 - edit the discussion topic and click "switch views." Change
   the relative url for the src attribute to an absolute url
   and save.
 - inspect the image element again; the src attribute should be
   an absolute link.
 - edit the discussion topic. The image should display normally.  make a text edit and save.
 - the image should still display normally in the discussion
   topic.

Change-Id: Ifc056b5507d70ef63bbe07a2245e08cad7bbd605
Reviewed-on: https://gerrit.instructure.com/27472
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
Fix Quiz Questions API doc data type

"answers" array must have a type. Should probably be "string".

Test Plan:
- QuizQuestion model in API docs should have an "answers" array of
  type "string".

Change-Id: I431bcb54c1344acac259495658fe0a564d0bfac7
Reviewed-on: https://gerrit.instructure.com/27213
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Josh Simpson <jsimpson@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
TinyMCE: Make shift+tab take focus to the link before the editor

Fixes CNVS-9789

Test plan:
- Visit any page witha rich content editor.
- Tab into the editor.
- Press shift+tab and confirm that your focus is taken to the focusable
  element directly before the editor.

Change-Id: Ib60730e85008aed99f87811fdad218d6add3a947
Reviewed-on: https://gerrit.instructure.com/26928
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
refactor groups collection

creates a seperation of concerns for a few similar collections and views
that previously shared a class filled with conditionals. Sets up a heirarchy
for groupUsers where the category controls much of the business logic.

fixes CNVS-9675

test plan:
- N/A

Change-Id: Ifb886c3326f721fcc3562d9e50132d5a02380bc7
Reviewed-on: https://gerrit.instructure.com/26742
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
fix erroneous user count for unassignedUsers

fixes CNVS-9929

test plan:
1. go to new groups ui
2. go to student organized group set (should have yellow warning)
3. if there isn't already a group there with some users in it, then
   create a new group, add some users, and refresh the page.
4. delete a group that has some users in it, making sure you haven't
   expanded it yet.
5. note that the "Everyone" count does not change.

Change-Id: Ibf942155f97a09a564ea3e3bd462f722a6bb5db4
Reviewed-on: https://gerrit.instructure.com/27328
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
disable group category actions during random assignment

fixes CNVS-9990

test plan:
* create a new group set
* randomly assign users
* verify that during the random assignment,
**  there is no + group or cog menu to perform
**  group category actions

*

Change-Id: I96f04faacdda4ca31d2ab9ebcde4c8eab9f46570
Reviewed-on: https://gerrit.instructure.com/27535
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
update disabled message for unpublish button

test plan:
 - with draft state enabled
 - on the modules page
 * hover over a quiz with student submissions
   - should specify that it cannot be unpublished
 * hover over an assignment with student submissions
   - should specify that it cannot be unpublished
 * hover over a discussion with student submissions
   - should specify that it cannot be unpublished

 all tooltips for the unpublish buttons should read:
   "Can't unpublish if there are student submissions"

fixes CNVS-9942

Change-Id: Ifda975656408324b77c2c5aa58807358c132811c
Reviewed-on: https://gerrit.instructure.com/27546
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
test LDAP Settings modal window has info that runs off edge

fixes: CNVS-4431

The window was to small width wise.  This increases the width of the dialog.

Test Case:
  - Setup some LDAP authentication.
  - Run the Test LDAP authentication.
  - The content of the dialog should fit width wise for success and failed
    cases.

Change-Id: Iaf4bd8ae29006134d190fdcce45bb95e3d64a2e7
Reviewed-on: https://gerrit.instructure.com/27482
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>