Commit Graph

7312 Commits

Author SHA1 Message Date
Cody Cutrer 551e4d137c RuboCop: Performance/StartWith
auto-corrected, with post-review checking for possible nilness

Change-Id: I89c30b92691a2a5f73d98d9c8ac721c50d3a4ba7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278014
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 22:53:48 +00:00
Cody Cutrer 1832881748 RuboCop: Performance/RegexpMatch
[skip-stages=Flakey]

auto-corrected

Change-Id: Icf79dc86947cde22d0853b3db8afa3db853e7b8a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278013
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 22:02:06 +00:00
Cody Cutrer a498023706 RuboCop: Performance/StringReplacement
auto-corrected

Change-Id: I4df9529bd8d09d9f96e979d59120f126fe2b8761
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278006
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 22:00:48 +00:00
Cody Cutrer 6bdee6ed50 RuboCop: Style/SlicingWithRange
[skip-stages=Flakey]

auto-corrected (with manual post-review looking for possible non-array,
non-string slices that might go bad, with none found)

Change-Id: I00feba96f58f701ed1f668f86928b8871d0d8ef2
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277991
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 21:56:43 +00:00
Alex Slaughter 15b4b78d0c Fix for $Canvas.assignment.description being too long
Resolves bug introduced in https://gerrit.instructure.com/c/canvas-lms/+/275548/

Test Plan:
 - Specs pass

flag = none

Change-Id: Ib890ddd9770f49a1b04b912590f78b8f9f37ca47
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278061
Reviewed-by: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
2021-11-11 21:31:09 +00:00
Cody Cutrer 6311053d81 RuboCop: Style/ColonMethodCall
[skip-stages=Flakey]

auto-corrected

Change-Id: I46f0ee2c3fb97f3ca37627c0edd8eecffaf0aa59
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277986
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:58 +00:00
Cody Cutrer a38ba75856 RuboCop: Style/RedundantCondition
auto-corrected

Change-Id: I5b6b6d5e75a5573d621a728a676c64bb908e8b63
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277971
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:32 +00:00
Cody Cutrer 8d4fee2d25 RuboCop: Style/RedundantAssignment
[skip-stages=Flakey]

auto-corrected

Change-Id: I73517db1000afa49b81fdd4f40d610faa760e6ff
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277967
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:20 +00:00
Cody Cutrer ba1fdaf2a9 RuboCop: Style/ConditionalAssignment
auto-corrected

Change-Id: Ie87e4c1b6c05bc31ce13481a94c413dcf7b20278
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277964
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 17:39:06 +00:00
balazs.komaromi b14445880f Populate deleted_at of pseudonym during sis import
During user deletion, workflow_state was changed to
'deleted' on the Pseudonym, but deleted_at property
was not set. This change fixes this, deleted_at
will be set to the current time.

Closes SOS-2378

Test plan:
 - Do a SIS import with one active user in it
 - Change the status of the user to 'deleted' in CSV
 - Run SIS import again
 - Check the deleted_at property for the given user
   in the pseudonyms table of the Canvas database

flag = none

Change-Id: I6ea6cfedc5e2889ff8ce6914978137025f49cd68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277663
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>
2021-11-11 09:09:08 +00:00
Cody Cutrer 6c2705e1bf RuboCop: Performance/StringInclude
[skip-stages=Flakey]

auto-corrected, with manual review to identify possible nilness

Change-Id: I205436e5c3cb37aae99ea552c7d14e6d1a04ef06
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277893
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:35:04 +00:00
Cody Cutrer ddfd72ca17 RuboCop: Style/RedundantBegin
[skip-stages=Flakey]

auto-corrected

Change-Id: I6a29a9d2fa1057e2278c105a8331d2c79e496897
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277904
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:19:27 +00:00
Cody Cutrer f23a4917d7 RuboCop: Style/RedundantRegexpEscape
[skip-stages=Flakey]

auto-corrected

Change-Id: I21b955242be4150034f8188eb24049cd1204956d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277883
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:19:02 +00:00
Cody Cutrer cf213ee24b RuboCop: Style/RedundantFreeze
[skip-stages=Flakey]

auto-corrected

Change-Id: Id1b8bafdd744219a4797e6e1ba5891cd7ce4bccd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277888
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:06:47 +00:00
Cody Cutrer b2d5e59698 RuboCop: Style/RedundantParentheses
[skip-stages=Flakey]

auto-corrected

Change-Id: I773f1128042a03265d6e925cfd86d69f0dc11892
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277877
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:06:22 +00:00
Cody Cutrer 8125858d27 RuboCop: Style/RedundantInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: Id04fd07bb918f0f4dc376b5c3474653a8e767e95
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277870
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-11 02:06:11 +00:00
Simon Williams e2bc786ab7 ePortfolio admin API
This provides an API for several actions that make moderating
ePortfolios easier. You can list all ePortfolios for a user, show
details, moderate spam status for 1 or all of a users' ePortoflios, and
delete or restore an ePortfolio

Listing and deleting can be done by the owning user, but all the
moderation actions require the user to have the moderate_user_content
permission.

There is currently no support for creating a new ePortfolio or updating
the content of an existing ePortfolio.

closes FOO-2188
flag = none

test plan: run through the new API endpoints, make sure permissions and
functionality are correct.

Change-Id: I3ffa58adb00c466a601a41a05307c24bb406fa42
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273956
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-11-10 15:50:54 +00:00
Cody Cutrer 7fdf9d7588 RuboCop: Lint
[skip-stages=Flakey]

the balance. mostly. Lint/UriEscapeUnescape is put in the pending
block because it's so touchy, and I didn't want to deal with it
right now

all manual

Change-Id: Ibeb81e013f56f160d51f7d237a9bcfe98daa1e53
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277569
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-09 21:42:31 +00:00
Jacob Burroughs 68d665b3ac Fix locale loading in deployed envs
Change-Id: Iad7ba069a1a373415e68a8abfa52f752d263630f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277729
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jacob Burroughs <jburroughs@instructure.com>
2021-11-09 20:08:48 +00:00
Ed Schiebel 2a277632c2 Make typeset math and math image match
at least get them much closer.
1. typeset math using svg by default, which is how the image is generated
2. size the image so it matches the surrounding font-size

Also, still typeset math from images even if the image fails to load.

closes MAT-501
flag=new_math_equation_handling

SIZING MATH REQUIRES A COMPANION CHANGE TO MATHMAN (the other stuff doesn't)
  - clone git clone ssh://<yourid>@gerrit.instructure.com:29418/mathman
    and follow the instructions for building.
  - checkout https://gerrit.instructure.com/c/mathman/+/277389
  - build it (once built, you don't have to run in in docker)
  - in a canvas rails console:
    Setting.set(
      'equation_image_url,
      'http://localhost:8000/svg?tex='
    )
    http://localhost:8000 is where mathman is via `node app.js`
    it's at http://mathman.docker if in docker (at least that's
    what the README says, I don't really know)
  - test mathman by requesting `http://<mathman-url>/svg?tex=17`
    and expect an image of "17". now try with `request /svg?tex=17&scale=2`
    and your "17" shoul be twice as large.
  - restart your canvas server

test plan:
  Updated typesetting:
  - have a question_bank quetsion with math and answers with math
  - include the question in a quiz
  > verify that the question looks the same in the question bank
    as it does when previewing/taking the quiz
    - if your math includes a "g", it should look the same
    - the size of the equation should be pretty close
  Sizing to match:
  - turn on scale_math_equations site admin feature
  - put an equation w/in a paragraph with a large font, or
    add an equation to the rce, select it, and change the font size
  - click on the equation, edit equation, click insert equation
    w/o changing anything
  > expect the equation to match the larger font.

  - extra credit: DO THIS WITH AND WITHOUT MATHMAN PLUGIN ENABLED
    (yes, there are 2 paths canvas takes to mathman)
    make sure to update dyanmic-settings.yml's math-man entry
    math-man:
      base_url: 'http://localhost:8000'
      use_for_svg: 'true'
      use_for_mml: 'false'
  - at /plugins, enable mathman plugin and ensure use_for_svg istrue

  Error handling:
  - change the URL to mathman to a dead end
  - load a page with math equation images
  > expect the math to be typeset by mathjax

Change-Id: I354e98a0a0256740ce5b4937f5b4e3adc690fe51
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277245
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: David Lyons <lyons@instructure.com>
2021-11-09 19:28:42 +00:00
Cody Cutrer 5deb17ec1c bump nokogiri
and gems that have strict dependencies on it

needed to rework BasicLTI::BasicOutcomes to avoid YAML serializing
Nokogiri::XML objects, since it will now raise an exception when
trying to deserialize. it didn't need them before, I just needed
to adjust the call to be a class method to avoid bringing along
the unnecessary context

also, nokogumbo was folded into nokogiri as of 1.12, so no need
to have it explicitly

Change-Id: I6f95ee897f4764b9703d4f09ff3182710a267c6f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274652
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-09 16:39:39 +00:00
Cody Cutrer 42bffa8b21 cdc: improve reliability of fixture creation
Change-Id: I4c458ab1a79ffba18eaec2bf732727f125650d62
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277645
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 23:41:05 +00:00
Cody Cutrer 9075b1d8b2 cdc: allow fixtures from plugins
Change-Id: Ife6b1730605f098c2b8d930d5f7b26ea553eb1a9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277642
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 23:17:29 +00:00
Evan Battaglia ef49dce47f Fix duplicate tools shown at pagination breaks
fixes INTEROP-4606
flag=none

Given "Tool 1" is the last tool on a page, Canvas currently uses the
downcase'd name for the bookmark, e.g. "tool 1". When using the bookmark
(in restrict_scope()), The collation key for the tool in the database
(collation key for "Tool 1") is greater than the collation key for "tool
1", so it is included in the output for the second page as well.

I thought at first we could just not downcase the tool name in
bookmark_for().  However, for the tools page, we create bookmarkers for
the LTI 2 tools and LTI
1 tools and merge them by comparing the bookmarks for each object.

So the essential problem is: merging bookmarks needs to use same
collation technique as fetching. Canvas::ICU() appears to be _mostly_
the same collation algorithm as postgres uses, with these exceptions:
* I found a Unicode collation test and did find some _extremely_ rare
  characters that caused different orderings between Canvas::ICU() and
  public.collkey(), but I'm confident they would never be used in an LTI
  tool name and probably almost never any text of any language.
* We may soon be moving from public.collkey() to COLLATE
  public."und-u-kn-true" but I tested these too and it only differs for
  extremely rare characters.
* I did not test different locales.

However, the worst-case scenario is the bookmark merging doesn't get the
last key in the PG collation and we get duplicates again; we would never
skip (not show) any tools in the pagination.

Test plan:
- Have some tools with both lower- and upper-case letters, ideally a mix
  of LTI 1 and LTI 2 tools.
- Open ui/features/external_apps/react/lib/ExternalAppsStore.js and edit
  the PER_PAGE constant to force a page break before the end of your
  tools. Break in a place near the tools with both lower- and upper-case
  letters.
- Open the Apps listings page in account or course settings and make
  sure there are no duplicate tools listed where the page breaks (two
  different API calls are made).
- For the ultimate test try changing PER_PAGE to 1 and make sure the
  tools are still in the same order and there are none skipped or
  duplicated

Change-Id: I3169692a16f9bc0eac7bdbba94beebf73df6490d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276660
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2021-11-08 22:58:33 +00:00
Cody Cutrer 005b2d283a add file to easily require all the fixtures for CDC tests
Change-Id: Ib882cced423b8696b32a0eba3c5fcde5fea78cc7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277612
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 19:53:43 +00:00
Cody Cutrer 34d15f5e08 RuboCop: Lint/Void
[skip-stages=Flakey]

all manual

Change-Id: I28e1f1528640da64269ae5ad046215b1ad54ceea
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277556
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 15:50:45 +00:00
Cody Cutrer 20533e467f RuboCop: Lint/NoReturnInBeginEndBlocks
all manual

Change-Id: I55146b72afcf57838123736cb91976ee8649357b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277555
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 15:50:27 +00:00
Cody Cutrer bb9fe29416 RuboCop: Lint/IneffectiveAccessModifier
all manual

note that for any methods moved/re-indented, I made no other changes
(except possibly a remove of a `self.` on a method call to call another
now-private method) for ease of review

Change-Id: I0cca6644264a0b46a45a1a5c99021c9deb64fca0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277532
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 15:50:15 +00:00
Cody Cutrer 7e7bc924b7 RuboCop: Lint/MissingSuper
all manual

Change-Id: Ibc71a5265c81359925c7819ea694f3cb7cc3e542
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277540
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 14:15:35 +00:00
Cody Cutrer 78ab4aa3ab RuboCop: Lint/AmbiguousBlockAssociation
[skip-stages=Flakey]

all manual

Change-Id: I6098510885677b3da681de65e4ef07f7684fdefa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277445
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-08 14:12:46 +00:00
Cody Cutrer 9652bee370 RuboCop: Lint/DuplicateMethods
all manual

Change-Id: Ib24846f21531d23d4908f40c037ad073613516fc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277545
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-05 23:18:28 +00:00
Alex Slaughter 85108b92ba move inst_access to gem
This moves the inst_access gem to the public repo and references
the now published inst_access gem instead.

Github:
https://github.com/instructure/inst_access

Rubygems.org:
https://rubygems.org/gems/inst_access

Test Plan:
 - Specs pass

flag = none

Change-Id: I6002b118723e5a329202085a6c649a857e34d0e3
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277527
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-11-05 19:47:46 +00:00
Cody Cutrer 990aed867d RuboCop: Lint/EmptyBlock
[skip-stages=Flakey]

all manual

Change-Id: Ief093aaeec2e996caae47c86c84b9c97486cff7c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277466
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-04 21:38:32 +00:00
Cody Cutrer 3474d36533 RuboCop: Lint/DuplicateBranch
all manual

Change-Id: Iafce1417d95b0d590774f55c769f2abeb139ea96
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277367
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-11-04 20:02:10 +00:00
Cody Cutrer 649e5b36a2 RuboCop: Lint/ShadowingOuterLocalVariable
[skip-stages=Flakey]

all manual

Change-Id: Ieb74efcd4206426973dd72eb2ca7c5f5af5167f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277394
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-04 14:02:24 +00:00
Cody Cutrer 6f0b6ac899 RuboCop: Lint/ConstantDefinitionInBlock spec/[a-l]
[skip-stages=Flakey]

all manual

the fixes are a little scattered, since the same method doesn't work
everywhere depending on requirements. mostly I changed to `let`, but
some required `stub_const`. For `let`, I eventually settled on
avoiding a dedicated `let` for the class if it's only used one, and
it's a trivial class just to include the module. otherwise there's
a separate `let` for the class, and if there's only one it's named
`klass` instead of something contrived.

Change-Id: I84734c963d4789be3ec3cd852cca623e7c2a08df
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277285
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-03 16:24:08 +00:00
Ethan Vizitei c0f7b567fa no need to reset column info on unloaded models
refs FOO-1786
flag=none

TEST PLAN:
  1) specs pass

Change-Id: I4dfdf06a46a4caaf1e71feaa96066cf460fb7a3b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277253
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-02 17:00:28 +00:00
Cody Cutrer 0321c40e94 RuboCop: Lint/ConstantDefinitionInBlock app, config, gems, lib
all except for spec

all manual

Change-Id: I8d4f118598ad7521b705a52d1133097b17f94393
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277228
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-11-02 01:34:48 +00:00
Mysti Lilla cd9c592f03 Ensure student view can see quizzes
fixes INTEROP-7116
flag=none

Test plan
- Have a course with new quizzes set up
- Have a new quiz set up for testing
- Ensure student view student can see
  the quiz when the course is active
- The student view student should
  get a concluded message if the
  course is concluded

Change-Id: Id160cc51fe37337baf65c36e46ce9947a05c5776
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277149
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Alex Slaughter <aslaughter@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
2021-11-01 18:32:19 +00:00
Ethan Vizitei 89d76e1745 remove oauth shim
refs FOO-2476
flag=none

TEST PLAN:
  1) specs pass

Change-Id: I46962024463871f5afbb1c1518c5ef020905bf38
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277124
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2021-10-29 18:04:52 +00:00
Juan Chavez 3f8026e1b2 Fix RCE links for unpublished/date-locked files
fixes MAT-374

flag=none

test plan 1:
- Upload a pdf to course root folder.
- Set visibility of the file to unpublished.
- Create a page with a link to the file (using
RCE course links).
- Replace the pdf (same name, without changing
visibility).
- As a student, navigate to the page and click the
file link.
- Verify that there is no error and Canvas doc
viewer is opened (saying that the file is locked).

test plan 2:
- Upload a pdf to course root folder.
- Set visibility of the file to date-locked.
- Create a page with a link to the file (using
RCE course links).
- Replace the pdf (same name, without changing
visibility).
- As a student, navigate to the page and click the
file link.
- Verify that there is no error and Canvas doc
viewer is opened (saying that the file is locked).

Change-Id: I91c79dd1ec1ab362eb387ac39dab9a638fc275f0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275803
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Juan Chavez <juan.chavez@instructure.com>
2021-10-28 18:58:27 +00:00
Syed Hussain c8d08f5b4e Include student first/last name in gradebook export
Gradebook csv export should work for both student name or
separate first and last names

closes EVAL-1989
flag=gradebook_show_first_last_names

Test plan:
With the siteadmin FF ON, and the account admin setting to allow
showing student first/last names enabled, as a teacher:

1. Select "Split Student Names" option from the view options menu
2. Verify the gradebook grid shows separate columns for student
last and first  names
3. From the gradebook actions menu, select export
4. Verify the exported csv has values for student last and first
names (in this order, comma separated) and rest of the values are
correct.
5. Unselect the "Split Student Names" option
6. Verify the grid has 1 column for student name
7. Export the csv, and verify the csv has 1 column for student
name and rest of the values are correct

Change-Id: Ia38e9d47333414e3fdac67eddc820547126ea345
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276073
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
2021-10-28 17:35:35 +00:00
Cody Cutrer a0a399136a RuboCop: Lint/UnusedBlockArgument config,doc,gems,lib
all manual

Change-Id: I8bb9c11634b0e2b2c8a79dd6f8f2cb71eaa90450
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276628
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 22:30:15 +00:00
Marcus Vinicius Pompeu d97ffa57a8 Make outcome_imports endpoint aware of the parent group
closes OUT-4768
flag=improved-outcomes-management

Test plan:

  - Jenkins verifies this (API change only)

Change-Id: Ib41277d66c1e81b9d7ff7c1b94fe5a521b2552d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274606
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Watson <bwatson@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Kyle Rosenbaum <krosenbaum@instructure.com>
2021-10-27 15:57:14 +00:00
Cody Cutrer aee91b708e RuboCop: Lint/UnusedMethodArgument app/models
all manual

several instances I noticed that the entire method was unused, so removed it

Change-Id: I14ffe7d4b6966ee790e32410f1dbaf5b26ea7f21
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276513
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:55:26 +00:00
Cody Cutrer 61e5b3a6dc RuboCop: Lint/UnusedMethodArgument lib
all manual

Change-Id: I0db0dbf9ffec3ac6675f6d159f8d038fe2f09256
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276489
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:54:27 +00:00
Cody Cutrer 44614b47d7 RuboCop: Lint/UselessAssignment app, config, doc, gems, lib
(everything except spec)

all manual

Change-Id: I6c49a3139efb0f0802ba63a15cab4d4d2cd0b8dd
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276310
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-27 15:36:29 +00:00
Keith T. Garner 19d9329411 add prioritizeNonToolGrade extension to grade passback
This flag is useful for if an LTI tool needs to provide a grade
passback, but would prefer to use the grade in canvas already if a
teacher graded via the gradebook instead of the tool.

An example of where this comes into play is if an LTI tool's grade
passback is delayed, during the delay a teacher manually grades in
canvas's gradebook, and then later the grade passback happens. We know
that certain institutions would prefer the teacher grade stay. (Why the
teacher is giving a different grade than the LTI tool? No idea.)

test plan:
 - specs pass

Change-Id: I2b166f892cc11bfc64522a850944a91aa4d94a96
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274389
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Susan Sorensen <susan.sorensen@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
2021-10-27 15:03:43 +00:00
Xander Moffatt 0a5c90cff2 process content items with line items
closes INTEROP-7069
flag=lti_deep_linking_line_items,lti_deep_linking_module_index_menu

why:
* a new addition to the IMS LTI spec is to accept line items as part of
a deep link response, and the Canvas way of handling line items is to
create an assignment

test plan:
* with a 1.3 test tool set up, launch the tool from either the modules
or assignment index menu (3-dot button in top right of page)
* fill in the line item box in the test tool with:
```
{"scoreMaximum":10,"label":"line item test","resourceId":"id","tag":"test"}
```
* fill in the available box in the test tool with:
```
{"startDateTime":"2021-10-18T14:32:07Z","endDateTime":"2021-11-18T14:32:07Z"}
```
* fill in the submission box in the test tool with:
```
{"endDateTime":"2021-11-18T14:32:07Z"}
```
* send the content items back to Canvas
* the page should reload
* you should have one new assignment, titled "line item test"
* it should be worth 10 points, and launch the test tool when opened
* it should unlock on Oct 18 and lock on Nov 18, and be due on Nov 18
* launch the tool from the index menu again and this time fill in the
line item box with:
```
{"label":"this should do nothing"}
```
* submit the content items back to Canvas
* the page should reload
* you should not have any new assignments, since scoreMaximum is a
required field and was not present

Change-Id: I5a7cd02f20da23f162efc7705ac1d98cf1bffe8b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/272069
Product-Review: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Alexandre Trindade <alexandre.trindade@instructure.com>
QA-Review: Alexandre Trindade <alexandre.trindade@instructure.com>
2021-10-26 23:18:51 +00:00
Ethan Vizitei 8aafc7d464 unconfuse OAuth::Helper references
refs FOO-2529
flag=none

TEST PLAN:
  1) sentry error goes away

Change-Id: I32305a316832fa21bd1edb8550cba309a3222c35
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276823
Reviewed-by: Ben Rinaca <brinaca@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-10-26 16:18:22 +00:00