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

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

by David Winn -
Number of replies: 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.

Average of ratings: Useful (1)
In reply to David Winn

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

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of 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!
In reply to Dan Marsden

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

by 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.
In reply to David Winn

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

by Paul Holden -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi both,

Please see MDL-75322
In reply to Paul Holden

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

by David Winn -
Hi Paul,

Thanks for the update on that.

I totally forgot to create a tracker issue for it back in April like I said I would in my previous comment. It was a busy period here.