當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilFormat::ftimestamp2datetimeDB方法代碼示例

本文整理匯總了PHP中ilFormat::ftimestamp2datetimeDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilFormat::ftimestamp2datetimeDB方法的具體用法?PHP ilFormat::ftimestamp2datetimeDB怎麽用?PHP ilFormat::ftimestamp2datetimeDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilFormat的用法示例。


在下文中一共展示了ilFormat::ftimestamp2datetimeDB方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isExecutable

 /**
  * Checks if the test is executable by the given user
  *
  * @param ilTestSession|ilTestSessionDynamicQuestionSet
  * @param integer $user_id The user id
  * @return array Result array
  * @access public
  */
 function isExecutable($testSession, $user_id, $allowPassIncrease = FALSE)
 {
     $result = array("executable" => true, "errormessage" => "");
     if (!$this->startingTimeReached()) {
         $result["executable"] = false;
         $result["errormessage"] = sprintf($this->lng->txt("detail_starting_time_not_reached"), ilFormat::ftimestamp2datetimeDB($this->getStartingTime()));
         return $result;
     }
     if ($this->endingTimeReached()) {
         $result["executable"] = false;
         $result["errormessage"] = sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->getEndingTime()));
         return $result;
     }
     $active_id = $this->getActiveIdOfUser($user_id);
     if ($this->getEnableProcessingTime()) {
         if ($active_id > 0) {
             $starting_time = $this->getStartingTimeOfUser($active_id);
             if ($starting_time !== FALSE) {
                 if ($this->isMaxProcessingTimeReached($starting_time, $active_id)) {
                     if ($allowPassIncrease && $this->getResetProcessingTime() && ($this->getNrOfTries() == 0 || $this->getNrOfTries() > $this->_getPass($active_id) + 1)) {
                         // a test pass was quitted because the maximum processing time was reached, but the time
                         // will be resetted for future passes, so if there are more passes allowed, the participant may
                         // start the test again.
                         // This code block is only called when $allowPassIncrease is TRUE which only happens when
                         // the test info page is opened. Otherwise this will lead to unexpected results!
                         $testSession->increasePass();
                         $testSession->setLastSequence(0);
                         $testSession->saveToDb();
                     } else {
                         $result["executable"] = false;
                         $result["errormessage"] = $this->lng->txt("detail_max_processing_time_reached");
                     }
                     return $result;
                 }
             }
         }
     }
     if ($this->hasNrOfTriesRestriction() && $active_id > 0) {
         require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
         $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this);
         $testPassesSelector->setActiveId($active_id);
         $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
         $closedPasses = $testPassesSelector->getReportablePasses();
         if (count($closedPasses) >= $this->getNrOfTries()) {
             $result["executable"] = false;
             $result["errormessage"] = $this->lng->txt("maximum_nr_of_tries_reached");
             return $result;
         }
     }
     return $result;
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:59,代碼來源:class.ilObjTest.php

示例2: endingTimeReached

 /**
  * handle endingTimeReached
  * @private
  */
 function endingTimeReached()
 {
     ilUtil::sendInfo(sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->object->getEndingTime())));
     $this->testSession->increasePass();
     $this->testSession->setLastSequence(0);
     $this->testSession->saveToDb();
     if (!$this->object->canViewResults()) {
         $this->outIntroductionPage();
     } else {
         $this->ctrl->redirectByClass("ilTestEvaluationGUI", "outUserResultsOverview");
     }
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:16,代碼來源:class.ilTestPlayerAbstractGUI.php


注:本文中的ilFormat::ftimestamp2datetimeDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。