You are here

quiz_certificate.module in Certificate 6

File

modules/quiz_certificate/quiz_certificate.module
View source
<?php

/**
 * Implementation of hook_access_certificate().
 */
function quiz_certificate_access_certificate($node, $user) {
  if ($node->type == 'quiz') {
    $results = _quiz_get_results($node->nid, $user->uid);
    foreach ($results as $rid => $result) {
      if ($result['time_end'] && $result['score'] > $node->pass_rate) {
        return TRUE;
      }
    }
  }
}

Functions