Skip to content

Commit

Permalink
Merge pull request #60 from integral-learning/feature/#35610-mi2-logg…
Browse files Browse the repository at this point in the history
…ing-open-mumie-task

Feature/#35610 Logging open mumie task
  • Loading branch information
fsacha authored Oct 25, 2023
2 parents 44aa210 + 6dd50df commit 3c045e5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
39 changes: 39 additions & 0 deletions classes/event/course_module_viewed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_mumie\event;
defined('MOODLE_INTERNAL') || die;

/**
* The mod_mumie course module viewed event.
*
* @package mod_mumie
* @copyright 2017-2023 integral-learning GmbH (https://www.integral-learning.de/)
* @author Filip Sacha ([email protected])
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_module_viewed extends \core\event\course_module_viewed {
/**
* Init method.
*
* @return void
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'mumie';
}
}
3 changes: 3 additions & 0 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@

$redirecturl = new moodle_url('/auth/mumie/launch.php', array('id' => $mumietask->id));

$event = \mod_mumie\event\course_module_viewed::create(array('context' => $context, 'objectid' => $mumietask->id));
$event->trigger();

if ($mumietask->launchcontainer == MUMIE_LAUNCH_CONTAINER_WINDOW || mod_mumie\locallib::is_safari_browser()) {
redirect($redirecturl);
} else {
Expand Down

0 comments on commit 3c045e5

Please sign in to comment.