translate provisioning report headers

refs CNVS-3134

test plan
 - provisioning report headers should be translated

Change-Id: I457989c7d82dac29cfd565e897ce8b8b8190de61
Reviewed-on: https://gerrit.instructure.com/34590
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate outcome report headers

refs CNVS-3134

test plan
 - outcome report examples and report headers
   should be translated

Change-Id: I4a9fd3e8b47b2e3b095b9c6160123e088508832c
Reviewed-on: https://gerrit.instructure.com/34581
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate grade report headers

refs CNVS-3134

test plan
 - grade report examples and report headers
   should be translated

Change-Id: Ib0ad3f67e990d70372882fa4315245c80500e73a
Reviewed-on: https://gerrit.instructure.com/34579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
translate course report headers

refs CNVS-3134

test plan
 - course report examples and report headers
   should be translated

Change-Id: I1ed6e93886c281c0f8635aca63171af8966bc58c
Reviewed-on: https://gerrit.instructure.com/34577
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
bump switchman version

Change-Id: I917579dfaf73f869b032aa9a5377129726095931
Reviewed-on: https://gerrit.instructure.com/35653
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
save context_id on lti launch

fixes: PS-1538

**test plan
configure and launch lti tool, upon lti tool launch the
lti_context_id for user should be set, and if course launch
the lti_context_id on course object, if account launch, then
lti_context_id on account.  Once these are set, api calls to the
corresponding object can be made using the syntax lti_context_id:id

Change-Id: Icdf02e4f99691be417c024adb2a2751ba2aa9335
Reviewed-on: https://gerrit.instructure.com/35380
Reviewed-by: Brad Humphrey <brad@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
fix bug in adding user notes to teachers

fixes CNVS-13347

Change-Id: I69cb5464f98288f2f28f5bb1664f23292307a4fc
Reviewed-on: https://gerrit.instructure.com/35659
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
add user_id to poll serializer

fixes CNVS-13360
This commit adds the user_id to the poll json response, only for
teachers.

Test plan
- As a teacher, create a poll
- Request that poll via the poll#show endpoint
- It should have a 'user_id' field with the id of the creator
- As a student, request the same poll via the poll#show endpoint (the
  student won't be able to view it without a published poll session)
- The student should not see the 'user_id' field.

Change-Id: Ib0b09d779f3486edaa38a870d20211268be819d3
Reviewed-on: https://gerrit.instructure.com/35693
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
update user cache on enrollment deletion

fixes CNVS-12427

test plan
 - enroll a user in a course
 - delete the enrollment
 - as the user make a GET api call to 
 - <canvas_url>/api/v1/courses (can use ?as_user_id=ID)
 - should return unauthorized

Change-Id: I949640ad9ad8d9d702ac3f7b79dd19f35f4f98b5
Reviewed-on: https://gerrit.instructure.com/35658
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
validate assignment titles

fixes CNVS-10160

test plan
 - attempt to save assignment with title over 255 char
 - should fail and not generate db error

Change-Id: If5633aea38fb10d71367900af841b3ed070c1085
Reviewed-on: https://gerrit.instructure.com/35664
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Better formatting for emails and add avatar for conversations

Fixes: CNVS-12970

We needed an avatar and signature for notifications
sent out via conversations. Also reformatted all the
notifications to take on a cleaner and more easy to
read format.

The majority of testing can be done on the conversation
notifications. I was using letter opener to do this.
I have included letter opener and the relevant setup
stuff in this commit so that it can be tested.

Test-Plan:
-Make sure that your organization has allowed avatars
-Give a student or a teacher an avatar
-Send a conversation message to another user from
  the user that has an avatar
-If you have letter_opener installed, the email
  should be intercepted and you'll see its formatting.
  Otherwise, use whatever method you'd like to view
  the email.
-Verify that everything looks alright and we have
  an avatar and good formatting.

-STEP 2-
-Disable avatars
-Send another email and verify that the avatar isn't
  showing up

Change-Id: I876dc119c5daefa10811c75c08b315722a50f63d
Reviewed-on: https://gerrit.instructure.com/35144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
Use source user as "FROM" for emails

This gives certain user-triggered events
a "look" as though they came directly from
that user (the FROM and REPLY-TO headers
have the name of the source user).

This also introduces "letter_opener" into the
dev environment.  If you use "letter_opener"
as your send method for dev emails, it will
open all emails in a browser tab. Very useful.

closes: CNVS-11837

TEST PLAN:

Validate each of the following notifications
looks like it's "from" the source user:

- Submitting an assignment
- Resubmitting an assignment
- Posting to a discussion
- sending a conversation message
- posting a comment on a submission

Change-Id: I0e04aa9aa5bf31a590e69507e04b86b637247acf
Conflicts:
	app/models/message.rb
Reviewed-on: https://gerrit.instructure.com/35362
Reviewed-by: Drew Bowman <dbowman@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
fix poll visibility issue for students

fixes CNVS-13374
This commit addresses a mistaken assumption about poll visibility for
students.  Previously, there had to be opened poll sessions for a
student to have read access to the poll. This has been changed to be
based around a students enrollments - if the poll has a poll session
associated with a course or course_section the student is enrolled in,
then they are able to read the poll.

Test plan
- Create a poll as a teacher
- Create a poll session associated with a particular course
  - A student enrolled in the associated course should be able to access
   the poll via #show, regardless of whether or not the session is opened.

  - A student who isn't enrolled in the associated course should not be
   able to access the poll via #show, regardless of whether or not the
   session is opened.

Change-Id: Idf7d4ebeac27d15ce8d37ef498ebc3ab871a6d7e
Reviewed-on: https://gerrit.instructure.com/35722
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
allows deletion of last section due date

fixes CNVS-13183

test plan
- in rails 2
- in a course with multiple sections that have at least 1 student enrolled
- once with an assignment, and once with a graded discussion topic
- create an assignment with a due date for 2+ sections and 'Everyone else'
- delete the section due dates and save the assignment
- verify that the due dates were actually deleted
- repeat for rails 3

Change-Id: I2c57af7cdf08e39f93d682193a2c4ed5aef82ba3
Reviewed-on: https://gerrit.instructure.com/35295
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Liz Abinante <labinante@instructure.com>
add extend time modal link and dialog for ember quizzes moderate

fixes CNVS-12448

test plan:
- as a teacher
  - enable fabulous quizzes
  - enroll a few students in the course

  - create a quiz with a time limit
  - publish the quiz
  - visit the quiz moderate page

- in a different browser / session as a student
  - start the quiz as a student
  - don't submit the quiz yet!

- as a teacher
  - refresh the moderate page
  - you should be shown a clock icon for the students with currently running
    quizzes.
  - you can now click on this icon!
  - this will bring up a modal dialog to extend time for the current attempt
  - try out extending the quiz by a few minutes from now
  - try out extending the quiz by a few minutes from the end date

- also try these out with multiple students taking the quiz at once.
- changing the options in the modal should persist until you choose a different
  student, at which point it will reset the form in the dialog

Change-Id: I0adf1ed2133b6adaf8501b5131bd70365b06c249
Reviewed-on: https://gerrit.instructure.com/35343
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
Possible points server-side validation

fixes CNVS-7565

test plan:
- From Assignments screen, click 'Add Assignment'
in sidebar
- Click 'more options'
- On the resulting page, enter a negative number
for Points
- Submit the form
- You should see a message stating that the points
have to be a positive number

- From Assignments screen, click to edit an existing
assignment
- On the resulting page, enter a negative number
for Points
- Submit the form
- You should see a message stating that the points
have to be a positive number

Change-Id: I7e618dd8409c123e836ee3e192ad42cdf9d909d5
Reviewed-on: https://gerrit.instructure.com/33535
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
add explanation that some scores aren't graded yet in quiz attempt history

fixes CNVS-13255

test plan:
  - as a teacher
    - create a quiz with an essay question
    - take the quiz
    - the attempt history table should show an asterisk next to scores
      that are pending review, and a message that explains some questions
      aren't graded yet

    - create a quiz without an essay question
    - take the quiz
    - the attempt history table should NOT show an asterisk next to scores or
      an explanation that some questions not graded yet

  - as a student
    - take the essay quiz and we should have asterisks / message as well
    - take the quiz without essays, and we should not get asterisks/message

  - try this with multiple attempts as well. It should highlight any attempt
    that is pending review
  - this should work with both fabulous quizzes enabled / disabled

Change-Id: I7fd6b0744ca12ee1486a066d15b70701bbb22770
Reviewed-on: https://gerrit.instructure.com/35643
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
groups: fix group leader outcome alignment in Firefox

fixes CNVS-13366

test plan:
  * open a course's groups page
  * make a user a group leader
  * verify that the leader icon looks right across browsers

Change-Id: I73ae8f15cbbcf55a864cc4db81382b1820cea52b
Reviewed-on: https://gerrit.instructure.com/35707
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Drew Bowman <dbowman@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
don't force MFA reconfig after successful CAS login when MFA is needed

fixes CNVS-13348

the problem was CAS login uses a GET, so we were taking the reconfig
path. so check more specifically for the reconfigure action

test plan:
 * configure MFA for an account
 * make sure you can log in, but *don't* remember the device for
   MFA purposes
 * configure CAS on the account
 * login with CAS
 * it should ask for your MFA code, not to reconfigure MFA

Change-Id: If955ee3ed48456c64c9732fa90c7fb911e1c402d
Reviewed-on: https://gerrit.instructure.com/35668
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
pend failing groups spec until we find out why it's failing

Change-Id: I6f0bfa107aafbe3a115da7b29a516377d94d74e3
Reviewed-on: https://gerrit.instructure.com/35740
Reviewed-by: Drew Bowman <dbowman@instructure.com>
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>