instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.6k stars 2.48k forks source link

Updating line item score updates the submission time of the linked assignment #1799

Open nick96 opened 3 years ago

nick96 commented 3 years ago

Summary:

As part of integrating our platform with Canvas via the LTI API we have run into an issue where submitting a line item's score updates the submission time of Canvas assignment linked to the line item. This is leading to assignment submissions being marked as late when teachers mark work after the due date in our platform because it submits the scores to the line item's Score endpoint which updates the submission time of the linked Canvas assignment to be after the due date.

Steps to reproduce:

  1. Create an assignment and linked line item
  2. Submit student work via the Score endpoint setting the activityProgress to "Submitted" and the gradingProgress to "NotReady"
  3. See that the submission time has been updated
  4. After the due date, submit the score the the line item's Score endpoint with scoreGiven and scoreMaximum, and setting activityProgress to "Completed" and gradingProgress to "FullyGraded"
  5. See that the submission time has been updated and it is marked as late

Expected behavior:

The second request does not update the submission time of the linked assignment.

Actual behavior:

The second request does update the submission time of the linked assignment.

Additional notes:

pb-sobrien commented 3 years ago

We have been running into this problem, as well. I found some Canvas docs and it ignores everything that isn't FullyGraded or PendingManual : https://canvas.instructure.com/doc/api/all_resources.html

It looks like there is a Canvas-specifc "extension" you can add to the score payload with a submitted_at timestamp. I do wish this was LTI standard, since that's not how all other LMSes will accept a submitted timestamp.

ashutoshrishi commented 3 years ago

This is affecting us as well. We are building an external LTI tool to work with Canvas, and the first Submission event we send back is fine. But if a lecturer grades an assessment in our tool then that "grading" event that is sent back via the /scores API is now selected as the Submission timestamp?

We are using the Canvas-specific extension to passback the submission files and timestamp too, but it doesn't matter as any post-submission Grading event will now become the Submission time.

As all grading occurs after the due-date, or when the submissions are in, everything will be marked as late eventually and incur penalties.