"Run now" for Scheduled Tasks for Plagiarism Plugins in 4.0?

"Run now" for Scheduled Tasks for Plagiarism Plugins in 4.0?

από David Winn -
Αριθμός απαντήσεων: 4

I am a plugin developer for a company who owns several plagiarism plugins in Moodle and I am testing Moodle 4.0.

I have found that the "Run now" link on the scheduled tasks page does not appear for plagiarism plugins. I have the path to PHP CLI field set, "Allow 'Run now' for scheduled tasks" set and "Enable plagiarism plugins" is also set. "Run now" appears for activity modules and Moodle tasks, but neither of the plagiarism plugins I am testing.

I have done some digging into the Moodle code and it seems that the call to $plugininfo->is_enabled() inside the mathod is_component_enabled() is returning null.

Is this something anyone else has encountered whilst testing plagiarism plugins in 4.0? I am trying to rule it out being my environment. I have done both an upgrade from 3.11 and a fresh install of 4.0 but no luck.

I know how to run the scheduled tasks from the CLI, but it is sometimes useful to run them from the web.

Μέσος όρος βαθμολογίας:Useful (1)
Σε απάντηση σε David Winn

Re: "Run now" for Scheduled Tasks for Plagiarism Plugins in 4.0?

από Dan Marsden -
Φωτογραφία Core developers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers Φωτογραφία Plugins guardians Φωτογραφία Testers Φωτογραφία Translators
Hey David!

We'll need to add the function "get_enabled_plugins" to the core\plugininfo\plagiarism class then loop over all plugins and check get_config('plagiarism_'.$plugin, 'enabled') setting.

although... this will also duplicate a chunk of the plagiarism_load_available_plugins function so I think we should probably write a new get_enabled_plugins in the core\plugininfo\plagiarism class then see if we can convert some of the old plagiarism_load_available_plugins calls to use the newer get_enabled_plugins style function.

If you get round to dropping this in the tracker - make sure you have the "plagiarism" component selected in the tracker issue or ping me and I'll take a look!
Σε απάντηση σε Dan Marsden

Re: "Run now" for Scheduled Tasks for Plagiarism Plugins in 4.0?

από David Winn -
Hi Dan,

It just seems odd because this works fine in 3.11 and prior versions. I don't know what may have changed in 4.0 to cause this to stop working. It feels like a regression so maybe it doesn't need a lot of work.

What I have noticed with further digging is that in the load_enabled_plugins() method in plugin_manager.php, the line $enabled = $plugininfoclass::get_enabled_plugins(); returns null for \core\plugininfo\plagiarism despite "Enable plagiarism plugins" being set in the UI admin page. I don't understand why and can't figure that out.

I will create a tracker issue but may be later today.
Σε απάντηση σε David Winn

Re: "Run now" for Scheduled Tasks for Plagiarism Plugins in 4.0?

από Paul Holden -
Φωτογραφία Core developers Φωτογραφία Moodle HQ Φωτογραφία Moodle Workplace team Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers Φωτογραφία Testers
Hi both,

Please see MDL-75322