* Panepistimiopolis Ilissia, 15784, Athens, Greece * e-mail: info@openeclass.org * ======================================================================== */ /** * @file group.php * @brief group statistics */ $require_current_course = true; $require_course_admin = true; $require_help = true; $helpTopic = 'Usage'; $require_login = true; require_once '../../include/baseTheme.php'; require_once 'modules/group/group_functions.php'; require_once "statistics_tools_bar.php"; statistics_tools($course_code, "group"); $navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage); $pageName = $langGroupUsage; initialize_group_info(); $q = Database::get()->queryArray("SELECT id, name, g.description, max_members, COUNT(*) AS registered\n\t FROM `group` AS g, group_members AS gm\n\t\t WHERE g.course_id = ?d AND g.id = gm.group_id\n\t\t GROUP BY g.id", $course_id); if (count($q) > 0) { $tool_content .= "<div class='table-responsive'><table class='table-default'>\n\t\t<tr>\n\t\t <th class='text-left'>{$langGroupName}</th>\n\t\t <th class='text-center'>{$langGroupTutor}</th>\n\t\t <th class='text-center'>{$langRegistered}</th>\n\t\t <th class='text-center'>{$langMax}</th>\n\t\t</tr>"; foreach ($q as $group) { $tool_content .= "<td>\n\t\t\t<a href='../group/group_usage.php?course={$course_code}&module=usage&group_id={$group->id}'>" . q($group->name) . "</a></td>"; $tool_content .= "<td>" . display_user(group_tutors($group->id)) . "</td>"; $tool_content .= "<td class='text-center'>{$group->registered}</td>"; if ($group->max_members == 0) { $tool_content .= "<td class='text-center'>-</td>"; } else { $tool_content .= "<td class='text-center'>{$group->max_members}</td>"; }
$head_content .= "<script type='text/javascript'> $(function() { $('#user_date_start, #user_date_end').datetimepicker({ format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', language: '".$language."', autoclose: true }); }); </script>"; $toolName = $langUsage; $pageName = $langFavourite; $navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage); statistics_tools($course_code, "favourite"); if (isset($_POST['user_date_start'])) { $uds = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_start']); $u_date_start = $uds->format('Y-m-d H:i'); $user_date_start = $uds->format('d-m-Y H:i'); } else { $date_start = new DateTime(); $date_start->sub(new DateInterval('P30D')); $u_date_start = $date_start->format('Y-m-d H:i'); $user_date_start = $date_start->format('d-m-Y H:i'); } if (isset($_POST['user_date_end'])) { $ude = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_end']); $u_date_end = $ude->format('Y-m-d H:i'); $user_date_end = $ude->format('d-m-Y H:i');
if (isset($_GET['from_stats']) and $_GET['from_stats'] == 1) { // if we come from statistics $toolName = $langUsage; $navigation[] = array('url' => '../usage/?course=' . $course_code, 'name' => $langUsage); $pageName = "{$langLearningPaths} - {$langTrackAllPathExplanation}"; } else { $navigation[] = array("url" => "index.php?course={$course_code}", "name" => $langLearningPaths); $pageName = $langTrackAllPathExplanation; } // display a list of user and their respective progress $sql = "SELECT U.`surname`, U.`givenname`, U.`id`\n\tFROM `user` AS U, `course_user` AS CU\n\tWHERE U.`id`= CU.`user_id`\n\tAND CU.`course_id` = {$course_id}\n\tORDER BY U.`surname` ASC"; @($tool_content .= get_limited_page_links($sql, 30, $langPreviousPage, $langNextPage)); $usersList = get_limited_list($sql, 30); if (isset($_GET['from_stats']) and $_GET['from_stats'] == 1) { // if we come from statistics statistics_tools($course_code, "detailsAll", "../usage/"); } // check if there are learning paths available $lcnt = Database::get()->querySingle("SELECT COUNT(*) AS count FROM lp_learnPath WHERE course_id = ?d", $course_id)->count; if ($lcnt == 0) { $tool_content .= "<div class='alert alert-warning'>{$langNoLearningPath}</div>"; draw($tool_content, 2, null, $head_content); exit; } else { $tool_content .= "<div class='alert alert-info'>\n <b>{$langDumpUserDurationToFile}: </b>1. <a href='dumpuserlearnpathdetails.php?course={$course_code}'>{$langcsvenc2}</a>\n 2. <a href='dumpuserlearnpathdetails.php?course={$course_code}&enc=1253'>{$langcsvenc1}</a> \n </div>"; } // display tab header $tool_content .= "\n <table class='table-default'>\n <tr>\n <th class='left'><div align='left'>{$langStudent}</div></th>\n <th width='120'>{$langAm}</th>\n <th>{$langGroup}</th>\n <th colspan='2'>{$langProgress} </th>\n </tr>\n"; // display tab content $k = 0; foreach ($usersList as $user) {
$format = 'csv'; if (isset($_GET['enc']) and $_GET['enc'] == '1253') { $charset = 'Windows-1253'; } else { $charset = 'UTF-8'; } $crlf = "\r\n"; header("Content-Type: text/csv; charset={$charset}"); header("Content-Disposition: attachment; filename=usersduration.csv"); echo join(';', array_map("csv_escape", array($langSurnameName, $langAm, $langGroup, $langDuration))), $crlf, $crlf; } else { $format = 'html'; $toolName = $langUsage; $pageName = $langUserDuration; $navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage); statistics_tools($course_code, "userduration"); // display number of users $tool_content .= "\n <div class='alert alert-info'>\n <b>{$langDumpUserDurationToFile}: </b>1. <a href='userduration.php?course={$course_code}&format=csv'>{$langcsvenc2}</a>\n 2. <a href='userduration.php?course={$course_code}&format=csv&enc=1253'>{$langcsvenc1}</a>\n </div>"; $tool_content .= "\n <table class='tbl_alt' width='99%'>\n <tr>\n <th class='left'> {$langSurname} {$langName}</th>\n <th>{$langAm}</th>\n <th>{$langGroup}</th>\n <th>{$langDuration}</th>\n </tr>"; } $result = user_duration_query($course_id); if (count($result) > 0) { $i = 0; foreach ($result as $row) { $i++; $grp_name = user_groups($course_id, $row->id, $format); if ($format == 'html') { if ($i % 2 == 0) { $tool_content .= "<tr class='even'>"; } else { $tool_content .= "<tr class='odd'>";
$helpTopic = 'Usage'; $require_login = true; require_once '../../include/baseTheme.php'; require_once "statistics_tools_bar.php"; load_js('tools.js'); load_js('bootstrap-datetimepicker'); $head_content .= "<script type='text/javascript'> $(function() { $('#user_date_start, #user_date_end').datetimepicker({ format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', language: '".$language."', autoclose: true }); }); </script>"; statistics_tools($course_code, "index"); $pageName = $langUsage; $made_chart = true; ob_start(); require_once "results.php"; require_once "form.php"; add_units_navigation(true); draw($tool_content, 2, null, $head_content);
$require_login = true; } $require_course_admin = true; require_once '../../include/baseTheme.php'; require_once 'include/log.php'; require_once 'statistics_tools_bar.php'; load_js('datatables'); load_js('datatables_filtering_delay'); load_js('bootstrap-datetimepicker'); $head_content .= "<script type='text/javascript'>\n \$(document).ready(function() {\n \$('#log_results_table').dataTable ({ \n 'sPaginationType': 'full_numbers',\n 'bAutoWidth': true, \n 'oLanguage': {\n 'sLengthMenu': '{$langDisplay} _MENU_ {$langResults2}',\n 'sZeroRecords': '" . $langNoResult . "',\n 'sInfo': '{$langDisplayed} _START_ {$langTill} _END_ {$langFrom2} _TOTAL_ {$langTotalResults}',\n 'sInfoEmpty': '{$langDisplayed} 0 {$langTill} 0 {$langFrom2} 0 {$langResults2}',\n 'sInfoFiltered': '',\n 'sInfoPostFix': '',\n 'sSearch': '" . $langSearch . "',\n 'sUrl': '',\n 'oPaginate': {\n 'sFirst': '«',\n 'sPrevious': '‹',\n 'sNext': '›',\n 'sLast': '»'\n }\n }\n }).fnSetFilteringDelay(1000);\n \$('.dataTables_filter input').attr('placeholder', '{$langDetail}');\n });\n </script>"; $head_content .= "<script type='text/javascript'>\n \$(function() {\n \$('#user_date_start, #user_date_end').datetimepicker({\n format: 'dd-mm-yyyy hh:ii',\n pickerPosition: 'bottom-left',\n language: '" . $language . "',\n autoclose: true \n }); \n });\n </script>"; if (!isset($_REQUEST['course_code'])) { $course_code = course_id_to_code($course_id); } $toolName = $langUsersLog; statistics_tools($course_code, "displaylog"); $navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage); $logtype = isset($_REQUEST['logtype']) ? intval($_REQUEST['logtype']) : '0'; $u_user_id = isset($_REQUEST['u_user_id']) ? intval($_REQUEST['u_user_id']) : '-1'; $u_module_id = isset($_REQUEST['u_module_id']) ? intval($_REQUEST['u_module_id']) : '-1'; if (isset($_POST['user_date_start'])) { $uds = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_start']); $u_date_start = $uds->format('Y-m-d H:i'); $user_date_start = $uds->format('d-m-Y H:i'); } else { $date_start = new DateTime(); $date_start->sub(new DateInterval('P30D')); $u_date_start = $date_start->format('Y-m-d H:i'); $user_date_start = $date_start->format('d-m-Y H:i'); } if (isset($_POST['user_date_end'])) {
$head_content .= "<script type='text/javascript'> $(function() { $('#user_date_start, #user_date_end').datetimepicker({ format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', language: '".$language."', autoclose: true }); }); </script>"; $toolName = $langUsage; $pageName = $langOldStats; $navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage); statistics_tools($course_code, "oldStats"); if (isset($_POST['user_date_start'])) { $uds = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_start']); $u_date_start = $uds->format('Y-m-d H:i'); $user_date_start = $uds->format('d-m-Y H:i'); } else { $date_start = new DateTime(); $date_start->sub(new DateInterval('P2Y')); $u_date_start = $date_start->format('Y-m-d H:i'); $user_date_start = $date_start->format('d-m-Y H:i'); } if (isset($_POST['user_date_end'])) { $ude = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_end']);
require_once 'statistics_tools_bar.php'; load_js('bootstrap-datetimepicker'); $head_content .= "<script type='text/javascript'> $(function() { $('#user_date_start, #user_date_end').datetimepicker({ format: 'dd-mm-yyyy hh:ii', pickerPosition: 'bottom-left', language: '".$language."', autoclose: true }); }); </script>"; statistics_tools($course_code, "userlogins"); $pageName = $langUserLogins; $navigation[] = array('url' => 'index.php?course=' . $course_code, 'name' => $langUsage); if (isset($_POST['user_date_start'])) { $uds = DateTime::createFromFormat('d-m-Y H:i', $_POST['user_date_start']); $u_date_start = $uds->format('Y-m-d H:i'); $user_date_start = $uds->format('d-m-Y H:i'); } else { $date_start = new DateTime(); $date_start->sub(new DateInterval('P2D')); $u_date_start = $date_start->format('Y-m-d H:i'); $user_date_start = $date_start->format('d-m-Y H:i'); } if (isset($_POST['user_date_end'])) {