Event when quiz close time has passed

Event when quiz close time has passed

написао/ла Louis-Philippe Baron -
Број одговора: 3
Hello there,

I want to automatically get all grades of all attempts when a quiz closes (when end time has passed) to do an automatic export process to an external service. I found all quiz-related events on which I can sub, but none seems to be related to this behaviour.


A workaround can be to sub to quiz_attempt_submitted and try to deal with it, no probs about it, but I would prefer dealing with all attempts at the same time.


Am I right saying there is no event related to "quiz closed"-like event or am I missing something ?


Thanks by advance,

У одговору на Louis-Philippe Baron

Re: Event when quiz close time has passed

написао/ла Tim Hunt -
Слика Core developers Слика Documentation writers Слика Particularly helpful Moodlers Слика Peer reviewers Слика Plugin developers

There is no event for this (because no particuarl Moodle code runs at that time.

Another way to solve this would be to make a scheduled task, which queries the quiz settings table, and finds all quizzes that have timeclose between when the task last ran, and now.

У одговору на Tim Hunt

Re: Event when quiz close time has passed

написао/ла Louis-Philippe Baron -

Hello Tim,

Thanks confirming what I thought. Our system is now compliant with a single on it's API so I used the "quiz_attempt_submitted" event and I'm saving every attempt when it is finished and validated by moodle ; this event is doing the job.


Thanks for your reply tho !