From d37781a529bbd299f89b7d43f590e83fe72b6957 Mon Sep 17 00:00:00 2001 From: Kanika Goyal Date: Sun, 12 Aug 2012 15:11:54 +0530 Subject: [PATCH 1/2] MDL-34544: Plagiarism API - add support for control of drafts to new assign --- mod/assign/locallib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 455afd1fadf..bf8c064b60c 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -2574,6 +2574,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; From eb93ee27b32a258f3dc91cd1d30548f2b5c732b5 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Mon, 3 Sep 2012 13:45:51 +1200 Subject: [PATCH 2/2] MDL-34544 - assign - document assessable_ events --- mod/assign/db/events.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/mod/assign/db/events.php b/mod/assign/db/events.php index 24446f88142..edd84cbcf13 100644 --- a/mod/assign/db/events.php +++ b/mod/assign/db/events.php @@ -24,9 +24,29 @@ $handlers = array(); -/* List of events thrown from assignment module +/* List of events generated by the assign module, with the fields on the event object. -assignment_finalize_sent - object course, object user, object cm, object assignment, fileareaname -assignment_file_sent - object course, object user, object cm, object assignment, object file +assessable_content_uploaded + ->modulename = 'assign'; + ->cmid = // The cmid of the assign. + ->itemid = // The submission id of the user submission. + ->courseid = // The course id of the course the assign belongs to. + ->userid = // The user id that the attempt belongs to. + ->content = // The text content entered by the user (empty if no content submitted) + ->pathnamehashes = // An array of pathnamehashes of the files submitted by the user (var not passed if not set). +assessable_file_uploaded + ->modulename = 'assign'; + ->cmid = // The cmid of the assign. + ->itemid = // The submission id of the user submission. + ->courseid = // The course id of the course the assign belongs to. + ->userid = // The user id that the attempt belongs to. + ->pathnamehashes = // An array of pathnamehashes of the files submitted by the user (var not passed if not set). + +assessable_content_done + ->modulename = 'assign'; + ->cmid = // The cmid of the assign. + ->itemid = // The submission id of the user submission. + ->courseid = // The course id of the course the assign belongs to. + ->userid = // The user id that the attempt belongs to. */