Commit Graph

9 Commits

Author SHA1 Message Date
Jacob Fugal 0c96126c80 validations on Version and SubmissionVersion
fixes CNVS-16961

don't create a SubmissionVersion when the Version fails to save. and if
we try to, don't let it be valid. add a data fixup to remove those that
had already happened (all of the instances of this found in production
came from cases where there was no corresponding Version the
SubmissionVersion should have been tied to).

Change-Id: I4e08acf41779ab88de85387b88db155955d3c50e
Reviewed-on: https://gerrit.instructure.com/44916
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-12-12 23:29:45 +00:00
Braden Anderson 45d19f3003 validate types on polymorphic associations
fixes ALYT-26

test plan:
	* regression test

Change-Id: Ie93e89b842e354f1f76d75f3492145b86c79a035
Reviewed-on: https://gerrit.instructure.com/34560
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-05-28 17:05:34 +00:00
Simon Williams d337334979 make data fixup resilient to missing submission rows
fixes CNVS-9349

test plan:
- no visible changes to submission version api
- the data fixup does not fail when version rows exist for non-existant
  submissions

Change-Id: I579808d94b1b32b1e87faaab1efb53f51ea82d7c
Reviewed-on: https://gerrit.instructure.com/26103
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-11-11 23:31:36 +00:00
Simon Williams b59fae9897 make submission version datafixup ignore yaml errors
fixes CNVS-8241

test plan:
- is possible, have a submission version with invalid yaml
- make sure the PopulateSubmissionVersions job runs successfully
- make sure the GradingHistory api endpoint returns all submission
  versions

Change-Id: I00039df95cd3725d32c5478b27f10b9557cb9172
Reviewed-on: https://gerrit.instructure.com/24646
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-11 19:51:29 +00:00
Cody Cutrer 7d349a7e32 refactor bulk_insert to use AR::Base.transaction
fixes CNVS-7451

test plan:
 * basic regression test on conversations

Change-Id: Ie90bc36427294920188a4ca9b58bd6045d792768
Reviewed-on: https://gerrit.instructure.com/23265
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-08-14 18:57:08 +00:00
Brian Palmer 1c4ecd7902 remove SubmissionVersion#reindex
submission.assignment and assignment.context can't change, so there is
no need to reindex on update.

test plan: specs in spec/model/submission_version_spec.rb

Change-Id: If76bda91ba608d8848fcadca97fe4e1c63b67f1a
Reviewed-on: https://gerrit.instructure.com/20765
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-05-23 15:55:31 +00:00
Brian Palmer 8b00c010a9 skip submission versions that have no assignment
fixes CNVS-5733

test plan: specs. it's difficult to get a submission version into this
state now that we do more validation.

Change-Id: I5c482198ff95ce93e09a1b373e4e7061da96984d
Reviewed-on: https://gerrit.instructure.com/20452
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-05-08 14:20:57 +00:00
Jacob Fugal 69a0254845 add gradebook history feed API endpoint
fixes CNVS-2802

test-plan:
 - create a course with multiple students and assignments
 - create submissions for those students and assignments
 - grade the submissions, including multiple gradings of some of them
 - GET /api/v1/courses/X/gradebook_history/feed
   - each grading should match the SubmissionVersion object described in
     the API docs
   - should include gradings for any assignment and student in the
     course
   - should include all gradings for any submission that's been graded
     multiple times
   - should paginate the returned gradings
   - should order the most recent gradings first
 - GET /api/v1/courses/X/gradebook_history/feed?assignment_id=Y
   - should only return gradings for submissions on that assignment
 - GET /api/v1/courses/X/gradebook_history/feed?user_id=Z
   - should only return gradings for submissions by that user
 - GET /api/v1/courses/X/gradebook_history/feed?ascending=1
   - should order the oldest gradings first
 - Repeat with combinations of the various parameters

Change-Id: I44aae11919116519f87a097f2d5cf1849acc4db3
Reviewed-on: https://gerrit.instructure.com/19680
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-27 03:41:05 +00:00
Jacob Fugal 6465b20ec0 populate submission versions
back-populate submission_versions from existing versions for
submissions, and insert new index rows when new versions for submissions
are created.

refs CNVS-2802

test-plan:
  migration:
    - have at least two submission with at least one submission with
      multiple versions in your database before introduction of this
      code
    - run the migration
    - for every existing submission version record, there should now be
      a submission_versions record
    - the submission_versions records should have the correct metadata
      for the submission version
  trigger:
    - create a new submission
    - should create a new submission_versions record
    - modify the submission in a way that triggers a new version
    - should create a new submission_versions record

Change-Id: I9c4c39fa60926b037142abf3f01572c9deaa0643
Reviewed-on: https://gerrit.instructure.com/19605
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-04-20 13:20:47 +00:00