Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider only relevant discussions when evaluating CMPs
Context module progressions should only consider items that a user is able to view when evaluating a module's completion status. Ungraded discussions can be posted to only certain sections within a course, so only discussions in section(s) where the student is enrolled should be considered. This is normally the case, however, when evaluating all of the progressions within a course, we cache the item visibilities to prevent recalculating the same thing repeatedly (see ContextModule#evaluate_all_progressions). This codepath is not frequently followed, but is, for example, when a module itelf is edited. In the caching process, we get all of the sections (and associated discussions) visible to a list of users. This was an issue becuase the list of users might contain users with different section visibilities. This patchset considers section visibilities for each user in the list individually, ensuring that module progressions evaluate appropriately for all users. closes LS-3245 flag = none Test plan: - Create a course with 2 sections - Create a module in the course - Create 2 discussions in the module - both ungraded; assign one to the first section, and one to the second section - Create a page in the module - Edit module requirements - set "contribute to the page" on both discussions and "view" on the page - Enroll a student in one of the sections and publish the course - As the student, view the page and reply to the visible discussion - Expect the module to be marked as completed - As the teacher, create a new (empty) module, move it to the top of the page, then delete it - As the student, view the modules page; expect the module to still be marked as completed Change-Id: I4d9a57dae0cf521a46953f4c5217df7358b08835 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/296104 Tested-by: Service Cloud Jenkins <[email protected]> QA-Review: Luis Oliveira <[email protected]> Reviewed-by: Luis Oliveira <[email protected]> Product-Review: Jackson Howe <[email protected]>
- Loading branch information