本文整理汇总了PHP中ExerciseLib::convert_to_percentage方法的典型用法代码示例。如果您正苦于以下问题:PHP ExerciseLib::convert_to_percentage方法的具体用法?PHP ExerciseLib::convert_to_percentage怎么用?PHP ExerciseLib::convert_to_percentage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExerciseLib
的用法示例。
在下文中一共展示了ExerciseLib::convert_to_percentage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_user_progress
//.........这里部分代码省略.........
$count_exercises = 0;
if (is_array($exercises) && !empty($exercises)) {
$count_exercises = count($exercises);
}
// Count of user results
$done_exercises = null;
$courseInfo = api_get_course_info($course_data['code']);
$answered_exercises = 0;
if (!empty($exercises)) {
foreach ($exercises as $exercise_item) {
$attempts = Event::count_exercise_attempts_by_user(api_get_user_id(), $exercise_item['id'], $courseInfo['real_id'], $my_session_id);
if ($attempts > 1) {
$answered_exercises++;
}
}
}
// Average
$average = ExerciseLib::get_average_score_by_course($courseInfo['real_id'], $my_session_id);
$all_exercises += $count_exercises;
$all_unanswered_exercises_by_user += $count_exercises - $answered_exercises;
$all_average += $average;
}
$all_average = $all_average / count($course_list);
if (isset($_GET['session_id']) && $my_session_id == $_GET['session_id']) {
$html .= '<tr style="background-color:#FBF09D">';
} else {
$html .= '<tr>';
}
$url = api_get_path(WEB_CODE_PATH) . "session/index.php?session_id={$my_session_id}";
$html .= Display::tag('td', Display::url($session_name, $url, array('target' => SESSION_LINK_TARGET)));
$html .= Display::tag('td', $all_exercises);
$html .= Display::tag('td', $all_unanswered_exercises_by_user);
//$html .= Display::tag('td', $all_done_exercise);
$html .= Display::tag('td', ExerciseLib::convert_to_percentage($all_average));
if (isset($_GET['session_id']) && $my_session_id == $_GET['session_id']) {
$icon = Display::url(Display::return_icon('2rightarrow_na.png', get_lang('Details')), '?session_id=' . $my_session_id);
} else {
$icon = Display::url(Display::return_icon('2rightarrow.png', get_lang('Details')), '?session_id=' . $my_session_id);
}
$html .= Display::tag('td', $icon);
$html .= '</tr>';
}
$html .= '</table><br />';
$html .= Display::div($main_session_graph, array('id' => 'session_graph', 'class' => 'chart-session', 'style' => 'position:relative; text-align: center;'));
// Checking selected session.
if (isset($_GET['session_id'])) {
$session_id_from_get = intval($_GET['session_id']);
$session_data = $course_in_session[$session_id_from_get];
$course_list = $session_data['course_list'];
$html .= Display::tag('h3', $session_data['name'] . ' - ' . get_lang('CourseList'));
$html .= '<table class="data_table" width="100%">';
//'.Display::tag('th', get_lang('DoneExercises'), array('class'=>'head')).'
$html .= '
<tr>
<th width="300px">' . get_lang('Course') . '</th>
' . Display::tag('th', get_lang('PublishedExercises'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('NewExercises'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('MyAverage'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('AverageExerciseResult'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('LPProgress'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('Score') . Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class' => 'head')) . '
' . Display::tag('th', get_lang('LastConnexion'), array('class' => 'head')) . '
' . Display::tag('th', get_lang('Details'), array('class' => 'head')) . '
</tr>';
foreach ($course_list as $course_data) {