Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: totara compatibility #69

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions db/messages.php
Original file line number Diff line number Diff line change
@@ -24,6 +24,11 @@

defined('MOODLE_INTERNAL') || die();

// Totara compatibility.
if (!defined('MESSAGE_DEFAULT_ENABLED')) {
define('MESSAGE_DEFAULT_ENABLED', MESSAGE_DEFAULT_LOGGEDIN | MESSAGE_DEFAULT_LOGGEDOFF);
}

$messageproviders = array(
// Notify teacher that a student has submitted an attempt.
'submission' => array(
7 changes: 5 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
@@ -49,6 +49,11 @@
* @return mixed true if the feature is supported, null if unknown
*/
function hvp_supports($feature) {
// Totara compatibility.
if (defined('FEATURE_MOD_PURPOSE') && $feature == FEATURE_MOD_PURPOSE) {
return MOD_PURPOSE_CONTENT;
}

switch($feature) {
case FEATURE_GROUPS:
return true;
@@ -70,8 +75,6 @@ function hvp_supports($feature) {
return true;
case FEATURE_SHOW_DESCRIPTION:
return true;
case FEATURE_MOD_PURPOSE:
return MOD_PURPOSE_CONTENT;

default:
return null;

Unchanged files with check annotations Beta

return {
init: function () {
// Moodle complains if you pass in settings through init (js_call_amd) since they are too large
const settings = H5PSettings;

Check failure on line 5 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - pgsql - php 8.1 - mod_hvp

'H5PSettings' is not defined

Check failure on line 5 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - mariadb - php 8.1 - mod_hvp

'H5PSettings' is not defined

Check failure on line 5 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - pgsql - php 8.3 - mod_hvp

'H5PSettings' is not defined

Check failure on line 5 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - mariadb - php 8.3 - mod_hvp

'H5PSettings' is not defined
settings.container = document.getElementById('h5p-hub-registration');
H5PHub.createRegistrationUI(settings);

Check failure on line 7 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - pgsql - php 8.1 - mod_hvp

'H5PHub' is not defined

Check failure on line 7 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - mariadb - php 8.1 - mod_hvp

'H5PHub' is not defined

Check failure on line 7 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - pgsql - php 8.3 - mod_hvp

'H5PHub' is not defined

Check failure on line 7 in amd/src/contenthubregistration.js

GitHub Actions / ci / MOODLE_405_STABLE - mariadb - php 8.3 - mod_hvp

'H5PHub' is not defined
},
};
});