Commit ca08d409 by dragonfi

Publish assessment submitted event

parent fe65b30b
...@@ -289,6 +289,8 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -289,6 +289,8 @@ class MentoringBlock(XBlockWithLightChildren):
child.save() child.save()
completed = child_result['completed'] completed = child_result['completed']
event_data = {}
(raw_score, score, correct, incorrect) = self.score (raw_score, score, correct, incorrect) = self.score
if current_child == self.steps[-1]: if current_child == self.steps[-1]:
log.info(u'Last assessment step submitted: {}'.format(submissions)) log.info(u'Last assessment step submitted: {}'.format(submissions))
...@@ -297,10 +299,17 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -297,10 +299,17 @@ class MentoringBlock(XBlockWithLightChildren):
'value': raw_score, 'value': raw_score,
'max_value': 1, 'max_value': 1,
}) })
event_data['final_grade'] = raw_score
self.num_attempts += 1 self.num_attempts += 1
self.completed = True self.completed = True
event_data['exercise_id'] = current_child.name
event_data['num_attempts'] = self.num_attempts
event_data['submitted_answer'] = submissions
self._publish_event('xblock.mentoring.assessment.submitted', event_data)
return { return {
'completed': completed, 'completed': completed,
'attempted': self.attempted, 'attempted': self.attempted,
......
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