Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions openedx_events/content_authoring/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,19 @@ class LibraryContainerData:

container_key = attr.ib(type=LibraryContainerLocator)
background = attr.ib(type=bool, default=False)


@attr.s(frozen=True)
class Lti1p1ContentGraded:
"""
Data about LTI 1.1 content object.

Arguments:
user_id (int): database identifier of the learner's LMS user.
xblock_id (UsageKey): Location of the Xblock reponsible to launch the LTI content.
anonymous_user_id (str): Anonymous id of the Learner's LMS user.
"""

user_id = attr.ib(type=int)
xblock_id = attr.ib(type=UsageKey)
anonymous_user_id = attr.ib(type=str)
14 changes: 14 additions & 0 deletions openedx_events/content_authoring/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
LibraryBlockData,
LibraryCollectionData,
LibraryContainerData,
Lti1p1ContentGraded,
XBlockData,
)
from openedx_events.tooling import OpenEdxPublicSignal
Expand Down Expand Up @@ -370,3 +371,16 @@
"course": CourseData,
}
)

# .. event_type: org.openedx.content_authoring.xblock.lti1p1.content.graded.v1
# .. event_name: XBLOCK_LTI1P1_GRADED
# .. event_key_field: xblock.scope_ids.usage_id
# .. event_description: emitted when an LTI 1.1 Content is graded via Xblock's OutcomeService
# .. event_data: Lti1p1ContentGraded
# .. event_trigger_repository: Pearson-Advance/xblock-lti-consumer
XBLOCK_LTI1P1_GRADED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.xblock.lti1p1.content.graded.v1",
data={
"graded_content": Lti1p1ContentGraded,
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "CloudEvent",
"type": "record",
"doc": "Avro Event Format for CloudEvents created with openedx_events/schema",
"fields": [
{
"name": "graded_content",
"type": {
"name": "Lti1p1ContentGraded",
"type": "record",
"fields": [
{
"name": "user_id",
"type": "long"
},
{
"name": "xblock_id",
"type": "string"
},
{
"name": "anonymous_user_id",
"type": "string"
}
]
}
}
],
"namespace": "org.openedx.content_authoring.xblock.lti1p1.content.graded.v1"
}