Thanks a lot, Andreas... I was no considering the variables $course and $cm, because it's a local pluging that was not intended to be instantiated in courses and I assumed wrongly that they would not be necessary.
I added those two parameters and it works correctly.
Thanks for your time, Andreas. Much appreciated.
I added those two parameters and it works correctly.
Thanks for your time, Andreas. Much appreciated.