From c2470c0e895606a9f793e264f8cedf6cf386259f Mon Sep 17 00:00:00 2001 From: Vasovasovasovaso Date: Fri, 8 Jul 2022 11:22:37 +0200 Subject: [PATCH 1/3] grading page is no longer opened in new tab --- changelog.md | 9 +++++++-- lib.php | 11 +++++++++-- version.php | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index 61670c3..9b6a415 100644 --- a/changelog.md +++ b/changelog.md @@ -2,14 +2,19 @@ All important changes to this plugin will be documented in this file. +## [v1.4.8] - 2022-07-08 + +### Fixed +- MUMIE Task's grading page is no longer opened in new tab. + ## [v1.4.7] - 2022-03-23 -## Fixed +### Fixed - Fixed an issue where only participants with default student role were listed on the individual grading settings page. Now every participant with a graded role will be listed. ## [v1.4.6] - 2022-03-11 -## Added +### Added - Added support for MUMIE servers with multiple courses ### Fixed diff --git a/lib.php b/lib.php index e8426dd..af8d46b 100644 --- a/lib.php +++ b/lib.php @@ -23,6 +23,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +use core\check\performance\debugging; use mod_mumie\locallib; defined('MOODLE_INTERNAL') || die; @@ -107,6 +108,9 @@ function mumie_delete_instance($id) { * * @param stdClass $coursemodule */ + + + function mumie_get_coursemodule_info($coursemodule) { global $DB, $USER, $CFG; @@ -122,9 +126,12 @@ function mumie_get_coursemodule_info($coursemodule) { $info->content = format_module_intro('mumie', $mumie, $coursemodule->id, false); } + + $context = context_module::instance($coursemodule->id); + $openinnewtab = $mumie->launchcontainer == MUMIE_LAUNCH_CONTAINER_WINDOW && !has_capability("mod/mumie:viewgrades", $context, $USER); // If the activity is supposed to open in a new tab, we need to do this right here or moodle won't let us. - if ($mumie->launchcontainer == MUMIE_LAUNCH_CONTAINER_WINDOW) { - $info->onclick = "window.open('{$CFG->wwwroot}/mod/mumie/view.php?id={$coursemodule->id}'); return false;"; + if ($openinnewtab) { + $info->onclick = "window.open('{$CFG->wwwroot}/mod/mumie/view.php?id={$coursemodule->id}'); return false;"; } return $info; diff --git a/version.php b/version.php index 0661add..1064330 100644 --- a/version.php +++ b/version.php @@ -25,10 +25,10 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2022032300; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2022070800; // The current module version (Date: YYYYMMDDXX). $plugin->component = 'mod_mumie'; // Full name of the plugin (used for diagnostics). $plugin->requires = 2020061500; -$plugin->release = "v1.4.7"; +$plugin->release = "v1.4.8"; $plugin->maturity = MATURITY_STABLE; $plugin->dependencies = array( 'auth_mumie' => 2021031200, From 96d927e07b478a15f0ca651faf66b74c77735e5c Mon Sep 17 00:00:00 2001 From: Vasovasovasovaso Date: Fri, 8 Jul 2022 11:54:06 +0200 Subject: [PATCH 2/3] fixed whitespace errors --- lib.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib.php b/lib.php index af8d46b..4449c70 100644 --- a/lib.php +++ b/lib.php @@ -108,9 +108,6 @@ function mumie_delete_instance($id) { * * @param stdClass $coursemodule */ - - - function mumie_get_coursemodule_info($coursemodule) { global $DB, $USER, $CFG; @@ -126,12 +123,11 @@ function mumie_get_coursemodule_info($coursemodule) { $info->content = format_module_intro('mumie', $mumie, $coursemodule->id, false); } - - $context = context_module::instance($coursemodule->id); + $context = context_module::instance($coursemodule->id); $openinnewtab = $mumie->launchcontainer == MUMIE_LAUNCH_CONTAINER_WINDOW && !has_capability("mod/mumie:viewgrades", $context, $USER); // If the activity is supposed to open in a new tab, we need to do this right here or moodle won't let us. if ($openinnewtab) { - $info->onclick = "window.open('{$CFG->wwwroot}/mod/mumie/view.php?id={$coursemodule->id}'); return false;"; + $info->onclick = "window.open('{$CFG->wwwroot}/mod/mumie/view.php?id={$coursemodule->id}'); return false;"; } return $info; From 23a517e689a5259b1afe7e47ce2409668dd4a027 Mon Sep 17 00:00:00 2001 From: Vasovasovasovaso Date: Fri, 8 Jul 2022 12:03:13 +0200 Subject: [PATCH 3/3] deleted unnecessary code --- lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib.php b/lib.php index 4449c70..0bd8050 100644 --- a/lib.php +++ b/lib.php @@ -23,7 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -use core\check\performance\debugging; use mod_mumie\locallib; defined('MOODLE_INTERNAL') || die;