FMCorz / moodle-block_xp

A gamification plugin for Moodle allowing students to gain experience points and level up.
https://levelup.plus/?ref=github
150 stars 41 forks source link

Not possible to reward students for completing a course #70

Closed davosmith closed 6 years ago

davosmith commented 7 years ago

There does not seem to be a way to reward students for completing a course.

You can enter '\core\event\course_completed' as the event to catch, but due to course completion being processed by cron, the correct userid in this case is $event->relateduserid, not $event->userid, so the code never makes it through the initial background checks (in block_xp_helper::observer) and into the part that checks if the event is relevant.

FMCorz commented 7 years ago

Thanks for the report.

Indeed, by design the block only rewards for events which occur as the students perform actions, not when they are deferred. However, I'm working on something which should make it possible.

kineoalex commented 7 years ago

Hi @FMCorz, we've come across the same issue as well. Do you have any idea on when you might have an update to address it? Many thanks!

FMCorz commented 7 years ago

Hopefully soon.

FMCorz commented 6 years ago

This feature is now available through the add-on Level up! Plus.