Skip to content

feat: add generic XBlock LTI grade passback event - #540

Open
luisfelipec95 wants to merge 2 commits into
openedx:mainfrom
Pearson-Advance:lfc/add-event-capture-grade-LTI
Open

luisfelipec95 wants to merge 2 commits into
openedx:mainfrom
Pearson-Advance:lfc/add-event-capture-grade-LTI

Conversation

@luisfelipec95

@luisfelipec95 luisfelipec95 commented Jan 16, 2026 •

Copy link
Copy Markdown

Summary

This PR introduces a new public event for LTI grade passback from XBlock integrations, generalized to support both LTI 1.1 and 1.3 use cases.

Instead of a 1.1-only signal, this change defines a generic event contract that includes a version discriminator (lti_version) and common grading context fields.

What changed

  • Added LtiGradePassbackData data model.
  • Added new public signal in openedx_events/content_authoring/signals.py:
    • event_name: XBLOCK_LTI_GRADE_PASSBACK
    • event_type: org.openedx.content_authoring.xblock.lti.grade.passback.v1
    • event_key_field: lti_grade_passback.usage_key
    • event_trigger_repository: openedx/xblock-lti-consumer

Event payload

lti_grade_passback (LtiGradePassbackData) includes:

  • user_id
  • anonymous_user_id
  • course_key
  • usage_key
  • score
  • max_score
  • lti_version (e.g. "1.1" / "1.3")

Motivation

Issue discussion highlighted that the existing generic external grader event is currently oriented to xqueue metadata and does not carry the LTI-specific source/context required for this flow.

This PR provides a clear and extensible contract for LTI grade passback while avoiding a 1.1-only event design.

Related links

@openedx-webhooks

openedx-webhooks commented Jan 16, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @luisfelipec95!

This repository is currently maintained by @openedx/committers-openedx-events.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 16, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jan 16, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jan 20, 2026
@mphilbrick211

Copy link
Copy Markdown

Hi @luisfelipec95! Is this pull request still in progress?

@luisfelipec95

Copy link
Copy Markdown
Author

Hi @luisfelipec95! Is this pull request still in progress?

Hi @mphilbrick211! Yes, it’s still in progress. The discussion to determine whether we should move forward with this PR is happening here:

#539

@mphilbrick211 mphilbrick211 added the blocked by other work PR cannot be finished until other work is complete label Aug 19, 2026
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to Blocked in Contributions Aug 19, 2026
@luisfelipec95
luisfelipec95 force-pushed the lfc/add-event-capture-grade-LTI branch from d628b8c to c8fd1f1 Compare October 8, 2026 21:49
@luisfelipec95 luisfelipec95 changed the title feat: add event to capture the grade of an LTI 1.1 content feat: add generic XBlock LTI grade passback event Oct 8, 2026
@luisfelipec95
luisfelipec95 marked this pull request as ready for review October 8, 2026 22:20
@feanil
feanil self-requested a review October 16, 2026 15:56
@feanil feanil linked an issue Oct 16, 2026 that may be closed by this pull request
# .. event_data: LtiGradePassbackData
# .. event_trigger_repository: openedx/xblock-lti-consumer
XBLOCK_LTI_GRADE_PASSBACK = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.xblock.lti.grade.passback.v1",

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.

This is a learner's grade reported while the course is running, so it belongs in the learning subdomain rather than content_authoring, next to the other grade events like EXTERNAL_GRADER_SCORE_SUBMITTED. Move the data class and the signal to openedx_events/learning/ and make the type org.openedx.learning.xblock.lti.grade.passback.v1.

lti_version (str): LTI protocol version source (e.g. "1.1", "1.3").
"""
user_id = attr.ib(type=int)
anonymous_user_id = attr.ib(type=str)

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.

What does the consumer need anonymous_user_id for? Sending it next to user_id gives anyone reading the event bus the mapping between the two, which is what the anonymous id is meant to avoid. If the consumer only needs to identify the learner inside Open edX, user_id is enough and we can drop this one. If we only need a consistent ID for the user, then we should only pass the anonymous_id.

usage_key = attr.ib(type=UsageKey)
score = attr.ib(type=float)
max_score = attr.ib(type=float)
lti_version = attr.ib(type=str)

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.

Document the exact values this can take, eg. "1.1" and "1.3", so consumers don't have to guess at the format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked by other work PR cannot be finished until other work is complete open-source-contribution PR author is not from Axim or 2U

Projects

Status: Blocked

Development

Successfully merging this pull request may close these issues.

Add event for LTI 1.1 XBlock grading

5 participants