mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-40054 mod_lesson: replaced 'end' add_to_log call with an event
This commit is contained in:
parent
9c192d812b
commit
00c027c7e3
5 changed files with 118 additions and 3 deletions
|
@ -1255,6 +1255,18 @@ class lesson extends lesson_base {
|
|||
public function stop_timer() {
|
||||
global $USER, $DB;
|
||||
unset($USER->startlesson[$this->properties->id]);
|
||||
|
||||
$cm = get_coursemodule_from_instance('lesson', $this->properties()->id, $this->properties()->course,
|
||||
false, MUST_EXIST);
|
||||
|
||||
// Trigger lesson ended event.
|
||||
$event = \mod_lesson\event\lesson_ended::create(array(
|
||||
'objectid' => $this->properties()->id,
|
||||
'context' => context_module::instance($cm->id),
|
||||
'courseid' => $this->properties()->course
|
||||
));
|
||||
$event->trigger();
|
||||
|
||||
return $this->update_timer(false, false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue