mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
MDL-40063 mod_quiz: replaced 'continue attempt' add_to_log call with an event
This commit is contained in:
parent
8de2eb3582
commit
e0114708af
4 changed files with 152 additions and 3 deletions
|
@ -95,9 +95,18 @@ if ($autosaveperiod) {
|
|||
}
|
||||
|
||||
// Log this page view.
|
||||
add_to_log($attemptobj->get_courseid(), 'quiz', 'continue attempt',
|
||||
'review.php?attempt=' . $attemptobj->get_attemptid(),
|
||||
$attemptobj->get_quizid(), $attemptobj->get_cmid());
|
||||
$params = array(
|
||||
'objectid' => $attemptid,
|
||||
'relateduserid' => $attemptobj->get_userid(),
|
||||
'courseid' => $attemptobj->get_courseid(),
|
||||
'context' => context_module::instance($attemptobj->get_cmid()),
|
||||
'other' => array(
|
||||
'quizid' => $attemptobj->get_quizid()
|
||||
)
|
||||
);
|
||||
$event = \mod_quiz\event\attempt_viewed::create($params);
|
||||
$event->add_record_snapshot('quiz_attempts', $attemptobj->get_attempt());
|
||||
$event->trigger();
|
||||
|
||||
// Get the list of questions needed by this page.
|
||||
$slots = $attemptobj->get_slots($page);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue