You are here

function course_quiz_quiz_finished in Course 6

Same name and namespace in other branches
  1. 7.2 modules/course_quiz/course_quiz.module \course_quiz_quiz_finished()
  2. 7 modules/course_quiz/course_quiz.module \course_quiz_quiz_finished()

Implements hook_quiz_finished().

Update the fulfillment record.

File

modules/course_quiz/course_quiz.module, line 42

Code

function course_quiz_quiz_finished($quiz, $score, $rid) {
  $uid = db_result(db_query('SELECT uid FROM {quiz_node_results} WHERE result_id = %d', $rid));
  $account = user_load($uid);
  if ($courseObject = course_get_course_object('course_quiz', 'quiz', $quiz->nid, $account)) {
    $courseObject
      ->grade($account, $rid);
  }
}