You are here

public function CourseObjectQuiz::unenroll in Course 7

Same name and namespace in other branches
  1. 6 modules/course_quiz/course_quiz.classes.inc \CourseObjectQuiz::unenroll()

Remove all quiz attempts associated with this fulfillment.

File

modules/course_quiz/course_quiz.classes.inc, line 150

Class

CourseObjectQuiz

Code

public function unenroll() {
  parent::unenroll();
  $fulfillment = $this
    ->getFulfillment();
  $result_ids = (array) $fulfillment
    ->getOption('quiz_result_ids');
  if (course_quiz_quiz_version() >= 5) {
    entity_delete_multiple('quiz_result', $result_ids);
  }
  else {
    quiz_delete_results($result_ids);
  }
}