Commit Graph

1874 Commits

Author SHA1 Message Date
Cody Cutrer a75a8df919 allow looking up accounts by uuid
Change-Id: I00462e63141ca570769f4cd5cca7e4bd84563af8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260941
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-04-08 17:04:38 +00:00
Augusto Callejas 09ed9f1d5f Add source outcome group association
closes OUT-4354

flag=improved_outcomes_management

When importing a learning outcome group from one context
to another, its useful to know what group was copied from,
so this association will help us track that source.

test plan:
  - qa-cr

Change-Id: I642b1db42a685dbd81117c037443241b37b52ed7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262149
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Pat Renner <prenner@instructure.com>
Product-Review: Augusto Callejas <acallejas@instructure.com>
2021-04-07 18:26:44 +00:00
Cody Cutrer 83a1e99526 use add_reference in course templates migration
so that the FK will be created inline with the column

Change-Id: I099ba42ae2c8e77915082bd31964cb68c72da078
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262411
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-04-07 16:29:45 +00:00
Cody Cutrer 307dfe09b9 make course template migrations nicer to PG < 11
Change-Id: I78f55adb7dc2d607220b5e3aa8cc2ca392c704fb
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262340
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-04-06 22:25:34 +00:00
Simon Williams 6e877868be support both old and new postgres versions for new submission column
this migration was originally written with a backfill, but the
submissions table was large enough that the backfill was very slow. so
we changed to create the column with a default, taking advantage of
PG11+ ability to do this quickly rather than lock the table. But some
operators have not upgraded postgres versions yet, so let's support both
methods for now, while we work out a clear upgrade timeline.

Change-Id: I7e745c16ba162ab2740e9387e3138a7fca74df8c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261779
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-04-06 14:23:44 +00:00
Cody Cutrer 7f0db1bfac apply course template to newly created courses
closes FOO-1419

except for course copies

also had to loosen course copy and course audit records to allow for
course copies without a user (i.e. kicked off by the system)

test plan:
 * create a template course, with some content, and assign it to an
   account (you may need to do this in console)
 * create a new course in that account via various methods
 * the new course should always have content copied from the template,
   unless you created it via a course copy

Change-Id: I9ec7e2e8dea47ee24aac43ee291c477d80424736
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260809
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>
2021-04-05 19:56:05 +00:00
Jeremy Stanley 90e7ab67de drop unused visibility and manipulate columns from feature_flags
these were introduced as part of a major refactor that never
materialized. they have never been used.

closes LS-2098

Change-Id: I9c6711a9c2175f2e094d055f5d12fc21989c6d68
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262001
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-03-31 21:19:38 +00:00
Cody Cutrer 809904d8b6 add frozen_string_literal comment to migrations
Change-Id: Idf4ddb29567c1dfab9f01b09c7a1056367ae7b44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261814
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-03-30 18:14:36 +00:00
Michael Ziwisky 247d91a4d7 Set up replica identity index for EnrollmentState
also moves the RootAccountResolver specs out of enrollment_state_spec.rb
and into a more generic root_account_resolver_spec.rb

refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ia3ee89d63974e4c787ca8d1c6ab80eba5f54beb4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260526
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-29 16:59:02 +00:00
Michael Ziwisky 824502bb03 Set up replica identity index for RoleOverride
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: I944d86adc191e5cb18a2129546e1661ae6197b78
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260529
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-29 16:58:46 +00:00
Michael Brewer-Davis a9ff89f509 make LearningOutcomeResult soft-deleteable
refs OUT-4247

Test plan:
- ensure results from aligned rubrics and from quizzes
  are visible in the learning mastery gradebook

Change-Id: Ie9731f2c702f91b3da2ce4d8ae43f7045ee5509e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260613
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Brian Watson <bwatson@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
2021-03-23 17:16:41 +00:00
Michael Ziwisky a39a2e99cc Set up replica identity index for User
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ib309f1249a84d44492af8298d44fee3efa40992c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260534
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Michael Ziwisky <mziwisky@instructure.com>
2021-03-23 16:27:45 +00:00
Evan Battaglia 046a0ccb13 Add ms_group_id to microsoft_sync_groups
It turns out creating a Microsoft group for a course is a two-step
process; the easiest way to determine if both steps have run is to save
Microsoft's ID for the group one the model, and only save it once we
have run both steps.

flag=none
refs INTEROP-6567

Test plan:
- run migration up, observe new field in DB
- run migration down, observe field is gone

Change-Id: I46be7cce6555cdc8a91770fc13cd94ea9dec23b9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260506
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-03-22 16:30:58 +00:00
Evan Battaglia f32bf09676 MicrosoftGroup::UserMapping
closes INTEROP-6597
flag=none

Test plan:
- rake db:migrate
- try creating a MicrosoftGroup::UserMapping model. make sure Rails
  requires it to have both a root account and a user id (failing
  validation otherwise). Make sure Rails also fails validation if you
  try to create two records with the same user id and root account id.
- describe table (\d+ microsoft_groups_user_mappings) and check that
  root account id is non-nullable, the indexes look good,
  replica identity is on [root_account_id, id]
- Rollback migration (rake db:migrate:down VERSION=20210308210138) and
  check that table is gone

Change-Id: I2430eec8843494409e0026fbe761cc7945abf568
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260311
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2021-03-22 16:30:48 +00:00
Cody Cutrer 091ee63614 add course template columns
refs FOO-1682, FOO-1680

Change-Id: I646619d7b65b97c7c5a62091573d60ac5b541388
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260504
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
2021-03-19 18:07:48 +00:00
Michael Ziwisky f494cafcb2 Set up replica identity index for UserNote
refs FOO-1171
flag=none

[pin-commit-custom_reports=8f6d09124c5ddc197fb437a5d6dc72657ce86178]
[pin-commit-multiple_root_accounts=e3bbab4b0e0ae9420316ea5cbe601bd7a104a409]

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ib0a98b82a7fb758738fd5e33d18b0e21a4a255f5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260532
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2021-03-19 16:13:53 +00:00
Michael Ziwisky a437e76654 Set up replica identity index for EnrollmentDatesOverride
refs FOO-1171
flag=none

[pin-commit-instructure_misc_plugin=2a355a61125e91cccf377984902b3a15921e525d]

test plan:
 - migration works up and down
 - tests pass

Change-Id: I30820fda78adc1b2844a31be42eca88b02aefd60
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260525
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2021-03-16 20:19:36 +00:00
Michael Ziwisky 7ab57265c9 Set up replica identity index for UserAccountAssociation
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: I027da73a5ff87226206e3ba7b06618c0919ad8d1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260531
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>
2021-03-16 20:01:43 +00:00
Michael Ziwisky 2ac314bdfa Set up replica identity index for CourseAccountAssociation
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ib1e7f0cd2398c56fff8ec0208ace8a69a180a393
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260522
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>
2021-03-16 20:01:35 +00:00
Michael Ziwisky ca41fd8a4f Set up replica identity index for AccessToken
refs FOO-1171
flag=none

also don't backfill nulls if the column is already non-nullable

test plan:
 - migration works up and down
 - tests pass

Change-Id: I5009a2f31249643738f69a6b0d765daf89276165
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260519
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>
2021-03-16 20:00:56 +00:00
Michael Ziwisky 791498a14f Set up replica identity index for AccountUser
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ia7627b9fa46322307dc86e1ddf62be5246009ee7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260520
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-03-12 17:30:40 +00:00
Michael Ziwisky 36e86bbeed Set up replica identity index for CourseSection
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ife52db0c4540642424f1caf971ddd8d8c201a4b8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260523
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-03-12 17:30:25 +00:00
Michael Ziwisky 69d8e8af4c Set up replica identity index for EnrollmentTerm
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ibdad976f3333fa89d94b3721cd7706202d79c067
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260527
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-03-12 17:30:15 +00:00
Michael Ziwisky bc1fd177be Set up replica identity index for Course
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: I98a8b6964cdd155f131a4dc907fbf6c4dcbf157c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260524
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-03-12 17:30:04 +00:00
Michael Ziwisky 67040a0770 Set up replica identity index for Enrollment
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: Ia41fe9006fd2040137f1d160776578cea232920b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260528
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-03-12 17:29:51 +00:00
Michael Ziwisky e51be2293e Set up replica identity index for Pseudonym
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: I523528da85d0e3170e7b9d32b9e0a011987ae5d8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260533
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-03-12 17:29:04 +00:00
Michael Ziwisky c45c0acc6a Set up replica identity index for Role
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: I3a45025a1b8f178de84d9511b0efe56546d701f1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260530
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-03-12 17:28:55 +00:00
Michael Ziwisky d2e5c41180 Set up replica identity index for AssetUserAccess
refs FOO-1171
flag=none

test plan:
 - migration works up and down
 - tests pass

Change-Id: I9db3afcd14042cd997fa042b1ddd12b2cf0a3a5a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260521
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-03-12 17:24:48 +00:00
Gary Mei 3624ca554d add index for when canvadocs context attempt null
refs EVAL-1457
flag=annotated_document_submissions

Test Plan
- Specs pass.

Change-Id: I16321d4c9ac34b56f26b7a3f67ec2e16213151e1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260399
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Gary Mei <gmei@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-03-10 22:48:39 +00:00
Gary Mei 70cad93c82 add canvadocs_annotation_context
closes EVAL-1457
flag=annotated_document_submissions

Test Plan
- In a rails console, create 2 CanvadocsAnnotationContexts.
  ```
  CanvadocsAnnotationContext.create!(
    attachment_id: #{the_assignment_attachment_id},
    submission_id: #{submission_id},
    submission_attempt: #{1 and then 2}
  )
  ```
- Act as a student for the following steps.
- POST to
  api/v1/canvadoc_session?
    submission_attempt=1&submission_id=#{submission_id}
- With the returned url, open a Canvadocs session and make annotations.

- Repeat the previous two steps, with submission_attempt=2.
- Verify that annotations are persisted separately for each
  submission_attempt.

- Repeat, with submission_attempt=draft.
- Verify that annotations from the previous attempts do not cross over.

Change-Id: Id2e876e232fe4f5a5c1de91ad27c40314a4a7946
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258876
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Syed Hussain <shussain@instructure.com>
2021-03-10 21:05:34 +00:00
Evan Battaglia 01e87e81a3 Add MicrosoftSync::Group table and model
Does not contain UPN->AAD cache or member/admin aads, those will come
later if needed.

Test plan:
- rake db:migrate
- Check that root account id is non-nullable and there is an index on
  (root_account_id, id) (e.g. `\d+ microsoft_sync_groups`)
- check there is unique index on course_id
- Verify the replica identity for developer_key_account_bindings
  has been set to index (SELECT relname, relreplident
  FROM pg_class WHERE relname = 'microsoft_sync_groups';)
- Check that root_account_id is automatically added when you create a
  MicrosoftSync::Group
- Rollback migration (rake db:migrate:down VERSION=20210301174622) and
  check that table is gone

closes INTEROP-6558

Change-Id: I3250659e4e06c285ecf1b121b2078fb1051ae7be
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259734
Reviewed-by: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Evan Battaglia <ebattaglia@instructure.com>
2021-03-09 22:08:09 +00:00
Cody Cutrer 7574f599bb change backfill migration to just drop/add the column with default instead
it's much faster with postgres >= 11

Change-Id: Iba90373eaf6622c7b0e048bf898a9eea0fa15ac6
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260034
Reviewed-by: Rob Orton <rob@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-03-05 16:24:21 +00:00
August Thornton 1d016a31e5 add eportfolio account report
This adds an ePortfolio report that can be ran on a root account
or any sub-account. It defaults to giving a report of all active
eportfolios that reside under that institution. There is an
option to run the report to collect ePortfolios for users that
have no enrollments or just ePortfolios that are in a deleted
state.

closes FOO-1647
flag = none

test plan:
 • Navigate to Account Settings --> Reports
 • Verify the newly added "Eportfolio Report" appears
 • Clicking on the (?) gives further details about the report
 • There are two configuration options for the report
    - Only include ePortfolios from users with no enrollments
    - Only include ePortfolios that have been removed
 • The default report with no options selected will generate
   all active ePortfolios for the given institution
 • The first config option should only include ePortfolios from
   users with no enrollments
 • The second option should only include deleted ePortfolios
 • Using both options will generate a report of deleted
   ePortfolios from users with no enrollments

Change-Id: I9d8f4cdbe354a483380d8b80256cfb976fa5a953
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259515
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
2021-03-03 17:58:23 +00:00
Wagner Gonçalves b241135806 change resource link lookup_uuid uniqueness constraint
We're changing the uniquess constraint of lookup_uuid in favor a multiple
columns uniqueness constraint scoped to the context (context_id and
context_type).

refs INTEROP-6502
flag=none

test-plan
* specs should pass?

Change-Id: If2408b6677dd04439d8ef544ec6c864a212d90c1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258632
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2021-03-02 12:04:10 +00:00
Aaron Shafovaloff b19db4b7eb Teacher can create annotation assignment
refs EVAL-1363

test plan:
 - enable annotated_document_submissions flag
 - create new assignment
 - check "annotated document" under
   "Online Entry Options"
 - select a document
 - assignment should successfully save
 - assignment record should have annotatable_attachment_id field

flag=annotated_document_submissions

Change-Id: I5e90ca9c8f0b0501719cfe9e9d946be66fa899c5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258184
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
2021-03-01 20:05:53 +00:00
Cody Cutrer fa2975ed96 rename rails cache clearing migrations so they'll run again
Change-Id: Ifcdb0de1aa51f13490a8122c9155222fa024a49f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/259155
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-02-19 22:48:29 +00:00
Manoel Quirino Neto 2ddd5db18d Remove Common Core top-level display in Find Outcomes
closes OUT-4197
flag=none

Test Plan
- Make sure you don't see Common Core in Find Outcomes

Change-Id: I47f3ab90cc136e7b7d2206dcadaadd297cc8915b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257768
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Jody Sailor
2021-02-19 21:03:04 +00:00
Wagner Gonçalves 1eb9475aad persist resource_link_lookup_uuid at homework submission
closes INTEROP-6315, INTEROP-6319
flag=none

test plan:
* Have an LTI tool installed with homework submission and RCE editor
  placement enabled;
* Have a Course recorded;
* Have a Student enrolled to this Course;
* Have an Assignment recorded to this Course;
* Have LTI links added to the RCE editor in that assignment (later,
  we'll check if this link still working because we're changing the
  resource_link_lookup_id to resource_link_lookup_uuid LTI tool launch
  parameter)
* As a Student you should be able to access the Assignment to submit your
  homework. At the submission homework page you should be able to find
  LTI tool (usually rendered in a tab);
* Specify the custom params do you want to record, and submit it from the
  tool. You can add some comment too, and click to the submit assignment
  button;
* When accessing the Submission Details page you should be able to see
  that the tool was launched. At this point, the tool is launched via m
  eta refresh tag  https://www.w3.org/TR/WCAG20-TECHS/H76.html.
  You can check the application logs to see that a request was performed
  with resource_link_lookup_uuid parameter and you could check that the
  custom claim contains all custom params specified in the previous step;
* As a Teacher/SiteAdmin when accessing the SpeedGrader via Gradebook
  page you should be able to acces the homework submission via tray.
  After selecting the desired student you should be able to see the tool
  launched via iframe and the src URL should have the
  resource_link_lookup_uuid (I did this by inspecting the HTML elements)
  parameter. You should check if the custom claim has all expected
  parameters;
* You can Re-Submit a homework with different custom params to check
  that the custom claim was changed and was generate a new resource link
  (resource_link_lookup_uuid);
* Check if the LTI links added to the RCE editor still working;
* Add new links to the RCE editor and check if is working as expected;

[fsc-timeout=30]

Change-Id: I00c2bcdc02c7a5134efff1deff836657071067fa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256716
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-02-19 17:58:11 +00:00
Weston Dransfield 1499dfd03c Support custom params at collaborations placement
Closes INTEROP-6440,INTEROP-6441
flag=none

Test Plan:
- Use a 1.3 tool to do a deep linking response
  at the `collaborations` placement that includes
  custom parameters
- Verfy a collaboration is created
- Verify clicking on the collaboration launches the
  tool and includes the custom parameters
- Check for regressings with LTI 1 by creating a
  collaboration via an LTI 1 content item selection
  response

Change-Id: I935bdd38802f4d4204c494d6139cf8d5147fe806
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257063
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Wagner Goncalves <wagner.goncalves@instructure.com>
QA-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2021-02-19 17:56:47 +00:00
Wagner Gonçalves c836fea722 part 4: change lookup_id and resource_link_id to UUID datatype
This is part 4 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links. We're removing
the old columns and add a not null constraint to the new columns.

refs INTEROP-6488
flag=none

test-plan:
* Before running the migration, you should create assignments with
  an external submission tool and persist the custom params, as we did
  here https://gerrit.instructure.com/c/canvas-lms/+/256029 to check
  later if everything is working fine;
* You should execute the migration and none errors should be raised;
* You should check if LTI is launching as expected in the assignments
  created before;
* You should check if the tool is saving the resource link properly for
  new assignments;

Change-Id: Ibfe43519462eaae88aee00de2ca307df111fc7d5
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258268
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2021-02-18 17:47:51 +00:00
Augusto Callejas 92e03a64cd Allow reassignment from SpeedGrader
closes OUT-4033

[fsc-timeout=50]

flag=reassign_assignments

This feature allows teachers to reassign an assignment
to a student after they've submitted to the assignment
and the teacher has provided feedback via comments.

The reassignment will appear in their planner with
a "Redo" tag visible next to the assignment.

Only supports assignments of submission type "Online".

test plan:
  - enable "Reassign Assignments" feature option
  - in a course, create a student account
  - as a teacher, create an assignment with a due date
  - as a student, confirm the assignment appears in
    their planner
  - as a student, submit to the assignment
  - as a teacher, open the submission in SpeedGrader
  - reassign the assignment to the student by:
    * adding a comment to the assignment
    * clicking the "Reassign Assignment" button
  - as a student, confirm the assignment appears
    with a "Redo" pill in the planner, along with
    the comment from the teacher
  - as a student, resubmit to the assignment and
    confirm the assignment shows as completed again
    in the planner without the "Redo" pill
  - repeat the above steps, except with an assignment
    that has "Anonymous Grading" enabled and it should
    behave in the same way
  - repeat the above steps but with more students and
    no due date on the assignment, but with various
    assignment overrides with due dates and some students
    assigned to those overrides (using course sections)
    and confirm the "Resassign Assignment" button only
    appears for those students with assignment overrides
    (and hence due dates), with the button being disabled
    until the student both submits to the assignment and
    the teacher has provided a comment.

Change-Id: Id745b50f3810378804e0728e544ebf6bff8f756a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251663
QA-Review: Kai Bjorkman <kbjorkman@instructure.com>
Product-Review: Jody Sailor
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Pat Renner <prenner@instructure.com>
2021-02-17 00:28:25 +00:00
Simon Williams a048d65b2e create granular manage student permissions
refs FOO-165
flag=granular_permissions_manage_users

test plan: turning on the flag should show add/remove student
permissions. They are not functional yet. Note that "Manage Students"
will also still be visible for now.

Change-Id: Ifea19f6153decbbf1703d7a044a0b11eab9ad554
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258629
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
2021-02-15 17:53:14 +00:00
Mysti Lilla 877a7f7905 Fix attachment root_accounts for assessment question context
fixes OUT-4196
flag=none

Test plan
- Set up an attachment on a question bank
  (account and course, maybe?) and set the
  root_account_id on the attachment to 0
- Run the migration and ensure the root_account
  gets set correctly for the assessment_question's
  root account

Change-Id: I02f7cefc161368d4760135464da01c3ab2d6359d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257985
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Evan Battaglia <ebattaglia@instructure.com>
Product-Review: Mysti Lilla <mysti@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
2021-02-12 16:38:55 +00:00
Wagner Gonçalves 005e90871c part 3: change lookup_id and resource_link_id to UUID datatype
This is part 3 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links.

We start to read from the new columns created lookup_uuid and
resource_link_uuid.

Adding a migration to remove the not-null constraint of lookup_id and
resource_link_id columns. As part 3.1 we'll stop writing into these
columns, we need to execute this postdeploy migration at this point.

refs INTEROP-6488
flag=none

test-plan:
* specs should pass;
* you should check if LTI is launching as expected, and if the custom
  params was expanded as expected in all records that were created in the
  part 1 and 2;
* you should be able to new persist custom params, for example you can
  use the RCE editor placement;
* you can follow the test-plan:
    * https://gerrit.instructure.com/c/canvas-lms/+/256029
    * https://gerrit.instructure.com/c/canvas-lms/+/254453

[fsc-timeout=30]

Change-Id: I401f53a82f4dbef66c45932eb2eed8727488313d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258246
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Reviewed-by: Xander Moffatt <xmoffatt@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-02-11 18:02:20 +00:00
Wagner Gonçalves 20f555c08c part 2: change lookup_id and resource_link_id to UUID datatype
This is part 2 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links.

We're adding a data fixup to fill the new columns `lookup_uuid` and
`resource_link_uuid`. In case, the value of the related columns
`lookup_id` or `resource_link_id` is invalid we'll generate a new UUID
and set the related columns as the same value to keep consistency.

refs INTEROP-6488
flag=none

test-plan:
* Before you apply the new migrations you should create some resource
  links records and keep sure that `lookup_uuid` and `resource_link_uuid`
  fields has nil value and `lookup_id` and `resource_link_id` fields has
  invalid value;
* You should be able to execute the migration and it should works fine
  without raising exception;
* You should check for those records created before, if lookup_uuid has
  the same value of resource_link_id and if resource_link_uuid has the
  same value of resource_link_id;

Change-Id: I34ebd3368e70cd1166349981e30e9bc9beaa197c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257953
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
2021-02-05 18:29:49 +00:00
Wagner Gonçalves e083f3fcd4 part 1: change lookup_id and resource_link_id to UUID datatype
This is part 1 of changing the datatype from varchar to UUID of
lookup_id and resource_link_id from lti_resource_links. We're adding the
new columns lookup_uuid and resource_link_uuid.

refs INTEROP-6488
flag=none

test-plan:
* specs should pass;
* you should check if LTI is launching as expected;
* you should check that the tool is saving the resouce link properly,
  and lookup_uuid should be the same value of lookup_id,
  and resource_link_uuid should be the same value of resource_link_id;
* you can follow the test-plan:
  * https://gerrit.instructure.com/c/canvas-lms/+/256029
  * https://gerrit.instructure.com/c/canvas-lms/+/254453

Change-Id: Ie19b64e48cb407e53459c26d901f9e922e548d65
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257852
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Ethan Vizitei <evizitei@instructure.com>
QA-Review: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Wagner Goncalves <wagner.goncalves@instructure.com>
2021-02-05 16:55:29 +00:00
Stef Schenkelaars 77ffd0875f Fixed typo in data migration
During the update of the send_later syntax, a typo was introduced in the split user preferences data migration.
This commit fixes that typo so the migration will run again.

Closes: gh-1808

Test plan:
- Check out the code before the introduction of this migration
- Ensure you have filled your database with at least one user
- Check out the code including this new migration
- Run the migrations and check that there are no errors

flag=none

Change-Id: Ic326bc4536646af98fcf03d3db893ffa7424adcf
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/258245
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Alex Slaughter <aslaughter@instructure.com>
Product-Review: Alex Slaughter <aslaughter@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2021-02-05 15:32:45 +00:00
August Thornton 018c34044d remove granular permissions for course sections FF
closes FOO-1552
flag = none

test plan:
 • permissions around course_sections function as they did before,
   but now they are granularized and permanent

Change-Id: I5918a4c6ccce2ccaaf87d4b92772c31ad3e6280c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257619
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
2021-02-01 16:14:42 +00:00
August Thornton 940f47ec07 add granular permissions for course files
Note: we'll want to re-run the data fix-up when we're ready to turn
on the feature flag permanently; in hopes to capture any differences
made to course files permissions between now and then.

Modified the files_controller quota and api_quota permission checks
to make them more lenient in regards to accepting any or all of the
files permissions role overrides. This allows legacy grouping and
new granularized files permissions to live in harmony and be modified
without causing unauthorized errors on the quota resource.

This commit will cover the backend permissions required to granularize
files / folders permission calls, however there will be a follow-up
ps to clean up the course file page to hide elements the user might
not be authorized to use.

closes FOO-130
refs FOO-1501
flag = granular_permissions_course_files
[fsc-max-nodes=18]
[fsc-timeout=30]

Test Plan:
  - Run the migration and make sure there are no errors
  - With the granular_permissions_course_files FF turned off,
    course sections and REST API should work the same with this patch
    set checked out as it does in beta/production
  - Some things to check:
    * How it acts as a teacher, student, and public user
      in course files/folders and personal files/folders
      with the various settings above toggled to different states
    * How it acts as a teacher, student, and public user
      in discussions, modules, content migrations/import/exports
      (RCE should behave similarly throughout the site)
  - With the granular_permissions_course_files feature flag turned on
    course files/folders and REST API should work as expected. The same
    list checked above should be done so again, but this time:
    * Should only be able to upload or add folders if the
      Course Files - add permission is enabled for the user's role
    * Should only be able to manage file access, usage rights, move,
      or rename course files/folders if the Course Files -
      edit permission is enabled for the user's role
      • Check Toolbar header at the top of Course files
      • Check Cog (hamburger menu) to the right of each file/folder
      • Check Usage Rights Indicator under usage rights column
        that can be found in course and group file pages. This can
        be enabled under course settings if not available
    * Should only be able to delete course files/folders if the
      Course Files - delete permission is enabled for the user's role
    * Any given user/role should have full access to their respective
      personal files/folders regardless of granted permissions. The
      same also applies to a group context with some caveats
      • Should not be able to modify file access in a group context
      • Should not be able to modify usage rights in personal files
    * A student enrollment not granted any file permissions (the default)
      should only be able to _view_ and _download_ files unless granted
      additional access from an authorizing role
    * REST API works as expected
    * UI works as expected with no additional javascript errors

Change-Id: Ieb2d10915c274959e8da4c623f7aba11d3540c2b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253777
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: August Thornton <august@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
2021-01-27 17:02:38 +00:00
Cody Cutrer 885e009da9 Account.site_admin may not exist on a new db
Change-Id: I4b60cb9509371338775aab6d848baa9b17ab51b7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256515
Reviewed-by: Ryan Norton <rnorton@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-01-12 02:40:14 +00:00