Color contrast - Assignment Create/Edit page

Fixes: CNVS-15578

Couple of small tweaks to increase foreground-
background contrast in the Assignments create
UI. Added new variable for Canvas secondary-action
links that contain only an icon glyph (mostly
Close links in Canvas).

IMPORTANT: This ticket is only for the high-
contrast UI. To enable the high-contrast UI, go
to Settings then scroll down and make sure
"Use High Contrast Styles" is set to ON.
Test plan:

- Enable high contrast UI in Canvas (see above)
- Go through each issue Nathan entered into the
  JIRA and compare with the updated UI to make
  sure it's fixed.
- The webAIM color contrast tester can be found
  here: http://webaim.org/resources/contrastchecker/

Change-Id: I5655801f7b8f2060c763701a2857118ed7718e1d
Reviewed-on: https://gerrit.instructure.com/45428
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Colleen Palmer <colleen@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Color contrast - Individual rubric view

fixes CNVS-15649

This replaces the icons we had with color corrected ones so we
meet our contrast ratios for accessibility.

Test Plan:

- If you don't have any, navigate to your Rubrics page and add one
- Attach a Module outcome to a rubric and then view your Rubric
page
- There should now be a little flag that appears on it which should
meet our ratio

Reference screen: http://cl.ly/image/1j1E2l001O3A

Change-Id: Ie18ecd335fd350c4be6eda6845ebb17be7da71cb
Reviewed-on: https://gerrit.instructure.com/45365
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Chris Hart <chart@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Colleen Palmer <colleen@instructure.com>
fix 'undefined' folders in wiki sidebar upload tool

test plan:
 - have a course with multiple levels of folders in the
   file hierarchy
 - click "upload a new file" in the wiki sidebar
 - the "Folder" select box should
   (a) contain all the folders in the course, and
   (b) should show names for each (no "undefined")

fixes CNVS-13889

Change-Id: I0017ce3238046225545bba7d76d9b880d95eb093
Reviewed-on: https://gerrit.instructure.com/45515
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Adds an iterator to duplicate file names

When a file is uploaded via the WikiSidebar,
it can be uploaded multiple times with the same
name.  This commit adds an iterator to uploaded
files so that if the file has already been uploaded
or a file with the same name already exists,
an iterator is added to the newly uploaded file
to prevent duplicates (e.g. file.jpg, file-1.jpg, file-2.jpg).

fixes CNVS-17361

Test Plan:
* Enable "Better File Browsing" feature flag
* Go to any course's Pages section (as admin/teacher)
* Create a new page or edit an existing one
* On the create/edit page, select the "Files"
  tab from the WikiSidebar on the right
* Click "+ Upload a new file"
* Select some file, then upload it
* Upload the same file again, multiple times
* Go to that course's Files page
* In the course files (or wherever you chose to
  upload the file), the file you uploaded should be
  there, along with additional files with the same name
  followed by an iterator (e.g. yourfile.png, yourfile-1.png,
  yourfile-2.png, etc)

Change-Id: Iaa1307305659bf3b1b38991f0981ac6e48423209
Reviewed-on: https://gerrit.instructure.com/45550
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
Adds Usage Rights to Files preview and search results

closes CNVS-15868

Test Plan:
	- Enable Usage Rights
	- Go to New Files
	- Search for something
	- You should see usage rights reflected in the list of results
	- Preview an item
	- Open the info panel
	- Usage rights should be shown in the info panel

Change-Id: Ie7388597e9f9819cf5853584dc79c1b71945ea1d
Reviewed-on: https://gerrit.instructure.com/44432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
MGP - filter submissions

fixes CNVS-17104

test plan:
 * turn on MGP feature flag
 * using the submissions api
   /api/v1/courses/1/students/submissions
 * with the same parameters as gb uses
   - grouped=1
   - list of student ids (student_ids[]=<id>&student_ids[]=<id>)
 - add the grading_period_id parameter with the appropriate id
   - &grading_period_id=<id>
 > the response should only include submissions
   from assignments in that grading period

Change-Id: Ic1ff47564bf16cd1d158ee6a3307ed76a96915c9
Reviewed-on: https://gerrit.instructure.com/45404
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
turnitin: increase check status attempts

closes CNVS-16212

Change-Id: I33a12b1e13b47fa981f12fd80fb516da8d69c918
Reviewed-on: https://gerrit.instructure.com/45554
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
fix course settings "hide totals" setting

test plan:
* should be able to set the "Hide totals in
student grades summary" in course settings
and save properly

(side bonus: it should stay disabled while reloading)

closes #CNVS-17329

Change-Id: I3150654bf0b17a143c1ca8af004af9823aad731d
Reviewed-on: https://gerrit.instructure.com/45487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Updated ko translation

Change-Id: I104b9601526d24e72dbc924fc6481a64281b415a
Updated tr translation

Change-Id: I761b135ddc3bf167ad2fc3cd151deda2428af1f9
Updated zh_Hant translation

Change-Id: I6f30d7c88727977e6cf221aafe21447f7d6c319f
allow non-admin teachers to get user profiles

fixes CNVS-8913

test plan:
  - as a non-admin teacher
      - request student profile from api (users/:id/profile)
        - see that it works for your students
        - not for others though
  - as an admin
      - request student profile from api (users/:id/profile)
      - see that it works
  - as a student
    - go to profile page, see that it works
    - go to another students profile, see that it doesnt
    - request profile from api (users/:id/profile) see that
      it works the same

Change-Id: Ic4b32bfa3beecf23ac95c75c948880306ef55d60
Reviewed-on: https://gerrit.instructure.com/45230
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
use https for amara integration

Currently you get a warning when you click the "Go to subtitle creation
tool" button because you are posting a form to an HTTP URL from an HTTPS
one (Canvas). This should fix that warning.

Test plan:

 - On an uploaded video, click the subtitle tool and choose "Upload
   subtitles"
 - On the popup, click "Go to subtitle creation tool"
 - There should be no warning message shown

Change-Id: I1743399d8a2ceb07740b8ca5948ea2741aa99594
Reviewed-on: https://gerrit.instructure.com/45077
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
Color contrast - User avatars

fixes CNVS-16010

This changes the icon on the modal so that it meets accessibility
standards.

Test Plan:

- As a student go to your profile and click to change your icon
- The 'x' that appears on the modal now passes

- Go to styleguide and click on Modal Dialog > Show Dialog to see
the change in the global modal as well

Note for UI:
These modals are legacy and although still used throughout canvas
it felt best to replace the image with an svg than a png instead
of figuring out how to put in an <i> tag within the modal html.

Change-Id: Ia893ecc7d2f891dc92e8902060504292f67e10f9
Reviewed-on: https://gerrit.instructure.com/45353
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Chris Hart <chart@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Chris Hart <chart@instructure.com>
Grading Period Grade join table - MGP

fixes CNVS-16454

test plan:
 * test in the console
 - `GradingPeriodGrade.all` should return `[]` (no error)
 - `Enrollment.find(1).grading_period_grades` should return `[]` (no error)
 - make a GradingPeriod:
   `g = GradingPeriod.create(weight: 100, start_date: Time.now, end_date: 1.month.from_now)`
   `g.save!`
 - `g.grading_period_grades` should return `[]` (no error)

Change-Id: I7183d715dbfac3fcd89ab7e453237ad4ce6c650d
Reviewed-on: https://gerrit.instructure.com/45312
Product-Review: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
api modifications for rollcall

refs CNVS-3451

test plan:
  - make api call to get users in a course
    "/api/v1/courses/#{course_id}/users"
    with enrollment_state[]=active&enrollment_state[]=invited&
    enrollment_state[]=completed
  - all users who were invited to the course
    are returned even if they arent in it anymore
  - make api call to get sections
    "/api/v1/courses/#{course_id}/sections"
    with "enrollments" in the included section
  - all user objects have an attached enrollment

Change-Id: I24d6ee31ca9a5c044efa526e762aa1d504045b99
Reviewed-on: https://gerrit.instructure.com/44717
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Make Guard coffeescript compilation include line numbers when the build fails

Change-Id: If06afc8db7d13c9ecd7737e452dfef7eba32e4e2
Reviewed-on: https://gerrit.instructure.com/45581
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
respect individual group member limits when randomly assigning

fixes CNVS-16645

test plan
- create a group set
- create two groups
- set one group's membership limit to a low number
- randomly assign enough students to the groups to exceed the limit
 assuming the students were evenly split
- ensure that the group does not get more students than its limit

Change-Id: I680b354f7f54d6a926d67aafb8b10e0fcd6c5a73
Reviewed-on: https://gerrit.instructure.com/45598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
DA - unions on content_tag and discussion_topic scopes

fixes CNVS-16816

test plan:
  - make sure that the following are properly filtered
    from modules with DA on/off
     - quizzes
     - assignments
     - graded discussions
     - ungraded discusisons
     - wiki pages
  - check for modules index & student progressions page
  - discussion topic index properly filters with DA
    ON and OFF

Change-Id: Id0e2e97d2d876dfb48968163bf140da42183a3c9
Reviewed-on: https://gerrit.instructure.com/45133
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
remove FileAPI swf files

refs CAT-680

These files are no longer in use. There is some more
code cleanup that can be done, but it will need to be
done in a couple stages, as there is a plugin that
depends on the trashable code which will need to be
updated first.

Change-Id: I3821d241664fbf74bbc5928e8615a71ad0a2ef47
Reviewed-on: https://gerrit.instructure.com/45625
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>