本文整理汇总了PHP中Tracking::get_last_connection_time_in_lp方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracking::get_last_connection_time_in_lp方法的具体用法?PHP Tracking::get_last_connection_time_in_lp怎么用?PHP Tracking::get_last_connection_time_in_lp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracking
的用法示例。
在下文中一共展示了Tracking::get_last_connection_time_in_lp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_not_allowed
if (!$isAllowedToEdit) {
api_not_allowed(true);
}
$lpTable = Database::get_course_table(TABLE_LP_MAIN);
$lpId = isset($_GET['lp_id']) ? boolval($_GET['lp_id']) : false;
$sessionId = api_get_session_id();
$courseId = api_get_course_int_id();
$courseCode = api_get_course_id();
$sessionUsers = SessionManager::get_users_by_session($sessionId, 0);
$userList = [];
$lpInfo = Database::select('*', $lpTable, array('where' => array('c_id = ? AND ' => $courseId, 'id = ?' => $lpId)), 'first');
foreach ($sessionUsers as $user) {
$lpTime = Tracking::get_time_spent_in_lp($user['user_id'], $courseCode, array($lpId), $sessionId);
$lpScore = Tracking::get_avg_student_score($user['user_id'], $courseCode, array($lpId), $sessionId);
$lpPogress = Tracking::get_avg_student_progress($user['user_id'], $courseCode, array($lpId), $sessionId);
$lpLastConnection = Tracking::get_last_connection_time_in_lp($user['user_id'], $courseCode, array($lpId), $sessionId);
$lpLastConnection = empty($lpLastConnection) ? '-' : api_convert_and_format_date($lpLastConnection, DATE_TIME_FORMAT_LONG);
$userList[] = ['id' => $user['user_id'], 'first_name' => $user['firstname'], 'last_name' => $user['lastname'], 'lp_time' => api_time_to_hms($lpTime), 'lp_score' => is_numeric($lpScore) ? "{$lpScore}%" : $lpScore, 'lp_progress' => "{$lpPogress}%", 'lp_last_connection' => $lpLastConnection];
}
// View
$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php', 'name' => get_lang('LearningPaths')];
$actions = Display::url(Display::return_icon('back.png', get_lang('Back'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?' . api_get_cidreq());
$template = new Template(get_lang('StudentScore'));
$template->assign('user_list', $userList);
$template->assign('session_id', api_get_session_id());
$template->assign('course_code', api_get_course_id());
$template->assign('lp_id', $lpId);
$layout = $template->get_template('learnpath/report.tpl');
$template->assign('header', $lpInfo['name']);
$template->assign('actions', $actions);
$template->assign('content', $template->fetch($layout));
示例2: show_course_detail
//.........这里部分代码省略.........
$best_score = ExerciseLib::show_score($best_score_data['exe_result'], $best_score_data['exe_weighting']);
}
if ($attempts > 0) {
$exercise_stat = ExerciseLib::get_best_attempt_by_user(api_get_user_id(), $exercices['id'], $course_info['real_id'], $session_id);
if (!empty($exercise_stat)) {
//Always getting the BEST attempt
$score = $exercise_stat['exe_result'];
$weighting = $exercise_stat['exe_weighting'];
$exe_id = $exercise_stat['exe_id'];
$latest_attempt_url .= api_get_path(WEB_CODE_PATH) . 'exercice/result.php?id=' . $exe_id . '&cidReq=' . $course_info['code'] . '&show_headers=1&id_session=' . $session_id;
$percentage_score_result = Display::url(ExerciseLib::show_score($score, $weighting), $latest_attempt_url);
$my_score = 0;
if (!empty($weighting) && intval($weighting) != 0) {
$my_score = $score / $weighting;
}
//@todo this function slows the page
$position = ExerciseLib::get_exercise_result_ranking($my_score, $exe_id, $exercices['id'], $course_info['code'], $session_id, $user_list);
$graph = self::generate_exercise_result_thumbnail_graph($to_graph_exercise_result[$exercices['id']]);
$normal_graph = self::generate_exercise_result_graph($to_graph_exercise_result[$exercices['id']]);
}
}
$html .= Display::div($normal_graph, array('id' => 'main_graph_' . $exercices['id'], 'class' => 'dialog', 'style' => 'display:none'));
if (empty($graph)) {
$graph = '-';
} else {
$graph = Display::url('<img src="' . $graph . '" >', $normal_graph, array('id' => $exercices['id'], 'class' => 'expand-image'));
}
$html .= Display::tag('td', $attempts, array('align' => 'center'));
$html .= Display::tag('td', $percentage_score_result, array('align' => 'center'));
$html .= Display::tag('td', $position, array('align' => 'center'));
$html .= Display::tag('td', $best_score, array('align' => 'center'));
$html .= Display::tag('td', $graph, array('align' => 'center'));
//$html .= Display::tag('td', $latest_attempt_url, array('align'=>'center', 'width'=>'25'));
} else {
// Exercise configuration NO results
$html .= Display::tag('td', $attempts, array('align' => 'center'));
$html .= Display::tag('td', '-', array('align' => 'center'));
$html .= Display::tag('td', '-', array('align' => 'center'));
$html .= Display::tag('td', '-', array('align' => 'center'));
$html .= Display::tag('td', '-', array('align' => 'center'));
}
$html .= '</tr>';
}
} else {
$html .= '<tr><td colspan="5" align="center">' . get_lang('NoEx') . '</td></tr>';
}
$html .= '</table>';
// LP table results
$html .= '<table class="data_table">';
$html .= Display::tag('th', get_lang('Learnpaths'), array('class' => 'head', 'style' => 'color:#000'));
$html .= Display::tag('th', get_lang('LatencyTimeSpent'), array('class' => 'head', 'style' => 'color:#000'));
$html .= Display::tag('th', get_lang('Progress'), array('class' => 'head', 'style' => 'color:#000'));
$html .= Display::tag('th', get_lang('Score'), array('class' => 'head', 'style' => 'color:#000'));
$html .= Display::tag('th', get_lang('LastConnexion'), array('class' => 'head', 'style' => 'color:#000'));
$html .= '</tr>';
$list = new LearnpathList(api_get_user_id(), $course_info['code'], $session_id, 'publicated_on ASC', true);
$lp_list = $list->get_flat_list();
if (!empty($lp_list) > 0) {
foreach ($lp_list as $lp_id => $learnpath) {
$progress = Tracking::get_avg_student_progress($user_id, $course, array($lp_id), $session_id);
$last_connection_in_lp = Tracking::get_last_connection_time_in_lp($user_id, $course, $lp_id, $session_id);
$time_spent_in_lp = Tracking::get_time_spent_in_lp($user_id, $course, array($lp_id), $session_id);
$percentage_score = Tracking::get_avg_student_score($user_id, $course, array($lp_id), $session_id);
if (is_numeric($percentage_score)) {
$percentage_score = $percentage_score . '%';
} else {
$percentage_score = '0%';
}
$time_spent_in_lp = api_time_to_hms($time_spent_in_lp);
$html .= '<tr class="row_even">';
$url = api_get_path(WEB_CODE_PATH) . "newscorm/lp_controller.php?cidReq={$course_code}&id_session={$session_id}&lp_id={$lp_id}&action=view";
if ($learnpath['lp_visibility'] == 0) {
$html .= Display::tag('td', $learnpath['lp_name']);
} else {
$html .= Display::tag('td', Display::url($learnpath['lp_name'], $url, array('target' => SESSION_LINK_TARGET)));
}
$html .= Display::tag('td', $time_spent_in_lp, array('align' => 'center'));
if (is_numeric($progress)) {
$progress = $progress . '%';
}
$html .= Display::tag('td', $progress, array('align' => 'center'));
$html .= Display::tag('td', $percentage_score);
$last_connection = '-';
if (!empty($last_connection_in_lp)) {
$last_connection = api_convert_and_format_date($last_connection_in_lp, DATE_TIME_FORMAT_LONG);
}
$html .= Display::tag('td', $last_connection, array('align' => 'center', 'width' => '180px'));
$html .= "</tr>";
}
} else {
$html .= '<tr>
<td colspan="4" align="center">
' . get_lang('NoLearnpath') . '
</td>
</tr>';
}
$html .= '</table>';
}
return $html;
}
示例3: array
$lp_name = $learnpath['name'];
$any_result = false;
// Get progress in lp
$progress = Tracking::get_avg_student_progress($student_id, $course_code, array($lp_id), $sessionId);
if ($progress === null) {
$progress = '0%';
} else {
$any_result = true;
}
// Get time in lp
$total_time = Tracking::get_time_spent_in_lp($student_id, $course_code, array($lp_id), $sessionId);
if (!empty($total_time)) {
$any_result = true;
}
// Get last connection time in lp
$start_time = Tracking::get_last_connection_time_in_lp($student_id, $course_code, $lp_id, $sessionId);
if (!empty($start_time)) {
$start_time = api_convert_and_format_date($start_time, DATE_TIME_FORMAT_LONG);
} else {
$start_time = '-';
}
if (!empty($total_time)) {
$any_result = true;
}
// Quiz in lp
$score = Tracking::get_avg_student_score($student_id, $course_code, array($lp_id), $sessionId);
// Latest exercise results in a LP
$score_latest = Tracking::get_avg_student_score($student_id, $course_code, array($lp_id), $sessionId, false, true);
if ($i % 2 == 0) {
$css_class = "row_even";
} else {