mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-41039 mod_quiz: Renaming event to attempt_becameoverdue
This commit is contained in:
parent
d900f1dc05
commit
0a8b091d41
4 changed files with 9 additions and 6 deletions
|
@ -1459,7 +1459,7 @@ class quiz_attempt {
|
|||
$this->attempt->timecheckstate = $timestamp;
|
||||
$DB->update_record('quiz_attempts', $this->attempt);
|
||||
|
||||
$this->fire_state_transition_event('\mod_quiz\event\attempt_timelimit_exceeded', $timestamp);
|
||||
$this->fire_state_transition_event('\mod_quiz\event\attempt_becameoverdue', $timestamp);
|
||||
|
||||
$transaction->allow_commit();
|
||||
}
|
||||
|
|
|
@ -27,11 +27,14 @@ defined('MOODLE_INTERNAL') || die();
|
|||
/**
|
||||
* Event for when a quiz attempt is overdue.
|
||||
*
|
||||
* Please note that the name of this event is not following the event naming convention.
|
||||
* Its name should not be used as a reference for other events to be created.
|
||||
*
|
||||
* @package mod_quiz
|
||||
* @copyright 2013 Adrian Greeve <adrian@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class attempt_timelimit_exceeded extends \core\event\base {
|
||||
class attempt_becameoverdue extends \core\event\base {
|
||||
|
||||
/**
|
||||
* Init method.
|
|
@ -50,10 +50,10 @@ $observers = array(
|
|||
'callback' => '\mod_quiz\group_observers::group_member_removed',
|
||||
),
|
||||
|
||||
// Handle our own \mod_quiz\event\attempt_timelimit_exceeded event, to email
|
||||
// Handle our own \mod_quiz\event\attempt_becameoverdue event, to email
|
||||
// the student to let them know they forgot to submit, and that they have another chance.
|
||||
array(
|
||||
'eventname' => '\mod_quiz\event\attempt_timelimit_exceeded',
|
||||
'eventname' => '\mod_quiz\event\attempt_becameoverdue',
|
||||
'includefile' => '/mod/quiz/locallib.php',
|
||||
'callback' => 'quiz_attempt_overdue_handler',
|
||||
'internal' => false,
|
||||
|
|
|
@ -119,7 +119,7 @@ class mod_quiz_events_testcase extends advanced_testcase {
|
|||
$this->assertEventLegacyData($legacydata, $event);
|
||||
}
|
||||
|
||||
public function test_attempt_timelimit_exceeded() {
|
||||
public function test_attempt_becameoverdue() {
|
||||
|
||||
list($quizobj, $quba, $attempt) = $this->prepare_quiz_data();
|
||||
$attemptobj = quiz_attempt::create($attempt->id);
|
||||
|
@ -133,7 +133,7 @@ class mod_quiz_events_testcase extends advanced_testcase {
|
|||
|
||||
$this->assertCount(1, $events);
|
||||
$event = $events[0];
|
||||
$this->assertInstanceOf('\mod_quiz\event\attempt_timelimit_exceeded', $event);
|
||||
$this->assertInstanceOf('\mod_quiz\event\attempt_becameoverdue', $event);
|
||||
$this->assertEquals('quiz_attempts', $event->objecttable);
|
||||
$this->assertEquals($quizobj->get_context(), $event->get_context());
|
||||
$this->assertEquals($attempt->userid, $event->relateduserid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue