本文整理汇总了PHP中EfrontLesson::getUserActiveTimeInUnit方法的典型用法代码示例。如果您正苦于以下问题:PHP EfrontLesson::getUserActiveTimeInUnit方法的具体用法?PHP EfrontLesson::getUserActiveTimeInUnit怎么用?PHP EfrontLesson::getUserActiveTimeInUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EfrontLesson
的用法示例。
在下文中一共展示了EfrontLesson::getUserActiveTimeInUnit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
if ($ruleCheck !== true) {
$message = $ruleCheck;
$message_type = 'failure';
$smarty->assign("T_RULE_CHECK_FAILED", true);
$ruleCheck = false;
}
$smarty->assign("T_USER_PROGRESS", $userProgress);
}
if ($_student_) {
if (preg_match("#</object>#", $currentUnit['data']) || preg_match("#</applet>#", $currentUnit['data'])) {
$smarty->assign("T_CONTAINS_FLASH", true);
}
//$smarty -> assign("T_NEXT_LESSON", $currentLesson -> getNextLesson());
//$userTimeInUnit = EfrontTimes::formatTimeForReporting($times->getUserSessionTimeInUnit($currentUser->user['login'], $currentUnit['id']));
$userTimeInUnit = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInUnit($currentUser->user['login'], $currentUnit['id']));
$smarty->assign("T_USER_TIME_IN_UNIT", $userTimeInUnit);
//$smarty -> assign("T_USER_CURRENT_TIME_IN_UNIT", $times->getUserCurrentSessionTimeInUnit($currentUser->user['login'], $currentUnit['id']));
$userTimeInLesson = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInLesson($currentUser->user['login'], $currentLesson->lesson['id']));
$smarty->assign("T_USER_CURRENT_TIME_IN_LESSON", $userTimeInLesson['total_seconds']);
$smarty->assign("T_USER_TIME_IN_LESSON", $userTimeInLesson);
foreach ($currentLesson->getConditions() as $value) {
if ($value['type'] == 'time_in_lesson') {
$smarty->assign("T_REQUIRED_TIME_IN_LESSON", $value['options'][0] * 60);
}
}
if ($_change_ && $currentLesson->options['tracking'] && $currentUnit['options']['complete_unit_setting'] == EfrontUnit::COMPLETION_OPTIONS_AUTOCOMPLETE && $ruleCheck && !in_array($currentUnit['id'], array_keys($seenContent))) {
$smarty->assign("T_AUTO_SET_SEEN_UNIT", true);
}
if ($_change_ && $currentLesson->options['tracking'] && $currentUnit['options']['complete_unit_setting'] == EfrontUnit::COMPLETION_OPTIONS_COMPLETEAFTERSECONDS && $ruleCheck && !in_array($currentUnit['id'], array_keys($seenContent)) && $userTimeInUnit['total_seconds'] > $currentUnit['options']['complete_time']) {
$smarty->assign("T_AUTO_SET_SEEN_UNIT", true);
示例2: themes
}
$currentTheme = new themes($_SESSION['s_theme']);
$newTime = '';
$jsonValues = array();
if ($_SESSION['s_login']) {
$entity = getUserTimeTarget($_GET['HTTP_REFERER']);
//Update times for this entity
if ($_SESSION['s_lesson_user_type'] == 'student' && isset($_POST['user_total_time_in_unit']) && current($entity) == 'unit' && eF_checkParameter(key($entity), 'id')) {
$newTime = $_POST['user_total_time_in_unit'];
$jsonValues['entity'] = current($entity);
$jsonValues['entity_id'] = current($entity);
if ($newTime && is_numeric($newTime)) {
$result = eF_executeNew("insert into users_to_content (users_LOGIN, content_ID, lessons_ID) values('" . $_SESSION['s_login'] . "', " . key($entity) . ", " . $_SESSION['s_lessons_ID'] . ") on duplicate key update total_time={$newTime}");
$jsonValues['time_in_unit'] = EfrontTimes::formatTimeForReporting($newTime);
} else {
$jsonValues['old_time_in_unit'] = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInUnit($_SESSION['s_login'], key($entity)));
$jsonValues['old_time_in_lesson'] = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInLesson($_SESSION['s_login'], $_SESSION['s_lessons_ID']));
}
}
if (empty($_SESSION['last_periodic_check']) || time() - $_SESSION['last_periodic_check'] >= ceil($GLOBALS['configuration']['updater_period'] / 1000)) {
$result = eF_executeNew("update user_times set time=time+(" . time() . "-timestamp_now),timestamp_now=" . time() . "\r\n\t\t\t\t\t\twhere session_expired = 0 and session_custom_identifier = '" . $_SESSION['s_custom_identifier'] . "' and users_LOGIN = '" . $_SESSION['s_login'] . "'\r\n\t\t\t\t\t\tand entity = '" . current($entity) . "' and entity_id = '" . key($entity) . "'");
$_SESSION['last_periodic_check'] = time();
if ($currentTheme->options['sidebar_interface'] == 0) {
if (empty($_SESSION['last_periodic_check_users']) || time() - $_SESSION['last_periodic_check_users'] >= 300) {
$_SESSION['last_periodic_check_users'] = $_SESSION['last_periodic_check'];
$online = EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60);
$_SESSION['online_users'] = $online;
if ($currentTheme->options['sidebar_interface'] == 0) {
$jsonValues['online'] = $online;
}
} else {