From c64aaae370212bc0bda2a6fdc6d5c1187ce318a5 Mon Sep 17 00:00:00 2001 From: Brian Barnes Date: Mon, 17 Oct 2022 15:29:25 +1300 Subject: [PATCH 1/8] Fixed invalid chmod call --- classes/framework.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/framework.php b/classes/framework.php index 7584827ee..07100d1a6 100644 --- a/classes/framework.php +++ b/classes/framework.php @@ -216,14 +216,14 @@ public function fetchExternalData($url, $data = null, $blocking = true, $stream // Generate local tmp file path. $localfolder = $CFG->tempdir . uniqid('/hvp-'); - $stream = $localfolder . '.h5p'; + $filename = $localfolder . '.h5p'; // Add folder and file paths to H5P Core. $interface = self::instance('interface'); $interface->getUploadedH5pFolderPath($localfolder); - $interface->getUploadedH5pPath($stream); + $interface->getUploadedH5pPath($filename); - $stream = fopen($stream, 'w'); + $stream = fopen($filename, 'w'); $options['CURLOPT_FILE'] = $stream; } @@ -244,7 +244,7 @@ public function fetchExternalData($url, $data = null, $blocking = true, $stream if ($stream !== null) { fclose($stream); - @chmod($stream, $CFG->filepermissions); + @chmod($filename, $CFG->filepermissions); } $errorno = $curl->get_errno(); From 86a2e1a186bd00f63d36219551bb2809e4dba4ac Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 26 May 2023 16:08:06 +0200 Subject: [PATCH 2/8] Update version --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 709953d8b..295e63d01 100644 --- a/version.php +++ b/version.php @@ -23,9 +23,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2022121200; +$plugin->version = 2023052600; $plugin->requires = 2013051403; $plugin->cron = 0; $plugin->component = 'mod_hvp'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '1.23.0'; +$plugin->release = '1.23.1'; From bd0e5176cd3681efbdb33dc82e811055368af677 Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Fri, 24 Nov 2023 10:22:40 +0000 Subject: [PATCH 3/8] added suffix to completion rules --- mod_form.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mod_form.php b/mod_form.php index 62bc6873b..7b34089ef 100644 --- a/mod_form.php +++ b/mod_form.php @@ -434,15 +434,25 @@ public function get_data() { } public function add_completion_rules() { + global $CFG; + $mform =& $this->_form; + + // Changes for Moodle 4.3 - MDL-78516. + if ($CFG->branch < 403) { + $suffix = ''; + } else { + $suffix = $this->get_suffix(); + } + $items = array(); $group = array(); - $group[] = $mform->createElement('advcheckbox', 'completionpass', null, get_string('completionpass', 'hvp'), + $group[] = $mform->createElement('advcheckbox', 'completionpass' . $suffix, null, get_string('completionpass', 'hvp'), array('group' => 'cpass')); - $mform->disabledIf('completionpass', 'completionusegrade', 'notchecked'); - $mform->addGroup($group, 'completionpassgroup', get_string('completionpass', 'hvp'), '   ', false); - $mform->addHelpButton('completionpassgroup', 'completionpass', 'hvp'); - $items[] = 'completionpassgroup'; + $mform->disabledIf('completionpass' . $suffix, 'completionusegrade', 'notchecked'); + $mform->addGroup($group, 'completionpassgroup' . $suffix, get_string('completionpass', 'hvp'), '   ', false); + $mform->addHelpButton('completionpassgroup' . $suffix, 'completionpass', 'hvp'); + $items[] = 'completionpassgroup' . $suffix; return $items; } From a479377e4de943a8caf326f08ee381451a6102de Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Tue, 5 Dec 2023 15:43:39 +0000 Subject: [PATCH 4/8] imported h5p css files into styles.css and removed require CSS from locallib.php --- locallib.php | 1 - styles.css | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/locallib.php b/locallib.php index 874d1aed2..230e663b1 100644 --- a/locallib.php +++ b/locallib.php @@ -116,7 +116,6 @@ function hvp_get_core_assets($context) { // Add core stylesheets. foreach (\H5PCore::$styles as $style) { $settings['core']['styles'][] = $relpath . $style . $cachebuster; - $PAGE->requires->css(new moodle_url($liburl . $style . $cachebuster)); } // Add core JavaScript. foreach (\H5PCore::$scripts as $script) { diff --git a/styles.css b/styles.css index da54ad861..b395126b2 100644 --- a/styles.css +++ b/styles.css @@ -117,4 +117,14 @@ body.h5p-embed .clearer, body.h5p-embed #maincontent, body.h5p-embed #user-notifications { display: none; -} \ No newline at end of file +} +/* Import styles to prevent loading after output in locallib */ + +@import 'library/styles/font-open-sans.css'; +@import 'library/styles/h5p.css'; +@import 'library/styles/h5p-admin.css'; +@import 'library/styles/h5p-confirmation-dialog.css'; +@import 'library/styles/h5p-core-button.css'; +@import 'library/styles/h5p-hub-registration.css'; +@import 'library/styles/h5p-hub-sharing.css'; +@import 'library/styles/h5p-tooltip.css'; From 767b9be6886c02e13241b0da576e05d17cb69bed Mon Sep 17 00:00:00 2001 From: Falcon Date: Sat, 23 Dec 2023 13:02:21 +0100 Subject: [PATCH 5/8] Updated H5P core to latest version --- library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library b/library index dca8f6db6..f3579c0d2 160000 --- a/library +++ b/library @@ -1 +1 @@ -Subproject commit dca8f6db6839d3401a37360fbd7ad63443db6aa7 +Subproject commit f3579c0d28205bf34490ee151c07d43a2ffc3507 From 18372a8524075e8f0f71f575e82b682e89ee7dbb Mon Sep 17 00:00:00 2001 From: Falcon Date: Sat, 23 Dec 2023 13:36:10 +0100 Subject: [PATCH 6/8] Updated version number to 1.26 --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index 295e63d01..e1a695a20 100644 --- a/version.php +++ b/version.php @@ -23,9 +23,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023052600; +$plugin->version = 2023122300; $plugin->requires = 2013051403; $plugin->cron = 0; $plugin->component = 'mod_hvp'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '1.23.1'; +$plugin->release = '1.26'; From 744cc27cb5d3e1822c533d727662292b1bf164de Mon Sep 17 00:00:00 2001 From: Falcon Date: Mon, 25 Dec 2023 10:56:46 +0100 Subject: [PATCH 7/8] Revert "imported h5p css files into styles.css and removed require CSS from locallib.php" This reverts commit a479377e4de943a8caf326f08ee381451a6102de. --- locallib.php | 1 + styles.css | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/locallib.php b/locallib.php index 230e663b1..874d1aed2 100644 --- a/locallib.php +++ b/locallib.php @@ -116,6 +116,7 @@ function hvp_get_core_assets($context) { // Add core stylesheets. foreach (\H5PCore::$styles as $style) { $settings['core']['styles'][] = $relpath . $style . $cachebuster; + $PAGE->requires->css(new moodle_url($liburl . $style . $cachebuster)); } // Add core JavaScript. foreach (\H5PCore::$scripts as $script) { diff --git a/styles.css b/styles.css index b395126b2..da54ad861 100644 --- a/styles.css +++ b/styles.css @@ -117,14 +117,4 @@ body.h5p-embed .clearer, body.h5p-embed #maincontent, body.h5p-embed #user-notifications { display: none; -} -/* Import styles to prevent loading after output in locallib */ - -@import 'library/styles/font-open-sans.css'; -@import 'library/styles/h5p.css'; -@import 'library/styles/h5p-admin.css'; -@import 'library/styles/h5p-confirmation-dialog.css'; -@import 'library/styles/h5p-core-button.css'; -@import 'library/styles/h5p-hub-registration.css'; -@import 'library/styles/h5p-hub-sharing.css'; -@import 'library/styles/h5p-tooltip.css'; +} \ No newline at end of file From b1105da5772a211a151acc0da9773154c3071154 Mon Sep 17 00:00:00 2001 From: Falcon Date: Mon, 25 Dec 2023 11:19:06 +0100 Subject: [PATCH 8/8] Change version to 1.26.1 --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index e1a695a20..06fa5b7a2 100644 --- a/version.php +++ b/version.php @@ -23,9 +23,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023122300; +$plugin->version = 2023122500; $plugin->requires = 2013051403; $plugin->cron = 0; $plugin->component = 'mod_hvp'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '1.26'; +$plugin->release = '1.26.1';