Commit Graph

65 Commits

Author SHA1 Message Date
Cameron Matheson d9262af160 turnitin: increase check status attempts
closes CNVS-16212

Change-Id: I33a12b1e13b47fa981f12fd80fb516da8d69c918
Reviewed-on: https://gerrit.instructure.com/45554
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Josh Simpson <jsimpson@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-12-10 23:06:52 +00:00
Tyler Pickett 5b413bb2f8 capture additional failure info from turnitin
fixes CNVS-12682

Test Plan:
  make sure turnitin still works

Change-Id: Ifd3d8d560b89add408a0a2e9134b109e6cd999eb
Reviewed-on: https://gerrit.instructure.com/35155
Reviewed-by: Strand McCutchen <smccutchen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-12-05 00:04:06 +00:00
Cameron Matheson 1f8c0c4aa5 show warning when crocodoc is still processing
closes CNVS-15940

Test plan:
  * make a file upload assignment
  * submit a crocodocable submission
  * turn off delayed jobs
  * submit another crocodocable submission
  * in speedgrader, the second submission should not display in
    crocodoc.  you will be notified that the submission is still being
    processed

Change-Id: Ifcdda634dd97a81f17d0d753cade0b80f3e0ebce
Reviewed-on: https://gerrit.instructure.com/42387
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-11-04 20:30:55 +00:00
Simon Williams a7c5481d4d turnitin: don't explode if submission_type has changed before job runs
fixes CNVS-16377

test plan:
- enable turnitin
- create an assignment that accepts uploads or urls
- first submit an upload that is turnitinable (like a word doc)
- then, quickly resubmit a URL
- the submit_to_turnitin job should not be listed in the failed jobs list

Change-Id: I2d4fd2f2f94e65c7f6086c338f6dbe8e64203c12
Reviewed-on: https://gerrit.instructure.com/43140
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Sean Lewis <slewis@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-10-23 21:03:06 +00:00
Cody Cutrer 912a2cb083 rspec 3-ify spec/models
refs CNVS-16239

Change-Id: I0dc5ac9cb86fbb5dd0335d9e21d77d4a48ecb774
Reviewed-on: https://gerrit.instructure.com/42697
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2014-10-14 20:10:03 +00:00
Cody Cutrer dacf060160 no more dynamic finders
fixes CNVS-15126

Change-Id: I48b99ff69942463df6d6c355fe6f8a2fc679e69a
Reviewed-on: https://gerrit.instructure.com/41969
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-10-03 16:22:49 +00:00
Cody Cutrer 5cfaa2c031 remove AR serialization overrides
fixes CNVS-15784

restores default behavior of a nil column returning a blank object,
rather than nil

had to adjust turnitin code that expected a nil rather than blank,
and a few specs

test plan:
 * regression test turnitin integration

Change-Id: I62968cabdba15f2e59ebdfed9b946781a1b0561c
Reviewed-on: https://gerrit.instructure.com/41647
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-30 17:58:12 +00:00
Simon Williams 1196984e82 don't explode if web snapshotting fails
fixes CNVS-15449

test plan:
- make sure CutyCapt is enabled
- create a url submission assignment
- wait for the snapshot to happen
- go to speedgrader, the preview should show

Change-Id: Ib463c2a9c85361c2468332ef8f1e170c8641b03e
Reviewed-on: https://gerrit.instructure.com/40947
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-09-12 18:19:12 +00:00
Cameron Matheson 2da951a96e fix Submission.bulk_load_versioned_attachments
fixes CNVS-15394

This would blow up if the submission had nonexistant attachment_ids

Test plan:
  * make a submission for an assignment
  * in the console, find your submission and set attachment_ids to
    123456789 (or something)
  * Use the "List submissions for multiple assignments" API for the
    course.  It should work.

Change-Id: Iefcf71b194ece8ffbceebe3176622ede20b909fa
Reviewed-on: https://gerrit.instructure.com/40841
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-09-12 04:51:29 +00:00
Michael Nomitch 65a28679c5 DA - grading rework for performance
fixes CNVS-14865

test plan:
  - with a large class
  - with DA on and off
    - check that the gradebook csv download works
      (grades can be wrong when DA is on)
    - check that gradebook2 & srgb work
    - check that student grade summary pages work

Change-Id: I7a7b4ffe302d912aa2877106295a78ab662868f1
Reviewed-on: https://gerrit.instructure.com/39470
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-08-26 22:46:14 +00:00
Cameron Matheson abea42ae86 fix bulk_load_versioned_attachments bug
fixes CNVS-14509

previously it didn't include a submissions's attachment (used for
screenshots on url submissions)

Test plan:
  * make a url submission
  * use the submissions api (for_students endpoint) to get the submission
  * it should include an attachment for the screenshot of the submission

Change-Id: Ic4c2cfe693e0446bb48c811e8d2c5fd44e53d6a9
Reviewed-on: https://gerrit.instructure.com/37731
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-08-02 00:36:13 +00:00
Jon Jensen d666617bbb spec: speed up more slow model specs
reduce runtime of modified specs by >40% (9:05 -> 5:20)

Change-Id: I42f2aaaf92b4ea5c0a2c476b1e66dbe068de1961
Reviewed-on: https://gerrit.instructure.com/38488
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-07-31 16:48:28 +00:00
Michael Nomitch b4840c75cc DA - grade calculation works on backend
fixes CNVS-13715

test plan:
  - create a student who is in one group and not another
  - create an assignment only visible to each group
  - grade the student for both assignments
  - turn DA on
    - as the student and teacher, go to the student grades page
      - both of the assignments should be visible
      - final grade should be correct (factoring in both)
        * final grade = ungraded assignments count too
    - delete one of the grades and return
      - only one of the assignments should be visible
      - final grade should be correct (using just one assignment)
  - turn DA off
    - as the student and teacher, go to the student grades page
      - both assignments are visible
      - final grade should factor in both assignments
  - with DA on and off, ensure that the following work:
    - drop rules
    - never drop rules
    - assignment stats (mean median etc)
    - what if scores

Change-Id: I727aff943b14c91089ccffa6d3b63ba026abbeec
Reviewed-on: https://gerrit.instructure.com/36762
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-07-17 21:27:59 +00:00
Joel Hough 38c0bfd032 remove old conversations and conversation submission comments
fixes CNVS-12330, CNVS-9234, CNVS-8099

before you check out
- configure a user to use old conversations

test plan
- ensure that everyone get new conversations, always, even if
 they explicitly told us that they really like old conversations
 better

- as a student with an existing conversation with a teacher,
 make an assignment submission and a submission comment
- as the teacher, ensure that your unread message count did not
 increase because of the submission comment

Change-Id: If5ae7143abbc5cf5e035f5ed9ea2e5728f70cd45
Reviewed-on: https://gerrit.instructure.com/34343
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-05-12 23:38:34 +00:00
Joseph Rodriguez 32f45d6956 remove #grade_submission from QuizSubmission
fixes: CNVS-12565

test plan:
- as a student take a quiz
- verify that:
  - background submissions are working
  - end of time / date submissions are working
  - manual submsissons are working
- verify various question types are graded correctly
- verify outcomes work as previously defined

Change-Id: Ia85141559e8026993c0e270267947128a5a0466b
Reviewed-on: https://gerrit.instructure.com/33669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 19:28:03 +00:00
Nick Cloward 7dd31931a7 submission missing for submission types and scores of zero
refs: CNVS-10301

This is the canvas-lms part of the fix for the ticket.  This adds logic to
the submission model missing? method to take into consideration whether the
assignment expects a submission or not and has been graded with a grade of zero.

Change-Id: I043dab161e1765268e34464ec49fd0276b16acbb
Reviewed-on: https://gerrit.instructure.com/29186
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
QA-Review: Nick Cloward <ncloward@instructure.com>
Tested-by: Nick Cloward <ncloward@instructure.com>
2014-03-21 22:25:12 +00:00
Rob Orton 1be0a2db95 add unique index to enrollments users per section
index should be unique per user, section, role,
type, and associated_user_id

fixes CNVS-7698
fixes CNVS-7700

test plan
 - add duplicate enrollment in script console
   - run migrations
   - duplicates should be removed
   - attempt to add duplicate enrollment in console
   - duplicate enrollment should fail
 - test user merge with conflicting enrollments
 - test creating, deleting, and restoring enrollments
 - enrollment regression testing

Change-Id: I0fb600ba6ff98054f71dc41a8519680413507494
Reviewed-on: https://gerrit.instructure.com/30986
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-03-06 22:20:30 +00:00
Cody Cutrer 20cd75d6b8 spec: fix submission spec "before" block
Change-Id: I7e258a682115e7537d3015bee2533fb24060661f
Reviewed-on: https://gerrit.instructure.com/29886
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-10 20:01:10 +00:00
James Williams d9ae1efd2c spec: replace it_should_behave_like with include_examples
Change-Id: I8a10679218b9a6ff8485b7822a21c704bdfaa398
Reviewed-on: https://gerrit.instructure.com/29213
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>
2014-01-24 16:02:26 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz').  JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-01-24 00:08:46 +00:00
Cody Cutrer 054edfcb69 spec: fix sub-second precision error on mysql
refs CNVS-7032

Change-Id: I2f1913f08e8a3296eaacf83a3725bebeae81a99d
Reviewed-on: https://gerrit.instructure.com/28617
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-16 21:51:48 +00:00
Zach Pendleton f3b5bddb3f restore assessment request notifications
fixes CNVS-10485

test plan:
  * create an assignment with a rubric attached, auto-
    assigned peer reviews, and an online submission type;
  * as two students in the course with ASAP notification
    preferences, submit the assignment;
  * wait for the assignment's due date to pass, then verify
    that each student receives a reminder to peer review the
    assignment.

note: for the test steps to work, delayed jobs must
be running.

Change-Id: Ib066212df31e4af68fcff72a4de225b19db58077
Reviewed-on: https://gerrit.instructure.com/28586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2014-01-16 20:32:05 +00:00
Nick Cloward 1b1ce45f3c add option for course grade change (log auditing)
fixes: CNVS-8996

Added a grade change audit UI for searching grade change events.  This allows the
user to search based off of the grader, student, course id, and assignment id.
In addition to each parameter a date range can be selected.

Currently assignment and course can only be searched if the ID is known.  This
is because there is no way to query for courses based on a name with the api.

Note: The submission after_save :grade_change_audit needed to be after the
simply_versioned call because the grade change audit uses that to grab the
previous grade.  This was a bug in the grade change audit log api.  This
fixes that issue also.

Test Case:
  - Create a course with an assignment and student.
  - Grade the assignment for the student.
  - Change the grade for the student a few times.
  - Open the admin tools. Select the Logging tab and then pick the grade change
    activity option in the drop down.
  - Search for the grader.  The results from the grade changes should show
    accordingly.
  - Search for the student.  The results from the grade changes should show
    accordingly.
  - Search for the course id.  The results from the grade changes should show
    accordingly.
  - Search for the assignment id.  The results from the grade changes should
    show accordingly.
  - Perform each search type again, testing the date range capabilities.
  - Make sure you cannot search with an invalid date range, grader, and student.
  - Enter an invalid course id,  no results should be returned.
  - Enter an invalid assignment id,  no results should be returned.

Change-Id: Ie5a4d34dbb60627374035071c68ec4d404e80135
Reviewed-on: https://gerrit.instructure.com/26868
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
QA-Review: Nick Cloward <ncloward@instructure.com>
Tested-by: Nick Cloward <ncloward@instructure.com>
2014-01-09 23:50:57 +00:00
Cameron Matheson e703a35b74 speedgrader: always show group submission files
closes CNVS-9715

Some API consumers are uploading files intended for a group assignment
to a user's files endpoint instead of the group one.  This commit
allows a user's files to be associated with all submissions for an
assignment belonging to the same group.

NOTE: this does not allow users in the same group to steal each other's
files, only the owner of the file can submit it.

Test plan:
  1. create a group assignment
  2. upload a file to your user files area
  3. make a submission to the assignment with that file
  4. other users in that group should be able to view the file on their
     submission page
  5. try to submit the file from step 2 as another user in the group.
     this should fail

Change-Id: Ie949a5b71795fe0537305c57be94d48535605460
Reviewed-on: https://gerrit.instructure.com/27808
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-01-07 19:27:11 +00:00
Nick Cloward 711f33c07e add option for course grade change (log auditing)
fixes: CNVS-348

This adds grade change auditing functionality.  It uses cassandra and is built
after the authenication auditing.  A new API endpoint was created to query these
logs.  Permissions for this is a domain account.  The logs can be quiried by
assignment, course, student, and grader.

Refer to: https://gollum.instructure.com/grade-auditor-implementation

Test Case:

  Setup:
    - Create a course with a student and an assignment.

  1. Grade an assignment for a student.
  2. The auditor should create a record in cassandra.
  3. Query the endpoint should return the audit event.
      - Query by Assignment
      - Query by Course
      - Query by Student
      - Query by Grader
  4. Ensure permissions are valid by querying with a non root account admin.
  5. Permissions should be changable by site_admin under account permissions.

Change-Id: I0a1cf867d5d1b5bfbdeacc7eac81747f8732025a
Reviewed-on: https://gerrit.instructure.com/25961
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2013-11-21 20:53:27 +00:00
Liz Abinante 376fa7349a validate length for published_grade, grade
fixes CNVS-3603

test plan
- as a teacher
- grade assignment in speedgrader
- grade assignment in gradebook
- grade assignment on a submission page
- verify you cannot exceed 254 chars for the grade on any page

Change-Id: I1d7a38cae644db6ad139dfe70646c25c3eb70607
Reviewed-on: https://gerrit.instructure.com/25462
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-23 17:24:38 +00:00
Simon Williams b88e7f4a39 fix versioned_attachments (and fix a silly typo)
fixes CNVS-7322

test plan:
- make sure cuty_capt web snapshot thing is enabled
- make an assignment that accepts url submissions
- submit a url
- go to the submission in speedgrader
- it should show the link to the url with the snapshot underneath

Change-Id: I583d008c762c6d2f512eda0f4b32fc4584444263
Reviewed-on: https://gerrit.instructure.com/23113
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-08-07 23:53:29 +00:00
Cameron Matheson e158d09d19 faster SubmissionsApiController#for_students
fixes CNVS-6576

Test plan:
  * run the SubmissionsApiController#for_students action as a teacher
    (it's part of gb2)
    * make sure some/all of the submissions have attachments
    * you should see a reasonable amount of queries (not hundreds or
      thousands)
  * make sure gradebook2 correctly displays student submission data

Change-Id: If301a70eb001f7876aa94e476b2c76dfa664ae05
Reviewed-on: https://gerrit.instructure.com/21790
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-07-05 21:00:36 +00:00
Nathan Mills 471d87ffba only submit one group assignment to turnitin
Fixes PS-356

test plan
* turnitin, non gorup assignments should still submit to turnitin as before
* turnitin, group assignments should only send the origianl submitters submission to turnitin

Change-Id: I29e90e9d42be8b57a9bc4755a4db9b0ffd9e0487
Reviewed-on: https://gerrit.instructure.com/21219
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Tyler Belnap <tyler@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2013-06-24 19:14:10 +00:00
Jacob Fugal a771fe00ef replace submissions.late column with .cached_due_date
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>
2013-06-10 19:11:31 +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
Ethan Vizitei 83aa4c1a8b fix quiz submission notifications
FIXES CNVS-5540

make graded notifications come from quiz
submissions and not from regular submissions
so that we can accurately differentiate
between "graded" and "regraded".

Also makes sure that no messages get sent until
after essay questions on quizzes are graded.

Finally extracts the quiz_submission broadcast
policy into it's own object because there's
a lot of repetition there (did the same
for submission broadcast policy since I
was touching it anyway, could be a good pattern
for other broadcast policy definitions)

TEST PLAN:
  1) Log in as a student
  2) take a quiz with an essay question
  3) you should NOT get a notification
  4) login as a teacher, and grade that quiz
  5) the student should get a notification that
  their quiz has been graded
  6) that notification should NOT say that the
  quiz has been RE-graded.
  7) repeat, but grade from gradebook instead of
  speedgrader

Change-Id: Id057f6d7abb64906c03334031d0d66af1e25adb2
Reviewed-on: https://gerrit.instructure.com/20511
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-15 21:29:18 +00:00
Simon Williams 286d0ca9a1 don't mark submissions pending when new quiz submission starts
fixes CNVS-1610

test plan:
- as a teacher create a quiz with multiple attempts, without essay questions
- as one student take and complete the quiz
- as another student, take, complete, start taking again, and then leave
  without completing the quiz a second time
- as a teacher, your dashboard should not show a quiz needing grading
- as a teacher, both quizzes should show as graded in the speedgrader.

- now create a quiz with multiple attempts, with essay questions
- complete the quiz 1 time with 3 students
- as a teacher you should see 3 submissions needing grading on the dashboard
- grade two of them
- you should see one submission needing grading on the dashboard
- now start taking the quiz but don't complete it with one of the graded
  students
- dashboard should still say one needing grading
- now start taking the quiz but don't complete it with one the ungraded student
- dashboard should still say one needing grading

Change-Id: I22927f13e69bcac533bcc936bba0a6ac335fde6d
Reviewed-on: https://gerrit.instructure.com/20467
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-08 22:57:11 +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
Cody Cutrer 6dbb42e4da arel-ify specs
refs CNVS-4707

Change-Id: I3b559e6c80d817760e78df47d6c1d7c88f464f2b
Reviewed-on: https://gerrit.instructure.com/18984
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-27 21:51:21 +00:00
Jon Willesen 03a74245b0 respect assignment overrides in gradebook2
fixes #CNVS-472

When determining lateness of an assignment, use the cached late
value of the submission instead of doing manual comparisons.

test plan:
 * create an assignment due in the past with an override
   due in the future
 * submit the assignment both as a student the override
   applies to and a student the override does not apply
   to
 * as a teacher or admin, visit gradebook2 and verify that
   the late submission appears late and the on-time
   submission is not marked as late
 * check the mouse-over text on both submissions to make sure
   they display the lateness of the submissions correctly.

Change-Id: I4a77d2f065402babd737f887c08dfb844c342cbf
Reviewed-on: https://gerrit.instructure.com/16356
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2013-01-08 13:29:03 -07:00
Cameron Matheson f842c4ba4c cache submission lateness
fixes #CNVS-1295

* Adds a new 'late' field to submissions
* Adds compute_lateness method to submissions which
  is called on every save when the 'late' field is nil
  or when the submission time changes
* Adds after_save callbacks to Assignment and
  AssignmentOverride to recompute lateness on submissions
  in a background process
* Includes data migration for initializing the value of the
  new cache field

Change-Id: I68d47fdbcbb167bef8428b6ecd48bf6f66ef8cb7
Reviewed-on: https://gerrit.instructure.com/16086
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-12-26 15:37:18 -07:00
Ethan Vizitei bbda931a4a consider mooc performance
refs #CNVS-1292

Was unable to find any job-per-student
behavior (not to say that we won't ever discover
any), but I did find several instances of loading
full collections into memory
 of student objects or objects
that would be instantiated in the same order of
magnitude as students for a course, and was able
to tweak many of those.  There are undoubtably
more to find.

Change-Id: I044a1d92f90c830b4d1d07f0d4de17a718bcbe55
Reviewed-on: https://gerrit.instructure.com/16030
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
2012-12-18 10:38:58 -07:00
Cody Cutrer bdbeeb992d cross shard dashboards
two major pieces:
 * use context_type/context_id instead of context_code for
   three relations so that sharding extensions will
   automatically work
 * deserialize stream item data as actual AR objects instead
   of OpenObject (for similar reasons)

test plan:
 * run the predeploy migration, but not the postdeploy one
 * view your dashboard on a shard other than your home shard;
   it should be identical to your home shard
 * view courses that you are enrolled in with the same id but on
   different shards. the activity stream should have the correct
   data for the course in that shard, for both courses (i.e.
   no mixing of data from the two shards)
 * do actions that generate new stream items, and verify the new
   items appear correctly for the above two steps
 * run the postdeploy migration, wait for the job to finish, then
   repeat the test plan

Change-Id: I8d5fcadb8d971acf7388a12e9151a3e927751f44
Reviewed-on: https://gerrit.instructure.com/15462
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-29 17:36:24 -07:00
Jeremy Stanley 6edaff4a7d VDD: notifications; closes #10896
The following changes have been made:
 - Assignment Created
  - students see the due date that applies to them
  - admins see "Multiple Dates"
 - Assignment Due Date Changed
  - students see the due date that applies to them;
    they receive no notification if their date doesn't change
  - admins receive a separate notification for each due
    date that changes, that they have access to;
    the message indicates which section or group applies
    (section-limited TAs will not get messages about due dates
    in sections they can't see)
 - Assignment Submitted Late
  - the message text does not change, but the student's overridden
    due date is checked
 - Group Assignment Submitted Late
  - same as previous

There were some bugs fixed along the way:
 - no longer send duplicate Assignment Submitted and
   Assignment Resubmitted notifications when an assignment
   is resubmitted
 - Group Assignment Submitted Late actually goes out
   (there was a typo in the whenever clause)

Test plan:
 - Create a course with two sections and a teacher
 - Enroll a student in each section
 - Enroll a section-limited TA in each section
 - Make sure everybody involved is signed up for "Due Date"
   notifications, ASAP
 - Using the API, Create an assignment with a default due date
   (in the past) and an overridden due date for section 2
   (in the future).  the assignment and override must be
   created in the same request (use the "Create an assignment"
   API and supply assignment[assignment_overrides]; it may
   be easier to use a JSON request body)
 - Verify that everybody got an "Assignment Created"
   message (use /users/X/messages)
   - the teacher should see "Multiple Dates",
     as should the TA in section 2 (because the default date
     is still visible to him)
   - the student and the TA in section 1 should see
     the default due date
   - the student in section 2 should see the overridden
     due date
 - "Due Date Changed" messages will not go out for assignments
   that were created less than 3 hours ago (by design, and not
   new with this changeset), so for the remaining items, you
   either need to wait 3 hours, or falsify created_at for the
   assignment you just made...
 - Change the default due date for the assignment, leaving it
   in the past
  - Everybody except the student in section 2 should get a
    notification with the new date
 - Change the overridden due date for section 2, leaving it
   in the future
  - everybody except the teacher and TA in section 1 should get
    a notification about the new date
  - the teacher and section-2 TA's notifications should indicate
    that they apply to section 2 (the student's should not)
 - submit the assignment as each student
  - the teacher should get one notification about each submission:
    the one about the student in section 1 should say it's late;
    the one about the student in section 2 should not
 - submit again
  - the teacher should get one notification about each submission:
    the one about the student in section 1 should say it's late;
    the one about the student in section 2 should not, and should
     be identified as a resubmission
     (there is no late-re-submission notification)

Change-Id: I26e57807ea0c83b69e2b532ec8822f6570ba1701
Reviewed-on: https://gerrit.instructure.com/14662
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-14 09:04:07 -07:00
Stanley Stuart 1a2779eb12 add varied due date functionality to the main assignments page
test plan:
  REFERENCE:
    * "Main Assignments Page": "localhost:3000/assignments", or click on
    "Assignments" in the menu bar near the top of the page.
    * "Right Side Bar": Go to the Main Assignments Page, it's on your
    right.
    * "Course Assignments Page": Hover over "Courses" in the menu bar
    * near the top of the page, click on the course you set up. Once
    that page loads, click on "Assignments" tab on the left hand side.
  STEPS:
    * https://gist.github.com/f12b3694016f3dcc979e

Change-Id: I9a5884ec1057f196ba5b731a2978c874141bec5b
Reviewed-on: https://gerrit.instructure.com/15006
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-11-09 23:21:44 -07:00
Simon Williams 0f53105c2e submission unread counts
refs #10541

add a new unread count to the left nav bar, indicating how many grade changes
have occured since you last viewed the course.  a grade change can either be
a change in score or a comment left on a submission.  when the grades page is
visited, there will be a small new dot next to each submission with new grade
activity, and the count will clear after visiting the grades page.

todo: specs

test plan:
- as a teacher, set up some assignments, including some that are muted, and
  some that are peer review
- as a student, submit these assignments
- the counts should not change
- as another student, complete the peer review
- as the original student the count should be up by one, and there should be
  a blue dot next to the peer review assignment
- as the teacher, grade the other assignments, including the muted one
- as a student the count and dots should represent what was graded and visible
  (everthing but the muted assignment)
- after leaving/refreshing the page, the count and dots should be gone
- as a student, reply to comments on the submissions
- the counts should not change

Change-Id: Ifd5988e37831c4c63314f2aad27ddd2875389dd0
Reviewed-on: https://gerrit.instructure.com/14051
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-10-09 09:41:27 -06:00
Zach Pendleton 63488ec60b don't send teachers and admins quiz score notifications.
when a teacher or account admin has a quiz submission, they should
not receive a submission graded notification.

fixes #8820

test plan:
  * create a quiz and take it as a teacher or admin with a
    communication channel;
  * verify that no submission graded notification is sent.

Change-Id: I02fb4e17ca2f63308ca94ac7f0ba405ada70dae3
Reviewed-on: https://gerrit.instructure.com/13250
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-08-28 12:21:30 -06:00
Brian Palmer 73495c84dd specs: more generalization of delayed jobs in specs
this gets rid of more of the ActiveRecord Delayed::Job calls in our
specs, so that the specs can be run against other Delayed::Job backends.

Change-Id: I0df99dbb0ab9f7719741cfe7c68e76a4ace8afcf
Reviewed-on: https://gerrit.instructure.com/12958
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-08-21 10:34:56 -06:00
Brian Palmer 6c8efd8322 create the media object for submissions and comments if it doesn't exist
Check Kaltura to verify the media id is valid, then create the object,
so that we can track it as we normally do.

fixes #5775

also update some of the submission api documentation around media
comments and file uploads.

test plan: there isn't a UI to show media objects yet, so you'll have to
have console/db access. submit a video/audio submission comment through
the API, then verify that after jobs run, a MediaObject exists for the
media id you gave.

Change-Id: Id0f5b4cdc23330ea952e674df4fc0d1f1c81bf23
Reviewed-on: https://gerrit.instructure.com/12245
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-07-17 16:17:08 -06:00
Simon Williams 66ad993951 fix permission checks for submission comments
fixes #9370

a typo (instance_eval instead of class_eval) was causing submission comments to
not check permissions, so peer reviewers were receiving extra comments in ajax
responses.

test plan:
- submit an assignment, and comment on it
- also comment as the teacher
- set up a peer review
- load the page as the peer reviewer, it should not show the other comments
- make a comment as the reviewer. the other comments should not appear

Change-Id: I067e323a813ff836cfcadb5400e313de47be0e37
Reviewed-on: https://gerrit.instructure.com/12101
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2012-07-10 17:03:37 -06:00
Simon Williams 0108709c12 remove a potential race in turnitin processing; fixes #8704
Previously we spawned a new job to check the status of each asset sent to
turnitin.  If there were multiple files it was possible that two of the jobs
could run at the same time, with one overwriting the score computed by the
other.  This commit changes the logic so that only one job is spawned, which
checks the status on all outstanding assets.

test plan:
- turn in multiple files to a turnitin assignment
- ensure you get scores for both assignments

Change-Id: I78edb33584b8cf99d490681154b32559c0a7db25
Reviewed-on: https://gerrit.instructure.com/11722
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-06-22 10:13:25 -06:00
Simon Williams a419a64a04 allow teachers to resubmit to turnitin; closes #7981
add more structure to the turnitin_data hash on a submission to keep track of
what state things are in, so that we can present errors to the user as they
happen and provide a way to resubmit. there are three states: 'pending',
'error', and 'scored'.

submissions start out as 'pending', and can move to 'error' if anything goes
wrong in the submission process (either in creating the assignment, enrolling
the user, or actually submitting the paper). there are built in retrys, and the
error state only gets set if there is still an error after the retry limit. if
this succeeds, we stay pending until the score is successfully retrieved from
turnitin, at which point it is marked 'scored'.

this change is primarily in speed grader, although icons have been updated in
the gradebooks and submission pages as well. in the 'scored' state, (or without
a state) things should work exactly as they have previously - display a score,
which can be clicked to see the full report. in the 'error' state (indicated
with an exclaimation point icon), clicking the icon gives you more details
about the error and the option to resubmit. in the 'pending' state (indicated
by a clock icon), clicking the icon just explains that the submission is
pending.

test-plan:
- locate some submissions that were scored with turnitin before this change was
  applied and verify that they still work as expected
- submit something new that will get sent to turnitin. verify that it initially
  gets marked as pending, and then after 5-10 minutes has a score.
- submit something that will result in a turnitin error (eg: < 20 words,
  password protected pdf). verify that it initially gets marked as pending,
  then after ~30 minutes (to account for retries) is marked as an error.
- click the icon, and click the resubmit button. verify that it goes back to
  pending.
- verify that the new turnitin icons for these submission in gradebooks 1 and
  2 look correct and don't mess up the layout.

Change-Id: Ia5e1b04842de16aaa44d498eefe59ddb716dc014
Reviewed-on: https://gerrit.instructure.com/10125
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-24 16:49:42 -06:00
Brian Palmer ce6593d7a3 fix time race condition in spec
Change-Id: I8fc83f66f3e6c82c619cc077a50a811ab70c2068
Reviewed-on: https://gerrit.instructure.com/9729
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2012-03-30 15:10:54 -06:00
Rob Orton fa0f116457 fixes discussion submission submitted_at times for certain discussions
fixes #7319
fixes #7015

if a user deleted a discussion entry an then re submitted one
it would take the date of the original entry

if a teacher made a comment on a no submission and then the
student submitted the entry it would take the date of the comment

test plan
 * create a discussion topic assignment
 * submit two entries as student
 * delete one
 * the date should equal the oldest existing submission
 * create a discussion topic assignment
 * make a comment on a students non existent submission
 * submit the assignment as the student
 * the submission submitted_at should be the real submission date

Change-Id: I09b643eba575a9d84f3903ab6eefaf52b7801bb1
Reviewed-on: https://gerrit.instructure.com/9070
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-03-02 16:22:31 -07:00