diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index 841721441dc..978553cac18 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -1710,6 +1710,11 @@ public function save($type_e = '') if (api_get_setting('search_enabled') === 'true') { $this->search_engine_edit(); } + Event::addEvent( + LOG_EXERCISE_UPDATE, + LOG_EXERCISE_ID, + $id + ); } else { // Creates a new exercise // In this case of new exercise, we don't do the api_get_utc_datetime() @@ -1816,6 +1821,11 @@ public function save($type_e = '') if (api_get_setting('search_enabled') === 'true' && extension_loaded('xapian')) { $this->search_engine_save(); } + Event::addEvent( + LOG_EXERCISE_CREATE, + LOG_EXERCISE_ID, + $this->iid + ); } } diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 4a8cacf4bc8..70d69fcc09d 100755 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -234,6 +234,8 @@ define('LOG_CAREER_DELETE', 'career_deleted'); define('LOG_USER_PERSONAL_DOC_DELETED', 'user_doc_deleted'); define('LOG_WIKI_ACCESS', 'wiki_page_view'); +define('LOG_EXERCISE_CREATE', 'exe_created'); +define('LOG_EXERCISE_UPDATE', 'exe_updated'); define('LOG_EXERCISE_DELETE', 'exe_deleted'); // All results from an exercise define('LOG_EXERCISE_RESULT_DELETE', 'exe_result_deleted');