this slightly adjusts the current ASV/QSV visibilities
to also create visiblities for wiki pages and discussion
topics. Attachments are not yet included. The only changes
that needed to be made for these objects is account for the
objects's assignments. Otherwise these views are the same as
the ASV/QSV views
closes LF-1039
flag=differentiated_modules
test plan:
- Run the appropriate visibilities for each different
object, testing out various types of overrides and
ensure that the correct students appear in the list
- DiscussionTopic.find(id).discussion_topic_student_visibilities
- WikiPage.find(id).wiki_page_student_visibilities
- Test adding these objects to a module with student and
section overrides, ensure the correct students appear.
- Create a graded discussion and add it to a module with
a section or student assigned to the module
- Act as a student that is assigned to that module, and
go to the Assignment index page
- Expect the graded discussion to appear
- Act as a student not assigned to that module, and
go to the assignment index page
- Expect the graded discussion not to appear
Change-Id: I1fa77765cbcc207661e883593dbe74fa8b0ac8f4
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/344017
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>
Migration-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>
also include overrides from unpublished modules.
closes LF-1197
flag = differentiated_modules
Test plan:
- Run migrations
- Create a module with an override
- Add a classic quiz to that module
- Go to the assignment index page as a student who is NOT targeted
by the override
- Expect the quiz to not appear
- Go to the assignment index page as a student who is targeted by
the override
- Expect the quiz to appear
- Unpublish a module with overrides and expect the targeted students
to retain access to the items
Change-Id: Ia490ed4cfe2bb8318e58a80accb6a4c2d531a86d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341459
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Sarah Gerard <sarah.gerard@instructure.com>
QA-Review: Sarah Gerard <sarah.gerard@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Slightly refactors the student visibilities view generator as
StudentVisibilitiesV5 so that it can be used to generate the new
module_student_visibilities view in addition to ASV and QSV, which
it already does. Creates MSV in a migration. The migration also
replaces the ASV and QSV definitions using the updated generator to
keep all 3 views in sync - the syntax for ASV and QSV changes slightly,
but there's no functional changes to those views (its also only
updating asv_v2 and qsv_v2, which are behind a disabled flag in
production).
The resulting MSV view will return module ids that a user can see. A
user can see a module if its visible to everyone (i.e., there's no
active overrides on the module) OR if there's overrides on the module
that apply to the user.
closes LF-995
flag = none
Test plan:
- Compare the generated SQL for ASV/QSV between StudentVisibilitiesV4
and StudentVisibilitiesV5 by running the following:
connection.execute(MigrationHelpers::StudentVisibilities::StudentVisibilitiesV4.view(connection.quote_table_name("assignment_student_visibilities_v2"), Assignment.quoted_table_name, is_assignment: true))
connection.execute(MigrationHelpers::StudentVisibilities::StudentVisibilitiesV5.new(connection.quote_table_name("assignment_student_visibilities_v2"), Assignment).view_sql)
- Expect those to be functionally the same
- Find a module and click "Assign To" - assign a few students
- In a rails console, run ModuleStudentVisibility
.where(context_module_id: <module id>)
- Expcet the student IDs to match those assigned
Change-Id: I5067584c49be0dc37d9918528e769656ed1dda2e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/337282
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
closes LF-681
closes LF-682
flag=differentiated_modules
test plan:
- with the flag on
- have an assignment/quiz with different types of overrides
- the only overrides with unassign_item as true are section
and ADHOC overrides
- run assignment.assignment_student_visibilities
or quiz.quiz_student_visibilities with different scenarios
- assignment has an adhoc unassigned override
- assignment has a section unassigned override
- assignment has an assigned adhoc override with an
unassigned section override (student should still have
visibility)
- assignment has an unassigned adhoc override with an
assigned section override (student should not have
visibility)
- test out including the assignment in a module with
overrides as well (the module itself should not have
unassigned overrides)
Change-Id: Ia2e62b3dac069c37c18babc9c5dbae34ca11c52b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/333103
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Migration-Review: Aaron Ogata <aogata@instructure.com>
Migration-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
closes LF-671
closes LF-672
flag=differentiated_modules
test plan:
- with the flag on
- have a course with multiple assignments/quizzes
and modules
- for each assignment/quiz, run
assignment.assignment_student_visibilities
or quiz.quiz_student_visibilities
- test out different scenarios:
- an assignment that is in a module with an ADHOC override
- an assignment that is in a module with a section override
- an assignment in two modules, one with an override and
one without (should be visible to everyone)
- an assignment that has an assignment override and a
module with an override
- for each scenario, ensure that only the users with overrides
are given visibility, unless there is a module with no
overrides that contains the assignment.
Change-Id: I9c62c619e3f76456ca5a5eda0a85819d5c84158a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/332730
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>
Migration-Review: Jackson Howe <jackson.howe@instructure.com>
Migration-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>
closes LF-678
closes LF-677
flag=differentiated_modules
test plan:
- run migrations
- with the flag on (if you flipped your flag make sure
to restart canvas)
- test with both an assignment and quiz
- create a course override for the assignment/quiz
override = assignment.assignment_overrides.create!
override.update_attribute(:set_type, "Course")
override.update_attribute(:set_id, course.id)
- run assignment.assignment_student_visibilities or
quiz.quiz_student_visibilities
- expect to see all students in the course listed
Change-Id: Icad2a2f67f41273cf89a43db288983eb0218ff3c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/331992
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>
Migration-Review: Jackson Howe <jackson.howe@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>
In order to allow the changes we'll be making to
the ASV/QSV views to be feature flaged, we want to
create duplicates of both views that will have the
flagged changes. We'll also start keeping track of
the different versions in lib/migration_helpers
closes LF-938
flag=differentiated_modules
test plan:
- run migrations
- in a rails console, with the flag on
check that AssignmentStudentVisibilities.table_name
is equal to v2, same with QuizStudentVisibilities
- as of now these views should work exactly the same
as the current views
- you may need to restart canvas after switching
the flag on/off
Change-Id: I0a372823a9c7b31a53c76a9ecc205105936e89d7
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/331100
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>
Migration-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>