[svn r16769] Applied patch to broken breadcrumb when entering admin page through session admin (private task FS#3102) by iflores

skala
Yannick Warnier 17 years ago
parent 19ecf744a8
commit ed7b9b593a
  1. 49
      main/admin/resume_session.php
  2. 42
      main/admin/session_course_edit.php
  3. 308
      main/inc/banner.inc.php
  4. 126
      main/mySpace/myStudents.php
  5. 308
      main/tracking/courseLog.php

@ -1,27 +1,5 @@
<?php <?php // $Id: resume_session.php 16769 2008-11-17 22:19:30Z yannoo $
// $Id: course_list.php,v 1.15.2.1 2005/10/31 09:15:57 olivierb78 Exp $ /* For licensing terms, see /dokeos_license.txt */
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Olivier Brouckaert
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/** /**
============================================================================== ==============================================================================
@author Bart Mollet @author Bart Mollet
@ -37,15 +15,15 @@
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = 'admin'; $language_file = 'admin';
$cidReset = true; $cidReset = true;
require ('../inc/global.inc.php'); require '../inc/global.inc.php';
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section=SECTION_PLATFORM_ADMIN; $this_section=SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true); api_protect_admin_script(true);
$tool_name = get_lang('SessionOverview'); $tool_name = get_lang('SessionOverview');
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => "session_list.php","name" => get_lang('SessionList')); $interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList'));
// Database Table Definitions // Database Table Definitions
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
@ -58,7 +36,7 @@ $tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_C
$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); $tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
$tbl_class_rel_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); $tbl_class_rel_user = Database::get_main_table(TABLE_MAIN_CLASS_USER);
$id_session = $_GET['id_session']; $id_session = (int)$_GET['id_session'];
$sql = 'SELECT name, nbr_courses, nbr_users, nbr_classes, DATE_FORMAT(date_start,"%d-%m-%Y") as date_start, DATE_FORMAT(date_end,"%d-%m-%Y") as date_end, lastname, firstname, username, session_admin_id, nb_days_access_before_beginning, nb_days_access_after_end $sql = 'SELECT name, nbr_courses, nbr_users, nbr_classes, DATE_FORMAT(date_start,"%d-%m-%Y") as date_start, DATE_FORMAT(date_end,"%d-%m-%Y") as date_end, lastname, firstname, username, session_admin_id, nb_days_access_before_beginning, nb_days_access_after_end
FROM '.$tbl_session.' FROM '.$tbl_session.'
@ -211,18 +189,22 @@ else {
$sql = 'SELECT COUNT(id_user) as nb_users FROM '.$tbl_session_rel_course_rel_user.' WHERE course_code="'.Database::escape_string($course['code']).'" AND id_session='.intval($id_session); $sql = 'SELECT COUNT(id_user) as nb_users FROM '.$tbl_session_rel_course_rel_user.' WHERE course_code="'.Database::escape_string($course['code']).'" AND id_session='.intval($id_session);
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
$course['nbr_users'] = mysql_result($rs,0,0); $course['nbr_users'] = mysql_result($rs,0,0);
if(empty($course['username'])) if (empty($course['username'])) {
$coach = get_lang('None'); $coach = get_lang('None');
else } else {
$coach = $course['lastname'].' '.$course['firstname'].' ('.$course['username'].')'; $coach = $course['lastname'].' '.$course['firstname'].' ('.$course['username'].')';
}
$orig_param = '&origin=resume_session';
//hide_course_breadcrumb the parameter has been added to hide the name of the course, that appeared in the default $interbreadcrumb
echo ' echo '
<tr> <tr>
<td>'.$course['title'].' ('.$course['visual_code'].')</td> <td>'.$course['title'].' ('.$course['visual_code'].')</td>
<td>'.$coach.'</td> <td>'.$coach.'</td>
<td>'.$course['nbr_users'].'</td> <td>'.$course['nbr_users'].'</td>
<td> <td>
<a href="../tracking/courseLog.php?id_session='.$id_session.'&cidReq='.$course['code'].'"><img src="../img/statistics.gif" border="0" style="vertical-align: middle;" title="'.get_lang('Tracking').'" alt="'.get_lang('Tracking').'"/></a>&nbsp; <a href="../tracking/courseLog.php?id_session='.$id_session.'&cidReq='.$course['code'].$orig_param.'&hide_course_breadcrumb=1"><img src="../img/statistics.gif" border="0" style="vertical-align: middle;" title="'.get_lang('Tracking').'" alt="'.get_lang('Tracking').'"/></a>&nbsp;
<a href="session_course_edit.php?id_session='.$id_session.'&page=resume_session.php&course_code='.$course['code'].'"><img src="../img/edit.gif" border="0" align="absmiddle" title="'.get_lang('Edit').'"></a> <a href="session_course_edit.php?id_session='.$id_session.'&page=resume_session.php&course_code='.$course['code'].''.$orig_param.'"><img src="../img/edit.gif" border="0" align="absmiddle" title="'.get_lang('Edit').'"></a>
<a href="'.api_get_self().'?id_session='.$id_session.'&action=delete&idChecked[]='.$course['code'].'" onclick="javascript:if(!confirm(\''.get_lang('ConfirmYourChoice').'\')) return false;"><img src="../img/delete.gif" border="0" align="absmiddle" title="'.get_lang('Delete').'"></a> <a href="'.api_get_self().'?id_session='.$id_session.'&action=delete&idChecked[]='.$course['code'].'" onclick="javascript:if(!confirm(\''.get_lang('ConfirmYourChoice').'\')) return false;"><img src="../img/delete.gif" border="0" align="absmiddle" title="'.get_lang('Delete').'"></a>
</td> </td>
</tr>'; </tr>';
@ -261,13 +243,14 @@ else {
$result=api_sql_query($sql,__FILE__,__LINE__); $result=api_sql_query($sql,__FILE__,__LINE__);
$users=api_store_result($result); $users=api_store_result($result);
$orig_param = '&origin=resume_session&id_session='.$id_session; // change breadcrumb in destination page
foreach($users as $user){ foreach($users as $user){
echo '<tr> echo '<tr>
<td width="90%"> <td width="90%">
<b>'.$user['lastname'].' '.$user['firstname'].' ('.$user['username'].')</b> <b>'.$user['lastname'].' '.$user['firstname'].' ('.$user['username'].')</b>
</td> </td>
<td> <td>
<a href="../mySpace/myStudents.php?student='.$user['user_id'].'"><img src="../img/statistics.gif" border="0" style="vertical-align: middle;" title="'.get_lang('Reporting').'" alt="'.get_lang('Reporting').'"/></a>&nbsp;<a href="'.api_get_self().'?id_session='.$id_session.'&action=delete&user='.$user['user_id'].'" onclick="javascript:if(!confirm(\''.get_lang('ConfirmYourChoice').'\')) return false;"><img src="../img/delete.gif" border="0" align="absmiddle" title="'.get_lang('Delete').'"></a> <a href="../mySpace/myStudents.php?student='.$user['user_id'].''.$orig_param.'"><img src="../img/statistics.gif" border="0" style="vertical-align: middle;" title="'.get_lang('Reporting').'" alt="'.get_lang('Reporting').'"/></a>&nbsp;<a href="'.api_get_self().'?id_session='.$id_session.'&action=delete&user='.$user['user_id'].'" onclick="javascript:if(!confirm(\''.get_lang('ConfirmYourChoice').'\')) return false;"><img src="../img/delete.gif" border="0" align="absmiddle" title="'.get_lang('Delete').'"></a>
</td> </td>
</tr>'; </tr>';
} }

@ -1,10 +1,15 @@
<?php <?php //$id: $
/* For licensing terms, see /dokeos_license.txt */
/**
* Implements the edition of course-session settings
* @package dokeos.admin
*/
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file='admin'; $language_file='admin';
$cidReset=true; $cidReset=true;
include('../inc/global.inc.php'); require '../inc/global.inc.php';
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section=SECTION_PLATFORM_ADMIN; $this_section=SECTION_PLATFORM_ADMIN;
@ -23,22 +28,22 @@ $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tool_name=get_lang('ModifySessionCourse'); $course_info=api_get_course_info($_REQUEST['course_code']);
$tool_name=$course_info['name'];
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => "session_list.php","name" => get_lang("SessionList"));
$interbreadcrumb[]=array('url' => "../admin/resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']),"name" => get_lang('SessionOverview'));
$interbreadcrumb[]=array('url' => "session_course_list.php?id_session=$id_session","name" =>htmlentities($session_name,ENT_QUOTES,$charset));
$result=api_sql_query("SELECT name,title FROM $tbl_session_course,$tbl_session,$tbl_course WHERE id_session=id AND course_code=code AND id_session='$id_session' AND course_code='".addslashes($course_code)."'",__FILE__,__LINE__); $result=api_sql_query("SELECT name,title FROM $tbl_session_course,$tbl_session,$tbl_course WHERE id_session=id AND course_code=code AND id_session='$id_session' AND course_code='".addslashes($course_code)."'",__FILE__,__LINE__);
if(!list($session_name,$course_title)=mysql_fetch_row($result)) if (!list($session_name,$course_title)=mysql_fetch_row($result)) {
{
header('Location: session_course_list.php?id_session='.$id_session); header('Location: session_course_list.php?id_session='.$id_session);
exit(); exit();
} }
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); if ($_POST['formSent']) {
$interbreadcrumb[]=array('url' => "session_list.php","name" => get_lang("SessionList"));
$interbreadcrumb[]=array('url' => "session_course_list.php?id_session=$id_session","name" => get_lang("CourseSessionList")." &quot;".htmlentities($session_name,ENT_QUOTES,$charset)."&quot;");
if($_POST['formSent'])
{
$formSent=1; $formSent=1;
$id_coach=intval($_POST['id_coach']); $id_coach=intval($_POST['id_coach']);
@ -50,13 +55,10 @@ if($_POST['formSent'])
header('Location: '.$_GET['page'].'?id_session='.$id_session); header('Location: '.$_GET['page'].'?id_session='.$id_session);
exit(); exit();
} }else {
else
{
$result=api_sql_query("SELECT id_coach FROM $tbl_session_course WHERE id_session='$id_session' AND course_code='$course_code'",__FILE__,__LINE__); $result=api_sql_query("SELECT id_coach FROM $tbl_session_course WHERE id_session='$id_session' AND course_code='$course_code'",__FILE__,__LINE__);
if(!$infos=mysql_fetch_array($result)) if (!$infos=Database::fetch_array($result)) {
{
//header('Location: '.$_GET['page'].'?id_session='.$id_session); //header('Location: '.$_GET['page'].'?id_session='.$id_session);
exit(); exit();
} }
@ -66,13 +68,13 @@ $sql="SELECT user_id,lastname,firstname,username FROM $tbl_user WHERE status='1'
$result=api_sql_query($sql,__FILE__,__LINE__); $result=api_sql_query($sql,__FILE__,__LINE__);
$Coaches=api_store_result($result); $coaches=api_store_result($result);
Display::display_header($tool_name); Display::display_header($tool_name);
$tool_name=get_lang('ModifySessionCourse');
api_display_tool_title($tool_name); api_display_tool_title($tool_name);
?> ?>
<form method="post" action="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $_GET['page'] ?>" style="margin:0px;"> <form method="post" action="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $_GET['page'] ?>" style="margin:0px;">
<input type="hidden" name="formSent" value="1"> <input type="hidden" name="formSent" value="1">
@ -104,7 +106,7 @@ if(!empty($errorMsg))
<option value="0" <?php if((!$sent && $enreg['user_id'] == $infos['id_coach']) || ($sent && $enreg['user_id'] == $id_coach)) echo 'selected="selected"'; ?>><?php echo get_lang('None') ?></option> <option value="0" <?php if((!$sent && $enreg['user_id'] == $infos['id_coach']) || ($sent && $enreg['user_id'] == $id_coach)) echo 'selected="selected"'; ?>><?php echo get_lang('None') ?></option>
<?php <?php
foreach($Coaches as $enreg) foreach($coaches as $enreg)
{ {
?> ?>
@ -113,7 +115,7 @@ foreach($Coaches as $enreg)
<?php <?php
} }
unset($Coaches); unset($coaches);
?> ?>
</select></td> </select></td>

@ -1,31 +1,8 @@
<?php // $Id: banner.inc.php 16728 2008-11-12 15:49:54Z pcool $ <?php //$id: $
/* For licensing terms, see /dokeos_license.txt */
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/** /**
============================================================================== ==============================================================================
* This script contains the actual html code to display the Dokeos header * This script contains the actual html code to display the "header"
* or "banner" on top of every Dokeos page. * or "banner" on top of every Dokeos page.
* *
* @package dokeos.include * @package dokeos.include
@ -41,7 +18,7 @@
$iname = api_get_setting('Institution'); $iname = api_get_setting('Institution');
if (!empty($iname)) if (!empty($iname))
{ {
echo '-&nbsp;<a href="'.$iurl.'" target="_top">'.$iname.'</a>'; echo '-&nbsp;<a href="'.$iurl.'" target="_top">'.$iname.'</a>';
} }
?> ?>
@ -52,46 +29,34 @@
Course title section Course title section
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
if (!empty($_cid) and $_cid != -1 and isset($_course)) if (!empty($_cid) and $_cid != -1 and isset($_course)) {
{
//Put the name of the course in the header //Put the name of the course in the header
echo ' echo '
<div id="header1right"> <div id="header1right">
<a href="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/index.php" target="_top">'.$_course['name'].' '; <a href="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/index.php" target="_top">'.$_course['name'].' ';
if (api_get_setting("display_coursecode_in_courselist") == "true") if (api_get_setting("display_coursecode_in_courselist") == "true") {
{
echo $_course['official_code']; echo $_course['official_code'];
} }
if(api_get_setting("use_session_mode") == "true" && isset($_SESSION['session_name'])) if(api_get_setting("use_session_mode") == "true" && isset($_SESSION['session_name'])) {
{
echo ' ('.$_SESSION['session_name'].')'; echo ' ('.$_SESSION['session_name'].')';
} }
if (api_get_setting("display_coursecode_in_courselist") == "true" AND api_get_setting("display_teacher_in_courselist") == "true") if (api_get_setting("display_coursecode_in_courselist") == "true" AND api_get_setting("display_teacher_in_courselist") == "true") {
{
echo " - "; echo " - ";
} }
if (api_get_setting("display_teacher_in_courselist") == "true") if (api_get_setting("display_teacher_in_courselist") == "true") {
{
echo stripslashes($_course['titular']); echo stripslashes($_course['titular']);
} }
echo ' </a>'; echo ' </a>';
echo ' echo '
</div>'; </div>';
} } elseif (isset ($nameTools) && $language_file != 'course_home') {
elseif (isset ($nameTools) && $language_file != 'course_home')
{
//Put the name of the user-tools in the header //Put the name of the user-tools in the header
if (!isset ($_user['user_id'])) if (!isset ($_user['user_id'])) {
{
echo " "; echo " ";
} } elseif(!$noPHP_SELF) {
elseif(!$noPHP_SELF)
{
echo "<div id=\"my_courses\"><a href=\"".api_get_self()."?".api_get_cidreq(), "\" target=\"_top\">", $nameTools, "</a></div>", "\n"; echo "<div id=\"my_courses\"><a href=\"".api_get_self()."?".api_get_cidreq(), "\" target=\"_top\">", $nameTools, "</a></div>", "\n";
} } else {
else
{
echo "<div id=\"my_courses\">$nameTools</div>\n"; echo "<div id=\"my_courses\">$nameTools</div>\n";
} }
} }
@ -112,17 +77,16 @@ $web_course_path = api_get_path(WEB_COURSE_PATH);
External link section External link section
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
if (isset($_course['extLink']) && $_course['extLink']['name'] != "") if (isset($_course['extLink']) && $_course['extLink']['name'] != "") {
{
echo " / "; echo " / ";
if ($_course['extLink']['url'] != "") if ($_course['extLink']['url'] != "") {
{
echo "<a href=\"".$_course['extLink']['url']."\" target=\"_top\">"; echo "<a href=\"".$_course['extLink']['url']."\" target=\"_top\">";
echo $_course['extLink']['name']; echo $_course['extLink']['name'];
echo "</a>"; echo "</a>";
} } else {
else
echo $_course['extLink']['name']; echo $_course['extLink']['name'];
}
} }
?> ?>
@ -133,35 +97,28 @@ if (isset($_course['extLink']) && $_course['extLink']['name'] != "")
<div id="header2right"> <div id="header2right">
<ul> <ul>
<?php <?php
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id']) OR (api_get_setting('showonline','course') == "true" AND $_user['user_id'] AND $_cid)) {
{ if (api_get_setting("use_session_mode") == "true" && isset($_user['user_id']) && api_is_coach()) {
if(api_get_setting("use_session_mode") == "true" && isset($_user['user_id']) && api_is_coach())
{
echo ' <li><a href="'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$_user['user_id'].'&amp;referer='.urlencode($_SERVER['REQUEST_URI']).'" target="_top">'.get_lang('UsersConnectedToMySessions').'</a></li>'; echo ' <li><a href="'.api_get_path(WEB_PATH).'whoisonlinesession.php?id_coach='.$_user['user_id'].'&amp;referer='.urlencode($_SERVER['REQUEST_URI']).'" target="_top">'.get_lang('UsersConnectedToMySessions').'</a></li>';
} }
$statistics_database = Database :: get_statistic_database(); $statistics_database = Database :: get_statistic_database();
$number = count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline'))); $number = count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline')));
if(!empty($_course['id'])) if(!empty($_course['id'])) {
{
$online_in_course = who_is_online_in_this_course(api_get_user_id(), api_get_setting('time_limit_whosonline'), $_course['id']); $online_in_course = who_is_online_in_this_course(api_get_user_id(), api_get_setting('time_limit_whosonline'), $_course['id']);
$number_online_in_course= count( $online_in_course ); $number_online_in_course= count( $online_in_course );
} } else {
else
{
$number_online_in_course = 0; $number_online_in_course = 0;
} }
echo ' <li>'.get_lang('UsersOnline').': '; echo ' <li>'.get_lang('UsersOnline').': ';
// Display the who's online of the platform // Display the who's online of the platform
if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR (api_get_setting('showonline','users') == "true" AND $_user['user_id'])) {
{
echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.$number.'</a>'; echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.$number.'</a>';
} }
// Display the who's online for the course // Display the who's online for the course
if (is_array($_course) AND api_get_setting('showonline','course') == "true" AND isset($_course['sysCode'])) if (is_array($_course) AND api_get_setting('showonline','course') == "true" AND isset($_course['sysCode'])) {
{
echo "(<a href='".api_get_path(WEB_PATH)."whoisonline.php?cidReq=".$_course['sysCode']."' target='_top'>$number_online_in_course ".get_lang('InThisCourse')."</a>)"; echo "(<a href='".api_get_path(WEB_PATH)."whoisonline.php?cidReq=".$_course['sysCode']."' target='_top'>$number_online_in_course ".get_lang('InThisCourse')."</a>)";
} }
@ -169,19 +126,15 @@ if ((api_get_setting('showonline','world') == "true" AND !$_user['user_id']) OR
echo '</li>'; echo '</li>';
} }
if ($_user['user_id'] && isset($_cid)) if ($_user['user_id'] && isset($_cid)) {
{ if ((api_is_course_admin() || api_is_platform_admin()) && api_get_setting('student_view_enabled') == 'true') {
if ((api_is_course_admin() || api_is_platform_admin()) && api_get_setting('student_view_enabled') == 'true')
{
echo '<li>| '; echo '<li>| ';
api_display_tool_view_option(); api_display_tool_view_option();
echo '</li>'; echo '</li>';
} }
} }
if ( api_is_allowed_to_edit() ) if ( api_is_allowed_to_edit() ) {
{ if(!empty($help)) {
if(!empty($help))
{
// Show help // Show help
?> ?>
<li>| <li>|
@ -204,15 +157,11 @@ if ( api_is_allowed_to_edit() )
User section User section
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
if ($_user['user_id']) if ($_user['user_id']) {
{
$login = ''; $login = '';
if(api_is_anonymous()) if(api_is_anonymous()) {
{
$login = '('.get_lang('Anonymous').')'; $login = '('.get_lang('Anonymous').')';
} } else {
else
{
$uinfo = api_get_user_info(api_get_user_id()); $uinfo = api_get_user_info(api_get_user_id());
$login = '('.$uinfo['username'].')'; $login = '('.$uinfo['username'].')';
} }
@ -232,107 +181,73 @@ $navigation = array();
$possible_tabs = get_tabs(); $possible_tabs = get_tabs();
// Campus Homepage // Campus Homepage
if (api_get_setting('show_tabs', 'campus_homepage') == 'true') if (api_get_setting('show_tabs', 'campus_homepage') == 'true') {
{
$navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS]; $navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
} } else {
else
{
$menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS]; $menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
} }
if ($_user['user_id'] && !api_is_anonymous()) if ($_user['user_id'] && !api_is_anonymous()) {
{
// My Courses // My Courses
if (api_get_setting('show_tabs', 'my_courses') == 'true') if (api_get_setting('show_tabs', 'my_courses') == 'true') {
{
$navigation['mycourses'] = $possible_tabs['mycourses']; $navigation['mycourses'] = $possible_tabs['mycourses'];
} } else{
else
{
$menu_navigation['mycourses'] = $possible_tabs['mycourses']; $menu_navigation['mycourses'] = $possible_tabs['mycourses'];
} }
// My Profile // My Profile
if (api_get_setting('show_tabs', 'my_profile') == 'true') if (api_get_setting('show_tabs', 'my_profile') == 'true') {
{
$navigation['myprofile'] = $possible_tabs['myprofile']; $navigation['myprofile'] = $possible_tabs['myprofile'];
} } else {
else
{
$menu_navigation['myprofile'] = $possible_tabs['myprofile']; $menu_navigation['myprofile'] = $possible_tabs['myprofile'];
} }
// My Agenda // My Agenda
if (api_get_setting('show_tabs', 'my_agenda') == 'true') if (api_get_setting('show_tabs', 'my_agenda') == 'true') {
{
$navigation['myagenda'] = $possible_tabs['myagenda']; $navigation['myagenda'] = $possible_tabs['myagenda'];
} } else {
else
{
$menu_navigation['myagenda'] = $possible_tabs['myagenda']; $menu_navigation['myagenda'] = $possible_tabs['myagenda'];
} }
// Gradebook // Gradebook
if (api_get_setting('gradebook_enable') == 'true') if (api_get_setting('gradebook_enable') == 'true') {
{ if (api_get_setting('show_tabs', 'my_gradebook') == 'true') {
if (api_get_setting('show_tabs', 'my_gradebook') == 'true')
{
$navigation['mygradebook'] = $possible_tabs['mygradebook']; $navigation['mygradebook'] = $possible_tabs['mygradebook'];
} } else{
else
{
$menu_navigation['mygradebook'] = $possible_tabs['mygradebook']; $menu_navigation['mygradebook'] = $possible_tabs['mygradebook'];
} }
} }
// Reporting // Reporting
if (api_get_setting('show_tabs', 'reporting') == 'true') if (api_get_setting('show_tabs', 'reporting') == 'true') {
{ if(api_is_allowed_to_create_course() || $_user['status'] == DRH) {
if(api_is_allowed_to_create_course() || $_user['status'] == DRH)
{
$navigation['session_my_space'] = $possible_tabs['session_my_space']; $navigation['session_my_space'] = $possible_tabs['session_my_space'];
} } else {
else
{
$navigation['session_my_space'] = $possible_tabs['session_my_progress']; $navigation['session_my_space'] = $possible_tabs['session_my_progress'];
} }
} } else {
else if(api_is_allowed_to_create_course() || $_user['status'] == DRH) {
{
if(api_is_allowed_to_create_course() || $_user['status'] == DRH)
{
$menu_navigation['session_my_space'] = $possible_tabs['session_my_space']; $menu_navigation['session_my_space'] = $possible_tabs['session_my_space'];
} } else {
else
{
$menu_navigation['session_my_space'] = $possible_tabs['session_my_progress']; $menu_navigation['session_my_space'] = $possible_tabs['session_my_progress'];
} }
} }
if(api_is_platform_admin(true)) if(api_is_platform_admin(true)) {
{ if (api_get_setting('show_tabs', 'platform_administration') == 'true') {
if (api_get_setting('show_tabs', 'platform_administration') == 'true')
{
$navigation['platform_admin'] = $possible_tabs['platform_admin']; $navigation['platform_admin'] = $possible_tabs['platform_admin'];
} } else {
else
{
$menu_navigation['platform_admin'] = $possible_tabs['platform_admin']; $menu_navigation['platform_admin'] = $possible_tabs['platform_admin'];
} }
} }
} }
// Displaying the tabs // Displaying the tabs
foreach($navigation as $section => $navigation_info) foreach($navigation as $section => $navigation_info) {
{ if(isset($GLOBALS['this_section'])) {
if(isset($GLOBALS['this_section']))
{
$current = ($section == $GLOBALS['this_section'] ? ' id="current"' : ''); $current = ($section == $GLOBALS['this_section'] ? ' id="current"' : '');
} } else {
else
{
$current = ''; $current = '';
} }
echo ' <li'.$current.'><a href="'.$navigation_info['url'].'" target="_top"><span>'.$navigation_info['title'].'</span></a></li>'."\n"; echo ' <li'.$current.'><a href="'.$navigation_info['url'].'" target="_top"><span>'.$navigation_info['title'].'</span></a></li>'."\n";
@ -350,11 +265,10 @@ foreach($navigation as $section => $navigation_info)
*/ */
$navigation = array(); $navigation = array();
// part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage // part 1: Course Homepage. If we are in a course then the first breadcrumb is a link to the course homepage
if (isset ($_cid) and $_cid!=-1 and isset($_course)) //hide_course_breadcrumb the parameter has been added to hide the name of the course, that appeared in the default $interbreadcrumb
{ if (isset ($_cid) and $_cid!=-1 and isset($_course) and !isset($_GET['hide_course_breadcrumb'])) {
$navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'; $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php';
switch(api_get_setting('breadcrumbs_course_homepage')) switch(api_get_setting('breadcrumbs_course_homepage')) {
{
case 'get_lang': case 'get_lang':
$navigation_item['title'] = get_lang('CourseHomepageLink'); $navigation_item['title'] = get_lang('CourseHomepageLink');
break; break;
@ -368,10 +282,8 @@ if (isset ($_cid) and $_cid!=-1 and isset($_course))
$navigation[] = $navigation_item; $navigation[] = $navigation_item;
} }
// part 2: Interbreadcrumbs. If there is an array $interbreadcrumb defined then these have to appear before the last breadcrumb (which is the tool itself) // part 2: Interbreadcrumbs. If there is an array $interbreadcrumb defined then these have to appear before the last breadcrumb (which is the tool itself)
if (isset($interbreadcrumb) && is_array($interbreadcrumb)) if (isset($interbreadcrumb) && is_array($interbreadcrumb)) {
{ foreach($interbreadcrumb as $breadcrumb_step) {
foreach($interbreadcrumb as $breadcrumb_step)
{
$sep = (strrchr($breadcrumb_step['url'], '?') ? '&amp;' : '?'); $sep = (strrchr($breadcrumb_step['url'], '?') ? '&amp;' : '?');
$navigation_item['url'] = $breadcrumb_step['url'].$sep.api_get_cidreq(); $navigation_item['url'] = $breadcrumb_step['url'].$sep.api_get_cidreq();
$navigation_item['title'] = $breadcrumb_step['name']; $navigation_item['title'] = $breadcrumb_step['name'];
@ -380,18 +292,15 @@ if (isset($interbreadcrumb) && is_array($interbreadcrumb))
} }
// part 3: The tool itself. If we are on the course homepage we do not want to display the title of the course because this // part 3: The tool itself. If we are on the course homepage we do not want to display the title of the course because this
// is the same as the first part of the breadcrumbs (see part 1) // is the same as the first part of the breadcrumbs (see part 1)
if (isset ($nameTools) AND $language_file<>"course_home") if (isset ($nameTools) AND $language_file<>"course_home") {
{
$navigation_item['url'] = '#'; $navigation_item['url'] = '#';
$navigation_item['title'] = $nameTools; $navigation_item['title'] = $nameTools;
$navigation[] = $navigation_item; $navigation[] = $navigation_item;
} }
$final_navigation = array(); $final_navigation = array();
foreach($navigation as $index => $navigation_info) foreach($navigation as $index => $navigation_info) {
{ if(!empty($navigation_info['title'])) {
if(!empty($navigation_info['title']))
{
$final_navigation[$index] = '<a href="'.$navigation_info['url'].'" class="breadcrumb breadcrumb'.$index.'" target="_top">'.$navigation_info['title'].'</a>'; $final_navigation[$index] = '<a href="'.$navigation_info['url'].'" class="breadcrumb breadcrumb'.$index.'" target="_top">'.$navigation_info['title'].'</a>';
} }
} }
@ -401,16 +310,14 @@ echo implode(' &gt; ',$final_navigation);
</div> </div>
<?php <?php
if(api_get_setting('show_toolshortcuts')=='true') if(api_get_setting('show_toolshortcuts')=='true') {
{
echo '<div id="toolshortcuts">'; echo '<div id="toolshortcuts">';
require_once('tool_navigation_menu.inc.php'); require_once('tool_navigation_menu.inc.php');
show_navigation_tool_shortcuts(); show_navigation_tool_shortcuts();
echo '</div>'; echo '</div>';
} }
if (isset ($dokeos_database_connection)) if (isset ($dokeos_database_connection)) {
{
// connect to the main database. // connect to the main database.
// if single database, don't pefix table names with the main database name in SQL queries // if single database, don't pefix table names with the main database name in SQL queries
// (ex. SELECT * FROM `table`) // (ex. SELECT * FROM `table`)
@ -421,19 +328,16 @@ if (isset ($dokeos_database_connection))
} }
?> ?>
</div> </div> <!-- end of the whole #header section -->
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<?php <?php
//to mask the main div, set $header_hide_main_div to true in any script just before calling Display::display_header(); //to mask the main div, set $header_hide_main_div to true in any script just before calling Display::display_header();
global $header_hide_main_div; global $header_hide_main_div;
if(!empty($header_hide_main_div) && $header_hide_main_div===true) if (!empty($header_hide_main_div) && $header_hide_main_div===true) {
{
//do nothing //do nothing
} } else {
else
{
?> ?>
<div id="main"> <div id="main"> <!-- start of #main wrapper for #content and #menu divs -->
<?php <?php
} }
/* /*
@ -442,13 +346,11 @@ else
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
$chat = strpos(api_get_self(), 'chat_banner.php'); $chat = strpos(api_get_self(), 'chat_banner.php');
if (!$chat) if (!$chat) {
{
include_once (api_get_path(LIBRARY_PATH)."online.inc.php"); include_once (api_get_path(LIBRARY_PATH)."online.inc.php");
//echo $accept; //echo $accept;
$chatcall = chatcall(); $chatcall = chatcall();
if ($chatcall) if ($chatcall) {
{
Display :: display_normal_message($chatcall); Display :: display_normal_message($chatcall);
} }
} }
@ -458,31 +360,23 @@ if (!$chat)
Navigation menu section Navigation menu section
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
if(api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') if(api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') {
{
Display::show_course_navigation_menu($_GET['isHidden']); Display::show_course_navigation_menu($_GET['isHidden']);
if (isset($_cid) ) if (isset($_cid) ) {
{
echo '<div id="menuButton">'; echo '<div id="menuButton">';
echo $output_string_menu; echo $output_string_menu;
echo '</div>'; echo '</div>';
if(isset($_SESSION['hideMenu'])) if(isset($_SESSION['hideMenu'])) {
{ if($_SESSION['hideMenu'] =="shown") {
if($_SESSION['hideMenu'] =="shown") if (isset($_cid) ) {
{ echo '<div id="centerwrap"> <!-- start of #centerwrap -->';
if (isset($_cid) ) echo '<div id="center"> <!-- start of #center -->';
{
echo '<div id="centerwrap">';
echo '<div id="center">';
} }
} }
} } else {
else if (isset($_cid) ) {
{ echo '<div id="centerwrap"> <!-- start of #centerwrap -->';
if (isset($_cid) ) echo '<div id="center"> <!-- start of #center -->';
{
echo '<div id="centerwrap">';
echo '<div id="center">';
} }
} }
} }
@ -499,8 +393,7 @@ if(api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_n
* @version Dokeos 1.8.4 * @version Dokeos 1.8.4
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
*/ */
function get_tabs() function get_tabs() {
{
global $_course, $rootAdminWeb, $_user; global $_course, $rootAdminWeb, $_user;
// Campus Homepage // Campus Homepage
@ -508,31 +401,18 @@ function get_tabs()
$navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage'); $navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage');
// My Courses // My Courses
if(api_get_setting('use_session_mode')=='true') if(api_get_setting('use_session_mode')=='true') {
{ if(api_is_allowed_to_create_course()) {
if(api_is_allowed_to_create_course())
{
// Link to my courses for teachers // Link to my courses for teachers
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php?nosession=true'; $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php?nosession=true';
$navigation['mycourses']['title'] = get_lang('MyCourses'); $navigation['mycourses']['title'] = get_lang('MyCourses');
} } else {
else
{
// Link to my courses for students // Link to my courses for students
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php'; $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
$navigation['mycourses']['title'] = get_lang('MyCourses'); $navigation['mycourses']['title'] = get_lang('MyCourses');
} }
// Link to active sessions } else {
//$navigation[SECTION_ACTIVESESSIONS]['url'] = api_get_path(WEB_PATH).'user_portal.php';
//$navigation[SECTION_ACTIVESESSIONS]['title'] = get_lang('myActiveSessions');
// Link to inactive sessions
//$navigation[SECTION_INACTIVESESSIONS]['url'] = api_get_path(WEB_PATH).'user_portal.php?inactives';
//$navigation[SECTION_INACTIVESESSIONS]['title'] = get_lang('myInActiveSessions');
}
else
{
// Link to my courses // Link to my courses
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php'; $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
$navigation['mycourses']['title'] = get_lang('MyCourses'); $navigation['mycourses']['title'] = get_lang('MyCourses');
@ -547,29 +427,24 @@ function get_tabs()
$navigation['myagenda']['title'] = get_lang('MyAgenda'); $navigation['myagenda']['title'] = get_lang('MyAgenda');
// Gradebook // Gradebook
if (api_get_setting('gradebook_enable') == 'true') if (api_get_setting('gradebook_enable') == 'true') {
{
$navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' ); $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
$navigation['mygradebook']['title'] = get_lang('MyGradebook'); $navigation['mygradebook']['title'] = get_lang('MyGradebook');
} }
// Reporting // Reporting
if(api_is_allowed_to_create_course() || $_user['status']==DRH) if(api_is_allowed_to_create_course() || $_user['status']==DRH) {
{
// Link to my space // Link to my space
$navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'; $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/';
$navigation['session_my_space']['title'] = get_lang('MySpace'); $navigation['session_my_space']['title'] = get_lang('MySpace');
} } else {
else
{
// Link to my progress // Link to my progress
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH).'auth/my_progress.php'; $navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH).'auth/my_progress.php';
$navigation['session_my_progress']['title'] = get_lang('MyProgress'); $navigation['session_my_progress']['title'] = get_lang('MyProgress');
} }
// Platform administration // Platform administration
if (api_is_platform_admin(true)) if (api_is_platform_admin(true)) {
{
//$navigation['platform_admin']['url'] = $rootAdminWeb; //$navigation['platform_admin']['url'] = $rootAdminWeb;
$navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/'; $navigation['platform_admin']['url'] = api_get_path(WEB_CODE_PATH).'admin/';
$navigation['platform_admin']['title'] = get_lang('PlatformAdmin'); $navigation['platform_admin']['title'] = get_lang('PlatformAdmin');
@ -578,3 +453,4 @@ function get_tabs()
return $navigation; return $navigation;
} }
?> ?>
<!-- Begin Of script Output -->

@ -1,101 +1,79 @@
<?php // $Id: myStudents.php 16739 2008-11-13 15:36:40Z pcool $ <?php //$Id: myStudents.php 16769 2008-11-17 22:19:30Z yannoo $
/* /* For licensing terms, see /dokeos_license.txt */
============================================================================== /**
Dokeos - elearning and course management software * Implements the tracking of students in the Reporting pages
* @package dokeos.mySpace
Copyright (c) 2004-2008 Dokeos SPRL */
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = array ('registration', 'index', 'tracking', 'exercice','admin'); $language_file = array ('registration', 'index', 'tracking', 'exercice','admin');
$cidReset=true; $cidReset=true;
include ('../inc/global.inc.php'); require '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
include_once(api_get_path(LIBRARY_PATH).'tracking.lib.php'); require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
include_once(api_get_path(LIBRARY_PATH).'export.lib.inc.php'); require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
include_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php'); require_once api_get_path(LIBRARY_PATH).'course.lib.php';
include_once(api_get_path(LIBRARY_PATH).'course.lib.php'); require_once '../newscorm/learnpath.class.php';
include_once('../newscorm/learnpath.class.php');
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false; $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
if($export_csv)
{ if ($export_csv) {
ob_start(); ob_start();
} }
$csv_content = array(); $csv_content = array();
$this_section = "session_my_space"; $this_section = "session_my_space";
$nameTools=get_lang("StudentDetails");
$nameTools=get_lang("StudentDetails");
//$nameTools=SECTION_PLATFORM_ADMIN;
if(isset($_GET['details'])) if (isset($_GET['details'])) {
{ if (!empty($_GET['origin']) && $_GET['origin'] == 'user_course') {
if(!empty($_GET['origin']) && $_GET['origin'] == 'user_course')
{
$course_infos = CourseManager :: get_course_information($_GET['course']); $course_infos = CourseManager :: get_course_information($_GET['course']);
if(empty($cidReq)) if (empty($cidReq)) {
$interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_infos['directory'], 'name' => $course_infos['title']); $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_infos['directory'], 'name' => $course_infos['title']);
}
$interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$_GET['course'], "name" => get_lang("Users")); $interbreadcrumb[] = array ("url" => "../user/user.php?cidReq=".$_GET['course'], "name" => get_lang("Users"));
} } else if (!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course') {
else if(!empty($_GET['origin']) && $_GET['origin'] == 'tracking_course')
{
$course_infos = CourseManager :: get_course_information($_GET['course']); $course_infos = CourseManager :: get_course_information($_GET['course']);
if(empty($cidReq)) if (empty($cidReq)) {
$interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_infos['directory'], 'name' => $course_infos['title']); $interbreadcrumb[] = array ("url" => api_get_path(WEB_COURSE_PATH).$course_infos['directory'], 'name' => $course_infos['title']);
}
$interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$_GET['course'].'&studentlist=true&id_session='.(empty($_SESSION['id_session'])?'':$_SESSION['id_session']), "name" => get_lang("Tracking")); $interbreadcrumb[] = array ("url" => "../tracking/courseLog.php?cidReq=".$_GET['course'].'&studentlist=true&id_session='.(empty($_SESSION['id_session'])?'':$_SESSION['id_session']), "name" => get_lang("Tracking"));
} } else if (!empty($_GET['origin']) && $_GET['origin'] == 'resume_session') {
else $interbreadcrumb[]=array('url' => '../admin/index.php',"name" => get_lang('PlatformAdmin'));
{ $interbreadcrumb[]=array('url' => "../admin/session_list.php","name" => get_lang('SessionList'));
$interbreadcrumb[]=array('url' => "../admin/resume_session.php?id_session=".$_GET['id_session'],"name" => get_lang('SessionOverview'));
} else {
$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0){ if (isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0) {
$interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach'], "name" => get_lang("CoachStudents")); $interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach'], "name" => get_lang("CoachStudents"));
$interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student'].'&id_coach='.$_GET['id_coach'], "name" => get_lang("StudentDetails")); $interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student'].'&id_coach='.$_GET['id_coach'], "name" => get_lang("StudentDetails"));
} } else {
else{
$interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents")); $interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
$interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student'], "name" => get_lang("StudentDetails")); $interbreadcrumb[] = array ("url" => "myStudents.php?student=".$_GET['student'], "name" => get_lang("StudentDetails"));
} }
} }
$nameTools=get_lang("DetailsStudentInCourse"); $nameTools=get_lang("DetailsStudentInCourse");
} } else {
else if (!empty($_GET['origin']) && $_GET['origin'] == 'resume_session') {
{ $interbreadcrumb[]=array('url' => '../admin/index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ('url' => '../admin/index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[]=array('url' => "../admin/session_list.php","name" => get_lang('SessionList'));
$interbreadcrumb[]=array('url' => "../admin/resume_session.php?id_session=".Security::remove_XSS($_GET['id_session']),"name" => get_lang('SessionOverview'));
if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0) } else {
{ $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
if(isset($_GET['id_session']) && intval($_GET['id_session'])!=0) if (isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0) {
{ if (isset($_GET['id_session']) && intval($_GET['id_session'])!=0) {
$interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach']."&id_session=".$_GET['id_session'], "name" => get_lang("CoachStudents")); $interbreadcrumb[] = array ("url" => "student.php?id_coach=".Security::remove_XSS($_GET['id_coach'])."&id_session=".$_GET['id_session'], "name" => get_lang("CoachStudents"));
} } else {
else $interbreadcrumb[] = array ("url" => "student.php?id_coach=".Security::remove_XSS($_GET['id_coach']), "name" => get_lang("CoachStudents"));
{ }
$interbreadcrumb[] = array ("url" => "student.php?id_coach=".$_GET['id_coach'], "name" => get_lang("CoachStudents")); } else {
} $interbreadcrumb[] = array ("url" => "student.php", "name" => get_lang("MyStudents"));
} }
else
{
$interbreadcrumb[] = array ('url' => '../admin/user_list.php', 'name' => get_lang('UserList'));
} }
} }
api_block_anonymous_users(); api_block_anonymous_users();
@ -718,9 +696,7 @@ if(!empty($_GET['student']))
if(Database::num_rows($rs_lp_item_id_scorm)>0){ if(Database::num_rows($rs_lp_item_id_scorm)>0){
$lp_item_id = Database::result($rs_lp_item_id_scorm,0,'id'); $lp_item_id = Database::result($rs_lp_item_id_scorm,0,'id');
$lp_item__max_score = Database::result($rs_lp_item_id_scorm,0,'max_score'); $lp_item__max_score = Database::result($rs_lp_item_id_scorm,0,'max_score');
$total_weighting+=$lp_item__max_score; $total_weighting+=$lp_item__max_score;
//We get the last view id of this LP //We get the last view id of this LP
@ -841,6 +817,7 @@ if(!empty($_GET['student']))
FROM ".$t_quiz." AS quiz FROM ".$t_quiz." AS quiz
WHERE active='1' ORDER BY quiz.title ASC WHERE active='1' ORDER BY quiz.title ASC
"; ";
$resultExercices = api_sql_query($sqlExercices,__FILE__,__LINE__); $resultExercices = api_sql_query($sqlExercices,__FILE__,__LINE__);
$i = 0; $i = 0;
if(Database::num_rows($resultExercices)>0) if(Database::num_rows($resultExercices)>0)
@ -862,6 +839,7 @@ if(!empty($_GET['student']))
AND exe_cours_id = '".$a_infosCours['code']."' AND exe_cours_id = '".$a_infosCours['code']."'
AND exe_exo_id = ".$a_exercices['id']." AND exe_exo_id = ".$a_exercices['id']."
ORDER BY exe_date DESC LIMIT 1"; ORDER BY exe_date DESC LIMIT 1";
$resultScore = api_sql_query($sqlScore,__FILE__,__LINE__); $resultScore = api_sql_query($sqlScore,__FILE__,__LINE__);
$score = 0; $score = 0;
while($a_score = Database::fetch_array($resultScore)) while($a_score = Database::fetch_array($resultScore))
@ -1067,12 +1045,12 @@ if(!empty($_GET['student']))
</td>'; </td>';
if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0){ if(isset($_GET['id_coach']) && intval($_GET['id_coach'])!=0){
echo '<td align="center" width="10"> echo '<td align="center" width="10">
<a href="'.api_get_self().'?student='.$a_infosUser['user_id'].'&details=true&course='.$course_infos['code'].'&id_coach='.$_GET['id_coach'].'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a> <a href="'.api_get_self().'?student='.$a_infosUser['user_id'].'&details=true&course='.$course_infos['code'].'&id_coach='.Security::remove_XSS($_GET['id_coach']).'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.Security::remove_XSS($_GET['id_session']).'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a>
</td>'; </td>';
} }
else{ else{
echo '<td align="center" width="10"> echo '<td align="center" width="10">
<a href="'.api_get_self().'?student='.$a_infosUser['user_id'].'&details=true&course='.$course_infos['code'].'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a> <a href="'.api_get_self().'?student='.$a_infosUser['user_id'].'&details=true&course='.$course_infos['code'].'&origin='.Security::remove_XSS($_GET['origin']).'&id_session='.Security::remove_XSS($_GET['id_session']).'#infosStudent"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a>
</td>'; </td>';
} }
echo '</tr>'; echo '</tr>';

@ -1,25 +1,5 @@
<?php // $Id: courseLog.php 16739 2008-11-13 15:36:40Z pcool $ <?php //$id: $
/* /* For licensing terms, see /dokeos_license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
/** /**
============================================================================== ==============================================================================
* @author Thomas Depraetere * @author Thomas Depraetere
@ -31,61 +11,50 @@
* @package dokeos.tracking * @package dokeos.tracking
============================================================================== ==============================================================================
*/ */
/**
/* * INIT SECTION
============================================================================== */
INIT SECTION
==============================================================================
*/
$pathopen = isset($_REQUEST['pathopen']) ? $_REQUEST['pathopen'] : null; $pathopen = isset($_REQUEST['pathopen']) ? $_REQUEST['pathopen'] : null;
// name of the language file that needs to be included
// name of the language file that needs to be included
$language_file[] = 'admin';
$language_file[] = 'tracking'; $language_file[] = 'tracking';
$language_file[] = 'scorm'; $language_file[] = 'scorm';
include('../inc/global.inc.php'); require '../inc/global.inc.php';
$is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin; $is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin;
if(!$is_allowedToTrack) if (!$is_allowedToTrack) {
{
Display :: display_header(null); Display :: display_header(null);
api_not_allowed(); api_not_allowed();
Display :: display_footer(); Display :: display_footer();
} }
//includes for SCORM and LP //includes for SCORM and LP
require_once('../newscorm/learnpath.class.php'); require_once '../newscorm/learnpath.class.php';
require_once('../newscorm/learnpathItem.class.php'); require_once '../newscorm/learnpathItem.class.php';
require_once('../newscorm/learnpathList.class.php'); require_once '../newscorm/learnpathList.class.php';
require_once('../newscorm/scorm.class.php'); require_once '../newscorm/scorm.class.php';
require_once('../newscorm/scormItem.class.php'); require_once '../newscorm/scormItem.class.php';
require_once(api_get_path(LIBRARY_PATH).'tracking.lib.php'); require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
require_once(api_get_path(LIBRARY_PATH).'course.lib.php'); require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php'); require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once (api_get_path(LIBRARY_PATH).'export.lib.inc.php'); require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false; $export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
if($export_csv) if ($export_csv) {
{
ob_start(); ob_start();
} }
$csv_content = array(); $csv_content = array();
// charset determination // charset determination
if (!empty($_GET['scormcontopen'])) if (!empty($_GET['scormcontopen'])) {
{ $tbl_lp = Database::get_course_table('lp');
$tbl_lp = Database::get_course_table('lp'); $contopen = (int) $_GET['scormcontopen'];
$contopen = (int) $_GET['scormcontopen']; $sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen;
$sql = "SELECT default_encoding FROM $tbl_lp WHERE id = ".$contopen; $res = api_sql_query($sql,__FILE__,__LINE__);
$res = api_sql_query($sql,__FILE__,__LINE__); $row = Database::fetch_array($res);
$row = Database::fetch_array($res); $lp_charset = $row['default_encoding'];
$lp_charset = $row['default_encoding'];
//header('Content-Type: text/html; charset='. $row['default_encoding']);
} }
$htmlHeadXtra[] = "<style type='text/css'> $htmlHeadXtra[] = "<style type='text/css'>
@ -99,7 +68,6 @@ $htmlHeadXtra[] = "<style type='text/css'>
</style>"; </style>";
/* /*
----------------------------------------------------------- -----------------------------------------------------------
Constants and variables Constants and variables
@ -126,15 +94,20 @@ $tbl_learnpath_item = Database::get_course_table(TABLE_LP_ITEM);
$tbl_learnpath_view = Database::get_course_table(TABLE_LP_VIEW); $tbl_learnpath_view = Database::get_course_table(TABLE_LP_VIEW);
$tbl_learnpath_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW); $tbl_learnpath_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
if (isset($_GET['origin']) && $_GET['origin']=='resume_session') {
$interbreadcrumb[]=array('url' => '../admin/index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => '../admin/session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[]=array('url' => '../admin/resume_session.php?id_session='.$_SESSION['id_session'],'name' => get_lang('SessionOverview'));
}
$view = (isset($_REQUEST['view'])?$_REQUEST['view']:''); $view = (isset($_REQUEST['view'])?$_REQUEST['view']:'');
$nameTools = get_lang('Tracking'); $nameTools = get_lang('Tracking');
Display::display_header($nameTools, "Tracking"); Display::display_header($nameTools, 'Tracking');
include(api_get_path(LIBRARY_PATH)."statsUtils.lib.inc.php");
include("../resourcelinker/resourcelinker.inc.php");
require api_get_path(LIBRARY_PATH).'statsUtils.lib.inc.php';
require '../resourcelinker/resourcelinker.inc.php';
$a_students = CourseManager :: get_student_list_from_course_code($_course['id'], true, (empty($_SESSION['id_session'])?null:$_SESSION['id_session'])); $a_students = CourseManager :: get_student_list_from_course_code($_course['id'], true, (empty($_SESSION['id_session'])?null:$_SESSION['id_session']));
$nbStudents = count($a_students); $nbStudents = count($a_students);
@ -142,21 +115,21 @@ $nbStudents = count($a_students);
/** /**
* count the number of students in this course (used for SortableTable) * count the number of students in this course (used for SortableTable)
*/ */
function count_student_in_course() function count_student_in_course() {
{
global $nbStudents; global $nbStudents;
return $nbStudents; return $nbStudents;
} }
function sort_users($a,$b){ function sort_users($a,$b) {
$a = trim(strtolower($a[$_SESSION['tracking_column']])); $a = trim(strtolower($a[$_SESSION['tracking_column']]));
$b = trim(strtolower($b[$_SESSION['tracking_column']])); $b = trim(strtolower($b[$_SESSION['tracking_column']]));
if($_SESSION['tracking_direction'] == 'DESC') if ($_SESSION['tracking_direction'] == 'DESC') {
return strcmp($b, $a); return strcmp($b, $a);
else } else {
return strcmp($a, $b); return strcmp($a, $b);
}
} }
/* /*
@ -166,28 +139,21 @@ function sort_users($a,$b){
*/ */
echo '<div class="actions">'; echo '<div class="actions">';
if($_GET['studentlist'] == 'false') if ($_GET['studentlist'] == 'false') {
{
echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a>&nbsp;|&nbsp;'.get_lang('CourseTracking'); echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a>&nbsp;|&nbsp;'.get_lang('CourseTracking');
} } else {
else
{
echo get_lang('StudentsTracking').' | <a href="courseLog.php?'.api_get_cidreq().'&studentlist=false">'.get_lang('CourseTracking').'</a>'; echo get_lang('StudentsTracking').' | <a href="courseLog.php?'.api_get_cidreq().'&studentlist=false">'.get_lang('CourseTracking').'</a>';
} }
echo '&nbsp;<a href="#" onclick="window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>'; echo '&nbsp;<a href="#" onclick="window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a>';
if($_GET['studentlist'] == 'false') if($_GET['studentlist'] == 'false') {
{
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&studentlist=false"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>'; echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv&studentlist=false"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
} } else {
else
{
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>'; echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
} }
echo '</div>'; echo '</div>';
if($_GET['studentlist'] == 'false') if($_GET['studentlist'] == 'false') {
{
echo'<br /><br />'; echo'<br /><br />';
@ -195,84 +161,70 @@ if($_GET['studentlist'] == 'false')
* LEARNING PATHS * LEARNING PATHS
***************************/ ***************************/
echo "<div class='admin_section'> echo '<div class="admin_section">
<h4> <h4>
<img src='../img/scormbuilder.gif' align='absbottom'>&nbsp;".get_lang('AverageProgressInLearnpath')." <img src="../img/scormbuilder.gif" align="absbottom">&nbsp;'.get_lang('AverageProgressInLearnpath').'
</h4> </h4>
<table class='data_table'>"; <table class="data_table">';
$list = new LearnpathList($student); $list = new LearnpathList($student);
$flat_list = $list->get_flat_list(); $flat_list = $list->get_flat_list();
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('AverageProgressInLearnpath'),''); $temp=array(get_lang('AverageProgressInLearnpath'),'');
$csv_content[] = array('',''); $csv_content[] = array('','');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
if(count($flat_list)>0) if (count($flat_list)>0) {
{ foreach ($flat_list as $lp_id => $lp) {
foreach($flat_list as $lp_id => $lp)
{
$lp_avg_progress = 0; $lp_avg_progress = 0;
foreach($a_students as $student_id => $student) foreach ($a_students as $student_id => $student) {
{
// get the progress in learning pathes // get the progress in learning pathes
$lp_avg_progress += learnpath::get_db_progress($lp_id,$student_id); $lp_avg_progress += learnpath::get_db_progress($lp_id,$student_id);
} }
if($nbStudents > 0) if($nbStudents > 0) {
{
$lp_avg_progress = $lp_avg_progress / $nbStudents; $lp_avg_progress = $lp_avg_progress / $nbStudents;
} }
echo '<tr><td>'.$lp['lp_name'].'</td><td align="right">'.round($lp_avg_progress,1).' %</td></tr>'; echo '<tr><td>'.$lp['lp_name'].'</td><td align="right">'.round($lp_avg_progress,1).' %</td></tr>';
if($export_csv){ if($export_csv) {
$temp=array($lp['lp_name'],$lp_avg_progress); $temp=array($lp['lp_name'],$lp_avg_progress);
$csv_content[] = $temp; $csv_content[] = $temp;
} }
} }
} } else {
else
{
echo '<tr><td>'.get_lang('NoLearningPath').'</td></tr>'; echo '<tr><td>'.get_lang('NoLearningPath').'</td></tr>';
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('NoLearningPath'),''); $temp=array(get_lang('NoLearningPath'),'');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
} }
echo '</table></div>'; echo '</table></div>';
echo '<div class="clear"></div>'; echo '<div class="clear"></div>';
/*************************** /***************************
* EXERCICES * EXERCICES
***************************/ ***************************/
echo '<div class="admin_section">
echo "<div class='admin_section'>
<h4> <h4>
<img src='../img/quiz.gif' align='absbottom'>&nbsp;".get_lang('AverageResultsToTheExercices')." <a href='../exercice/exercice.php?".api_get_cidreq()."&show=result'>".get_lang('SeeDetail')."</a> <img src="../img/quiz.gif" align="absbottom">&nbsp;'.get_lang('AverageResultsToTheExercices').' <a href="../exercice/exercice.php?'.api_get_cidreq().'&show=result">'.get_lang('SeeDetail').'</a>
</h4> </h4>
<table class='data_table'>"; <table class="data_table">';
$sql = "SELECT id, title $sql = "SELECT id, title
FROM ".Database :: get_course_table(TABLE_QUIZ_TEST); FROM ".Database :: get_course_table(TABLE_QUIZ_TEST);
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('AverageProgressInLearnpath'),''); $temp=array(get_lang('AverageProgressInLearnpath'),'');
$csv_content[] = array('',''); $csv_content[] = array('','');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
if(Database::num_rows($rs)>0) if (Database::num_rows($rs)>0) {
{ while($quiz = Database::fetch_array($rs)) {
while($quiz = Database::fetch_array($rs))
{
$quiz_avg_score = 0; $quiz_avg_score = 0;
// get the progress in learning pathes // get the progress in learning pathes
@ -283,29 +235,25 @@ if($_GET['studentlist'] == 'false')
LIMIT 0, 1'; LIMIT 0, 1';
$rsAttempt = api_sql_query($sql, __FILE__, __LINE__); $rsAttempt = api_sql_query($sql, __FILE__, __LINE__);
$nb_attempts = 0; $nb_attempts = 0;
while($attempt = Database::fetch_array($rsAttempt)) while ($attempt = Database::fetch_array($rsAttempt)) {
{
$nb_attempts++; $nb_attempts++;
$exe_weight=$attempt['exe_weighting']; $exe_weight=$attempt['exe_weighting'];
if ($exe_weight>0) if ($exe_weight>0) {
{
$quiz_avg_score += $attempt['exe_result']/$exe_weight*100; $quiz_avg_score += $attempt['exe_result']/$exe_weight*100;
} }
} }
if($nb_attempts>0) if($nb_attempts>0) {
$quiz_avg_score = $quiz_avg_score / $nb_attempts; $quiz_avg_score = $quiz_avg_score / $nb_attempts;
}
echo '<tr><td>'.$quiz['title'].'</td><td align="right">'.round($quiz_avg_score,1).' %</td></tr>'; echo '<tr><td>'.$quiz['title'].'</td><td align="right">'.round($quiz_avg_score,1).' %</td></tr>';
if($export_csv){ if ($export_csv) {
$temp=array($quiz['title'],$quiz_avg_score); $temp=array($quiz['title'],$quiz_avg_score);
$csv_content[] = $temp; $csv_content[] = $temp;
} }
} }
} } else {
else
{
echo '<tr><td>'.get_lang('NoExercises').'</td></tr>'; echo '<tr><td>'.get_lang('NoExercises').'</td></tr>';
if($export_csv){ if($export_csv) {
$temp=array(get_lang('NoExercises'),''); $temp=array(get_lang('NoExercises'),'');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
@ -313,39 +261,35 @@ if($_GET['studentlist'] == 'false')
echo '</table></div>'; echo '</table></div>';
echo '<div class="clear"></div>'; echo '<div class="clear"></div>';
/********************** /**********************
* TOOLS * TOOLS
**********************/ **********************/
echo '<div class="admin_section">
echo "<div class='admin_section'>
<h4> <h4>
<img src='../img/acces_tool.gif' align='absbottom'>&nbsp;".get_lang('ToolsMostUsed')." <img src="../img/acces_tool.gif" align="absbottom">&nbsp;'.get_lang('ToolsMostUsed').'
</h4> </h4>
<table class='data_table'>"; <table class="data_table">';
$sql = "SELECT `access_tool`, COUNT(DISTINCT `access_user_id`),count( `access_tool` ) as count_access_tool $sql = "SELECT access_tool, COUNT(DISTINCT access_user_id),count( access_tool ) as count_access_tool
FROM $TABLETRACK_ACCESS FROM $TABLETRACK_ACCESS
WHERE `access_tool` IS NOT NULL WHERE access_tool IS NOT NULL
AND `access_cours_code` = '$_cid' AND access_cours_code = '$_cid'
GROUP BY `access_tool` GROUP BY access_tool
ORDER BY count_access_tool DESC ORDER BY count_access_tool DESC
LIMIT 0, 3"; LIMIT 0, 3";
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('ToolsMostUsed'),''); $temp=array(get_lang('ToolsMostUsed'),'');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
while ($row = Database::fetch_array($rs)) while ($row = Database::fetch_array($rs)) {
{
echo ' <tr> echo ' <tr>
<td>'.get_lang(ucfirst($row['access_tool'])).'</td> <td>'.get_lang(ucfirst($row['access_tool'])).'</td>
<td align="right">'.$row['count_access_tool'].' '.get_lang('Clicks').'</td> <td align="right">'.$row['count_access_tool'].' '.get_lang('Clicks').'</td>
</tr>'; </tr>';
if($export_csv){ if ($export_csv) {
$temp=array(get_lang(ucfirst($row['access_tool'])),$row['count_access_tool'].' '.get_lang('Clicks')); $temp=array(get_lang(ucfirst($row['access_tool'])),$row['count_access_tool'].' '.get_lang('Clicks'));
$csv_content[] = $temp; $csv_content[] = $temp;
} }
@ -360,45 +304,41 @@ if($_GET['studentlist'] == 'false')
* DOCUMENTS * DOCUMENTS
***************************/ ***************************/
echo "<div class='admin_section'> echo '<div class="admin_section">
<h4> <h4>
<img src='../img/documents.gif' align='absbottom'>&nbsp;".get_lang('DocumentsMostDownloaded')." <img src="../img/documents.gif" align="absbottom">&nbsp;'.get_lang('DocumentsMostDownloaded').'
</h4> </h4>
<table class='data_table'>"; <table class="data_table">';
$sql = "SELECT `down_doc_path`, COUNT(DISTINCT `down_user_id`), COUNT(`down_doc_path`) as count_down $sql = "SELECT down_doc_path, COUNT(DISTINCT down_user_id), COUNT(down_doc_path) as count_down
FROM $TABLETRACK_DOWNLOADS FROM $TABLETRACK_DOWNLOADS
WHERE `down_cours_id` = '$_cid' WHERE down_cours_id = '$_cid'
GROUP BY `down_doc_path` GROUP BY down_doc_path
ORDER BY count_down DESC ORDER BY count_down DESC
LIMIT 0, 3"; LIMIT 0, 3";
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('DocumentsMostDownloaded'),''); $temp=array(get_lang('DocumentsMostDownloaded'),'');
$csv_content[] = array('',''); $csv_content[] = array('','');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
if(Database::num_rows($rs)>0) if (Database::num_rows($rs)>0) {
{ while($row = Database::fetch_array($rs)) {
while($row = Database::fetch_array($rs))
{
echo ' <tr> echo ' <tr>
<td>'.$row['down_doc_path'].'</td> <td>'.$row['down_doc_path'].'</td>
<td align="right">'.$row['count_down'].' '.get_lang('Clicks').'</td> <td align="right">'.$row['count_down'].' '.get_lang('Clicks').'</td>
</tr>'; </tr>';
if($export_csv){ if ($export_csv) {
$temp=array($row['down_doc_path'],$row['count_down'].' '.get_lang('Clicks')); $temp=array($row['down_doc_path'],$row['count_down'].' '.get_lang('Clicks'));
$csv_content[] = $temp; $csv_content[] = $temp;
} }
} }
} } else {
else
{
echo '<tr><td>'.get_lang('NoDocumentDownloaded').'</td></tr>'; echo '<tr><td>'.get_lang('NoDocumentDownloaded').'</td></tr>';
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('NoDocumentDownloaded'),''); $temp=array(get_lang('NoDocumentDownloaded'),'');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
@ -412,31 +352,29 @@ if($_GET['studentlist'] == 'false')
* LINKS * LINKS
***************************/ ***************************/
echo "<div class='admin_section'> echo '<div class="admin_section">
<h4> <h4>
<img src='../img/link.gif' align='absbottom'>&nbsp;".get_lang('LinksMostClicked')." <img src="../img/link.gif" align="absbottom">&nbsp;'.get_lang('LinksMostClicked').'
</h4> </h4>
<table class='data_table'>"; <table class="data_table">';
$sql = "SELECT `cl`.`title`, `cl`.`url`,count(DISTINCT `sl`.`links_user_id`), count(`cl`.`title`) as count_visits $sql = "SELECT cl.title, cl.url,count(DISTINCT sl.links_user_id), count(cl.title) as count_visits
FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl
WHERE `sl`.`links_link_id` = `cl`.`id` WHERE sl.links_link_id = cl.id
AND `sl`.`links_cours_id` = '$_cid' AND sl.links_cours_id = '$_cid'
GROUP BY `cl`.`title`, `cl`.`url` GROUP BY cl.title, cl.url
ORDER BY count_visits DESC ORDER BY count_visits DESC
LIMIT 0, 3"; LIMIT 0, 3";
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('LinksMostClicked'),''); $temp=array(get_lang('LinksMostClicked'),'');
$csv_content[] = array('',''); $csv_content[] = array('','');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
if(Database::num_rows($rs)>0) if (Database::num_rows($rs)>0) {
{ while ($row = Database::fetch_array($rs)) {
while($row = Database::fetch_array($rs))
{
echo ' <tr> echo ' <tr>
<td>'.$row['title'].'</td> <td>'.$row['title'].'</td>
<td align="right">'.$row['count_visits'].' '.get_lang('Clicks').'</td> <td align="right">'.$row['count_visits'].' '.get_lang('Clicks').'</td>
@ -446,30 +384,23 @@ if($_GET['studentlist'] == 'false')
$csv_content[] = $temp; $csv_content[] = $temp;
} }
} }
} } else {
else
{
echo '<tr><td>'.get_lang('NoLinkVisited').'</td></tr>'; echo '<tr><td>'.get_lang('NoLinkVisited').'</td></tr>';
if($export_csv){ if ($export_csv) {
$temp=array(get_lang('NoLinkVisited'),''); $temp=array(get_lang('NoLinkVisited'),'');
$csv_content[] = $temp; $csv_content[] = $temp;
} }
} }
echo '</table></div>'; echo '</table></div>';
echo '<div class="clear"></div>'; echo '<div class="clear"></div>';
// send the csv file if asked // send the csv file if asked
if($export_csv) if ($export_csv) {
{
ob_end_clean(); ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_course_tracking'); Export :: export_table_csv($csv_content, 'reporting_course_tracking');
} }
} else {
}
// else display student list with all the informations // else display student list with all the informations
else {
// BEGIN : form to remind inactives susers // BEGIN : form to remind inactives susers
$form = new FormValidator('reminder_form','get',api_get_path(REL_CODE_PATH).'announcements/announcements.php'); $form = new FormValidator('reminder_form','get',api_get_path(REL_CODE_PATH).'announcements/announcements.php');
@ -501,8 +432,7 @@ else {
$tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : 0; $tracking_column = isset($_GET['tracking_column']) ? $_GET['tracking_column'] : 0;
$tracking_direction = isset($_GET['tracking_direction']) ? $_GET['tracking_direction'] : 'DESC'; $tracking_direction = isset($_GET['tracking_direction']) ? $_GET['tracking_direction'] : 'DESC';
if(count($a_students)>0) if (count($a_students)>0) {
{
$table = new SortableTable('tracking', 'count_student_in_course'); $table = new SortableTable('tracking', 'count_student_in_course');
$table -> set_header(0, get_lang('OfficialCode'), false, 'align="center"'); $table -> set_header(0, get_lang('OfficialCode'), false, 'align="center"');
$table -> set_header(1, get_lang('LastName'), true, 'align="center"'); $table -> set_header(1, get_lang('LastName'), true, 'align="center"');
@ -516,8 +446,7 @@ else {
$table -> set_header(9, get_lang('LatestLogin'), false, 'align="center"'); $table -> set_header(9, get_lang('LatestLogin'), false, 'align="center"');
$table -> set_header(10, get_lang('Details'),false); $table -> set_header(10, get_lang('Details'),false);
if($export_csv) if ($export_csv) {
{
$csv_content[] = array ( $csv_content[] = array (
get_lang('OfficialCode'), get_lang('OfficialCode'),
get_lang('LastName'), get_lang('LastName'),
@ -534,8 +463,7 @@ else {
$all_datas = array(); $all_datas = array();
$course_code = $_course['id']; $course_code = $_course['id'];
foreach($a_students as $student_id => $student) foreach ($a_students as $student_id => $student) {
{
$student_datas = UserManager :: get_user_info_by_id($student_id); $student_datas = UserManager :: get_user_info_by_id($student_id);
$avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0 ; $avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0 ;
@ -558,8 +486,7 @@ else {
$row[] = Tracking :: get_first_connection_date_on_the_course($student_id, $course_code); $row[] = Tracking :: get_first_connection_date_on_the_course($student_id, $course_code);
$row[] = Tracking :: get_last_connection_date_on_the_course($student_id, $course_code); $row[] = Tracking :: get_last_connection_date_on_the_course($student_id, $course_code);
if($export_csv) if ($export_csv) {
{
$row[8] = strip_tags($row[8]); $row[8] = strip_tags($row[8]);
$csv_content[] = $row; $csv_content[] = $row;
} }
@ -574,13 +501,11 @@ else {
$page = $table->get_pager()->getCurrentPageID(); $page = $table->get_pager()->getCurrentPageID();
$all_datas = array_slice($all_datas, ($page-1)*$table -> per_page, $table -> per_page); $all_datas = array_slice($all_datas, ($page-1)*$table -> per_page, $table -> per_page);
if($export_csv) if ($export_csv) {
{
usort($csv_content, 'sort_users'); usort($csv_content, 'sort_users');
} }
foreach($all_datas as $row) foreach ($all_datas as $row) {
{
$table -> addRow($row,'align="right"'); $table -> addRow($row,'align="right"');
} }
$table -> setColAttributes(0,array('align'=>'left')); $table -> setColAttributes(0,array('align'=>'left'));
@ -591,15 +516,12 @@ else {
$table -> setColAttributes(9,array('align'=>'center')); $table -> setColAttributes(9,array('align'=>'center'));
$table -> display(); $table -> display();
} } else {
else
{
echo get_lang('NoUsersInCourseTracking'); echo get_lang('NoUsersInCourseTracking');
} }
// send the csv file if asked // send the csv file if asked
if($export_csv) if ($export_csv) {
{
ob_end_clean(); ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_student_list'); Export :: export_table_csv($csv_content, 'reporting_student_list');
} }
@ -607,7 +529,5 @@ else {
} }
?> ?>
</table> </table>
<?php <?php
Display::display_footer(); Display::display_footer();
?>

Loading…
Cancel
Save