I have a function I want to execute when a user finishes a quiz.
function wilson_random_task_quiz_finished($quiz, $score, $session_data) {
// ...
}
When a user finishes a quiz, I think the hook should be invoked from the following code of the Quiz module.
/**
* Actions to take at the end of a quiz
*
* @param $quiz
* The quiz node
* @param $rid
* Result id
* @param $score
* Score as a number
*/
function quiz_end_actions($quiz, $score, $session_data) {
// Call hook_quiz_finished().
module_invoke_all('quiz_finished', $quiz, $score, $session_data);
if (!empty($quiz->aid)) {
actions_do($quiz->aid, $quiz, $score, $session_data);
}
return $score;
}
My hook is not invoked. What am I missing?
quiz_end_actions
function is being called? – 2pha May 3 '16 at 8:35function [module name]_quiz_end_actions($quiz, $score, $session_data)
– No Sssweat May 3 '16 at 8:41