Commit Graph

18942 Commits

Author SHA1 Message Date
Pat Renner 6d85448a45 add live_events for outcome_calculation_method
closes OUT-3999
flag=none

test-plan:
- ensure live events are running locally (see live_events.md)
- verify that when making changes (including soft deleting) or
 creating an outcome calculation method that live events are emitted

Change-Id: I715305dc3cd8dc1cab127033d1feb92acd28f948
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250457
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Manoel Quirino <manoel.quirino@instructure.com>
Product-Review: Jody Sailor
2020-10-21 22:19:53 +00:00
Cody Cutrer 84c5e7981b rails 6: instsfs e2e spec fixes
Change-Id: I612a02be7cfde569c1b02d45727b61293aefc25f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250753
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-21 20:08:23 +00:00
Cody Cutrer 934e10af14 rails 6: various fixes for controller specs
Change-Id: I93b6470bda86efc324d3fe0704d271813c49d6dc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250497
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-21 20:00:05 +00:00
Caleb Guanzon 5e16d6572f announcements api: filter to only visible before paginating
fixes VICE-891
fixes VICE-928

flag=none

TEST PLAN:
- just like the new spec does,
- in a course with 2 sections
- make sure that show_announcements_on_home_page = true
- make sure that home_page_announcement_limit = 2
- follow this order:

- first: create an announcement for the whole course
- second: create 2 announcments to the section
your student does not belong to
- last: create 1 announcement to the section
your student belongs to

- visit course page as your student
- verify that the first announcement you see
is the one for your section
- the second announcement you see is the one
for your course
- the 2 announcements for the other section
do not show

Change-Id: Idcc09f677dd470f7fe5706bbdf5851500ef1e461
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250250
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2020-10-21 19:01:13 +00:00
Ed Schiebel 89c51fc89b Better file URLs for viewing, not downloading
closes: LS-1265
flag=new_file_url_rewriting

- gets the verifier, if present, forwarded to the view ping-back url so
  it doesn't fail for one student viewing another student's file.
  Before, when clicking on a pdf and viewing it in canvadoc, the viewing
  of the file succeeds, but the ping-back to log access failed with a
  401. The pin-back now succeeds.
- gets the verifier added to the iframe src when the file is being
  viewed locally. You'll see this when stud1 views a .txt file from
  stud2. plain text files aren't canvadoc viewable, so they're viewed
  in a vanilla iframe.
- stops rewriting non /preview file URLs as download URLs.
  ?download_frd=1 is reserved for that. Before, when users deleted
  "/download" from a link using the html editor in the RCE, canvas put
  it back. Not any more. They shouldn't need to any more either,
  since...
- updates the RCE so links to files do not include /download in the
  URL.  When clicking on a file in the tray, the generated link no
  longer incfludes /download (and canvas won't put it back)
  Embedded images use /preview. Using Image Options to convert the
  image to a link removes /preview, and no longer replaces it with
  /download.

There's some weird file URL handling on in canvas. If the URL is
/preview, it is not logged as a page view. There are comments
indicating that /download will log access, though not always actually
download the file, and that download_frd is used for that. I found
this to be hard to confirm, /download seemed to download for me a lot.
It might be in conjunction with wrap=1, or the inline class name?

This change sets the "new_file_url_rewriting" flag, which enables
these changes, to on in ci and dev.
This change scares me a little and I really want to know that it's
OK.

test plan:
  - ensure new_file_url_rewriting is enabled (which it should be
    unless you're in test or prod environments)
  - it's nice to have canvadocs enabled too
  - do everything you can think of that revolves around files/attachments
    and make sure it still works. No, I/m not kidding

  - link files in the RCE
    - try file types that will be viewed in canvadocs (.pdf),
      in google docs (.rtf), and in a vanilla iffame (.txt)
  > expect clicking on the link to open the file in another tab
  - embed images in the RCE
  > expect the image to be shown, and the <img src> to be /preview
    (when loading a page with an image, the image will not show up in
     recent history, if that's on)
  - using Image Options, convert an image to a link
  > expect the image to be displayed in a new tab when the link is
    clicked
  - link a file, then add "download_frd=1" to the href's query_string
  > click on the link and expect the file to be downloaded, not viewed

  - I think there's some special handling WRT student submissions, so
    try all ^that in a submission.
  - All ^that should work if student1 links/embeds user files and
    images, then
  > expect student2 to be able to view them all
    (discussions are good for this)

  > expect existing content behavior to be the same as it ever was.

Change-Id: Ieae7e4daf549ececb982007b6ce97c8c091c099c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249094
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-10-21 18:48:33 +00:00
Manoel Quirino Neto 517813d1bc add mastery scale view to course outcomes ui
Given the account level mastery scales feature flag is enabled
When I view a course’s Outcomes tab
Then
  I see the same Mastery/Calculation tabs that are available
  on the accounts page
  I can edit the course mastery scale/calculation
  methods if I have permission
  I cannot edit these if I don’t have permissions

closes OUT-3880
flag=account_level_mastery_scales

test plan:
- as Admin, enable "Account-level Mastery Scales"
- Go to any course's admin view (like http://canvas.docker/courses/1),
- Go to outcomes
- You should see Manage, Mastery and Calculation tabs
- Click on Mastery tab
- You should see Mastery form exactly like the account
  outcomes Mastery Tab
- Edit and save this form
- Click on Calculation tab
- You should see Calculation form exactly like the account
  outcomes Calculation Tab
- Edit and save this form
- Go to account's outcomes (like http://canvas.docker/accounts/2/outcomes)
- Navigate thought those tabs and check those values
  are not equal to the course`s outcomes
- Try to repeat the process to different course and
  check the form values are not equal to every course

Change-Id: I3304a1553b147280ef94033b9f1063e2df986165
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249407
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Pablo Gomez <pablo.gomez@instructure.com>
Product-Review: Jody Sailor
2020-10-21 18:36:11 +00:00
Spencer Olson 4fd5a4c65d don't load modules when course is not module based
closes EVAL-1243
flag=none

Test Plan:
1. Create a module with some assignments in it and at least one
   completion requirement.
2. Open your browser dev tools and go to gradebook. Notice there is
   an AJAX request made to /api/v1/courses/:id/modules. Once the page
   loads, verify you can select a "Modules" option from the
   "View -> Filters" menu, and that you can then filter gradebook
   content by that module.
3. Delete the module. Open your browsers dev tools and go to gradebook.
   Notice there is no longer an AJAX request made to
   /api/v1/courses/:id/modules.

Change-Id: I6339acbe635a31e02eaa119fc391fde0121c542e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248936
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2020-10-21 17:20:44 +00:00
Spencer Olson 93aee7f242 optimize grading period assignments fetching
closes EVAL-1246
flag=none

Test Plan:
1. Create a course that uses grading periods. Have at least 2 grading
   periods.
2. Create an assignment. Assign it to one student in the first grading
   period, and the rest of the students ("Everyone Else") in the second
   grading period.
3. Sign in as the "one student" from the previous step. Click on
   "Grades". Select the first grading period from the Grading Period
   dropdown and click "Apply". You should see the assignment show up.
   Then, select the second grading period from the Grading Period
   dropdown and click "Apply". You should no longer see the assignment
   listed.

Change-Id: I69d4b8369784086034a7883460e63f4f259a79ca
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248932
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Jody Sailor
2020-10-21 16:12:52 +00:00
Evan Battaglia 89941a1dc1 Ensure keys are not rotated immediately again
"Somehow, the rotate_keys job returned" --
on Oct 1, both Lti::KeyStorage.rotate_keys and
Canvas::Oauth::KeyStorage.rotate_keys ran multiple times within seconds,
causing the keys to get rotated twice. This commit prevents us from
rotating keys if we just did a few seconds/minutes ago.

flag=none
closes INTEROP-6248

Test plan:
- in a rails console, run Lti::KeyStorage.retrieve_keys to see current
  keys. (Local Canvas didn't seem to be saving DyanmicSettings for me so
  rotating keys didn't have any effect on the keys at keys in
  /api/lti/security/jwks)
- kick off rotation of keys: Lti::KeyStorage.rotate_keys
- check keys rotated
- kick off rotation of keys again
- check keys not rotated
- change min_rotation_period to something smaller like 2 minutes. You
  can do that with:
    class << Lti::KeyStorage; def min_rotation_period; 2.minutes; end; end
  Wait that amount of time, kick off rotation of keys again, and check
  that the keys rotated.
- run Canvas::Oauth::KeyStorage.rotate_keys and
  Canvas::Oauth::KeyStorage.rotate_keys to make sure the min rotation
  period for each set of keys is completely separated. Note that these
  seem to start out empty so you will have to rotate them once to generate
  them.

Change-Id: I7d58909e2eba7ccb2cd4222e60edf3f437547a6e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250155
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
2020-10-21 14:55:29 +00:00
Ed Schiebel 2b859ccf85 Add setting to choose Lato or Lato Extended font for canvas
closes LS-1559
flag=none

This makes 2 changes
1. Before, we were loading both Lato and Lato Extended fonts. This is
unnecessary since Lato Extended is a superset of Lato. Now the default
behavior is to load Lato Extended and not Lato.
2. Because we host the Lato Extended font files, Cisco loads them from
their own instance of Akamai, and they want to avoid the extra bandwidth
it's using. If Setting.get('disable_lato_extended', 'false') returns
anything other than 'false', canvas will load Lato instead.

I don't know why it started failing, but I had to tweak an rce
selenium test.

test plan:
  - load any canvas page
  > using the devtools Network panel, Font filter, expect to see
    our lato extended woff2 files downloaded from /fonts/lato/extended
    and not from fonts.gstatic.com/s/lato
  > expect the pages to look just like they did before
  - load a page with the RCE
  > expect the lato extended woff2 files loaded in the tinymce iframe
    also.
  - add some text including bold, italic and so forth
  > expect the text to look like it did before (see also LS-317)

  - in a rails console, run Setting.set('disable_lato_extended', 'true')
  - send a SIGHUP to the canvas server process
    (hint: `ps -a | grep puma` will find the process for `kill -1 <pid>`
  - load any canvas page
  > expect to see fonts from fonts.gstatic.com/s/lato, and not our
    files from /fonts/lato/extended
  - load a page with the RCE
  > expect to see the fonts loaded in the tinymce iframe
    from fonts.gstatic.com, and not ours from /fonts/lato/extended

Change-Id: Ia0c1820fa96e5ae9095c3cd1c796d381fd035a8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
2020-10-21 12:42:03 +00:00
Michael Ziwisky 4f38d26f05 rails 6: some api spec fixes
Change-Id: I90960e7a6f60525f49bf457a3c01a5d00dc50d0a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250617
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-10-21 02:08:39 +00:00
Cody Cutrer 1c17f54a3f rails 6: view specs fixes
Change-Id: Ie5040fa5fbd0c360e214e5b9644d0c2d9061e1ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250572
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-21 02:07:54 +00:00
Cody Cutrer 247189ecda rails 6: fixes for integration specs
Change-Id: Idfff9d798ce3f3f65c7a3ed97bfd1669ba20e240
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250574
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-21 02:07:44 +00:00
Cody Cutrer 2a614036ca rails 6: plugin fixes
Change-Id: I564efaf24386ca690b48fb1231df1960dadf5850
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250618
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-21 02:07:27 +00:00
Cody Cutrer d52d6968c2 rails 6: fixes for API specs
Change-Id: I3ac07e45861aecaca50f82dbb7dccf169bc11edc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250566
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-21 02:07:15 +00:00
Adrian Packel d9f07e90d1 Show ungraded-as-zero score in total columns
When "View Ungraded as 0" is enabled in Gradebook, ensure the scores in
the "Total" columns are updated appropriately. (The front-end calculator
is already doing the work of calculating the ungraded-as-zero grades, so
this patchset just ensures that we display them when needed.)

closes EVAL-625
flag=view_ungraded_as_zero

Test plan:
- Have a course with some students and some assignments, with at least
  one assignment group
  - Issue some grades, such that the course contains a mix of graded and
    ungraded submissions
- In Gradebook, toggle "View ungraded as 0"
  - Check that total scores and assignment group scores update correctly
    when the value is toggled on or off
- Also check that the totals update appropriately in both modes as you
  enter new grades

Change-Id: Ie8dbb43ebda2a2ab7e536ec01d1392356ccaa40c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248972
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Kai Bjorkman <kbjorkman@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2020-10-20 20:15:03 +00:00
Alex Slaughter 15a3ac9204 Set LiveEvents Spec test value to correct type
Test Plan:
 - Specs Pass

Refs: QUIZ-7810
flag = none

Change-Id: Ib9a86f34ee7e0d3880259d816e854511316b0afe
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250486
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Bryan Petty <bpetty@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2020-10-20 19:41:31 +00:00
Rob Orton 064695d374 handle attachment_ids correctly with sharding
test plan
 - user1 = user on shard 1
 - user2 - user on shard 2
 - course on shard 2
 - enroll user1 and user2 in course
 - load conversations on user1 shard domain
 - send conversation from user1 to user2 with an attachment
 - go to sent items
 - it should have an attachment present

fixes VICE-880
flag=none

Change-Id: I58c316db6df380e0caae0a45f865ab124102be62
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250514
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
2020-10-20 18:35:42 +00:00
Adrian Packel 7602037766 Respect final grade override course settings
fixes EVAL-1266
flag=final_grade_override_in_gradebook_history

Test plan:
- Enable the "Final Grade Override in Gradebook History" site admin flag
- Enable the "Final Grade Override" feature flag
- Have a course with Final Grade Override enabled and some override
  grades entered
- In the Gradebook settings panel, turn OFF "Allow Final Grade Override"
  for the course
- Open Gradebook history
  - Override grade changes should not appear in the results
  - The "show final grade override only" checkbox should not appear
  - Otherwise, the remaining filters should function as normal
- Re-enable the course "allow final grade override" setting and check
  that the checkbox and override grade changes appear again
- Try this with some other combinations (e.g., the site admin flag
  turned off but the course setting turned on); override grade changes
  should only appear if *both* the feature flags above are enabled and
  the course has the "allow final grade override" checkbox enabled

Change-Id: I4a9574423dea8b25092fed75885e405566e2ab95
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250428
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-10-20 16:07:39 +00:00
Cody Cutrer 566a8b3cf8 rails 6: fix any_instantiation_of
Change-Id: I559d8593b658babc535818a2838b6ae2c37e1ab0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250444
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2020-10-20 15:31:57 +00:00
Cody Cutrer 837e589cf4 rails 6: a few fixes
Change-Id: I81a86ae0fa59b5eca3849e51848f16843309983a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250437
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-20 15:31:51 +00:00
Wagner Gonçalves 3266e90083 Add a new variabble `lti11_legacy_user_id` in LTI 1.3 launches
We're adding the `lti11_legacy_user_id` variabble because is a constantly
request fom tool vendors that are working on the migration to LTI 1.3.

closes INTEROP-6214
flag=none

test-plan:
* Have a LTI 1.3 tool installed in your local Canvas, you can use the
lti-1.3.-test-tool for it.
* Launch the tool and ensure that under the JWT Decode that you see the
lti11_legacy_user_id variable as a String that matches with the current
user.

Change-Id: Id0efd2602111f99f0365ea95e2a8074c2ceca477
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249755
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
2020-10-19 22:25:09 +00:00
Alex Slaughter a7f36dbadd Update Contract Test Documentation
Test Plan:
 - Specs Pass

Refs: QUIZ-7892
flag = none

Change-Id: I4827407a3adaa1934dd64ac4c325b7ca1721cfc9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250190
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mark McDermott <mmcdermott@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2020-10-19 21:58:45 +00:00
Cody Cutrer 114399a1d3 rails 6: fix overrides API to use SisPseudonym
Change-Id: I56d1d651293330b8a43b235e01b62cefd3f4e000
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/224593
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-19 21:36:08 +00:00
Robin Kuss 726f953630 unskip and update existing rcs tests
flag=rce_enhancements
Closes LS-1550

Test Plan:
Passes locally and in jenkins

Change-Id: Ie8ef708196cd9e138a57956446b67713944221d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250291
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2020-10-19 19:00:10 +00:00
Adrian Packel d9353fcb20 Check new_sis_integrations on account level
Check whether the new_sis_integrations feature flag is enabled on the
root account level rather than the site-admin level, since it is set on
the former and not the latter.

fixes EVAL-1256
flag=disable_post_to_sis_when_grading_period_closed

Test plan:
- For a root account:
  - Enable the "Enable new SIS Integration Settings" flag
  - Enable the "Disable Post to SIS for Assignment in Closed Grading
    Periods" flag
  - In the account settings, enable the "SIS Syncing" checkbox to cause
    the below checkbox to appear
  - In the account settings, enable the 'Automatically disable "Post to
    SIS" on assignments when grading period closes' checkbox

- Set up a grading period with a close date within the past 20 minutes
- Have a course with at least one student
- Set up an assignment with a due date within that grading period
  - Set post_to_sis on the assignment to true

- Have delayed_jobs running and wait five minutes, OR run the following
  in a Rails console:
  > Assignment.disable_post_to_sis_if_grading_period_closed
- Check the assignment you created above
  - It should now have post_to_sis set to false

Change-Id: I6aa63b4a35fea95aedb221a13b63c600d7772cb5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249623
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2020-10-19 18:46:02 +00:00
Cody Cutrer a2059d44fe fix sub account cache invalidation
Change-Id: Icb7f6ef46f1c913f3e0a0018e43ba3a59c12012a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250387
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-19 14:38:19 +00:00
Simon Williams b878285f9c auth: handle double masquerade
Access tokens now support baking in a masquerading user, which interacts
strangely with trying to manually pass a masquerade user_id param in an
api request.

Clarify that if the users match, things work, if they don't match, we
error.

fixes FOO-1069
flag=none

test plan:
- while masquerading, create an access token
- it should work
- make an api request including as_user_id as the user you are
  masquerading as
- it should work
- make an api request including as_user_id as a different user
- it should error

Change-Id: Ia1d61a977d467d1fc0eca3db4931fdfda2d05618
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249955
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2020-10-19 13:52:17 +00:00
Jeremy Stanley 812f482eb6 re-evaluate all_day when deleting section-specific events
test plan:
 - have a course with multiple sections
 - create a calendar event in the course, choose the "more options"
   button, check the box to assign a separate date for each section,
   and set up two dates on the same day, one after the other.
   save. you should see both events on the calendar.
 - click one of the events, select "edit" and "more options".
 - uncheck the box to use a separate date for each section.
   make the single event start at the time the earlier section-
   specific event started, and end at the time the later section0
   specific event ended
 - save. the event should remember it start and end times and
   not appear as an all-day event

fixes LS-1490

Change-Id: I713650a19ff60bb9840770058474927dc9d59c6b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2020-10-16 15:52:19 +00:00
wdransfield 8541ed668e read secure params in LTI 2 basic launch
fixes INTEROP-6229
flag=none

Test Plan:
- Install an LTI 2 tool in Canvas that
  uses the similarity_detection placement.
  This tool should also use an assignment
  variable expansion. For example,
  'Canvas.assignment.dueAt.iso8601'
- Create an assignment with type online upload
  and select the LTI 2 tool as the plagiarism
  detection provider
- Set a due date on the assignment (to test
  the example variable expansion)
- Save the assignment
- Edit the assignment and monitor the LTI launch
  made to the tool when the assignment edit page
  is loaded
- Verify this launch includes the expanded
  assignment variable you added

Change-Id: Ia57e0bc94889557c7dcdbd4ed864cbd8ce9b89eb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249138
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-10-16 15:11:54 +00:00
Adrian Packel bb6abb0c38 Handle rubric criteria/ratings with large IDs
When handling rubric creation requests via the API, do not use the ID of
incoming rubric criteria (or ratings on an individual criterion) as an
index to store the item in an array. Doing so caused IDs like 297203574
to create an array with 297 million elements to store rubric criteria
and then operate on that array before throwing away the empty values
(and doing the same thing when storing ratings for specific criteria),
which slowed the process to a crawl.

fixes EVAL-1029
flag=none

Test plan:
- Make a POST request to the rubric creation API endpoint for an
  existing course, using excessively large values for the IDs (for a
  sample request see APPENDIX below):
  - /api/v1/courses/<courseID>/rubrics
- This should complete quickly (within a couple seconds if Rails doesn't
  have to reload) and certainly should not take over a minute
- Adding additional criteria should not cause a noticeable increase in
  the time taken
- Test that updating an existing rubric (using a PUT request) does not
  take forever
- Test that creating/updating a rubric via Canvas itself still works as
  before

APPENDIX: sample request that took over a minute without this patchset
but should finish very quickly with it

{
  "rubric": {
    "title": "Canvas Test Rubric - edit",
    "free_form_criterion_comments": false,
    "criteria": {
      "297203574": {
        "id": "297203574",
        "points": 5.0,
        "description": "First item",
        "long_description": "",
        "criterion_use_range": false,
        "ratings": {
          "229567777": { "id": "229567777", "points": 5.0, "description": "Very High", "long_description": "no" },
          "229567778": { "id": "229567778", "points": 4.0, "description": "High", "long_description": "no" },
          "229567779": { "id": "229567779", "points": 3.0, "description": "Achievement Standard", "long_description": "no" },
          "229567780": { "id": "229567780", "points": 2.0, "description": "Developing", "long_description": "no" },
          "229567781": { "id": "229567781", "points": 1.0, "description": "Emerging", "long_description": "no" }
        }
      },
      "297203575": {
        "id": "297203575",
        "points": 5.0,
        "description": "Second item",
        "long_description": "",
        "criterion_use_range": false,
        "ratings": {
          "229568289": { "id": "229568289", "points": 5.0, "description": "Very High", "long_description": "no" },
          "229568290": { "id": "229568290", "points": 4.0, "description": "High", "long_description": "no" },
          "229568291": { "id": "229568291", "points": 3.0, "description": "Achievement Standard", "long_description": "no" },
          "229568292": { "id": "229568292", "points": 2.0, "description": "Developing", "long_description": "no" },
          "229568293": { "id": "229568293", "points": 1.0, "description": "Emerging", "long_description": "no" }
        }
      },
      "297203576": {
        "id": "297203576",
        "points": 5.0,
        "description": "third item",
        "long_description": "",
        "criterion_use_range": false,
        "ratings": {
          "229568801": { "id": "229568801", "points": 5.0, "description": "Very High", "long_description": "no" },
          "229568802": { "id": "229568802", "points": 4.0, "description": "High", "long_description": "no" },
          "229568803": { "id": "229568803", "points": 3.0, "description": "Achievement Standard", "long_description": "no" },
          "229568804": { "id": "229568804", "points": 2.0, "description": "Developing", "long_description": "no" },
          "229568805": { "id": "229568805", "points": 1.0, "description": "Emerging", "long_description": "no" }
        }
      },
      "297203577": {
        "id": "297203577",
        "points": 5.0,
        "description": "fourth item",
        "long_description": "",
        "criterion_use_range": false,
        "ratings": {
          "229569313": { "id": "229569313", "points": 5.0, "description": "Very High", "long_description": "no" },
          "229569314": { "id": "229569314", "points": 4.0, "description": "High", "long_description": "no" },
          "229569315": { "id": "229569315", "points": 3.0, "description": "Achievement Standard", "long_description": "no" },
          "229569316": { "id": "229569316", "points": 2.0, "description": "Developing", "long_description": "no" },
          "229569317": { "id": "229569317", "points": 1.0, "description": "Emerging", "long_description": "no" }
        }
      },
      "297203578": {
        "id": "297203578",
        "points": 5.0,
        "description": "fifth item",
        "long_description": "",
        "criterion_use_range": false,
        "ratings": {
          "229569825": { "id": "229569825", "points": 5.0, "description": "Very High", "long_description": "no" },
          "229569826": { "id": "229569826", "points": 4.0, "description": "High", "long_description": "no" },
          "229569827": { "id": "229569827", "points": 3.0, "description": "Achievement Standard", "long_description": "no" },
          "229569828": { "id": "229569828", "points": 2.0, "description": "Developing", "long_description": "no" },
          "229569829": { "id": "229569829", "points": 1.0, "description": "Emerging", "long_description": "no" }
        }
      }
    }
  }
}

Change-Id: I33a6cb77c8cda3a4ce0ea949da83281d822e0a12
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249271
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
2020-10-16 14:57:58 +00:00
wdransfield a0e230a850 Don't raise error when tool launched with duplicates in context
Fixes INTEROP-6260

Right now LTI 1.3 assignment launches will fail in the
following scenario:

There are duplicate LTI 1.3 tools in the context: Tools A and B

- An assignment was created with Tool A
- The assignment was modified to use Tool B

This scenario is a legitimate situation that could occur
when an institution is upgrading an installed tool and want
to test that things work before uinstalling the old tool.

The solution here was to remove the check that required the
tool on the resource link record to match the currently
configured tool (See g/170818).

Also note the message of that commit correctly indicated that
this check was "...almost certainly incorrect
long-term behavior" (although it made sense at the time
it was added)

Test Plan:
- Install an LTI 1.3 tool and configure it with an assignment
- Install a duplicate LTI 1.3 tool
- Edit the assignment to point to the duplicate tool
- Validate that the assignment still launches and that
  AGS can be used from the duplicate tool

Change-Id: If1be3894b26a7cb845a8f70ca5e030c917467f0a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250017
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2020-10-15 23:16:29 +00:00
Jackson Howe 97b4333095 Disable rce menubar items when inappropriate
When an iframe or other certain attributes are selected in the rce,
we disable the content insertion toolbar items (like linking, media,
etc). This change also disables the associated items in the menubar.

flag=rce_enhancements
fixes LS-1442

Test plan:
 - Open up an RCE
 - Add an iframe to the content
 - Click on the iframe
 - Expect the 4 content insertion buttons in the toolbar to be
   disabled (done in previous commit)
 - In the insert menu, expect the submenu items under Link, Image,
   Media, and Document to all be disabled

Change-Id: I400ba05ac9f5a92f9ce055194a8d244bc962bc8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250021
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-10-15 15:03:50 +00:00
Ryan Norton 46b38db1e8 skip slow batch assignment specs
flag = none
refs DEMO-76

Change-Id: Ic6dcdbf263e61c4ebcdc92d5d6b06f86d0fa934a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250171
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
QA-Review: Ryan Norton <rnorton@instructure.com>
Product-Review: Ryan Norton <rnorton@instructure.com>
2020-10-14 22:43:17 +00:00
Matthew Lemon 074c4d72eb add setting for changing pronouns
This allows schools to lock down a user's ability to change their
pronoun within Canvas.

Fixes VICE-837
flag=none

TEST PLAN:
- As an admin navigate to the account settings
- Enable personal pronouns and note the additional check box to allow
  users to change their pronouns in Canvas
- With it enabled navigate to a users settings and attempt to edit their
  settings
- Note that you should be able to change the user's pronoun
- Disable the setting on the account attempt to edit a users settings
  again
- Note that the dropdown should be disabled and you shouldn't be able to
  change the user's pronoun

Change-Id: I7d7d454e1b5df9a0afa2b39768159a86910cb7d2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249883
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-10-14 22:12:17 +00:00
Rob Orton eeee18f16a allow groups and group_categories to be restored
test plan
 - delete a course group_category
 - go to /courses/:id/undelete
 - it should have the group_category listed
 - hit undelete to the group_category
 - it should restore the group_category
 - repeat for an individual group

fixes VICE-901
flag=none

Change-Id: Ia47ac829d2227bbb4c26f34c3f3cd6aa2c1638c4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250061
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Matthew Lemon <mlemon@instructure.com>
Product-Review: Matthew Lemon <mlemon@instructure.com>
QA-Review: Matthew Lemon <mlemon@instructure.com>
2020-10-14 21:57:39 +00:00
Matthew Lemon 23c690243a add observed student toggle to NP page
We need to be able to both query for and update the users
`send_observed_names_in_notifications` preference through graphql. We
also need to update the front end UI to display the toggle when viewing
your account notification preferences.

fixes VICE-904
fixes VICE-881
flag=notification_update_account_ui

TEST PLAN:
- Create a course and add an observer to it
- Ensure the notification_update_account_ui flag is enabled on your
  local site admin
- As the observer navigate to /profile/communication
- Note that there should be a toggle for showing name of observed
  students in notifications
- Enable the toggle and then refresh the page and note that the change
  should still be present
- As a non observer user navigate to /profile/communication and note
  that the toggle is not present
- As any user navigate to a courses notification preferences page and
  note that the toggle should not be present

Change-Id: I77e1b46f3e928364b0e33e91957f356f2a3e2edb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249643
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Ben Nelson <bnelson@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
2020-10-14 21:43:46 +00:00
Aaron Shafovaloff f28872f9e8 Decaffeinate Gradebook
Test plan upon merge to master:
 - Gradebook regression test

flag=none

Refs EVAL-1045
Refs FOO-860

Change-Id: I509436789a121ba80371f00aa4ecfaccc666814b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/245501
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
2020-10-14 20:37:39 +00:00
Ed Schiebel b706c50618 Use an svg file as its own thumbnail
as long as it's < 16k (some course designers embed base64 encoded
png images in their 2MB svgs. we don't want those)

closes LS-1522
flag=none

test plan:
  - upload an svg file
  - find it in the files page
  > expect it to have itself as its thumbnail
  - upload a giant svg file
  > expect it to have a vanilla icon instead of its thumbnail

Change-Id: I4ad26e67c1b7dfbc2a38fa2182a6fa18d233f27e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249403
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-10-14 19:45:26 +00:00
Wagner Gonçalves f907d70909 Add custom variable com.instructure.Observee.sisIds
We're adding a custom variable substitution that returns a string of
observee's (students) SIS ids for the current user (observer), in the
context of the current course for LTI toll launches.

closes INTEROP-5940
flag=none

test-plan:
* Have an LTI tool installed in your local Canvas at a course
level that uses the new custom variable.
* Ensure that your current user is enrolled in at least section
in the course the tool is installed in.
* Launch the tool and ensure that under the custom claims you see
the observee ids variable expanded to an array that matches the
students your current user is linked in the current course.

Change-Id: Ib9d019411b991646633a4c3b7bc33ac159635379
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249646
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2020-10-14 19:23:15 +00:00
Aaron Ogata 236b495375 generalize session_storage clear fix
refs LS-1394

Change-Id: I0a4cc1c3829d246a5ce76c7b49d08f314c064861
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250133
Reviewed-by: Kyle Rosenbaum <krosenbaum@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-10-14 18:38:37 +00:00
Kyle Rosenbaum 7006dc60cc update iframe allowances for Edge 79+; refs ARC-7120
As of Edge 79 (Chromium Edge), Feature Policy is enabled requiring
the use of * to enable that feature in all browsing contexts
(iframes) regardless of their origin.

Test Plan:
1. Use Edge 79 or greater
2. Navigate to a Studio LTI placement
3. Click on the 'Record' menu in the upper right corner
4. Click on 'Webcam Capture'
4. A prompt should display asking the user to accept webcam &
microphone permissions
5. Upon acceptance of permissions, webcam capture modal displays
a live view of your webcam

Change-Id: Ie2b32915bfeefebe976cba2e753c603d06c9c90f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249717
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Balint Kartyas <balint.kartyas@instructure.com>
Reviewed-by: Andras Nemeth <andras.nemeth@instructure.com>
QA-Review: John Koropchak <jkoropchak@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2020-10-14 16:59:09 +00:00
Cody Cutrer dfc0fe5f6a ruby 2.7/rails 6: several deprecation warning and spec fixes
Change-Id: I6314b3f304e8befc18ee2f832993a0740690d786
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249956
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-14 16:13:04 +00:00
Michael Brewer-Davis 9f01610f48 update rubrics after outcome proficiency changes
closes OUT-3779, OUT-3876
flag=account_level_mastery_scales

Test plan:
- enable mastery scales
- create an account level mastery scale
- create account and course level rubrics
- update the account level mastery scale
- verify rubrics updated
- associate the account level rubric
  with an assignment and assess for
  a student
- update the account level mastery scale
- verify account rubric unchanged, course
  rubric updated

Change-Id: I9bcaef171b2d118e18ddbbc0f8e619961d6b32fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249289
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Jody Sailor
2020-10-14 16:01:37 +00:00
Robin Kuss 81361d2333 unskip rce link tests
flag=none

Fixes LS-1394

Test Plan:
- passes with several iterations of Jenkins

Change-Id: Ia6ea84ae40cb484088a1bcf00aa1d949162fa12e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250003
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
2020-10-14 15:48:54 +00:00
Evan Battaglia 3dea2c1c3f make submission_created emit only on actual submissions
Normally submissions are created in raw SQL so the after_create hook is
not fired but there are some cases where this is not the case: in these
weird edge cases, submission_created is also fired when we create
Submission records with ActiveRecord so the after_create hooks fire.  We
don't understand exactly what they are but they are a very small
proportion (about 0.15% of total submission_created events) and no one
cares about them.

This also adds "workflow_state" to the event body, and DRYs up some
specs.

closes INTEROP-6224
flag=none

Test plan:
- Run canvas with the environment variable STUB_LIVE_EVENTS_KINESIS=1
  e.g.:
    dcr -e STUB_LIVE_EVENTS_KINESIS=1 -u 0 web \
    bundle exec rails server --binding='0.0.0.0' -p 80
- create assignments and make submissions for students in the following
  ways, making sure the submission_created event is emitted (it will
  be in the Canvas STDOUT, you might have to search for it) only when the
  student (or API call in some cases) submits or resubmits:
  - Student submits through UI.
  - Student re-submits through UI.
  - Done through API (?) Something like
    /api/v1/courses/123/assignments/12345/submissions/1234 ?
  - Grade passback (?)
  - AGS (?)
- Make sure a submission_created event has the "workflow_state" in it.
- In a console, create a Submission with Submission.create! in a
  unt push gerrit
  submitted state and make sure the event does not fire.
- In a console, create a Submission with Submission.create! in a
  submitted state and make sure the event does fire (you must provide
  workflow_state: submitted, and a submission_type such as
  online_text_entry)

Change-Id: I92b1c595282bf498557b7e52660547cc624795ac
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249769
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Product-Review: Oxana Jurosevic
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
2020-10-13 20:53:47 +00:00
Aaron Ogata 64e2b17562 remove abort_on_consistent_badness_formatter
refs DE-321

Change-Id: Idd1c201e6b99fd0347b82ae977b4f5828b818f6e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249995
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Ogata <aogata@instructure.com>
Product-Review: Aaron Ogata <aogata@instructure.com>
2020-10-13 18:10:04 +00:00
Xander Moffatt 00a2df171e migrate line items from 1.1 to 1.3 on AGS create
* this only occurs if the AGS is used before a tool is launched
* and uses the same just-in-time fixup from the assignment
* another commit will address this same issue but for the index action
* no other actions need this fixup, since they all require a line item

closes INTEROP-6163
flag=none

test plan:
* install a new configuration of the LTI 1.3 test tool locally, with
  the assignment_selection placement included
* copy that ContextExternalTool using `tool.clone` in a Rails console
* rename that tool to something like `Fake 1.1 tool`, and edit the text
  in the assignment_selection placement to match
* create an assignment that launches that fake 1.1 tool
* in a Rails console, edit that fake 1.1 tool:
  * `tool.settings[:use_1_3] = false`
  * `tool.developer_key_id = nil`
* and remove the line item and resource link created:
  * `Lti::LineItem.last.delete`
  * `Lti::ResourceLink.last.delete`
* edit the assignment to now launch the new 1.3 tool from the first step
* DO NOT LET THE ASSIGNMENT LOAD OR LAUNCH THE TOOL!!
  * once you click save immediately click to a different page
* get an LTI access token
  * in the `lti-1.3-test-tool` repo, run:
  * dcr web rake jwt:access_token['https://canvas.instructure.com',3,5,'all']
  * where 3 is the credential id, and 5 is the platform id (these are
    models from the tool itself)
  * the token is the JWT returned
* make a request to the LineItemsController in the AGS
  * get the Assignment's lti_context_id
```
curl -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"scoreMaximum":2, "label":"test","resourceLinkId":"<lti_id>"}' \
  http://canvas.docker/api/lti/courses/1/line_items
```
* this call should not error
* once it completes, there should be a new Lti::LineItem with a matching
  assignment_id
* and a new Lti::ResourceLink with a resource_link_id that matches the
  assignment's lti_context_id
* the assignment should launch properly

Change-Id: I0315dc5b1ede7ad3c37c81ec1b75cad1db693657
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248329
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
2020-10-13 17:00:02 +00:00
Jeremy Stanley 3c798a4115 show name of user who performed sync in blueprint history
test plan:
 - set up a blueprint course and associated course
 - perform a sync
 - the sync history in the blueprint course's sidebar should show
   "X changes pushed by (name of user)"
 - the blueprint information in the associated course's settings
   should also show the name of the user who performed the last sync

flag = none
closes LS-1263

Change-Id: Iee4e2326d773a72d109566291a873c922108e173
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249760
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2020-10-13 16:54:08 +00:00
Simon Williams 7250aba4bf correctly delete cross-shard user observer links
fixes FOO-1029
flag=none

test plan:
- create a cross-shard user observer
- try to delete the link
- it should work

Change-Id: I15e4830a31e9dd29915cac1765342ec41877a4f0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249952
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2020-10-13 16:48:40 +00:00