Merge branch 'master_MDL-34544' of git://github.com/danmarsden/moodle
[moodle.git] / mod / assign / locallib.php
index 7aa5446..2d59aa1 100644 (file)
@@ -3323,6 +3323,14 @@ class assign {
                 $this->add_to_log('submit for grading', $this->format_submission_for_log($submission));
                 $this->notify_graders($submission);
                 $this->notify_student_submission_receipt($submission);
+                // Trigger assessable_content_done event to show completion
+                $eventdata = new stdClass();
+                $eventdata->modulename   = 'assign';
+                $eventdata->cmid         = $this->get_course_module()->id;
+                $eventdata->itemid       = $submission->id;
+                $eventdata->courseid     = $this->get_course()->id;
+                $eventdata->userid       = $USER->id;
+                events_trigger('assessable_content_done', $eventdata);
             }
         }
         return true;