Skip to content

Commit

Permalink
Exercise: log exercise creation and update - refs BT#21185
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Nov 3, 2023
1 parent 4f219c2 commit 0d533ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main/exercise/exercise.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
);
}
}

Expand Down
2 changes: 2 additions & 0 deletions main/inc/lib/api.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 0d533ef

Please sign in to comment.