Commit Graph

1657 Commits

Author SHA1 Message Date
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
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 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
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 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 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 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
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
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
Isaac Moore f94fe15d01 Add `locked_for_user` property to `observer_alert_json`
This change adds a new `locked_for_user` property to the Observer Alert
API to indicate whether or not a particular alert's context is "locked"
(e.g., invisible) for the calling observer. This can be set to `true` for
a number of reasons, but most commonly, the deletion of the content or
the conclusion of the course.

closes LS-2668
flag=none

test plan:
- create an observing enrollment for a student enrolled in a course
- using the API, as an observer, create an observer alert threshold for
  a high assignment grade for your student (see the bottom of the commit
  message for an example request)
- as a teacher, enter a grade for the student in the course above the
  value you set in your threshold
- call the `/api/v1/users/self/observer_alerts/<student_id>` endpoint and
  verify an alert appears, and `locked_for_user` is false
- set the course end date to the past, and restrict students from viewing
  the course after the end date
- call the API again, and verify `locked_for_user` becomes true
- revert your change to the course end date
- call the API again, and verify `locked_for_user` becomes false
- delete the assignment
- call the API again, and verify `locked_for_user` becomes true again

### Example threshold creation request:
```
curl --request POST \
  --url http://<canvas URL>/api/v1/users/self/observer_alert_thresholds \
  --header 'Authorization: Bearer <your token here>' \
  --header 'Content-Type: application/json' \
  --data '{
	"observer_alert_threshold": {
		"alert_type": "assignment_grade_high",
		"threshold": "90",
		"user_id": <your student's user id>
	}
}'
```

Change-Id: Ifc0775c70a0e0cb6bf66c5e60968013a91661eb9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276187
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2021-10-20 22:54:45 +00:00
Jackson Howe 60f3a182fe Tweak zoom/webex regex to allow '-' in url
fixes LS-2752
flag = none

Test plan:
 - Add a link like https://instr-ucture.zoom.us/j/9585021282 (with a
   hyphen) to a k5 subject calendar event location or description
 - Visit the planner
 - Expect to see a join button

Change-Id: Iac43b8bc15eada834bdc71054e3f239d253e4aee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276272
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
2021-10-19 19:43:13 +00:00
Rob Orton 4c14d0fdf1 don't join cross shard for discussion_topics
test plan
 - specs should pass

fixes VICE-2164
flag=none

Change-Id: I3be48a2d4500dc7377ec274d9a6a87c01130f725
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275553
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Drake Harper <drake.harper@instructure.com>
QA-Review: Drake Harper <drake.harper@instructure.com>
Product-Review: Drake Harper <drake.harper@instructure.com>
2021-10-18 15:47:51 +00:00
Eric Saupe 36ebfea4ec Fix inconsistent can_submit value
fixes LS-2679
flag=none

test plan:
- Create a published course with a student enrolled
- Create and publish an assignment
- Create a module and leave it unpublished
- Check the API for the assignment for the student with
include[]=can_submit in the request like this,
api/v1/courses/:course_id/assignments/:assignment_id?include[]=can_submit&as_user_id=:user_id
- Verify the can_submit value is true
- Add the assignment to the module
- Verify the API response for can_submit is false
- Publish the module
- Verify the API response for can_submit is true

Change-Id: Ife6ce897bf52c990ad6bdd3a7d7d5787dda069dc
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275985
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-10-15 19:33:05 +00:00
Spencer Olson 734344eaff fix speedgrader status menu with anonymous assignments
closes EVAL-1995
flag=edit_submission_status_from_speedgrader

Test Plan:
1. Enable "Edit Submission Status from Speedgrader".
2. Create an anonymous assignment.
3. Go to SpeedGrader and change a student's status (i.e. Late, Missing,
   Excused, or None) using the select menu. Verify the request succeeds
   and the status is updated.
4. Create an assignment that is not anonymous.
5. Go to SpeedGrader and change a student's status using the select
   menu. Verify the request succeeds and the status is updated.

Change-Id: I949648b7a2c78e01642d0c73298995acb3e4e7d6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275004
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Eduardo Escobar <eduardo.escobar@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2021-10-14 16:19:50 +00:00
Spencer Olson 41b9a6e4cc add annotatable_attachment_id to assignment json
closes EVAL-2025
flag=none

Test Plan:
1. Verify the /api/v1/courses/:id/assignments and
   /api/v1/courses/:course_id/assignments/:id endpoints return
   annotatable_attachment_id on the assignment.

Change-Id: I740c71adcb30f472ca44b2ef9e30ef1ac3321e54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275737
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Syed Hussain <shussain@instructure.com>
QA-Review: Syed Hussain <shussain@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-10-13 15:48:39 +00:00
Jonathan Guardado c8fe6426dd Observer grades touch-ups
The "View feedback" link was fixed, passing the right user as a prop
to the GradeRow component

The discrepancy in the totals was due to the grading period wasn't
being propagated until the observed users score calculation, which
caused the API to return the totals for the complete course instead
of the ones for the grading period, now this parameter is included in
the operation and the totals match with the scores in the student
view

closes LS-2690
flag= k5_parent_support

Test plan:

"View feedback" link:
- Enroll a student to a course
- Link the student to an observer
- As a teacher, create an assignment in the course
- As the student, submit the assignment response
- As the teacher, leave some comments to the student submission
- Log in as the observer and go to the Subject grades tab
- Click on the View feedback link
- Expect to be sent to the observed user submissions

Discrepancy in the totals:
- Log in as the observer and go to the Subject Grades Tab
- Select an Student
- Select a grading period
- Expect to the totals be the same as if you were logged as the
selected student

[pin-commit-multiple_root_accounts=87eb5358ec946ae0c3d9c2d8df9d298a5d51fd89]
[pin-commit-analytics=8980785704bdbf128375dfc7a5beec879d3129e3]

Change-Id: I4c2e33446d9bef24d0de24a7397263f67d229163
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275182
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-10-12 20:56:33 +00:00
Drake Harper f3355037ec Add student reporting setting to course
refs VICE-2009
flag=discussions_reporting

Test Plan:
 - specs should pass
 - make a get request to
    http://127.0.0.1:3000/api/v1/courses/<insert course id>/settings
 > should see “allow_student_reporting” as true in response unless
    changed in UI

Change-Id: Ie6c999e573e95303a4e1c9dff6917d1576510e03
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275397
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Davis Hyer <dhyer@instructure.com>
QA-Review: Davis Hyer <dhyer@instructure.com>
Product-Review: Davis Hyer <dhyer@instructure.com>
2021-10-11 22:05:22 +00:00
Ethan Vizitei 17a887bc53 rename CSVWithI18n to inflect properly for zeitwerk
refs FOO-2474
flag=none

TEST PLAN:
  1) specs pass

Change-Id: If8e9580fbf76a001f5765dcce9080daff66dba38
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275610
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-11 18:52:05 +00:00
Mysti Lilla 377d4eb438 Add developer key ID to external tool JSON
flags=none

Test plan
- Load up an LTI 1.3 external tool in the API
- See the developer_key_id

Change-Id: I00c277be71c7c1c9056c17a3f6bd3906708c60bb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275467
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: Connor Merchant <cmerchant@instructure.com>
2021-10-08 17:36:52 +00:00
Syed Hussain 2aafd53a2a Return last and first name in users request
Include last_name and first_name in api/v1/courses/course_id/users
response optionally if requested

closes EVAL-1991
flag=none

Test plan:
- Make a call to "api/v1/courses/course_id/users with
include: ['last_name', 'first_name']
- See that the response contains the last_name and first_name
fields
- Make the same call without include and make sure the fields are
not present in the response

Change-Id: I606e6c628858311588184537ec48217b8660d262
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274868
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
QA-Review: Eduardo Escobar <eduardo.escobar@instructure.com>
2021-10-05 15:53:54 +00:00
Mysti Lilla c2970e02bf Add webhook subscription info to submission
flag=none

Test plan
- Install an LTI tool proxy that does
  plagiarism
- Submit an assignment as a student
- Load /api/v1/courses/:course_id/
  assignments/:assignment_id/submissions
  /:user_id?include[]=webhook_info and
  verify that you can see the
  webhook_info in the API call
- Make sure you don't see it anywhere
  without the webhook_info includes
  flag (check as many submissions
  APIs as you can remember)

Change-Id: I6113128cae9c3184d73437bc97935a2d4e33fcee
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274333
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-10-04 18:13:21 +00:00
Cody Cutrer 6e04277c3a add declared_user_type
closes FOO-2318, FOO-2319, FOO-2320

test plan:
 * verify that /api/v1/users/self/logins includes the declared_user_type
 * use PUT /api/v1/users/self/logins/:id to update the declared_user_type;
   verify it changes

Change-Id: I1e43ab6ead5515b113b1949bdda544b2b5c6834f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273647
Reviewed-by: Simon Williams <simon@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-09-30 21:51:07 +00:00
Mysti Lilla e13d35a431 Add tool proxy subscription info to assignment with include
flag=none

Test plan
- Set up an assignment with a Plagiarism tool proxy
  (one with a subscription would help :) )
- Load an assignment with the API (most routes should
  work, but try api/v1/courses/:course_id/assignments/
  :assignment_id?include[]=webhook_info)
  (There isn't a good way to avoid n+1s on this, so
  I didn't actually try.  I'm not that worried, since
  I'm not adding this to the API documentation, but
  people should avoid doing this on a list of assignments
- Verify you can see the current subscription info on
  the assignment

Change-Id: I7647ef7d05b8766e8936dbb6ef72ec4d4abbe746
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273929
Product-Review: Karl Lloyd <karl@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-09-30 19:37:30 +00:00
Cody Cutrer b973c7ca27 RuboCop: Style/ParenthesesAroundCondition
[skip-stages=Flakey]

(auto-corrected)

this complements Lint/AssignmentInCondition

Change-Id: I8e621631cb8565cc6062398cfab714f61b485cad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274747
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-09-30 12:59:18 +00:00
Cody Cutrer 58d528037e RuboCop: Lint/AssignmentInCondition
[skip-stages=Flakey]

(manual)

Change-Id: I855b13a7888f4926df42fe6306cc248e611efdf6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274712
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-09-29 03:38:39 +00:00
Cody Cutrer dbd8c46655 RuboCop: Lint
[skip-stages=Flakey]

auto corrections applied:
 * Lint/AmbiguousOperator
 * Lint/AmbiguousOperatorPrecedence
 * Lint/AmbiguousRegexpLiteral
 * Lint/DeprecatedClassMethods
 * Lint/DeprecatedOpenSSLConstant
 * Lint/NonDeterministicRequireOrder
 * Lint/ParenthesesAsGroupedExpression
 * Lint/RedundantRequireStatement
 * Lint/RedundantSafeNavigation
 * Lint/RedundantSplatExpansion
 * Lint/RedundantStringCoercion
 * Lint/RedundantWithIndex
 * Lint/SendWithMixinArgument
 * Lint/SymbolConversion

Change-Id: I222ec19978033544513bb99755994d109435abad
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274551
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-09-29 03:38:23 +00:00
Cody Cutrer c65d57737a RuboCop: Layout lib
Change-Id: I0655d9a9d750f2debd6378b03d8ddc1403ebc31b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274158
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-09-22 20:01:52 +00:00
Jackson Howe 2d2a324f65 Add some new conferencing providers
Add regex to support extracting join links from Teams, Webex, and
Google Meet. Reserving the DynamicSetting for on-the-fly changes.

refs LS-2618
flag = none

Test plan:
 - Make a calendar event in a k5 course with a Teams/Webex/Meet url
   in the location or description.
 - View the planner as a student - expect to see a join button that
   opens the conferencing provider.

Change-Id: I3c60bd3f33e03a5306cc01f86614fac640ac4ced
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273445
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-09-15 19:04:16 +00:00
Dustin Cowles b273c8a5be do not include rubric with assignment in api when rubric.deleted?
Currently if there is an active association for a deleted rubric, the
rubric will be included with the assignment by default. This change will
check if the associated rubric is deleted and will not include it.

closes EVAL-1951
flag=none

Test plan:
- PreReq: PostMan with authenticated session
- Create a course with an assignment with an associated rubric
- Call api/v1/courses/{{CourseID}}/assignments/{{AssignmentID}}
- Observe 'rubric' key in response contains the associated rubric
- Set rubric.workflow_state = 'deleted' (do not call rubric.destroy!)
- Call api/v1/courses/{{CourseID}}/assignments/{{AssignmentID}}
- Observe no 'rubric' key in the response

Change-Id: I4456ef61fdc1be4ebea9d8c70fa480470f670a32
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273320
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@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>
2021-09-15 16:05:46 +00:00
Math Costa c490de0a4d Supress graded badge for hidden grades
fixes: LS-2587
flag=none

test plan:
1. Have a published course, a published assignment and a student enrollment
2. Set the assignment or course grade posting policy to manual
3. As the student, submit the assignment
4. As yourself, enter a grade for the submission and ensure that the grade is hidden
5. As the student, choose 'list view' from the dashboard
6. Look at the assignment on that list and check the 'graded' stamp is not present

Change-Id: I67006d974d9cd1abcc98d61e666ba646753deb61
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273295
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
2021-09-13 16:32:59 +00:00
Jon Scheiding c2279a1820 Add rewriteUrls parameter for GQL
fixes MAT-406
flag=none

Allows GQL API types to expose an option for the client to request
not to rewrite relative URLs into absolute ones in user content.

Also specifically adds this option for the SubmissionDraft GQL API.

test plan
- Navigate to Student View for an Online Text Entry assignment in a
  course with Assignment Enhancements enabled
- Switch the RCE to HTML view and enter the following HTML:
  <img src="/some_image.jpg" />
- Observe the "Draft Saved" notification at the bottom
- Refresh the page
- Verify that the submission HTML has not changed
  (in production, you will see that it changes to
  <img src="https://myusername.instructure.com/some_image.jpg" />)

Change-Id: I3437683f2f3a1915d03d1374d2d499bb3daf9a3f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271886
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Jon Scheiding <jon.scheiding@instructure.com>
Tested-by: Jon Scheiding <jon.scheiding@instructure.com>
2021-09-09 18:05:29 +00:00
Simon Williams f74c14684b use a separate manage_assignments_edit flag when ff is on
refs FOO-2226
flag = granular_permissions_manage_assignments

I originally intended to keep the original manage_assignments permission
and use it when the flag was on for edit/manage specific permissions,
but this made labeling and documentation difficult, especially since our
rollout strategy for this flag is gradual rather than all at once. So
this commit shifts gears to create a separete granular edit flag and
only use the old permission when the flag is off.

test plan:
- labeling and documentation on the account permissions page should be
  clearer and make more sense
- everything should continue to work as before

Change-Id: I93e4cbe0daa319217e17007e3391f905f1a9d77d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273020
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-09-08 20:58:12 +00:00
Ryan Hawkins 7b13cda89c Fix Custom Params Edit and Publish Bug
Previously, when publishing an assignment that uses an LTI 1.3 tool with
custom parameters for submission, the custom parameters would disappear.
This was caused by a difference in format from the GET Assignment
endpoint vs. the PUT and POST Assignment endpoints.

This commit updates these endpoints so they now send and expect the same
format, which is also now documented. In addition, the Assignment Edit
and New page was updated to switch to this new format.

Lastly, the previous existing specs were moved and adapted to more
directly mimic a direct API call, rather than just testing the logic
itself. This means we now have more thorough tests that run almost as
fast as the old ones! A SET's true dream.

closes INTEROP-6929, INTEROP-6930

flag = none

test-plan:
* You'll need the LTI 1.3 Test Tool for this. Install it and make sure
  it has the Assignment Selection placement.
* Create a new assignment that uses the LTI 1.3 Test Tool for
  submission. When you're configuring the tool in the assignment, give
  it some custom parameters to save. Use custom parameters for now.
* Save that assignment and make sure the custom parameters you entered
  get saved as well. The most thorough way is to launch the tool and
  make sure they got sent in the JWT.
* Go to the assignment index page and publish the assignment you just
  created. Launch the tool again and make sure the custom params are
  still there (that was the first bug)
* Create another assignment, also with the test tool and custom
  parameters and just save it.
* Go to the assignment index page and then edit it from there.
* Launch the tool again and make sure that the custom parameters are
  still there (that was the second bug)
* Create another assignment, same as before, but save and publish it
  this time. Make sure the custom params are still there when you launch
  the tool.
* Celebrate!

Change-Id: I3bbe3fd92c3b7b2fc34e95bcb2b547d2834ca49a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271674
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Ryan Hawkins <ryan.hawkins@instructure.com>
2021-09-02 22:42:21 +00:00
Gary Mei 180082b46a add Send To and Copy To functionality to files
closes MAT-187
flag=none

Test Plan
- Have two courses.
- Have two teachers, one enrolled in the first course and the other
  enrolled in the second course.
- Create a course file at the root level in the first course.
- Create a course file nested in a folder in the first course.

- Send the two files from the first course to the second teacher.
- Verify that the content shares appear for the second teacher.
- Verify that the content shares can be previewed with a Common
  Cartridge viewer.
- Verify that the content shares can be imported into the second
  course, with the folder hierarchy preserved.
- Delete the two imported files from the second course.

- Copy the two files from the first course to the second course.
- Verify that the two files are imported into the second course, with
  the file hierarchy preserved.

Change-Id: I8fa74f0fe175498f2fb73583ae06181356b684a5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270708
Reviewed-by: Jon Scheiding <jon.scheiding@instructure.com>
QA-Review: Jon Scheiding <jon.scheiding@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Gary Mei <gmei@instructure.com>
2021-09-02 19:41:23 +00:00
Ed Schiebel 8af5a65c6d Add a "join" button to planner calendar events with a zoom link
closes: LS-2505
flag=none

test plan:
  - create some calendar events:
    1. an all day event, one today, one another day
    2. an event with start time and no end time,
       one today with the start time before "now",
       one with the start time after "now"
    3. an event with start and end time
       one with "now" between start and end time
       one where it's not
    some with zoom link in description, some in location
    use your parsonal zoom meeting
    use a zoom link from google calendar
    use whatever zoom link you can find

  with canvas for elementary off
  - load the planner
  > expect no "Join" button

  with canvas for elementary on
  - load the planner
  > expect to see a "Join" button on each of the events
  > expect the Join button to be green for events that are
     currently active
  > expect teh Join button to be grey for events that are
     not currently active
  - shrink the window
  > expect the layout to accomodate the smaller screen size
  > expect screenreaders to distinguish between active and
    scheduled online meetings when reading the Join button

Change-Id: Icd0df43010b42dcc83fab2a11f8d206da9001190
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271818
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-08-23 16:11:19 +00:00
Eric Saupe 5d51f78135 Separate feature flags into settings and features
fixes LS-2468
flag=feature_flag_filter

test plan:
 - Enable the Feature Flag Filter flag
 - Flags should be organized first by Feature Option or Settings
 - Subcategories should be the applies_to category
 - Search should still work and hide anything that has no results
 - Filter pills should still work and hide anything that has no results
 - With the feature flag filter off the feature flags page should be
unchanged

Change-Id: I5473df54f1cb473b88a889bdec50316689617130
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271373
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-08-18 17:46:20 +00:00
Cody Cutrer 0847dc9670 allow suspending pseudonyms
where suspending means they still show up everywhere, but the user is no longer
allowed to login

closes FOO-2039

test plan:
 * have a regular user with an access token, and an active session
 * (via a separate session or access token) suspend a pseudonym
   via the API as an admin (logins API, set workflow_state to
   suspended)
 * ensure the original user gets logged out when they refresh, and
   that their access token doesn't work
 * but as the admin, you can still see the user

Change-Id: Idc0c61bcc244697e3c89b9beb2edfbe2a504b00e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269878
Reviewed-by: Simon Williams <simon@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-08-16 19:40:52 +00:00
Simon Williams 41eb604de0 remove unused feature_flag.development attribute
Change-Id: I49cec222286065ad95ea5bac3d473081576959e7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/271083
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-08-11 16:25:16 +00:00
Isaac Moore 9991f6df15 Remove calendar conferences feature flag
This feature is now permanently enabled.

closes LS-2483
flag=none

test plan:
- enable BBB (or another conferencing plugin)
- verify that events with conferencing can be created with (and appear
  correctly in) the simplified event creation modal
- verify that events with conferencing can be created with (and appear
  correctly in) the extended ("More Options") event creation view
- verify that events with a conference appear correctly in the calendar
- verify that when no conferencing plugin is enabled, or when within a
  non-course calendar context (such as a user calendar), conference options
  are not present, and event creation/modification still succeeds

Change-Id: Ic2a4bca772105b57869a4c9fd815b212d2275b83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270747
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
2021-08-10 20:46:47 +00:00
Jeremy Stanley 571017196d Canvas for Elementary: friendly course names
test plan:
 - in a course where C4E is enabled, there should be
   a "friendly name" option in course settings.
 - if a friendly name is set, it should be used on
   the dashboard, in important dates, in the
   filter calendars modal, and in email notifications
 - if C4E is turned off, the friendly name option
   doesn't appear and any name that was set
   there previously doesn't appear either

closes LS-2388

Change-Id: I245cac21d92f0f4b81c1598e24af6dbc7dcef807
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270755
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
2021-08-10 03:45:43 +00:00
Angela Gomba f9e593d422 Add friendly description to outcome_group_links endpoint
closes OUT-4472
flag=outcomes_friendly_description

test plan (referenced from g/268112):
- open network tab
- add a friendly description to a course outcome
that las learning outcome results
- visit the SLMGB for the course that has the learning
outcome results
  - if you don't have a course with results, import/create
  outcomes with a friendly description in your course
  and align these outcomes
  to a rubric within an assignment
   - add a student to the course
   - assess the student with the rubric to create
     learning outcome results
- verify friendly_description is present within
response["linked"]["outcome_links"]
- additionally, follow the test plan in g/262372 to
ensure it still works

Change-Id: Iba2e56c708beae761898c11a0f56e61e2f9f9b92
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270150
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Pat Renner <prenner@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Manoel Quirino <manoel.quirino@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
2021-08-09 18:07:43 +00:00
Eric Saupe 273e3630f5 Remove important_dates from Quizzes API
fixes LS-2418
flag=important_dates

test plan:
 - Enable the important dates feature flag
 - Have a C4E subject course
 - Creating a quiz via the API to the course does not throw an error
  when sending the quiz[important_dates]=true param

Change-Id: Id663260efc1a7f1f8613ce2dffdedda4b3954b2b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270804
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Nate Armstrong <narmstrong@instructure.com>
QA-Review: Nate Armstrong <narmstrong@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
2021-08-06 16:42:27 +00:00
Math Costa 8675ccb46f Remove course image feature flag
closes: LS-2417
flag=none

test plan:
- Confirm the course image feature behavers as expected

Change-Id: I3b4c2a204418562a25f0512104e3964082393bd7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/270197
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
2021-08-03 21:07:41 +00:00
Jeff Largent 0935fd13d9 Add C4E subject banner image setting
Allows users with admin rights over K5 subject courses to set a
separate image on the settings page to be used on the home page of the
course. If no banner image is set, then the home page will use the
card image. If no card image is set, then the home page will use the
course color. If no course color is set, then a defauly blue-gray
color will be used.

closes LS-2351
flag = none

Test plan:
  - Create a new subject in a C4E account
  - Expect the home page to show the course name on a gray background
  - Go to the settings page and select a course color
  - Expect the home page to show the course name of background of the
    color you just selected
  - Go to the settings page and upload an image for the Card Image
  - Expect that image to show on the home page
  - Go to the settings page and upload an image for the Wide Banner
    Image
  - Expect that new image to show on the home page
  - Go back to the settings page, click the upper-right menu on the
    Wide Banner Image, and choose "choose image"
  - Expect the replaced banner image to show on the home page
  - Go back to the settings page, click the upper-right menu on the
    Wide Banner Image, and choose "remove image"
  - Expect the banner image to no longer show on the home page
  - Go to the settings page of a course in a non-C4E account and
    expect the Wide Banner Image setting to not appear

BONUS POINTS:
  - Set up Unsplash at /plugins/unsplash
  - Set a Wide Banner Image on a C4E subject via Unsplash
  - Make sure replacing / removing images works with Unsplash urls as
    well as uploaded ones

Change-Id: I24c162fb142c8d57760a52abd67e17dd0c30dd18
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269902
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Peyton Craighill <pcraighill@instructure.com>
Reviewed-by: Jonathan Guardado <jonathan.guardado@instructure.com>
QA-Review: Jonathan Guardado <jonathan.guardado@instructure.com>
2021-07-29 16:28:16 +00:00
Eric Saupe 26010f52cc Add feature flag filtering and additional status
fixes LS-2389, LS-2401
flag=feature_flag_filter

test plan:
 - Go to the site admin feature flags
 - Verify the only filtering available is the search
 - Enable the Feature Flag Filters feature flag
 - Refresh the settings page and go to the feature flags tab
 - Verify there is an additional filtering field to filter by flag state

Change-Id: I27569f187310d7f74703ceb58e0e79ef3f217919
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/269638
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
QA-Review: Jeff Largent <jeff.largent@instructure.com>
Product-Review: Erin Hallmark <erin@instructure.com>
2021-07-28 19:08:35 +00:00