Skip to content

Avoid future submission timestamps in instructor LTI grade passback - #1699

Merged
bnmnetp merged 1 commit into
RunestoneInteractive:mainfrom
ascholerChemeketa:codex/fix-lti-future-submission-timestamp
Nov 22, 2026
Merged

bnmnetp merged 1 commit into
RunestoneInteractive:mainfrom
ascholerChemeketa:codex/fix-lti-future-submission-timestamp

Conversation

@ascholerChemeketa

Copy link
Copy Markdown
Contributor

Trying to instructor grade before the deadline of an assignment pushes LTI grades, but they are likely to be rejected by LMS as they are future timestamped by the logic that ensures they are not marked as "late".

This changes the logic to set the timestamp to earlier of current or 1 minute before deadline.


This pull request updates the logic for reporting submittedAt timestamps for LTI 1.3 grade passback, ensuring instructor-entered grades are never reported as future submissions and improving test coverage for various edge cases. The main changes clarify and enforce how submission times are set, especially around assignment deadlines, and expand the tests to cover more scenarios.

LTI 1.3 submission timestamp handling:

  • Updated _submitted_at_for_score to ensure instructor-triggered grades are never reported with a submittedAt later than the actual score timestamp, preventing issues with LMSs that reject future submission times. The timestamp is now clamped to one minute before the deadline or the score timestamp, whichever is earlier.
  • Updated docstrings for all affected functions (attempt_lti1p3_score_update, attempt_lti1p3_score_updates, attempt_lti1p3_score_updates_for, _send_lti1p3_score_updates) to clearly explain the new logic for instructor-triggered grade submission times. [1] [2] [3] [4]

Test improvements:

  • Expanded and parameterized tests in test_score_updates.py to cover a variety of deadline and submission scenarios, including deadlines in the past, at the current time, within the final minute, and with no deadline. Tests now ensure that instructor-triggered submissions never report a future submittedAt and that student-triggered submissions use the score timestamp as expected.
  • Updated test documentation to reflect the expanded test coverage, including handling of submission timestamps, students without LTI mapping, zero-point assignments, and scores exceeding assignment points.

Copilot AI balanced review requested due to automatic review settings November 21, 2026 15:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the instructor grade-passback timestamp update.

No open issues 🎉

What changed in this PR

Updates LTI 1.3 grade passback so instructor-entered grades submitted before an assignment deadline do not carry future submission timestamps that an LMS may reject.

Changes:

  • Caps instructor submittedAt at the earlier of the score timestamp or one minute before the deadline.
  • Updates function documentation to explain the timestamp rule.
  • Expands tests for deadline boundaries, missing deadlines, and unchanged student-triggered behavior.
File Description
test/​components/​rsptx/​lti1p3/​test_score_updates.py Adds parameterized coverage for instructor and student submission timestamps.
components/​rsptx/​lti1p3/​core.py Clamps instructor submission timestamps and documents the updated behavior.

Review effort: Balanced

@bnmnetp
bnmnetp merged commit d57349d into RunestoneInteractive:main Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants