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>