From 66ebd4a7b04c4bd9ff83f41f064064ed66816daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Mon, 20 Jan 2020 21:34:10 +0100 Subject: [PATCH] Changed the displayorder among all quiz reports. --- CHANGES.md | 9 +++++++++ db/install.php | 2 +- db/upgrade.php | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ version.php | 4 ++-- 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 CHANGES.md create mode 100644 db/upgrade.php diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..1a94f75 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,9 @@ +moodle-quiz_archive +========================= + +Changes +------- + +### Release v3.8-r2 + +* 2020-01-20 - Lowered the quiz archive priority so not to appear as default, which happened in some environements. diff --git a/db/install.php b/db/install.php index 7ef72df..127e5ba 100644 --- a/db/install.php +++ b/db/install.php @@ -33,7 +33,7 @@ function xmldb_quiz_archive_install() { $record = new stdClass(); $record->name = 'archive'; - $record->displayorder = '10000'; + $record->displayorder = '2000'; $DB->insert_record('quiz_reports', $record); } diff --git a/db/upgrade.php b/db/upgrade.php new file mode 100644 index 0000000..d3293d1 --- /dev/null +++ b/db/upgrade.php @@ -0,0 +1,51 @@ +. + +/** + * Update script for the quiz archive report. + * @package quiz_archive + * @copyright 2020 Luca Bösch + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + + +defined('MOODLE_INTERNAL') || die(); + +/** + * Upgrade function + * + * @param int $oldversion the version we are upgrading from + * @return bool result + */ +function xmldb_quiz_archive_upgrade($oldversion) { + global $DB; + + $dbman = $DB->get_manager(); + + if ($oldversion < 2020012000) { + + // Update quiz_reports displayorder to 2000. + $updatesql = " + UPDATE {quiz_reports} + SET displayorder = 2000 + WHERE name = 'archive'"; + $DB->execute($updatesql); + + upgrade_plugin_savepoint(true, 2020012000, 'auth', 'oauth2'); + } + + return true; +} \ No newline at end of file diff --git a/version.php b/version.php index 1e0213c..6c53e4b 100644 --- a/version.php +++ b/version.php @@ -24,8 +24,8 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2019052400; +$plugin->version = 2020012000; $plugin->requires = 2017110800; $plugin->component = 'quiz_archive'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = 'v3.7-r1'; +$plugin->release = 'v3.8-r2';