当前位置: 首页>>代码示例>>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;未经允许,请勿转载。