|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
use ChamiloSession as Session; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @package chamilo.tracking |
|
|
|
|
* @package chamilo.tracking |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
require_once __DIR__.'/../inc/global.inc.php'; |
|
|
|
@ -12,8 +12,6 @@ $current_course_tool = TOOL_TRACKING; |
|
|
|
|
|
|
|
|
|
$course_info = api_get_course_info(); |
|
|
|
|
$groupId = isset($_REQUEST['gidReq']) ? intval($_REQUEST['gidReq']) : 0; |
|
|
|
|
//$groupId = api_get_group_id(); |
|
|
|
|
|
|
|
|
|
$from_myspace = false; |
|
|
|
|
$from = isset($_GET['from']) ? $_GET['from'] : null; |
|
|
|
|
|
|
|
|
@ -66,7 +64,10 @@ $csv_content = array(); |
|
|
|
|
if (isset($_GET['origin']) && $_GET['origin'] == 'resume_session') { |
|
|
|
|
$interbreadcrumb[] = array('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin')); |
|
|
|
|
$interbreadcrumb[] = array('url' => '../session/session_list.php', 'name' => get_lang('SessionList')); |
|
|
|
|
$interbreadcrumb[] = array('url' => '../session/resume_session.php?id_session='.api_get_session_id(), 'name' => get_lang('SessionOverview')); |
|
|
|
|
$interbreadcrumb[] = array( |
|
|
|
|
'url' => '../session/resume_session.php?id_session='.api_get_session_id(), |
|
|
|
|
'name' => get_lang('SessionOverview'), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$view = (isset($_REQUEST['view']) ? $_REQUEST['view'] : ''); |
|
|
|
@ -114,7 +115,10 @@ if (empty($groupId)) { |
|
|
|
|
Display::return_icon('group.png', get_lang('GroupReporting'), array(), ICON_SIZE_MEDIUM), |
|
|
|
|
'course_log_groups.php?'.api_get_cidreq() |
|
|
|
|
); |
|
|
|
|
echo Display::url(Display::return_icon('course_na.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM), '#'); |
|
|
|
|
echo Display::url( |
|
|
|
|
Display::return_icon('course_na.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM), |
|
|
|
|
'#' |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
echo Display::url( |
|
|
|
|
Display::return_icon('group_na.png', get_lang('GroupReporting'), array(), ICON_SIZE_MEDIUM), |
|
|
|
@ -149,17 +153,15 @@ if ($lpReporting) { |
|
|
|
|
$flat_list = $list->get_flat_list(); |
|
|
|
|
|
|
|
|
|
if (count($flat_list) > 0) { |
|
|
|
|
|
|
|
|
|
// learning path tracking |
|
|
|
|
echo '<div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'scorms.gif', |
|
|
|
|
get_lang('AverageProgressInLearnpath') |
|
|
|
|
).get_lang('AverageProgressInLearnpath') |
|
|
|
|
).' |
|
|
|
|
<table class="data_table">'; |
|
|
|
|
|
|
|
|
|
echo '<div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'scorms.gif', |
|
|
|
|
get_lang('AverageProgressInLearnpath') |
|
|
|
|
).get_lang('AverageProgressInLearnpath') |
|
|
|
|
); |
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
if ($export_csv) { |
|
|
|
|
$temp = array(get_lang('AverageProgressInLearnpath', ''), ''); |
|
|
|
|
$csv_content[] = array('', ''); |
|
|
|
@ -204,19 +206,16 @@ if ($lpReporting) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($exerciseReporting) { |
|
|
|
|
|
|
|
|
|
// Exercices tracking. |
|
|
|
|
echo '<div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'quiz.png', |
|
|
|
|
get_lang('AverageResultsToTheExercices') |
|
|
|
|
).get_lang('AverageResultsToTheExercices') |
|
|
|
|
).' |
|
|
|
|
<table class="data_table">'; |
|
|
|
|
|
|
|
|
|
echo '<div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'quiz.png', |
|
|
|
|
get_lang('AverageResultsToTheExercices') |
|
|
|
|
).get_lang('AverageResultsToTheExercices') |
|
|
|
|
); |
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
|
|
|
|
|
$sql = "SELECT id, title FROM $TABLEQUIZ |
|
|
|
|
WHERE c_id = $course_id AND active <> -1 AND session_id = $session_id"; |
|
|
|
|
$rs = Database::query($sql); |
|
|
|
@ -243,18 +242,16 @@ if ($exerciseReporting) { |
|
|
|
|
$quiz_avg_score += $avg_student_score; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$studentCount = ($studentCount == 0 || is_null( |
|
|
|
|
$studentCount |
|
|
|
|
) || $studentCount == '') ? 1 : $studentCount; |
|
|
|
|
$studentCount = ($studentCount == 0 || is_null($studentCount) || $studentCount == '') ? 1 : $studentCount; |
|
|
|
|
$quiz_avg_score = round(($quiz_avg_score / $studentCount), 2).'%'; |
|
|
|
|
$url = api_get_path( |
|
|
|
|
WEB_CODE_PATH |
|
|
|
|
).'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params; |
|
|
|
|
|
|
|
|
|
echo '<tr><td>'.Display::url( |
|
|
|
|
$quiz['title'], |
|
|
|
|
$url |
|
|
|
|
).'</td><td align="right">'.$quiz_avg_score.'</td></tr>'; |
|
|
|
|
$url = api_get_path(WEB_CODE_PATH).'exercise/overview.php?exerciseId='.$quiz['id'].$course_path_params; |
|
|
|
|
|
|
|
|
|
echo '<tr><td>'; |
|
|
|
|
echo Display::url( |
|
|
|
|
$quiz['title'], |
|
|
|
|
$url |
|
|
|
|
); |
|
|
|
|
echo '</td><td align="right">'.$quiz_avg_score.'</td></tr>'; |
|
|
|
|
if ($export_csv) { |
|
|
|
|
$temp = array($quiz['title'], $quiz_avg_score); |
|
|
|
|
$csv_content[] = $temp; |
|
|
|
@ -267,13 +264,11 @@ if ($exerciseReporting) { |
|
|
|
|
$csv_content[] = $temp; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '</table></div>'; |
|
|
|
|
echo '<div class="clear"></div>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$filterByUsers = array(); |
|
|
|
|
|
|
|
|
|
if (!empty($groupId)) { |
|
|
|
|
$filterByUsers = $student_ids; |
|
|
|
|
} |
|
|
|
@ -304,15 +299,13 @@ if ($export_csv) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Forums tracking. |
|
|
|
|
echo '<div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon('forum.gif', get_lang('Forum')). |
|
|
|
|
get_lang('Forum').' - <a href="../forum/index.php?'.api_get_cidreq().'">'. |
|
|
|
|
get_lang('SeeDetail').'</a>' |
|
|
|
|
). |
|
|
|
|
'<table class="data_table">'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon('forum.gif', get_lang('Forum')). |
|
|
|
|
get_lang('Forum').' - <a href="../forum/index.php?'.api_get_cidreq().'">'. |
|
|
|
|
get_lang('SeeDetail').'</a>' |
|
|
|
|
); |
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
echo '<tr><td>'.get_lang('ForumForumsNumber').'</td><td align="right">'.$count_number_of_forums_by_course.'</td></tr>'; |
|
|
|
|
echo '<tr><td>'.get_lang('ForumThreadsNumber').'</td><td align="right">'.$count_number_of_threads_by_course.'</td></tr>'; |
|
|
|
|
echo '<tr><td>'.get_lang('ForumPostsNumber').'</td><td align="right">'.$count_number_of_posts_by_course.'</td></tr>'; |
|
|
|
@ -321,11 +314,12 @@ echo '<div class="clear"></div>'; |
|
|
|
|
|
|
|
|
|
// Chat tracking. |
|
|
|
|
if ($showChatReporting) { |
|
|
|
|
echo '<div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon('chat.gif', get_lang('Chat')).get_lang('Chat') |
|
|
|
|
).' |
|
|
|
|
<table class="data_table">'; |
|
|
|
|
echo '<div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon('chat.gif', get_lang('Chat')).get_lang('Chat') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
$chat_connections_during_last_x_days_by_course = Tracking::chat_connections_during_last_x_days_by_course( |
|
|
|
|
$course_code, |
|
|
|
|
7, |
|
|
|
@ -338,13 +332,15 @@ if ($showChatReporting) { |
|
|
|
|
get_lang('ChatConnectionsDuringLastXDays', ''), |
|
|
|
|
'7' |
|
|
|
|
), |
|
|
|
|
$chat_connections_during_last_x_days_by_course |
|
|
|
|
$chat_connections_during_last_x_days_by_course, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
echo '<tr><td>'.sprintf( |
|
|
|
|
get_lang('ChatConnectionsDuringLastXDays'), |
|
|
|
|
'7' |
|
|
|
|
).'</td><td align="right">'.$chat_connections_during_last_x_days_by_course.'</td></tr>'; |
|
|
|
|
echo '<tr><td>'; |
|
|
|
|
echo sprintf( |
|
|
|
|
get_lang('ChatConnectionsDuringLastXDays'), |
|
|
|
|
'7' |
|
|
|
|
); |
|
|
|
|
echo '</td><td align="right">'.$chat_connections_during_last_x_days_by_course.'</td></tr>'; |
|
|
|
|
|
|
|
|
|
echo '</table></div>'; |
|
|
|
|
echo '<div class="clear"></div>'; |
|
|
|
@ -352,14 +348,14 @@ if ($showChatReporting) { |
|
|
|
|
|
|
|
|
|
// Tools tracking. |
|
|
|
|
if ($showTrackingReporting) { |
|
|
|
|
echo '<div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'acces_tool.gif', |
|
|
|
|
get_lang('ToolsMostUsed') |
|
|
|
|
).get_lang('ToolsMostUsed') |
|
|
|
|
).' |
|
|
|
|
<table class="data_table">'; |
|
|
|
|
echo '<div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'acces_tool.gif', |
|
|
|
|
get_lang('ToolsMostUsed') |
|
|
|
|
).get_lang('ToolsMostUsed') |
|
|
|
|
); |
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
|
|
|
|
|
$tools_most_used = Tracking::get_tools_most_used_by_course( |
|
|
|
|
$course_id, |
|
|
|
@ -373,16 +369,14 @@ if ($showTrackingReporting) { |
|
|
|
|
|
|
|
|
|
if (!empty($tools_most_used)) { |
|
|
|
|
foreach ($tools_most_used as $row) { |
|
|
|
|
echo ' <tr> |
|
|
|
|
echo '<tr> |
|
|
|
|
<td>'.get_lang(ucfirst($row['access_tool'])).'</td> |
|
|
|
|
<td align="right">'.$row['count_access_tool'].' '.get_lang( |
|
|
|
|
'Clicks' |
|
|
|
|
).'</td> |
|
|
|
|
</tr>'; |
|
|
|
|
<td align="right">'.$row['count_access_tool'].' '.get_lang('Clicks').'</td> |
|
|
|
|
</tr>'; |
|
|
|
|
if ($export_csv) { |
|
|
|
|
$temp = array( |
|
|
|
|
get_lang(ucfirst($row['access_tool']), ''), |
|
|
|
|
$row['count_access_tool'].' '.get_lang('Clicks', '') |
|
|
|
|
$row['count_access_tool'].' '.get_lang('Clicks', ''), |
|
|
|
|
); |
|
|
|
|
$csv_content[] = $temp; |
|
|
|
|
} |
|
|
|
@ -397,23 +391,21 @@ if ($documentReporting) { |
|
|
|
|
// Documents tracking. |
|
|
|
|
if (!isset($_GET['num']) || empty($_GET['num'])) { |
|
|
|
|
$num = 3; |
|
|
|
|
$link = ' - <a href="'.api_get_self().'?'.api_get_cidreq( |
|
|
|
|
).'&num=1#documents_tracking">'.get_lang('SeeDetail').'</a>'; |
|
|
|
|
$link = ' - <a href="'.api_get_self().'?'.api_get_cidreq().'&num=1#documents_tracking">'.get_lang('SeeDetail').'</a>'; |
|
|
|
|
} else { |
|
|
|
|
$num = 1000; |
|
|
|
|
$link = ' - <a href="'.api_get_self().'?'.api_get_cidreq( |
|
|
|
|
).'&num=0#documents_tracking">'.get_lang('ViewMinus').'</a>'; |
|
|
|
|
$link = ' - <a href="'.api_get_self().'?'.api_get_cidreq().'&num=0#documents_tracking">'.get_lang('ViewMinus').'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
echo '<a name="documents_tracking" id="a"></a><div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'documents.gif', |
|
|
|
|
get_lang('DocumentsMostDownloaded') |
|
|
|
|
).' '.get_lang('DocumentsMostDownloaded').$link |
|
|
|
|
).' |
|
|
|
|
<table class="data_table">'; |
|
|
|
|
echo '<a name="documents_tracking" id="a"></a><div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'documents.gif', |
|
|
|
|
get_lang('DocumentsMostDownloaded') |
|
|
|
|
).' '.get_lang('DocumentsMostDownloaded').$link |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
$documents_most_downloaded = Tracking::get_documents_most_downloaded_by_course( |
|
|
|
|
$course_code, |
|
|
|
|
$session_id, |
|
|
|
@ -429,20 +421,20 @@ if ($documentReporting) { |
|
|
|
|
if (!empty($documents_most_downloaded)) { |
|
|
|
|
foreach ($documents_most_downloaded as $row) { |
|
|
|
|
echo '<tr> |
|
|
|
|
<td>'.Display::url( |
|
|
|
|
$row['down_doc_path'], |
|
|
|
|
api_get_path( |
|
|
|
|
WEB_CODE_PATH |
|
|
|
|
).'document/show_content.php?file='.$row['down_doc_path'].$course_path_params |
|
|
|
|
).'</td> |
|
|
|
|
<td align="right">'.$row['count_down'].' '.get_lang( |
|
|
|
|
'Clicks' |
|
|
|
|
).'</td> |
|
|
|
|
<td>'; |
|
|
|
|
echo Display::url( |
|
|
|
|
$row['down_doc_path'], |
|
|
|
|
api_get_path( |
|
|
|
|
WEB_CODE_PATH |
|
|
|
|
).'document/show_content.php?file='.$row['down_doc_path'].$course_path_params |
|
|
|
|
); |
|
|
|
|
echo '</td> |
|
|
|
|
<td align="right">'.$row['count_down'].' '.get_lang('Clicks').'</td> |
|
|
|
|
</tr>'; |
|
|
|
|
if ($export_csv) { |
|
|
|
|
$temp = array( |
|
|
|
|
$row['down_doc_path'], |
|
|
|
|
$row['count_down'].' '.get_lang('Clicks', '') |
|
|
|
|
$row['count_down'].' '.get_lang('Clicks', ''), |
|
|
|
|
); |
|
|
|
|
$csv_content[] = $temp; |
|
|
|
|
} |
|
|
|
@ -455,22 +447,19 @@ if ($documentReporting) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '</table></div>'; |
|
|
|
|
|
|
|
|
|
echo '<div class="clear"></div>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($linkReporting) { |
|
|
|
|
|
|
|
|
|
// links tracking |
|
|
|
|
echo '<div class="report_section"> |
|
|
|
|
'.Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'link.gif', |
|
|
|
|
get_lang('LinksMostClicked') |
|
|
|
|
).' '.get_lang('LinksMostClicked') |
|
|
|
|
).' |
|
|
|
|
<table class="data_table">'; |
|
|
|
|
|
|
|
|
|
echo '<div class="report_section">'; |
|
|
|
|
echo Display::page_subheader( |
|
|
|
|
Display::return_icon( |
|
|
|
|
'link.gif', |
|
|
|
|
get_lang('LinksMostClicked') |
|
|
|
|
).' '.get_lang('LinksMostClicked') |
|
|
|
|
); |
|
|
|
|
echo '<table class="data_table">'; |
|
|
|
|
$links_most_visited = Tracking::get_links_most_visited_by_course( |
|
|
|
|
$course_code, |
|
|
|
|
$session_id |
|
|
|
@ -484,19 +473,16 @@ if ($linkReporting) { |
|
|
|
|
|
|
|
|
|
if (!empty($links_most_visited)) { |
|
|
|
|
foreach ($links_most_visited as $row) { |
|
|
|
|
echo ' <tr> |
|
|
|
|
<td>'.Display::url( |
|
|
|
|
$row['title'].' ('.$row['url'].')', |
|
|
|
|
$row['url'] |
|
|
|
|
).'</td> |
|
|
|
|
<td align="right">'.$row['count_visits'].' '.get_lang( |
|
|
|
|
'Clicks' |
|
|
|
|
).'</td> |
|
|
|
|
</tr>'; |
|
|
|
|
echo '<tr><td>'; |
|
|
|
|
echo Display::url( |
|
|
|
|
$row['title'].' ('.$row['url'].')', |
|
|
|
|
$row['url'] |
|
|
|
|
); |
|
|
|
|
echo '</td><td align="right">'.$row['count_visits'].' '.get_lang('Clicks').'</td></tr>'; |
|
|
|
|
if ($export_csv) { |
|
|
|
|
$temp = array( |
|
|
|
|
$row['title'], |
|
|
|
|
$row['count_visits'].' '.get_lang('Clicks', '') |
|
|
|
|
$row['count_visits'].' '.get_lang('Clicks', ''), |
|
|
|
|
); |
|
|
|
|
$csv_content[] = $temp; |
|
|
|
|
} |
|
|
|
@ -515,7 +501,7 @@ if ($linkReporting) { |
|
|
|
|
// send the csv file if asked |
|
|
|
|
if ($export_csv) { |
|
|
|
|
ob_end_clean(); |
|
|
|
|
Export :: arrayToCsv($csv_content, 'reporting_course_tools'); |
|
|
|
|
Export:: arrayToCsv($csv_content, 'reporting_course_tools'); |
|
|
|
|
exit; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|