Cope with API change in M2.8

Hi Bas,

Changes for Moodle 2.8.

Tested a little and this appears to be the only thing that crops up.  Perhaps there needs to be a M2.7 development branch?

Cheers,

Gareth