mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-28166 send quiz event notifications asynchronously.
This avoids the problem that you cannot send messages in transactions. It also means that the quiz submission will not be prevented, and the message will still be sent eventually, if any part of the messaging system is giving intermittent errors when the student wants to submit their quiz.
- Loading branch information
Showing
8 changed files
with
196 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Post-install code for the quiz module. | ||
* | ||
* @package mod | ||
* @subpackage quiz | ||
* @copyright 2011 The Open University | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
||
$handlers = array( | ||
// Handle our own quiz_attempt_submitted event, as a way to send confirmation | ||
// messages asynchronously. | ||
'quiz_attempt_submitted' => array ( | ||
'handlerfile' => '/mod/quiz/locallib.php', | ||
'handlerfunction' => 'quiz_attempt_submitted_handler', | ||
'schedule' => 'cron', | ||
), | ||
); | ||
|
||
/* List of events generated by the quiz module, with the fields on the event object. | ||
quiz_attempt_started | ||
->component = 'mod_quiz'; | ||
->attemptid = // The id of the new quiz attempt. | ||
->timestart = // The timestamp of when the attempt was started. | ||
->userid = // The user id that the attempt belongs to. | ||
->quizid = // The quiz id of the quiz the attempt belongs to. | ||
->cmid = // The course_module id of the quiz the attempt belongs to. | ||
->courseid = // The course id of the course the quiz belongs to. | ||
quiz_attempt_submitted | ||
->component = 'mod_quiz'; | ||
->attemptid = // The id of the quiz attempt that was submitted. | ||
->timefinish = // The timestamp of when the attempt was submitted. | ||
->userid = // The user id that the attempt belongs to. | ||
->submitterid = // The user id of the user who sumitted the attempt. | ||
->quizid = // The quiz id of the quiz the attempt belongs to. | ||
->cmid = // The course_module id of the quiz the attempt belongs to. | ||
->courseid = // The course id of the course the quiz belongs to. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.