|
@@ -35,6 +35,10 @@ function show_image(image,width,height) {
|
|
|
$export = isset($_GET['export']) ? $_GET['export'] : false;
|
|
|
$sessionId = isset($_GET['id_session']) ? intval($_GET['id_session']) : 0;
|
|
|
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
|
|
|
+$course_code = isset($_GET['course']) ? Security :: remove_XSS($_GET['course']) : null;
|
|
|
+
|
|
|
+// time spent on the course
|
|
|
+$courseInfo = api_get_course_info($course_code);
|
|
|
|
|
|
if (empty($sessionId)) {
|
|
|
$sessionId = api_get_session_id();
|
|
@@ -54,29 +58,24 @@ if (isset ($_GET['from']) && $_GET['from'] == 'myspace') {
|
|
|
}
|
|
|
|
|
|
$nameTools = get_lang('StudentDetails');
|
|
|
-
|
|
|
-$get_course_code = isset($_GET['course']) ? Security :: remove_XSS($_GET['course']) : '';
|
|
|
-
|
|
|
$em = Database::getManager();
|
|
|
|
|
|
if (isset($_GET['details'])) {
|
|
|
if ($origin == 'user_course') {
|
|
|
- $course_info = CourseManager :: get_course_information($get_course_code);
|
|
|
if (empty ($cidReq)) {
|
|
|
$interbreadcrumb[] = array (
|
|
|
- "url" => api_get_path(WEB_COURSE_PATH) . $course_info['directory'],
|
|
|
- 'name' => $course_info['title']
|
|
|
+ "url" => api_get_path(WEB_COURSE_PATH) . $courseInfo['directory'],
|
|
|
+ 'name' => $courseInfo['title']
|
|
|
);
|
|
|
}
|
|
|
$interbreadcrumb[] = array (
|
|
|
- "url" => "../user/user.php?cidReq=" . $get_course_code,
|
|
|
+ "url" => "../user/user.php?cidReq=" . $course_code,
|
|
|
"name" => get_lang("Users")
|
|
|
);
|
|
|
} else
|
|
|
if ($origin == 'tracking_course') {
|
|
|
- $course_info = CourseManager :: get_course_information($get_course_code);
|
|
|
$interbreadcrumb[] = array (
|
|
|
- "url" => "../tracking/courseLog.php?cidReq=".$get_course_code.'&id_session=' . api_get_session_id(),
|
|
|
+ "url" => "../tracking/courseLog.php?cidReq=".$course_code.'&id_session=' . api_get_session_id(),
|
|
|
"name" => get_lang("Tracking")
|
|
|
);
|
|
|
} else
|
|
@@ -171,19 +170,16 @@ $check = Security::check_token('get');
|
|
|
if ($check) {
|
|
|
switch ($_GET['action']) {
|
|
|
case 'reset_lp':
|
|
|
- $course = isset($_GET['course']) ? $_GET['course'] : "";
|
|
|
$lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']) : "";
|
|
|
|
|
|
if (api_is_allowed_to_edit() &&
|
|
|
- !empty($course) &&
|
|
|
!empty($lp_id) &&
|
|
|
!empty($student_id)
|
|
|
) {
|
|
|
- $course_info = api_get_course_info($course);
|
|
|
Event::delete_student_lp_events(
|
|
|
$student_id,
|
|
|
$lp_id,
|
|
|
- $course_info,
|
|
|
+ $courseInfo,
|
|
|
$sessionId
|
|
|
);
|
|
|
|
|
@@ -256,13 +252,14 @@ while ($row = Database :: fetch_array($rs)) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
// Get the list of sessions where the user is subscribed as student
|
|
|
$sql = 'SELECT session_id, c_id
|
|
|
FROM '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER).'
|
|
|
WHERE user_id=' . intval($user_info['user_id']);
|
|
|
$rs = Database::query($sql);
|
|
|
$tmp_sessions = array();
|
|
|
-while ($row = Database :: fetch_array($rs)) {
|
|
|
+while ($row = Database :: fetch_array($rs, 'ASSOC')) {
|
|
|
$tmp_sessions[] = $row['session_id'];
|
|
|
if ($drh_can_access_all_courses) {
|
|
|
if (in_array($row['session_id'], $tmp_sessions)) {
|
|
@@ -276,6 +273,8 @@ while ($row = Database :: fetch_array($rs)) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
|
|
|
api_get_user_id(),
|
|
|
api_get_course_info()
|
|
@@ -355,7 +354,6 @@ if (!empty($student_id)) {
|
|
|
|
|
|
// get average of score and average of progress by student
|
|
|
$avg_student_progress = $avg_student_score = 0;
|
|
|
- $course_code = isset($_GET['course']) ? Security :: remove_XSS($_GET['course']) : null;
|
|
|
|
|
|
if (CourseManager :: is_user_subscribed_in_course($user_info['user_id'], $course_code, true)) {
|
|
|
|
|
@@ -377,9 +375,6 @@ if (!empty($student_id)) {
|
|
|
|
|
|
$avg_student_progress = round($avg_student_progress, 2);
|
|
|
|
|
|
- // time spent on the course
|
|
|
- $courseInfo = api_get_course_info($course_code);
|
|
|
-
|
|
|
$time_spent_on_the_course = 0;
|
|
|
if (!empty($courseInfo)) {
|
|
|
$time_spent_on_the_course = api_time_to_hms(
|
|
@@ -438,39 +433,35 @@ if (!empty($student_id)) {
|
|
|
$avg_student_score
|
|
|
);
|
|
|
|
|
|
- //Show title
|
|
|
- $info_course = CourseManager :: get_course_information($course_code);
|
|
|
$coachs_name = '';
|
|
|
$session_name = '';
|
|
|
- $nb_login = Tracking :: count_login_per_student($user_info['user_id'], $info_course['real_id']);
|
|
|
+ //$nb_login = Tracking :: count_login_per_student($user_info['user_id'], $courseInfo['real_id']);
|
|
|
//get coach and session_name if there is one and if session_mode is activated
|
|
|
- if ($sessionId > 0) {
|
|
|
+ /*if ($sessionId > 0) {
|
|
|
$session_info = api_get_session_info($sessionId);
|
|
|
$session_coach_id = $session_info['session_admin_id'];
|
|
|
- $course_coachs = api_get_coachs_from_course($sessionId, $info_course['real_id']);
|
|
|
- $nb_login = '';
|
|
|
+ $course_coachs = api_get_coachs_from_course($sessionId, $courseInfo['real_id']);
|
|
|
+ // $nb_login = '';
|
|
|
if (!empty($course_coachs)) {
|
|
|
$info_tutor_name = array();
|
|
|
foreach ($course_coachs as $course_coach) {
|
|
|
$info_tutor_name[] = api_get_person_name($course_coach['firstname'], $course_coach['lastname']);
|
|
|
}
|
|
|
- $info_course['tutor_name'] = implode(",",$info_tutor_name);
|
|
|
+ $courseInfo['tutor_name'] = implode(",", $info_tutor_name);
|
|
|
} elseif ($session_coach_id != 0) {
|
|
|
$session_coach_id = intval($session_info['id_coach']);
|
|
|
$coach_info = api_get_user_info($session_coach_id);
|
|
|
- $info_course['tutor_name'] = $coach_info['complete_name'];
|
|
|
+ $courseInfo['tutor_name'] = $coach_info['complete_name'];
|
|
|
}
|
|
|
- $coachs_name = $info_course['tutor_name'];
|
|
|
+ $coachs_name = $courseInfo['tutor_name'];
|
|
|
$session_name = $session_info['name'];
|
|
|
- } // end
|
|
|
+ } // end*/
|
|
|
|
|
|
- $info_course = CourseManager :: get_course_information($get_course_code);
|
|
|
$table_title = Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL).$user_info['complete_name'];
|
|
|
|
|
|
echo Display::page_subheader($table_title);
|
|
|
|
|
|
$userPicture = UserManager::getUserPicture($user_info['user_id']);
|
|
|
-
|
|
|
$userGroupManager = new UserGroup();
|
|
|
$userGroups = $userGroupManager->getUserGroupListByUser($user_info['user_id'], UserGroup::NORMAL_CLASS);
|
|
|
?>
|
|
@@ -573,14 +564,21 @@ if (!empty($student_id)) {
|
|
|
echo get_lang('Score').' ';
|
|
|
Display :: display_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?>
|
|
|
</td>
|
|
|
- <td align="left"><?php if (is_numeric($avg_student_score)) { echo $avg_student_score.'%';} else { echo $avg_student_score ;} ?></td>
|
|
|
+ <td align="left"><?php
|
|
|
+ if (is_numeric($avg_student_score)) {
|
|
|
+ echo $avg_student_score.'%';
|
|
|
+ } else {
|
|
|
+ echo $avg_student_score;
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
<?php
|
|
|
- if (!empty($nb_login)) {
|
|
|
+ /*if (!empty($nb_login)) {
|
|
|
echo '<tr><td align="right">'.get_lang('CountToolAccess').'</td>';
|
|
|
echo '<td align="left"> '.$nb_login.'</td>';
|
|
|
echo '</tr>';
|
|
|
- }
|
|
|
+ }*/
|
|
|
} ?>
|
|
|
</tbody>
|
|
|
</table>
|
|
@@ -604,56 +602,51 @@ if (!empty($student_id)) {
|
|
|
</div>
|
|
|
<?php
|
|
|
|
|
|
- $table_title = '';
|
|
|
+ /*$table_title = '';
|
|
|
if (!empty($sessionId)) {
|
|
|
$session_name = api_get_session_name($sessionId);
|
|
|
- $table_title = $session_name ? Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.' ':'';
|
|
|
+ $table_title = $session_name ? Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.' ':'';
|
|
|
}
|
|
|
- if (!empty($info_course['title'])) {
|
|
|
- $table_title .= $info_course ? Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$info_course['title'].' ':'';
|
|
|
+ if (!empty($courseInfo['title'])) {
|
|
|
+ $table_title .= $courseInfo ? Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['title'].' ':'';
|
|
|
}
|
|
|
|
|
|
- echo Display::page_subheader($table_title);
|
|
|
+ echo Display::page_subheader($table_title);*/
|
|
|
|
|
|
if (empty($_GET['details'])) {
|
|
|
$csv_content[] = array();
|
|
|
$csv_content[] = array(
|
|
|
- get_lang('Session', ''),
|
|
|
- get_lang('Course', ''),
|
|
|
- get_lang('Time', ''),
|
|
|
- get_lang('Progress', ''),
|
|
|
- get_lang('Score', ''),
|
|
|
- get_lang('AttendancesFaults', ''),
|
|
|
+ get_lang('Session'),
|
|
|
+ get_lang('Course'),
|
|
|
+ get_lang('Time'),
|
|
|
+ get_lang('Progress'),
|
|
|
+ get_lang('Score'),
|
|
|
+ get_lang('AttendancesFaults'),
|
|
|
get_lang('Evaluations')
|
|
|
);
|
|
|
|
|
|
$attendance = new Attendance();
|
|
|
+ foreach ($courses_in_session as $sessionId => $courses) {
|
|
|
+ $session_name = '';
|
|
|
+ $access_start_date = '';
|
|
|
+ $access_end_date = '';
|
|
|
+ $date_session = '';
|
|
|
+ $title = Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_SMALL).' '.get_lang('Courses');
|
|
|
|
|
|
- foreach ($courses_in_session as $key => $courses) {
|
|
|
- $sessionId = $key;
|
|
|
$session_info = api_get_session_info($sessionId);
|
|
|
- $session_name = '';
|
|
|
if ($session_info) {
|
|
|
$session_name = $session_info['name'];
|
|
|
- }
|
|
|
- $access_start_date = '';
|
|
|
+ if (!empty($session_info['access_start_date']) && $session_info['access_start_date'] != '0000-00-00') {
|
|
|
+ $access_start_date = api_format_date($session_info['access_start_date'], DATE_FORMAT_SHORT);
|
|
|
+ }
|
|
|
|
|
|
- if (!empty($session_info['access_start_date']) && $session_info['access_start_date'] != '0000-00-00') {
|
|
|
- $access_start_date = api_format_date($session_info['access_start_date'], DATE_FORMAT_SHORT);
|
|
|
- }
|
|
|
+ if (!empty($session_info['access_end_date']) && $session_info['access_end_date'] != '0000-00-00') {
|
|
|
+ $access_end_date = api_format_date($session_info['access_end_date'], DATE_FORMAT_SHORT);
|
|
|
+ }
|
|
|
|
|
|
- $access_end_date = '';
|
|
|
- if (!empty($session_info['access_end_date']) && $session_info['access_end_date'] != '0000-00-00') {
|
|
|
- $access_end_date = api_format_date($session_info['access_end_date'], DATE_FORMAT_SHORT);
|
|
|
- }
|
|
|
- $date_session = '';
|
|
|
- if (!empty($access_start_date) && !empty($access_end_date)) {
|
|
|
- $date_session = get_lang('From') . ' ' . $access_start_date . ' ' . get_lang('Until') . ' ' . $access_end_date;
|
|
|
- }
|
|
|
- $title = '';
|
|
|
- if (empty($sessionId)) {
|
|
|
- $title = Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_SMALL).' '.get_lang('Courses');
|
|
|
- } else {
|
|
|
+ if (!empty($access_start_date) && !empty($access_end_date)) {
|
|
|
+ $date_session = get_lang('From') . ' ' . $access_start_date . ' ' . get_lang('Until') . ' ' . $access_end_date;
|
|
|
+ }
|
|
|
$title = Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.($date_session?' ('.$date_session.')':'');
|
|
|
}
|
|
|
|
|
@@ -676,62 +669,61 @@ if (!empty($student_id)) {
|
|
|
|
|
|
if (!empty($courses)) {
|
|
|
foreach ($courses as $courseId) {
|
|
|
- $courseInfo = api_get_course_info_by_id($courseId);
|
|
|
- $courseId = $courseInfo['real_id'];
|
|
|
- $course_code = $courseInfo['code'];
|
|
|
-
|
|
|
- if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
|
|
|
- $course_info = CourseManager :: get_course_information($course_code);
|
|
|
+ $courseInfoItem = api_get_course_info_by_id($courseId);
|
|
|
+ $courseId = $courseInfoItem['real_id'];
|
|
|
+ $courseCodeItem = $courseInfoItem['code'];
|
|
|
|
|
|
+ if (CourseManager :: is_user_subscribed_in_course($student_id, $courseCodeItem, true)) {
|
|
|
$time_spent_on_course = api_time_to_hms(
|
|
|
Tracking :: get_time_spent_on_the_course($user_info['user_id'], $courseId, $sessionId)
|
|
|
);
|
|
|
|
|
|
// get average of faults in attendances by student
|
|
|
- $results_faults_avg = $attendance->get_faults_average_by_course($student_id, $course_code, $sessionId);
|
|
|
+ $results_faults_avg = $attendance->get_faults_average_by_course($student_id, $courseCodeItem, $sessionId);
|
|
|
if (!empty($results_faults_avg['total'])) {
|
|
|
if (api_is_drh()) {
|
|
|
- $attendances_faults_avg = '<a title="'.get_lang('GoAttendance').'" href="'.api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$course_code.'&id_session='.$sessionId.'&student_id='.$student_id.'">'.$results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>';
|
|
|
+ $attendances_faults_avg =
|
|
|
+ '<a title="'.get_lang('GoAttendance').'" href="'.api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$courseCodeItem.'&id_session='.$sessionId.'&student_id='.$student_id.'">'.
|
|
|
+ $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)</a>';
|
|
|
} else {
|
|
|
- $attendances_faults_avg = $results_faults_avg['faults'].'/'.$results_faults_avg['total'].' ('.$results_faults_avg['porcent'].'%)';
|
|
|
+ $attendances_faults_avg =
|
|
|
+ $results_faults_avg['faults'].'/'.
|
|
|
+ $results_faults_avg['total'].
|
|
|
+ ' ('.$results_faults_avg['porcent'].'%)'
|
|
|
+ ;
|
|
|
}
|
|
|
} else {
|
|
|
$attendances_faults_avg = '0/0 (0%)';
|
|
|
}
|
|
|
|
|
|
// Get evaluations by student
|
|
|
- $cats = Category::load(null, null, $course_code, null, null, $sessionId);
|
|
|
+ $cats = Category::load(null, null, $courseCodeItem, null, null, $sessionId);
|
|
|
|
|
|
$scoretotal = array();
|
|
|
if (isset($cats) && isset($cats[0])) {
|
|
|
if (!empty($sessionId)) {
|
|
|
- $scoretotal= $cats[0]->calc_score($student_id, null, $course_code, $sessionId);
|
|
|
+ $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem, $sessionId);
|
|
|
} else {
|
|
|
- $scoretotal= $cats[0]->calc_score($student_id, null, $course_code);
|
|
|
+ $scoretotal= $cats[0]->calc_score($student_id, null, $courseCodeItem);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$scoretotal_display = '0/0 (0%)';
|
|
|
if (!empty($scoretotal)) {
|
|
|
- $scoretotal_display = round(
|
|
|
- $scoretotal[0],
|
|
|
- 1
|
|
|
- ).'/'.
|
|
|
- round(
|
|
|
- $scoretotal[1],
|
|
|
- 1
|
|
|
- ).' ('.
|
|
|
- round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)';
|
|
|
+ $scoretotal_display =
|
|
|
+ round($scoretotal[0], 1 ).'/'.
|
|
|
+ round($scoretotal[1], 1).
|
|
|
+ ' ('.round(($scoretotal[0] / $scoretotal[1]) * 100, 2).' %)';
|
|
|
}
|
|
|
|
|
|
- $progress = Tracking::get_avg_student_progress($user_info['user_id'], $course_code, null, $sessionId);
|
|
|
- $score = Tracking :: get_avg_student_score($user_info['user_id'], $course_code, null, $sessionId);
|
|
|
+ $progress = Tracking::get_avg_student_progress($user_info['user_id'], $courseCodeItem, null, $sessionId);
|
|
|
+ $score = Tracking :: get_avg_student_score($user_info['user_id'], $courseCodeItem, null, $sessionId);
|
|
|
$progress = empty($progress) ? '0%' : $progress.'%';
|
|
|
$score = empty($score) ? '0%' : $score.'%';
|
|
|
|
|
|
$csv_content[] = array(
|
|
|
$session_name,
|
|
|
- $course_info['title'],
|
|
|
+ $courseInfoItem['title'],
|
|
|
$time_spent_on_course,
|
|
|
$progress,
|
|
|
$score,
|
|
@@ -740,7 +732,8 @@ if (!empty($student_id)) {
|
|
|
);
|
|
|
|
|
|
echo '<tr>
|
|
|
- <td ><a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['directory'] .'/?id_session=' . $sessionId . '">'.$course_info['title'].'</a></td>
|
|
|
+ <td ><a href="' .$courseInfoItem['course_public_url'] .'?id_session=' . $sessionId . '">'.
|
|
|
+ $courseInfoItem['title'].'</a></td>
|
|
|
<td >'.$time_spent_on_course .'</td>
|
|
|
<td >'.$progress.'</td>
|
|
|
<td >'.$score.'</td>
|
|
@@ -748,10 +741,10 @@ if (!empty($student_id)) {
|
|
|
<td >'.$scoretotal_display.'</td>';
|
|
|
|
|
|
if (isset($_GET['id_coach']) && intval($_GET['id_coach']) != 0) {
|
|
|
- echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.$origin.'&id_session='.$sessionId.'#infosStudent">
|
|
|
+ echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$courseInfoItem['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.$origin.'&id_session='.$sessionId.'#infosStudent">
|
|
|
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a></td>';
|
|
|
} else {
|
|
|
- echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$course_info['code'].'&origin='.$origin.'&id_session='.$sessionId.'#infosStudent">
|
|
|
+ echo '<td width="10"><a href="'.api_get_self().'?student='.$user_info['user_id'].'&details=true&course='.$courseInfoItem['code'].'&origin='.$origin.'&id_session='.$sessionId.'#infosStudent">
|
|
|
'.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a></td>';
|
|
|
}
|
|
|
echo '</tr>';
|
|
@@ -781,25 +774,29 @@ if (!empty($student_id)) {
|
|
|
get_lang('LastConnexion')
|
|
|
);
|
|
|
|
|
|
- $query = $em
|
|
|
- ->createQuery('
|
|
|
+ if (empty($sessionId)) {
|
|
|
+ $query = $em->createQuery('
|
|
|
SELECT lp FROM ChamiloCourseBundle:CLp lp
|
|
|
- WHERE lp.sessionId = :session AND lp.cId = :course
|
|
|
+ WHERE lp.sessionId = 0 AND lp.cId = :course
|
|
|
ORDER BY lp.displayOrder ASC
|
|
|
');
|
|
|
|
|
|
- if (empty($sessionId)) {
|
|
|
$query->setParameters([
|
|
|
- 'session' => 0,
|
|
|
- 'course' => $info_course['real_id']
|
|
|
+ 'course' => $courseInfo['real_id']
|
|
|
]);
|
|
|
} else {
|
|
|
+ $query = $em->createQuery('
|
|
|
+ SELECT lp FROM ChamiloCourseBundle:CLp lp
|
|
|
+ WHERE lp.cId = :course
|
|
|
+ ORDER BY lp.displayOrder ASC
|
|
|
+ ');
|
|
|
$query->setParameters([
|
|
|
- 'session' => $sessionId,
|
|
|
- 'course' => $info_course['real_id']
|
|
|
+ 'course' => $courseInfo['real_id']
|
|
|
]);
|
|
|
}
|
|
|
+
|
|
|
$rs_lp = $query->getResult();
|
|
|
+
|
|
|
if (count($rs_lp) > 0) {
|
|
|
?>
|
|
|
<!-- LPs-->
|
|
@@ -807,22 +804,54 @@ if (!empty($student_id)) {
|
|
|
<table class="table table-striped table-hover">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th><?php echo get_lang('Learnpaths');?></th>
|
|
|
- <th><?php
|
|
|
+ <th><?php echo get_lang('LearningPath');?></th>
|
|
|
+ <th>
|
|
|
+ <?php
|
|
|
echo get_lang('Time').' ';
|
|
|
- Display :: display_icon('info3.gif', get_lang('TotalTimeByCourse'), array ('align' => 'absmiddle', 'hspace' => '3px')); ?></th>
|
|
|
- <th><?php
|
|
|
+ Display:: display_icon(
|
|
|
+ 'info3.gif',
|
|
|
+ get_lang('TotalTimeByCourse'),
|
|
|
+ array('align' => 'absmiddle', 'hspace' => '3px')
|
|
|
+ );
|
|
|
+ ?>
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ <?php
|
|
|
echo get_lang('AverageScore').' ';
|
|
|
- Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInAllAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
|
|
|
+ Display:: display_icon(
|
|
|
+ 'info3.gif',
|
|
|
+ get_lang('AverageIsCalculatedBasedInAllAttempts'),
|
|
|
+ array('align' => 'absmiddle', 'hspace' => '3px')
|
|
|
+ );
|
|
|
+ ?>
|
|
|
+ </th>
|
|
|
<th><?php
|
|
|
echo get_lang('LatestAttemptAverageScore').' ';
|
|
|
- Display :: display_icon('info3.gif', get_lang('AverageIsCalculatedBasedInTheLatestAttempts'), array ( 'align' => 'absmiddle', 'hspace' => '3px')); ?></th>
|
|
|
+ Display::display_icon(
|
|
|
+ 'info3.gif',
|
|
|
+ get_lang('AverageIsCalculatedBasedInTheLatestAttempts'),
|
|
|
+ array('align' => 'absmiddle', 'hspace' => '3px')
|
|
|
+ );
|
|
|
+ ?>
|
|
|
+ </th>
|
|
|
<th><?php
|
|
|
echo get_lang('Progress').' ';
|
|
|
- Display :: display_icon('info3.gif', get_lang('LPProgressScore'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
|
|
|
+ Display:: display_icon(
|
|
|
+ 'info3.gif',
|
|
|
+ get_lang('LPProgressScore'),
|
|
|
+ array('align' => 'absmiddle', 'hspace' => '3px')
|
|
|
+ );
|
|
|
+ ?>
|
|
|
+ </th>
|
|
|
<th><?php
|
|
|
echo get_lang('LastConnexion').' ';
|
|
|
- Display :: display_icon('info3.gif', get_lang('LastTimeTheCourseWasUsed'), array ('align' => 'absmiddle','hspace' => '3px')); ?></th>
|
|
|
+ Display:: display_icon(
|
|
|
+ 'info3.gif',
|
|
|
+ get_lang('LastTimeTheCourseWasUsed'),
|
|
|
+ array('align' => 'absmiddle', 'hspace' => '3px')
|
|
|
+ );
|
|
|
+ ?>
|
|
|
+ </th>
|
|
|
<?php
|
|
|
echo '<th>'.get_lang('Details').'</th>';
|
|
|
if (api_is_allowed_to_edit()) {
|
|
@@ -900,8 +929,11 @@ if (!empty($student_id)) {
|
|
|
true
|
|
|
);
|
|
|
|
|
|
- if ($i % 2 == 0) $css_class = "row_even";
|
|
|
- else $css_class = "row_odd";
|
|
|
+ if ($i % 2 == 0) {
|
|
|
+ $css_class = "row_even";
|
|
|
+ } else {
|
|
|
+ $css_class = "row_odd";
|
|
|
+ }
|
|
|
|
|
|
$i++;
|
|
|
|
|
@@ -925,6 +957,7 @@ if (!empty($student_id)) {
|
|
|
$score = $score.'%';
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
echo Display::tag('td', $score);
|
|
|
|
|
|
if (!is_null($score_latest)) {
|
|
@@ -951,7 +984,7 @@ if (!empty($student_id)) {
|
|
|
$from ='&from=myspace';
|
|
|
}
|
|
|
$link = Display::url(
|
|
|
- Display::return_icon('2rightarrow.png'),
|
|
|
+ Display::return_icon('2rightarrow.png', get_lang('Details')),
|
|
|
'lp_tracking.php?cidReq='.Security::remove_XSS($_GET['course']).'&course='.Security::remove_XSS($_GET['course']).$from.'&origin='.$origin.'&lp_id='.$learnpath->getId().'&student_id='.$user_info['user_id'].'&id_session='.$sessionId
|
|
|
);
|
|
|
echo Display::tag('td', $link);
|
|
@@ -961,7 +994,7 @@ if (!empty($student_id)) {
|
|
|
echo '<td>';
|
|
|
if ($any_result === true) {
|
|
|
echo '<a href="myStudents.php?action=reset_lp&sec_token='.$token.'&cidReq='.Security::remove_XSS($_GET['course']).'&course='.Security::remove_XSS($_GET['course']).'&details='.Security::remove_XSS($_GET['details']).'&origin='.$origin.'&lp_id='.$learnpath->getId().'&student='.$user_info['user_id'].'&details=true&id_session='.$sessionId.'">';
|
|
|
- echo Display::return_icon('clean.png',get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
+ echo Display::return_icon('clean.png', get_lang('Clean'),'',ICON_SIZE_SMALL).'</a>';
|
|
|
echo '</a>';
|
|
|
}
|
|
|
echo '</td>';
|
|
@@ -970,8 +1003,6 @@ if (!empty($student_id)) {
|
|
|
$data_learnpath[$i][] = $lp_name;
|
|
|
$data_learnpath[$i][] = $progress . '%';
|
|
|
}
|
|
|
- } else {
|
|
|
- //echo '<tr><td colspan="6">'.get_lang('NoLearnpath').'</td></tr>';
|
|
|
}
|
|
|
?>
|
|
|
</tbody>
|
|
@@ -1006,7 +1037,7 @@ if (!empty($student_id)) {
|
|
|
$t_quiz = Database :: get_course_table(TABLE_QUIZ_TEST);
|
|
|
$sql = "SELECT quiz.title, id FROM " . $t_quiz . " AS quiz
|
|
|
WHERE
|
|
|
- quiz.c_id = ".$info_course['real_id']." AND
|
|
|
+ quiz.c_id = ".$courseInfo['real_id']." AND
|
|
|
(quiz.session_id = $sessionId OR quiz.session_id = 0) AND
|
|
|
active IN (0, 1)
|
|
|
ORDER BY quiz.title ASC ";
|
|
@@ -1016,11 +1047,33 @@ if (!empty($student_id)) {
|
|
|
if (Database :: num_rows($result_exercices) > 0) {
|
|
|
while ($exercices = Database :: fetch_array($result_exercices)) {
|
|
|
$exercise_id = intval($exercices['id']);
|
|
|
- $count_attempts = Tracking::count_student_exercise_attempts($student_id, $courseInfo['real_id'], $exercise_id, 0, 0, $sessionId, 2);
|
|
|
- $score_percentage = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $sessionId, 1, 0);
|
|
|
+ $count_attempts = Tracking::count_student_exercise_attempts(
|
|
|
+ $student_id,
|
|
|
+ $courseInfo['real_id'],
|
|
|
+ $exercise_id,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ $sessionId,
|
|
|
+ 2
|
|
|
+ );
|
|
|
+ $score_percentage = Tracking::get_avg_student_exercise_score(
|
|
|
+ $student_id,
|
|
|
+ $course_code,
|
|
|
+ $exercise_id,
|
|
|
+ $sessionId,
|
|
|
+ 1,
|
|
|
+ 0
|
|
|
+ );
|
|
|
|
|
|
if (!isset($score_percentage) && $count_attempts > 0) {
|
|
|
- $scores_lp = Tracking::get_avg_student_exercise_score($student_id, $course_code, $exercise_id, $sessionId, 2, 1);
|
|
|
+ $scores_lp = Tracking::get_avg_student_exercise_score(
|
|
|
+ $student_id,
|
|
|
+ $course_code,
|
|
|
+ $exercise_id,
|
|
|
+ $sessionId,
|
|
|
+ 2,
|
|
|
+ 1
|
|
|
+ );
|
|
|
$score_percentage = $scores_lp[0];
|
|
|
$lp_name = $scores_lp[1];
|
|
|
} else {
|
|
@@ -1059,11 +1112,11 @@ if (!empty($student_id)) {
|
|
|
|
|
|
$sql = 'SELECT exe_id FROM ' . $tbl_stats_exercices . '
|
|
|
WHERE
|
|
|
- exe_exo_id ="'.$exercise_id.'" AND
|
|
|
- exe_user_id ="'.$student_id.'" AND
|
|
|
- c_id = '.$courseInfo['real_id'].' AND
|
|
|
- session_id ="'.$sessionId.'" AND
|
|
|
- status = ""
|
|
|
+ exe_exo_id = "'.$exercise_id.'" AND
|
|
|
+ exe_user_id ="'.$student_id.'" AND
|
|
|
+ c_id = '.$courseInfo['real_id'].' AND
|
|
|
+ session_id ="'.$sessionId.'" AND
|
|
|
+ status = ""
|
|
|
ORDER BY exe_date DESC
|
|
|
LIMIT 1';
|
|
|
$result_last_attempt = Database::query($sql);
|
|
@@ -1105,13 +1158,13 @@ if (!empty($student_id)) {
|
|
|
<?php
|
|
|
}
|
|
|
|
|
|
- //@when using sessions we do not show the survey list
|
|
|
+ // @when using sessions we do not show the survey list
|
|
|
if (empty($sessionId)) {
|
|
|
$survey_list = SurveyManager::get_surveys($course_code, $sessionId);
|
|
|
|
|
|
$survey_data = array();
|
|
|
foreach($survey_list as $survey) {
|
|
|
- $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $info_course['real_id']);
|
|
|
+ $user_list = SurveyManager::get_people_who_filled_survey($survey['survey_id'], false, $courseInfo['real_id']);
|
|
|
$survey_done = Display::return_icon("accept_na.png", get_lang('NoAnswer'), array(), ICON_SIZE_SMALL);
|
|
|
if (in_array($student_id, $user_list)) {
|
|
|
$survey_done = Display::return_icon("accept.png", get_lang('Answered'), array(), ICON_SIZE_SMALL);
|
|
@@ -1158,13 +1211,13 @@ if (!empty($student_id)) {
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<?php
|
|
|
- $csv_content[] = array ();
|
|
|
- $nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $sessionId);
|
|
|
- $messages = Tracking::count_student_messages($student_id, $course_code, $sessionId);
|
|
|
- $links = Tracking::count_student_visited_links($student_id, $info_course['real_id'], $sessionId);
|
|
|
- $chat_last_connection = Tracking::chat_last_connection($student_id, $info_course['real_id'], $sessionId);
|
|
|
- $documents = Tracking::count_student_downloaded_documents($student_id, $info_course['real_id'], $sessionId);
|
|
|
- $uploaded_documents = Tracking::count_student_uploaded_documents($student_id, $course_code, $sessionId);
|
|
|
+ $csv_content[] = array();
|
|
|
+ $nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $sessionId);
|
|
|
+ $messages = Tracking::count_student_messages($student_id, $course_code, $sessionId);
|
|
|
+ $links = Tracking::count_student_visited_links($student_id, $courseInfo['real_id'], $sessionId);
|
|
|
+ $chat_last_connection = Tracking::chat_last_connection($student_id, $courseInfo['real_id'], $sessionId);
|
|
|
+ $documents = Tracking::count_student_downloaded_documents($student_id, $courseInfo['real_id'], $sessionId);
|
|
|
+ $uploaded_documents = Tracking::count_student_uploaded_documents($student_id, $course_code, $sessionId);
|
|
|
|
|
|
$csv_content[] = array(
|
|
|
get_lang('OtherTools')
|