this data actually changes rarely, so don't force the row to be written
if it didn't change
Change-Id: I7876ab5488f8b0d810f032f20bc5a60c06447efd
Reviewed-on: https://gerrit.instructure.com/28995
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
also update due_date_cacher sql to not break in rails 3
when the joins are applied in reverse order
Change-Id: I9638f0483cc7c995773b512e0f9bfe1fdc3aa682
Reviewed-on: https://gerrit.instructure.com/28173
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
in order to avoid rails 3 deprecation warnings
Change-Id: If4c6ece9496e1161718770420384003de23f0421
Reviewed-on: https://gerrit.instructure.com/28206
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes: CNVS-1601
Since submissions were not created for students who did not submit an
assignment the analytics were showing them as missing even if they were not due
yet. Regardless what the score was. The fix changed the DueDateCacher to create
submissions for students with overridden due dates. This will cache the due date
so analyitics can correctly calculate the graph data. The analytics will search
for a submission, if it finds one it will use the cached due date for
calculations, if not it uses the assignments date due assuming there are not any
dates that are overridden.
Also reference g/23800.
Test Case:
Setup: Create a Course with an assignment and an enrollment.
- Without the student submitting the assignment. Grade the assignment for the
student.
- Open analytics for the course and the Assignments graph should not show any
submissions for that assignment.
- Create a due date override.
- A submission should be created to cache the due date and the graph should
not show any submissions for that assignment.
Change-Id: Icdae246d9c9913c8a163505d14b86f1300c809de
Reviewed-on: https://gerrit.instructure.com/25352
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
deleting a user could cause thousands of update-cached-due-dates
jobs to be enqueued (one per assignment per enrollment; in the
referenced ticket, the test student had 13 enrollments and there
were 88 assignments, yielding 1,144 jobs, causing the request
to time out).
fix this by
(1) using a batch job to update all assignments in the course,
instead of a job per assignment
(2) when deleting a user with multiple enrollments in a course,
only run the update cached due date job once per course
test plan:
0. run in "production" configuration (i.e., in QA portal)
1. have a course with 10 sections and 100 assignments.
I suggest creating these in the console, e.g.
course = course.create! name: "CNVS-8068"
10.times { |x| course.course_sections.create! name: "section #{x}" }
100.times { |x| course.assignments.create! name: "assignment #{x}" }
2. enter student view mode in this course
3. reset the student view student
4. verify 1000 jobs were not created (and the request doesn't time out)
fixes CNVS-8068
Change-Id: If00dd3197b70df42b0f9ec18303b02594861f69f
Reviewed-on: https://gerrit.instructure.com/25160
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
refs CNVS-7032
* mysql doesn't have boolean
* mysql will auto-commit the transaction unless you explicitly say
TEMPORARY when dropping the temp table
Change-Id: Iaca3ddd5768f509a0b610925f601e1712e9b7d42
Reviewed-on: https://gerrit.instructure.com/22666
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
fixes CNVS-6887
use a smarter query, and skip it altogether for account groups
test plan:
* regression test adding/removing users to groups in a course with
overrides and stuff.
* an sis import of account level groups should still work
Change-Id: Ie9943af04ce6aab31f9f0d76f51c7474c1299616
Reviewed-on: https://gerrit.instructure.com/22317
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
don't load 1000 assignments, just use a range of ids
test plan:
* data migration should not fail
* on-demand recalculations should not fail
Change-Id: I7da3244a08ab6f61b8393c9f9d85257b181157cc
Reviewed-on: https://gerrit.instructure.com/21738
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
refs CNVS-5805
with efficient calculation of all due dates for any submissions for a
given assignment when related records (the assignment, its overrides,
related enrollments, and related group memberships) changes.
compares this cached due date to the submitted_at or current time when
determining lateness.
populates the column for existing submissions in a post-deploy
data-fixup migration.
test-plan:
- run lib/data_fixup/initialize_submission_cached_due_date.rb
- all submissions' cached_due_dates should be updated over several
jobs
- enroll a student in a course and create submissions in that course
- create a second enrollment in a second section; the
cached_due_dates for the user's submissions should recalculate
- destroy the second enrollment; the cached_due_dates for the user's
submissions should recalculate
- create a group assignment
- add the student to a group in the assignment's category; the
cached_due_dates for the user's submissions should recalculate
- remove the student from the group; the cached_due_dates for the
user's submissions should recalculate
- enroll more students in the course
- change an assignment's due date; the cached_due_dates for the
assignment's submissions should recalculate
- create an override for the assignment; the cached_due_dates for
the assignment's submissions should recalculate
- change the due date on the override; the cached_due_dates for the
assignment's submissions should recalculate
- delete the override; the cached_due_dates for the assignment's
submissions should recalculate
- during any of the above recalculations:
- the most lenient applicable override should apply
- if the most lenient applicable override is more stringent than the
assignment due_at, it should still apply
- the assignment due_at should apply if there are no applicable
overrides
Change-Id: Ibacab27429a76755114dabb1e735d4b3d9bbd2fc
Reviewed-on: https://gerrit.instructure.com/21123
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jacob Fugal <jacob@instructure.com>