Skip to content

Commit

Permalink
Add course_session_data anchor & minor changes
Browse files Browse the repository at this point in the history
- Replace OR with ||
- Minor format code
- Adding api_get_self()
  • Loading branch information
jmontoyaa committed Apr 11, 2017
1 parent 9eaa5dd commit 106199f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions main/inc/lib/tracking.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4752,7 +4752,6 @@ public static function show_user_progress(
$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));

Expand All @@ -4762,15 +4761,15 @@ public static function show_user_progress(
'2rightarrow_na.png',
get_lang('Details')
),
'?session_id='.$my_session_id.'#course_session_list'
api_get_self().'?session_id='.$my_session_id.'#course_session_list'
);
} else {
$icon = Display::url(
Display::return_icon(
'2rightarrow.png',
get_lang('Details')
),
'?session_id='.$my_session_id.'#course_session_list'
api_get_self().'?session_id='.$my_session_id.'#course_session_list'
);
}
$html .= Display::tag('td', $icon);
Expand Down Expand Up @@ -4935,7 +4934,7 @@ public static function show_user_progress(
}
// Score
$html .= Display::tag('td', $percentage_score, array('align'=>'center'));
if (empty($last_connection) or is_bool($last_connection)) {
if (empty($last_connection) || is_bool($last_connection)) {
$last_connection = '';
}
$html .= Display::tag('td', $last_connection, array('align' => 'center'));
Expand All @@ -4944,7 +4943,7 @@ public static function show_user_progress(
$details = '<a href="#">';
$details .= Display::return_icon('2rightarrow_na.png', get_lang('Details'));
} else {
$details = '<a href="'.api_get_self().'?course='.$course_code.'&session_id='.$session_id_from_get.$extra_params.'">';
$details = '<a href="'.api_get_self().'?course='.$course_code.'&session_id='.$session_id_from_get.$extra_params.'#course_session_data">';
$details .= Display::return_icon('2rightarrow.png', get_lang('Details'));
}
$details .= '</a>';
Expand Down Expand Up @@ -4974,6 +4973,7 @@ public static function show_course_detail($user_id, $course_code, $session_id)
$course = Database::escape_string($course_code);
$course_info = CourseManager::get_course_information($course);

$html .= '<a name="course_session_data"></a>';
$html .= Display::page_subheader($course_info['title']);
$html .= '<div class="table-responsive">';
$html .= '<table class="table table-striped table-hover">';
Expand Down Expand Up @@ -5021,7 +5021,6 @@ public static function show_course_detail($user_id, $course_code, $session_id)
);

$to_graph_exercise_result = array();

if (!empty($exercise_list)) {
$score = $weighting = $exe_id = 0;
foreach ($exercise_list as $exercices) {
Expand Down Expand Up @@ -5095,7 +5094,6 @@ public static function show_course_detail($user_id, $course_code, $session_id)
$session_id
);
if (!empty($exercise_stat)) {

// Always getting the BEST attempt
$score = $exercise_stat['exe_result'];
$weighting = $exercise_stat['exe_weighting'];
Expand Down

0 comments on commit 106199f

Please sign in to comment.