Trigger Moodle redirect function using scrom event \mod_scorm\event\status_submitted

Trigger Moodle redirect function using scrom event \mod_scorm\event\status_submitted

by Eiz Eddin Al Katrib -
Number of replies: 1
Picture of Core developers Picture of Plugin developers

Hi,

I am observing the scorm event "\mod_scorm\event\status_submitted" to try to trigger Moodle redirect($url) function, however I am not able to get this function executed using that event.

Can someone please advice if it is possible to trigger this function using this event?

By the way, I am able to observe that event correctly and I am already using it for other actions, like adding a key and a value to the sessions.

Please let me know if you need any further details.

Thanks

Average of ratings: -
In reply to Eiz Eddin Al Katrib

Re: Trigger Moodle redirect function using scrom event \mod_scorm\event\status_submitted

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You cannot use a redirect inside an event handler - if you were allowed to do so, you would break any further code that the event triggering page still had to execute, as well as preventing any other observers from handling that same event.


Average of ratings: Useful (1)