|
|
|
|
@ -10,6 +10,7 @@ if (!isset($_GET['course'])) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
require_once __DIR__.'/../inc/global.inc.php'; |
|
|
|
|
require_once '../work/work.lib.php'; |
|
|
|
|
|
|
|
|
|
api_block_anonymous_users(); |
|
|
|
|
|
|
|
|
|
@ -30,6 +31,8 @@ $details = isset($_GET['details']) ? Security::remove_XSS($_GET['details']) : '' |
|
|
|
|
$currentUrl = api_get_self().'?student='.$student_id.'&course='.$courseCode.'&id_session='.$sessionId |
|
|
|
|
.'&origin='.$origin.'&details='.$details; |
|
|
|
|
$allowMessages = api_get_configuration_value('private_messages_about_user'); |
|
|
|
|
$workingTime = api_get_configuration_value('considered_working_time'); |
|
|
|
|
$workingTimeEdit = api_get_configuration_value('allow_working_time_edition'); |
|
|
|
|
|
|
|
|
|
if (empty($student_id)) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
@ -212,6 +215,30 @@ $tbl_stats_exercices = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISE |
|
|
|
|
$action = isset($_GET['action']) ? $_GET['action'] : ''; |
|
|
|
|
|
|
|
|
|
switch ($action) { |
|
|
|
|
case 'add_work_time': |
|
|
|
|
if (false === $workingTimeEdit) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
$workingTime = isset($_GET['time']) ? $_GET['time'] : ''; |
|
|
|
|
$workId = isset($_GET['work_id']) ? $_GET['work_id'] : ''; |
|
|
|
|
Event::eventAddVirtualCourseTime($courseInfo['real_id'], $student_id, $sessionId, $workingTime, $workId); |
|
|
|
|
Display::addFlash(Display::return_message(get_lang('Updated'))); |
|
|
|
|
|
|
|
|
|
header('Location: '.$currentUrl); |
|
|
|
|
exit; |
|
|
|
|
case 'remove_work_time': |
|
|
|
|
if (false === $workingTimeEdit) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
$workingTime = isset($_GET['time']) ? $_GET['time'] : ''; |
|
|
|
|
$workId = isset($_GET['work_id']) ? $_GET['work_id'] : ''; |
|
|
|
|
Event::eventRemoveVirtualCourseTime($courseInfo['real_id'], $student_id, $sessionId, $workingTime, $workId); |
|
|
|
|
|
|
|
|
|
Display::addFlash(Display::return_message(get_lang('Updated'))); |
|
|
|
|
|
|
|
|
|
header('Location: '.$currentUrl); |
|
|
|
|
exit; |
|
|
|
|
break; |
|
|
|
|
case 'export_to_pdf': |
|
|
|
|
$sessionToExport = $sId = isset($_GET['session_to_export']) ? (int) $_GET['session_to_export'] : 0; |
|
|
|
|
$sessionInfo = api_get_session_info($sessionToExport); |
|
|
|
|
@ -223,21 +250,25 @@ switch ($action) { |
|
|
|
|
$numberVisits = 0; |
|
|
|
|
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); |
|
|
|
|
$progress = 0; |
|
|
|
|
$timeSpentPerCourse = []; |
|
|
|
|
$progressPerCourse = []; |
|
|
|
|
foreach ($courses as $course) { |
|
|
|
|
$courseId = $course['c_id']; |
|
|
|
|
$timeSpent += Tracking::get_time_spent_on_the_course($student_id, $courseId, $sessionToExport); |
|
|
|
|
|
|
|
|
|
$sql = 'SELECT DISTINCT count(course_access_id) as count |
|
|
|
|
FROM '.$table.' |
|
|
|
|
$courseTimeSpent = Tracking::get_time_spent_on_the_course($student_id, $courseId, $sessionToExport); |
|
|
|
|
$timeSpentPerCourse[$courseId] = $courseTimeSpent; |
|
|
|
|
$timeSpent += $courseTimeSpent; |
|
|
|
|
$sql = "SELECT DISTINCT count(course_access_id) as count |
|
|
|
|
FROM $table |
|
|
|
|
WHERE |
|
|
|
|
user_id = '.$student_id.' AND |
|
|
|
|
c_id = '.$courseId.' AND |
|
|
|
|
session_id = '.$sessionToExport.' |
|
|
|
|
ORDER BY login_course_date ASC'; |
|
|
|
|
c_id = $courseId AND |
|
|
|
|
session_id = $sessionToExport AND |
|
|
|
|
user_id = $student_id"; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
$row = Database::fetch_array($result); |
|
|
|
|
$numberVisits += $row['count']; |
|
|
|
|
$progress += Tracking::get_avg_student_progress($student_id, $course['code'], [], $sessionToExport); |
|
|
|
|
$courseProgress = Tracking::get_avg_student_progress($student_id, $course['code'], [], $sessionToExport); |
|
|
|
|
$progressPerCourse[$courseId] = $courseProgress; |
|
|
|
|
$progress += $courseProgress; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$average = round($progress / count($courses), 1); |
|
|
|
|
@ -304,25 +335,14 @@ switch ($action) { |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if ($isSubscribed) { |
|
|
|
|
$timeInSeconds = Tracking::get_time_spent_on_the_course( |
|
|
|
|
$user_info['user_id'], |
|
|
|
|
$courseId, |
|
|
|
|
$sessionToExport |
|
|
|
|
); |
|
|
|
|
$timeInSeconds = $timeSpentPerCourse[$courseId]; |
|
|
|
|
$totalCourseTime += $timeInSeconds; |
|
|
|
|
$time_spent_on_course = api_time_to_hms($timeInSeconds); |
|
|
|
|
|
|
|
|
|
$progress = Tracking::get_avg_student_progress( |
|
|
|
|
$user_info['user_id'], |
|
|
|
|
$courseCodeItem, |
|
|
|
|
[], |
|
|
|
|
$sId |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$progress = $progressPerCourse[$courseId]; |
|
|
|
|
$totalProgress += $progress; |
|
|
|
|
|
|
|
|
|
$bestScore = Tracking::get_avg_student_score( |
|
|
|
|
$user_info['user_id'], |
|
|
|
|
$student_id, |
|
|
|
|
$courseCodeItem, |
|
|
|
|
[], |
|
|
|
|
$sId, |
|
|
|
|
@ -339,8 +359,10 @@ switch ($action) { |
|
|
|
|
$score = empty($bestScore) ? '0%' : $bestScore.'%'; |
|
|
|
|
|
|
|
|
|
$courseTable .= '<tr> |
|
|
|
|
<td ><a href="'.$courseInfoItem['course_public_url'].'?id_session='.$sId.'">'. |
|
|
|
|
$courseInfoItem['title'].'</a></td> |
|
|
|
|
<td> |
|
|
|
|
<a href="'.$courseInfoItem['course_public_url'].'?id_session='.$sId.'">'. |
|
|
|
|
$courseInfoItem['title'].'</a> |
|
|
|
|
</td> |
|
|
|
|
<td >'.$time_spent_on_course.'</td> |
|
|
|
|
<td >'.$progress.'</td> |
|
|
|
|
<td >'.$score.'</td>'; |
|
|
|
|
@ -366,12 +388,10 @@ switch ($action) { |
|
|
|
|
$courseTable .= '</tbody></table>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$studentInfo = api_get_user_info($student_id); |
|
|
|
|
|
|
|
|
|
$tpl = new Template('', false, false, false, true, false, false); |
|
|
|
|
$tpl->assign('title', get_lang('Attestation of attendance')); |
|
|
|
|
$tpl->assign('session_title', $sessionInfo['name']); |
|
|
|
|
$tpl->assign('student', $studentInfo['complete_name']); |
|
|
|
|
$tpl->assign('student', $user_info['complete_name']); |
|
|
|
|
$tpl->assign('table_progress', $table->toHtml()); |
|
|
|
|
$tpl->assign('subtitle', sprintf( |
|
|
|
|
get_lang('In session %s, you had the following results'), |
|
|
|
|
@ -385,7 +405,7 @@ switch ($action) { |
|
|
|
|
'session_info' => $sessionInfo, |
|
|
|
|
'course_info' => '', |
|
|
|
|
'pdf_date' => '', |
|
|
|
|
'student_info' => $studentInfo, |
|
|
|
|
'student_info' => $user_info, |
|
|
|
|
'show_grade_generated_date' => true, |
|
|
|
|
'show_real_course_teachers' => false, |
|
|
|
|
'show_teacher_as_myself' => false, |
|
|
|
|
@ -441,36 +461,42 @@ switch ($action) { |
|
|
|
|
if (true === $allowMessages) { |
|
|
|
|
$subject = isset($_POST['subject']) ? $_POST['subject'] : ''; |
|
|
|
|
$message = isset($_POST['message']) ? $_POST['message'] : ''; |
|
|
|
|
$currentUserInfo = api_get_user_info(); |
|
|
|
|
MessageManager::sendMessageAboutUser( |
|
|
|
|
$user_info, |
|
|
|
|
$currentUserInfo, |
|
|
|
|
$subject, |
|
|
|
|
$message |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Send also message to all student bosses |
|
|
|
|
$bossList = UserManager::getStudentBossList($student_id); |
|
|
|
|
|
|
|
|
|
if (!empty($bossList)) { |
|
|
|
|
$url = api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id; |
|
|
|
|
$link = Display::url($url, $url); |
|
|
|
|
|
|
|
|
|
foreach ($bossList as $boss) { |
|
|
|
|
MessageManager::send_message_simple( |
|
|
|
|
$boss['boss_id'], |
|
|
|
|
sprintf(get_lang('Follow up message about student %s'), $user_info['complete_name']), |
|
|
|
|
sprintf( |
|
|
|
|
get_lang('Hi,<br/><br/>'), |
|
|
|
|
$currentUserInfo['complete_name'], |
|
|
|
|
$user_info['complete_name'], |
|
|
|
|
$link |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
if (!empty($subject) && !empty($message)) { |
|
|
|
|
$currentUserInfo = api_get_user_info(); |
|
|
|
|
MessageManager::sendMessageAboutUser( |
|
|
|
|
$user_info, |
|
|
|
|
$currentUserInfo, |
|
|
|
|
$subject, |
|
|
|
|
$message |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Send also message to all student bosses |
|
|
|
|
$bossList = UserManager::getStudentBossList($student_id); |
|
|
|
|
|
|
|
|
|
if (!empty($bossList)) { |
|
|
|
|
$url = api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$student_id; |
|
|
|
|
$link = Display::url($url, $url); |
|
|
|
|
|
|
|
|
|
foreach ($bossList as $boss) { |
|
|
|
|
MessageManager::send_message_simple( |
|
|
|
|
$boss['boss_id'], |
|
|
|
|
sprintf(get_lang('Follow up message about student %s'), $user_info['complete_name']), |
|
|
|
|
sprintf( |
|
|
|
|
get_lang('Hi,<br/><br/>'), |
|
|
|
|
$currentUserInfo['complete_name'], |
|
|
|
|
$user_info['complete_name'], |
|
|
|
|
$link |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Display::addFlash(Display::return_message(get_lang('Message Sent'))); |
|
|
|
|
} else { |
|
|
|
|
Display::addFlash(Display::return_message(get_lang('AllFieldsRequired'), 'warning')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Display::addFlash(Display::return_message(get_lang('Message Sent'))); |
|
|
|
|
header('Location: '.$currentUrl); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
@ -710,6 +736,18 @@ if (Skill::isAllowed($student_id, false)) { |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Skill::isAllowed($student_id, false)) { |
|
|
|
|
echo Display::url( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'attendance.png', |
|
|
|
|
get_lang('CountDoneAttendance'), |
|
|
|
|
null, |
|
|
|
|
ICON_SIZE_MEDIUM |
|
|
|
|
), |
|
|
|
|
api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?action=all_attendance&student='.$student_id |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$permissions = StudentFollowUpPlugin::getPermissions( |
|
|
|
|
$student_id, |
|
|
|
|
api_get_user_id() |
|
|
|
|
@ -941,6 +979,115 @@ if ('true' === api_get_setting('allow_terms_conditions')) { |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($_GET['action']) and $_GET['action'] == 'all_attendance') { |
|
|
|
|
/*Display all attendances */ |
|
|
|
|
// Varible for all attendance list |
|
|
|
|
$startDate = new DateTime(); |
|
|
|
|
$startDate = $startDate->modify('-1 week'); |
|
|
|
|
if (isset($_GET['startDate'])) { |
|
|
|
|
$startDate = new DateTime($_GET['startDate']); |
|
|
|
|
} |
|
|
|
|
$startDate = $startDate->setTime(0, 0, 0); |
|
|
|
|
|
|
|
|
|
$endDate = new DateTime(); |
|
|
|
|
if (isset($_GET['endDate'])) { |
|
|
|
|
$endDate = new DateTime($_GET['endDate']); |
|
|
|
|
} |
|
|
|
|
$endDate = $endDate->setTime(23, 59, 0); |
|
|
|
|
|
|
|
|
|
// $startDate = new DateTime(api_get_local_time($startDate)); |
|
|
|
|
// $endDate = new DateTime(api_get_local_time($endDate)); |
|
|
|
|
if ($startDate > $endDate) { |
|
|
|
|
$dataTemp = $startDate; |
|
|
|
|
$startDate = $endDate; |
|
|
|
|
$endDate = $dataTemp; |
|
|
|
|
} |
|
|
|
|
$startDateText = api_get_local_time($startDate); |
|
|
|
|
$endDateText = api_get_local_time($endDate); |
|
|
|
|
// Varible for all attendance list |
|
|
|
|
|
|
|
|
|
/** Start date and end date*/ |
|
|
|
|
$defaults['startDate'] = $startDateText; |
|
|
|
|
$defaults['endDate'] = $endDateText; |
|
|
|
|
$form = new FormValidator('all_attendance_list', 'GET', |
|
|
|
|
'myStudents.php?action=all_attendance&student='.$student_id.'&startDate='.$defaults['startDate'].'&endDate='.$defaults['endDate'].'&&'.api_get_cidreq(), |
|
|
|
|
''); |
|
|
|
|
$form->addElement('html', '<input type="hidden" name="student" value="'.$student_id.'" >'); |
|
|
|
|
$form->addElement('html', '<input type="hidden" name="action" value="all_attendance" >'); |
|
|
|
|
|
|
|
|
|
$form->addDateTimePicker('startDate', [ |
|
|
|
|
get_lang('ExeStartTime'), |
|
|
|
|
], [ |
|
|
|
|
'form_name' => 'attendance_calendar_edit', |
|
|
|
|
], 5); |
|
|
|
|
$form->addDateTimePicker('endDate', [ |
|
|
|
|
get_lang('ExeEndTime'), |
|
|
|
|
], [ |
|
|
|
|
'form_name' => 'attendance_calendar_edit', |
|
|
|
|
], 5); |
|
|
|
|
|
|
|
|
|
$form->addButtonSave(get_lang('Submit')); |
|
|
|
|
$form->setDefaults($defaults); |
|
|
|
|
$form->display(); |
|
|
|
|
/** Display dates */ |
|
|
|
|
$attendance = new Attendance(); |
|
|
|
|
$data = $attendance->getCoursesWithAttendance($student_id, $startDate, $endDate); |
|
|
|
|
|
|
|
|
|
// 'attendance from %s to %s' |
|
|
|
|
$title = sprintf(get_lang('AttendanceFromXToY'), $startDateText, $endDateText); |
|
|
|
|
echo ' |
|
|
|
|
<h3>'.$title.'</h3> |
|
|
|
|
<div class=""> |
|
|
|
|
<table class="table table-striped table-hover table-responsive"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th>'.get_lang('DateExo').'</th> |
|
|
|
|
<th>'.get_lang('Training').'</th> |
|
|
|
|
|
|
|
|
|
<th>'.get_lang('Present').'</th> |
|
|
|
|
</tr> |
|
|
|
|
</thead> |
|
|
|
|
<tbody>'; |
|
|
|
|
// <th>'.get_lang('Professor').'</th> |
|
|
|
|
foreach ($data as $attendanceData => $attendanceSheet) { |
|
|
|
|
/* |
|
|
|
|
* $attendanceData can be in_category or not_category for courses |
|
|
|
|
* */ |
|
|
|
|
|
|
|
|
|
$totalAttendance = count($attendanceSheet); |
|
|
|
|
for ($i = 0; $i < $totalAttendance; $i++) { |
|
|
|
|
$attendanceWork = $attendanceSheet[$i]; |
|
|
|
|
$courseInfoItem = api_get_course_info_by_id($attendanceWork['courseId']); |
|
|
|
|
$date = api_get_local_time($attendanceWork[1]); |
|
|
|
|
$sId = $attendanceWork['session']; |
|
|
|
|
$printSession = ''; |
|
|
|
|
if ($sId != 0) { |
|
|
|
|
// get session name |
|
|
|
|
$printSession = "(".$attendanceWork['sessionName'].")"; |
|
|
|
|
} |
|
|
|
|
// $teacher = isset($attendanceWork['teacher'])?$attendanceWork['teacher']:''; |
|
|
|
|
echo ' |
|
|
|
|
<tr> |
|
|
|
|
<td>'.$date.'</td> |
|
|
|
|
<td>' |
|
|
|
|
.'<a title="'.get_lang('GoAttendance').'" href="'.api_get_path(WEB_CODE_PATH) |
|
|
|
|
.'attendance/index.php?cidReq='.$attendanceWork['courseCode'].'&id_session='.$sId.'&student_id=' |
|
|
|
|
.$student_id.'">' |
|
|
|
|
.$attendanceWork['courseTitle']." $printSession ".'</a> |
|
|
|
|
</td> |
|
|
|
|
|
|
|
|
|
<td>'.$attendanceWork['presence'].'</td> |
|
|
|
|
</tr>'; |
|
|
|
|
//<td>'.$teacher.'</td> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '</tbody> |
|
|
|
|
</table></div>'; |
|
|
|
|
/** Display dates */ |
|
|
|
|
/*Display all attendances */ |
|
|
|
|
Display::display_footer(); |
|
|
|
|
exit(); |
|
|
|
|
} |
|
|
|
|
$details = true; |
|
|
|
|
$tpl = new Template( |
|
|
|
|
'', |
|
|
|
|
@ -1325,15 +1472,11 @@ if (empty($details)) { |
|
|
|
|
['align' => 'absmiddle', 'hspace' => '3px'] |
|
|
|
|
), |
|
|
|
|
'progress' => get_lang('Progress'). |
|
|
|
|
Display::return_icon('info3.gif', get_lang('LPProgressScore'), ['align' => 'absmiddle', 'hspace' => '3px']), |
|
|
|
|
'last_connection' => get_lang('LastConnexion'). |
|
|
|
|
Display::return_icon( |
|
|
|
|
'info3.gif', |
|
|
|
|
get_lang('% of learning objects visited'), |
|
|
|
|
['align' => 'absmiddle', 'hspace' => '3px'] |
|
|
|
|
), |
|
|
|
|
'last_connection' => get_lang('Latest login'). |
|
|
|
|
Display::return_icon( |
|
|
|
|
'info3.gif', |
|
|
|
|
get_lang('Last time learner entered the course'), |
|
|
|
|
get_lang('LastTimeTheCourseWasUsed'), |
|
|
|
|
['align' => 'absmiddle', 'hspace' => '3px'] |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
@ -1367,6 +1510,19 @@ if (empty($details)) { |
|
|
|
|
$columnName |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$hookLpTracking = HookMyStudentsLpTracking::create(); |
|
|
|
|
|
|
|
|
|
if ($hookLpTracking) { |
|
|
|
|
$hookHeaders = $hookLpTracking->notifyTrackingHeader(); |
|
|
|
|
|
|
|
|
|
foreach ($hookHeaders as $hookHeader) { |
|
|
|
|
$columnHeadersToExport[] = $hookHeader['value']; |
|
|
|
|
|
|
|
|
|
$headers .= Display::tag('th', $hookHeader['value'], $hookHeader['attrs']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$csv_content[] = $columnHeadersToExport; |
|
|
|
|
$columnHeadersKeys = array_keys($columnHeaders); |
|
|
|
|
$categoriesTempList = learnpath::getCategories($courseInfo['real_id']); |
|
|
|
|
@ -1562,6 +1718,16 @@ if (empty($details)) { |
|
|
|
|
echo Display::tag('td', $start_time); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($hookLpTracking) { |
|
|
|
|
$hookContents = $hookLpTracking->notifyTrackingContent($lp_id, $student_id); |
|
|
|
|
|
|
|
|
|
foreach ($hookContents as $hookContent) { |
|
|
|
|
$contentToExport[] = strip_tags($hookContent['value']); |
|
|
|
|
|
|
|
|
|
echo Display::tag('td', $hookContent['value'], $hookContent['attrs']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$csv_content[] = $contentToExport; |
|
|
|
|
|
|
|
|
|
if (true === $any_result) { |
|
|
|
|
@ -1596,9 +1762,10 @@ if (empty($details)) { |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
echo '</td>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '</tr>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '</tbody></table></div>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1617,8 +1784,22 @@ if (empty($details)) { |
|
|
|
|
['align' => 'absmiddle', 'hspace' => '3px'] |
|
|
|
|
).'</th>'; |
|
|
|
|
echo '<th>'.get_lang('Attempts').'</th>'; |
|
|
|
|
echo '<th>'.get_lang('Latest attempt').'</th>'; |
|
|
|
|
echo '<th>'.get_lang('All attempts').'</th>'; |
|
|
|
|
echo '<th>'.get_lang('LatestAttempt').'</th>'; |
|
|
|
|
echo '<th>'.get_lang('AllAttempts').'</th>'; |
|
|
|
|
|
|
|
|
|
$hookQuizTracking = HookMyStudentsQuizTracking::create(); |
|
|
|
|
|
|
|
|
|
if ($hookQuizTracking) { |
|
|
|
|
$hookHeaders = array_map( |
|
|
|
|
function ($hookHeader) { |
|
|
|
|
return Display::tag('th', $hookHeader['value'], $hookHeader['attrs']); |
|
|
|
|
}, |
|
|
|
|
$hookQuizTracking->notifyTrackingHeader() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
echo implode(PHP_EOL, $hookHeaders); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '</tr></thead><tbody>'; |
|
|
|
|
|
|
|
|
|
$csv_content[] = []; |
|
|
|
|
@ -1629,6 +1810,18 @@ if (empty($details)) { |
|
|
|
|
get_lang('Attempts'), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
if ($hookQuizTracking) { |
|
|
|
|
$hookHeaders = array_map( |
|
|
|
|
function ($hookHeader) { |
|
|
|
|
return strip_tags($hookHeader['value']); |
|
|
|
|
}, |
|
|
|
|
$hookQuizTracking->notifyTrackingHeader() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$csvContentIndex = count($csv_content) - 1; |
|
|
|
|
$csv_content[$csvContentIndex] = array_merge($csv_content[$csvContentIndex], $hookHeaders); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$t_quiz = Database::get_course_table(TABLE_QUIZ_TEST); |
|
|
|
|
$sessionCondition = api_get_session_condition( |
|
|
|
|
$sessionId, |
|
|
|
|
@ -1669,6 +1862,10 @@ if (empty($details)) { |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$lp_name = '-'; |
|
|
|
|
$hookContents = $hookQuizTracking |
|
|
|
|
? $hookQuizTracking->notifyTrackingContent($exercise_id, $student_id) |
|
|
|
|
: []; |
|
|
|
|
|
|
|
|
|
if (!isset($score_percentage) && $count_attempts > 0) { |
|
|
|
|
$scores_lp = Tracking::get_avg_student_exercise_score( |
|
|
|
|
$student_id, |
|
|
|
|
@ -1754,6 +1951,13 @@ if (empty($details)) { |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
echo '</td>'; |
|
|
|
|
|
|
|
|
|
if (!empty($hookContents)) { |
|
|
|
|
foreach ($hookContents as $hookContent) { |
|
|
|
|
echo Display::tag('td', $hookContent['value'], $hookContent['attrs']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '</tr>'; |
|
|
|
|
$data_exercices[$i][] = $exercices['title']; |
|
|
|
|
$data_exercices[$i][] = $score_percentage.'%'; |
|
|
|
|
@ -1766,6 +1970,14 @@ if (empty($details)) { |
|
|
|
|
$count_attempts, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
if (!empty($hookContents)) { |
|
|
|
|
$csvContentIndex = count($csv_content) - 1; |
|
|
|
|
|
|
|
|
|
foreach ($hookContents as $hookContent) { |
|
|
|
|
$csv_content[$csvContentIndex][] = strip_tags($hookContent['value']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
@ -1776,7 +1988,6 @@ if (empty($details)) { |
|
|
|
|
|
|
|
|
|
// @when using sessions we do not show the survey list |
|
|
|
|
if (empty($sessionId)) { |
|
|
|
|
$survey_list = SurveyManager::get_surveys($courseCode, $sessionId); |
|
|
|
|
if (!empty($survey_list)) { |
|
|
|
|
$survey_data = []; |
|
|
|
|
foreach ($survey_list as $survey) { |
|
|
|
|
@ -1829,7 +2040,6 @@ if (empty($details)) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
require_once '../work/work.lib.php'; |
|
|
|
|
$userWorks = getWorkPerUser($student_id, $courseInfo['real_id'], $sessionId); |
|
|
|
|
echo ' |
|
|
|
|
<div class="table-responsive"> |
|
|
|
|
@ -1849,16 +2059,19 @@ if (empty($details)) { |
|
|
|
|
$workingTime = api_get_configuration_value('considered_working_time'); |
|
|
|
|
foreach ($userWorks as $work) { |
|
|
|
|
$work = $work['work']; |
|
|
|
|
$showOnce = true; |
|
|
|
|
foreach ($work->user_results as $key => $results) { |
|
|
|
|
$resultId = $results['id']; |
|
|
|
|
|
|
|
|
|
echo '<tr>'; |
|
|
|
|
echo '<td>'.$work->title.'</td>'; |
|
|
|
|
$documentNumber = $key + 1; |
|
|
|
|
$url = api_get_path(WEB_CODE_PATH).'work/view.php?cidReq='.$courseCode.'&id_session='.$sessionId.'&id=' |
|
|
|
|
.$results['id']; |
|
|
|
|
.$resultId; |
|
|
|
|
echo '<td class="text-center"><a href="'.$url.'">('.$documentNumber.')</a></td>'; |
|
|
|
|
$qualification = !empty($results['qualification']) ? $results['qualification'] : '-'; |
|
|
|
|
echo '<td class="text-center">'.$qualification.'</td>'; |
|
|
|
|
echo '<td class="text-center">'.$results['formatted_date'].'</td>'; |
|
|
|
|
echo '<td class="text-center">'.api_convert_and_format_date($results['sent_date_from_db']).' '.$results['expiry_note'].'</td>'; |
|
|
|
|
$assignment = get_work_assignment_by_id($work->id, $courseInfo['real_id']); |
|
|
|
|
|
|
|
|
|
echo '<td class="text-center">'; |
|
|
|
|
@ -1876,7 +2089,22 @@ if (empty($details)) { |
|
|
|
|
foreach ($resultExtra as $field) { |
|
|
|
|
$field = $field['value']; |
|
|
|
|
if ($workingTime == $field->getField()->getVariable()) { |
|
|
|
|
echo '<td class="text-center">'.$field->getValue().'</td>'; |
|
|
|
|
$time = $field->getValue(); |
|
|
|
|
echo '<td class="text-center">'; |
|
|
|
|
echo $time; |
|
|
|
|
if ($workingTimeEdit && $showOnce) { |
|
|
|
|
$showOnce = false; |
|
|
|
|
echo ' '.Display::url( |
|
|
|
|
get_lang('AddTime'), |
|
|
|
|
$currentUrl.'&action=add_work_time&time='.$time.'&work_id='.$work->id |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
echo ' '.Display::url( |
|
|
|
|
get_lang('RemoveTime'), |
|
|
|
|
$currentUrl.'&action=remove_work_time&time='.$time.'&work_id='.$work->id |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
echo '</td>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '</tr>'; |
|
|
|
|
|