Skip to content

Commit

Permalink
MDL-45803 mod_quiz: removed the quiz_fire_attempt_started function
Browse files Browse the repository at this point in the history
Also commented in mod/quiz/upgrade.txt to inform developers.
  • Loading branch information
mdjnelson committed Jun 11, 2014
1 parent 62a3472 commit b4cfcf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
19 changes: 0 additions & 19 deletions mod/quiz/locallib.php
Expand Up @@ -316,25 +316,6 @@ function quiz_attempt_save_started($quizobj, $quba, $attempt) {
return $attempt;
}

/**
* Fire an event to tell the rest of Moodle a quiz attempt has started.
*
* @param object $attempt
* @param quiz $quizobj
*/
function quiz_fire_attempt_started_event($attempt, $quizobj) {
// Trigger event.
$eventdata = array();
$eventdata['context'] = $quizobj->get_context();
$eventdata['courseid'] = $quizobj->get_courseid();
$eventdata['relateduserid'] = $attempt->userid;
$eventdata['objectid'] = $attempt->id;
$event = \mod_quiz\event\attempt_started::create($eventdata);
$event->add_record_snapshot('quiz', $quizobj->get_quiz());
$event->add_record_snapshot('quiz_attempts', $attempt);
$event->trigger();
}

/**
* Returns an unfinished attempt (if there is one) for the given
* user on the given quiz. This function does not return preview attempts.
Expand Down
7 changes: 7 additions & 0 deletions mod/quiz/upgrade.txt
@@ -1,5 +1,12 @@
This files describes API changes in the quiz code.

=== 2.7.1 ===

* The function quiz_fire_attempt_started_event has been removed. This function
should not have been used outside the quiz, but if you were using it, you should
trigger the event outside this function. Note that the appropriate start event is
fired automatically by the quiz_attempt_save_started function.

=== 2.7 ===

* The old quiz.questions database column (comma-separated list of question ids)
Expand Down

0 comments on commit b4cfcf5

Please sign in to comment.