Пример #1
0
 /**
  * Checks whether the certificate button could be shown on the info page or not
  *
  * @access public
  */
 function canShowCertificate($testSession, $user_id, $active_id)
 {
     if ($this->canShowTestResults($testSession)) {
         include_once "./Services/Certificate/classes/class.ilCertificate.php";
         include_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
         $cert = new ilCertificate(new ilTestCertificateAdapter($this));
         if ($cert->isComplete()) {
             $vis = $this->getCertificateVisibility();
             $showcert = FALSE;
             switch ($vis) {
                 case 0:
                     $showcert = TRUE;
                     break;
                 case 1:
                     if ($this->getPassed($active_id)) {
                         $showcert = TRUE;
                     }
                     break;
                 case 2:
                     $showcert = FALSE;
                     break;
             }
             if ($showcert) {
                 return TRUE;
             } else {
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }