Hi everyone,
I'm not sure if Alejandro managed to do what he wanted due to the Moodle version he was running... but looks like I'm trying to achieve the same task but I'm having difficulties in doing so. I've created the class for the scheduler to look at to perform the scheduled tasks (under mod/assign/submission/myplugin/classes/task/scheduler.php), as so:
I don't think my namespaces are correct too.. When I upgrade my plugin I get the following error:
Failed to load task: \/mod/assign/submission/myplugin/task/scheduleTest
But my question is, how can I schedule a task which I have currently running in locallib.php? I have a function in that file which is executed when a student submits their assignment (when the file uploaded event is triggered). How can I run the piece of code which I currently have in that function in the scheduler class in scheduler.php? Hope that all makes a bit of sense :/