Closes LX-1705
Test Plan: jenkins is happy
[skip-stages=Flakey]
Change-Id: I92b39cc5150ee522f1fee7ec77b87a276b7eb49e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348203
Reviewed-by: Jackson Howe <jackson.howe@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Robin Kuss <rkuss@instructure.com>
these views are causing serious performance problems. follow
the advice of our DBAs and instead of using/ joining on the
assignment_student_visibilities view we will now use the new
services
closes LX-1728
flag=differentiated_modules
test plan:
- tests pass
- a thorough QA of assigning assignments to different students
and sections and checking for correct visibility.
Change-Id: If88db4b7d26b6d289bcd453ea6108ce11d949bdf
Change-Id: Idc141205b1949416e5f17a5b87fbbdcbc99c4356
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349302
Reviewed-by: Jen Smith <jen.smith@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Jackson Howe <jackson.howe@instructure.com>
Product-Review: Sarah Gerard <sarah.gerard@instructure.com>
these views are causing serious performance problems. follow
the advice of our DBAs and instead of using/ joining on the
quiz_student_visibilities view we will now
use the new services
refs LX-1728
flag=differentiated_modules
test plan:
- tests pass
- a thorough QA of assigning quizzes to different students
and sections and checking for correct visibility.
Change-Id: I26f7d2cda691f6071a72b535ec3b53a89a85d108
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/349053
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: Sarah Gerard <sarah.gerard@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>
fixes GRADE-326
test plan:
* Create a course with a student and assignment group
* Add 2 assignments with 10 points possible to the assignment group
* Create a drop rule to drop the lowest assignment from the group
* Score the student 5 and 10 on the assignment
* In rails console:
e = Enrollment.where(user_id: <student_id>, course_id: <course_id>)
score = e.first.find_score
details = score.score_metadata.calculation_details
score.current_score should be 10, and details should look like
{
current: {
dropped: [first submission id]
}, final: {
dropped: [first submission id]
}
}
Change-Id: Iba4173ce52f52f6acd474860d190d1d4c4d3c253
Reviewed-on: https://gerrit.instructure.com/129213
Tested-by: Jenkins
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
QA-Review: Spencer Olson <solson@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
closes GRADE-124
test plan:
* Create a differentiated assignment
* Submit the assignment from two students
* Assign grades to all but one student
* Unassign the assignment from a graded student and the ungraded
student
* Go back to gradebook
* Verify that the cell for the graded student is grayed out and not
editable
* Verify that the cell for the ungraded student is grayed out and
not editable
Change-Id: I93c9a2f4dec0888d56ba39682bc2184196f25bba
Reviewed-on: https://gerrit.instructure.com/122731
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Matt Taylor <mtaylor@instructure.com>
QA-Review: KC Naegle <knaegle@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
This commit adds default values of false and not null constraints for
all boolean columns on the assignments, discussion_topics, and quizzes
tables. This commit also has a data fixup to backfill default values on
the boolean columns.
closes CNVS-34536
Test Plan:
* Do the following in a course with at least one closed grading period:
1. On the Assignments page, create an assignment with a due date in a
closed grading period using the "+" button on an assignment group.
2. As a teacher, try to toggle the "Post to SIS" setting for the
assignment from the Assignments page. Verify the setting changes.
3. Create a new assignment with a due date in a closed grading period
using the "+Assignment" button.
4. As a teacher, try to toggle the post to SIS setting for the
assignment from the Assignments page. Verify you can edit the
setting as you toggle the button.
Change-Id: I7c799bb3b194363836d900287be90ca13805508e
Reviewed-on: https://gerrit.instructure.com/101315
Reviewed-by: Neil Gupta <ngupta@instructure.com>
Reviewed-by: Derek Bender <djbender@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Tested-by: Jenkins
Product-Review: Keith T. Garner <kgarner@instructure.com>
add scores table, which will hold the
computed_current_score and computed_final_score
which is currently stored on the enrollment
object. in addition, grading period scores will
be stored on the scores table.
closes CNVS-33573
Test plan:
* Create a course
* Make sure should total for all grading periods is enabled
* As a teacher, create an assignment that falls in a grading period
* As a student, submit something for that assignment
* As a teacher, grade that submission
* As a student, view your grades
* You should see the student's grade for both the grading period and
all grading periods.
* Repeat this process for another assignment and make sure the total
grades get updated for the student.
Basically, we want to smoke test test saving scores for an assignment
and re-calculating course grades with new scores. Everything should
behave the same as before.
Change-Id: Ib7241d55c0fa52e01441671f17f65675f8e10564
Reviewed-on: https://gerrit.instructure.com/96825
Reviewed-by: Spencer Olson <solson@instructure.com>
Reviewed-by: Shahbaz Javeed <sjaveed@instructure.com>
Tested-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
closes CNVS-32229
closes CNVS-32232
test plan:
* Create a course with MGP enabled and two grading periods in
the default term
* Create two assignments for this course, one in a closed GP and
one in an open GP
* To test overrides, create the following as well:
* For one of the students, make the open assignment due in the
closed grading period
* For another student, make the closed assignment due in the
open grading period
* Ensure the following steps work for all assignment/student
combos due in a closed grading period.
** CNVS-32229 **
* Login as a teacher
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is locked down
* Right click on the locked-down input and select 'Inspect'
* Remove the 'ui-state-disabled' class and remove
readonly="readonly" from the input field's HTML
* Notice the input is no longer grayed out and you can enter
a grade
* Enter a grade and tab out of the input
* You should see an error message that says something went wrong
and notice in the Network tab of your dev tools that the AJAX
post failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there.
* Verify it isn't there in Gradebook either
* Login as an admin
* Go to speedgrader for the assignment in the closed GP
* Notice that the grade input is *not* locked down
* Enter a grade and tab out of the input
* You should *not* see an error message that says something went
wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook
** CNVS-32232 **
* Login as a teacher
* Go into a gradebook that has an assignment that is
locked down because it is in a closed grading period
* Notice that the grade cells for the assignment are locked
down (because the submissions fall in a closed grading period)
* Right-click on one of the locked-down cells and select 'Inspect'
* Remove the 'grayed-out' and 'cannot_edit_in_closed_grading_period'
classes
* Notice the cell is no longer grayed out and you can enter a grade.
* Enter a grade
* Click on another cell.
* You should see an error message that says something went wrong
and in the Network tab of your dev tools verify the AJAX post
failed, meaning the submission was not gradeable
* Refresh the page and notice the grade is not there
* Login as an admin
* Login as a teacher
* Go into a gradebook that has an assignment that is
in a closed grading period
* Enter a grade in a cell that should be due in a closed grading
period
* Click on another cell
* You should *not* see an error message that says something went
wrong meaning the submission was graded successfully
* Refresh the page and notice the grade is there.
* Verify it is also present in Gradebook
Change-Id: Ia80e4de626616309c5e9dffb78ed0f9671ad1076
Reviewed-on: https://gerrit.instructure.com/95687
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Spencer Olson <solson@instructure.com>
Tested-by: Jenkins
QA-Review: Anju Reddy <areddy@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
test plan:
* basic regression test of assignment overrides
closes #CNVS-27549
Change-Id: Ie463848b3831087efb3f9ec762dca6264055ee76
Reviewed-on: https://gerrit.instructure.com/73139
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
destroy! is now a method in rails
refs #CNVS-26056
Change-Id: I66e512265ff5cda6a12d7820e3cf69c77ef9e746
Reviewed-on: https://gerrit.instructure.com/69721
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs #CNVS-21596
Change-Id: I5dedaab90a2abe6bf288ff30401c9b31629b45b2
Reviewed-on: https://gerrit.instructure.com/59220
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs #CNVS-21596
Change-Id: Ia834d5114a04e7c6bdd30196393d19a1a04d8286
Reviewed-on: https://gerrit.instructure.com/58087
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
lul
Change-Id: I303e168053ec058cdbf40acc6337b3d3404034ad
Reviewed-on: https://gerrit.instructure.com/58065
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes CNVS-18403
test plan:
- quick regression test on DA for quizzes
Change-Id: I2c9521ce9fd22374cd192ca228967fa6ec50ade7
Reviewed-on: https://gerrit.instructure.com/48372
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Adam Stone <astone@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-16367
test plan:
- go to modules page and change stuff and save
- things dont break
- DA'd discussions/assignments/quizzes filter out
of the modules page for students
- the page for all student progressions works
as it should
Change-Id: I8403e4c508169e7f3750f3ddc7494f4a4ed3f371
Reviewed-on: https://gerrit.instructure.com/43113
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
fixes CNVS-15783
test plan:
- as a teacher make a DA'd quiz
- as a student with an override and a grade,
as a student with an override and no grade, and
as a student without an override with a grade
- the quiz is on the quiz index and assignment index,
and the show page is normal
- as a student without a grade or override, with a submission
* note the submission grade must be nil (the gradebook is messed
up so you may have to change it via the API)
- the quiz is on neither the assignment index or quiz index
- the quiz show page has a flash message telling you it doesnt count
- as a student without a grade or override without a submission
- the quiz is on neither the assignment index or quiz index
- the quiz show page redirects you to the quizzes index
- with DA off everything works as usual
Change-Id: I51e1e7efd1543e7bb6b858dfa04d7798a516c7c3
Reviewed-on: https://gerrit.instructure.com/41696
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
fixes CNVS-14094
test plan:
- course with DA as students and teacher
- api show & index
- quizzes index page shows only assigned quizzes
- quizzes show page url redirects to index if
quiz isnt visible to user
- grade calculation
- gradebook/grades page
- calendar events events
- modules filter out quizzes correctly
- observers see same things as their students
- if a student takes a quiz and it is not graded and then
loses visibility, make sure that the GB greys out the cell
rather than showing a submission icon
- same course with DA off works normally
Change-Id: I10b936f1516d6d24f11d74c0bb572051f0b1d1c4
Reviewed-on: https://gerrit.instructure.com/39897
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>