Commit dc92457d by Diana Huang Committed by Andy Armstrong

Update helpers to allow for kwargs.

parent 7f3acffc
......@@ -866,7 +866,7 @@ class OpenAssessmentBlock(
if assessment["name"] == mixin_name:
return assessment
def publish_assessment_event(self, event_name, assessment):
def publish_assessment_event(self, event_name, assessment, **kwargs):
"""
Emit an analytics event for the peer assessment.
......@@ -902,9 +902,7 @@ class OpenAssessmentBlock(
"feedback": part["feedback"]
})
self.runtime.publish(
self, event_name,
{
event_data = {
"feedback": assessment["feedback"],
"rubric": {
"content_hash": assessment["rubric"]["content_hash"],
......@@ -915,6 +913,13 @@ class OpenAssessmentBlock(
"submission_uuid": assessment["submission_uuid"],
"parts": parts_list
}
for key in kwargs:
event_data[key] = kwargs[key]
self.runtime.publish(
self, event_name,
event_data
)
def _serialize_opaque_key(self, key):
......
......@@ -51,7 +51,7 @@ class StaffAssessmentMixin(object):
data['overall_feedback'],
create_rubric_dict(self.prompts, self.rubric_criteria_with_labels)
)
self.publish_assessment_event("openassessmentblock.staff_assessment", assessment)
self.publish_assessment_event("openassessmentblock.staff_assess", assessment, type='full-grade')
workflow_api.update_from_assessments(assessment["submission_uuid"], None)
except StaffAssessmentRequestError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment