本文整理汇总了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;
}
示例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");
}
}