[svn r10051] update for the reporting

skala
Eric Marguin 19 years ago
parent 9b4a8633e2
commit 7d79623968
  1. BIN
      main/img/admins.gif
  2. BIN
      main/img/coachs.gif
  3. BIN
      main/img/courses.gif
  4. BIN
      main/img/students.gif
  5. BIN
      main/img/teachers.gif
  6. 11
      main/mySpace/cours.php
  7. 30
      main/mySpace/index.php
  8. 131
      main/mySpace/myStudents.php
  9. 6
      main/mySpace/session.php
  10. 45
      main/mySpace/student.php

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -207,20 +207,21 @@
$resultCoursesCoach = api_sql_query($sqlCourse);
$a_courses = array_merge($a_courses_teacher,api_store_result($resultCoursesCoach));
}
}
}
else{
$a_courses=$a_courses_teacher;
}
$resultCourse = api_sql_query($sqlCourse);
}
}
$a_header[]=get_lang('Title');
$a_header[]=get_lang('Tutor');
$a_header[]=get_lang('Teachers');
if(mysql_num_rows($resultCourse)>0)
if(count($a_courses)>0)
{
echo '<table class="data_table">
<tr>

@ -126,6 +126,22 @@ function is_coach(){
//La personne a le statut de professeur
if($is_allowedCreateCourse){
//Cours ou la personne est formateur mais dont les cours ne sont pas dans une session
$sql_select_courses="SELECT course_rel_user.course_code FROM $tbl_course_user as course_rel_user LEFT OUTER JOIN $tbl_session_course as src ON course_rel_user.course_code=src.course_code WHERE user_id='$_uid' AND status='1' AND src.course_code IS NULL";
$result_courses=api_sql_query($sql_select_courses);
while($a_courses=mysql_fetch_array($result_courses)){
$s_course_code=$a_courses["course_code"];
$sqlStudents = "SELECT user.user_id,lastname,firstname,email FROM $tbl_course_user as course_rel_user, $tbl_user as user WHERE course_rel_user.user_id=user.user_id AND course_rel_user.status='5' AND course_rel_user.course_code='$s_course_code'";
$result_students=api_sql_query($sqlStudents);
if(mysql_num_rows($result_students)>0){
while($a_students_temp=mysql_fetch_array($result_students)){
$a_stagiaire_teacher[]=$a_students_temp["user_id"];
}
}
}
$sqlNbStagiaire="SELECT DISTINCT srcru.id_user FROM $tbl_course_user as course_rel_user, $tbl_session_course_user as srcru " .
"WHERE course_rel_user.user_id='".$_user['user_id']."' AND course_rel_user.status='1' AND course_rel_user.course_code=srcru.course_code";
@ -292,7 +308,7 @@ function is_coach(){
if(api_is_platform_admin()){
echo '<div class="admin_section">
<h4>
<a href="teachers.php">'.get_lang('Trainers').' ('.$nbFormateurs.')</a>
<a href="teachers.php"><img src="'.api_get_path(WEB_IMG_PATH).'teachers.gif">&nbsp;'.get_lang('Trainers').' ('.$nbFormateurs.')</a>
</h4>
</div>';
}
@ -300,7 +316,7 @@ function is_coach(){
if(api_is_platform_admin() || $is_allowedCreateCourse){
echo '<div class="admin_section">
<h4>
<a href="coaches.php">'.get_lang("Tutor").' ('.$nbCoachs.')</a>
<a href="coaches.php"><img src="'.api_get_path(WEB_IMG_PATH).'coachs.gif">&nbsp;'.get_lang("Tutor").' ('.$nbCoachs.')</a>
</h4>
</div>';
}
@ -308,29 +324,29 @@ function is_coach(){
<div class="admin_section">
<h4>
<?php
echo "<a href='student.php'>".get_lang('Probationers').' ('.$nbStagiaire.')'."</a>";
echo "<a href='student.php'><img src='".api_get_path(WEB_IMG_PATH)."students.gif'>&nbsp;".get_lang('Probationers').' ('.$nbStagiaire.')'."</a>";
?>
</h4>
</div>
<div class="admin_section">
<h4>
<?php echo "<a href='admin.php'>".get_lang('Administrators')." (".$i_nb_admin.")</a>"; ?>
<?php echo "<a href='admin.php'><img src='".api_get_path(WEB_IMG_PATH)."admins.gif'>&nbsp;".get_lang('Administrators')." (".$i_nb_admin.")</a>"; ?>
</h4>
</div>
<div class="admin_section">
<h4>
<?php echo "<a href='cours.php'>".get_lang('Course').' ('.$nbCours.')'."</a>"; ?>
<?php echo "<a href='cours.php'><img src='".api_get_path(WEB_IMG_PATH)."courses.gif'>&nbsp;".get_lang('Course').' ('.$nbCours.')'."</a>"; ?>
</h4>
</div>
<div class="admin_section">
<h4>
<?php echo "<a href='session.php'>".get_lang('Sessions').' ('.$nbSessions.')'."</a>"; ?>
<?php echo "<a href='session.php'><img src='".api_get_path(WEB_IMG_PATH)."sessions.gif'>&nbsp;".get_lang('Sessions').' ('.$nbSessions.')'."</a>"; ?>
</h4>
</div>
<div class="admin_section">
<h4>
<?php echo get_lang('Tracks'); ?>
<?php echo "<img src='".api_get_path(WEB_IMG_PATH)."statistics.gif'>&nbsp;".get_lang('Tracks'); ?>
</h4>
<ul>
<li>

@ -5,7 +5,7 @@
$langFile = array ('registration', 'index','trad4all', 'tracking');
$cidReset=true;
require ('../inc/global.inc.php');
include ('../inc/global.inc.php');
$this_section = "session_my_space";
@ -153,108 +153,10 @@ else{
}
?>
<table class="data_table">
<tr>
<th>
<?php echo get_lang('Name'); ?>
</th>
<th>
<?php echo get_lang('Email'); ?>
</th>
<th>
<?php echo get_lang('Progress'); ?>
</th>
</tr>
<?php
if(isset($_GET["type"]) && $_GET["type"]=="coach"){
$sqlSessions = "SELECT id
FROM $tbl_session
WHERE id_coach = $i_user_id
";
$resultSessions = api_sql_query($sqlSessions);
$a_sessions = api_store_result($resultSessions);
$sql = "SELECT DISTINCT id_session
FROM $tbl_session_course
WHERE id_coach = $i_user_id
";
$resultSessions = api_sql_query($sql);
$a_sessions = array_merge($a_sessions,api_store_result($resultSessions));
$a_Students = array();
foreach($a_sessions as $a_session){
$sqlStudents = "SELECT session.id_user,
CONCAT(user.lastname,' ',user.firstname) as name,
user.email
FROM $tbl_session_user AS session
INNER JOIN $tbl_user as user
ON session.id_user = user.user_id
AND user.status = 5
WHERE id_session = ".$a_session['id_session']."
ORDER BY user.lastname"
;
$resultStudents = api_sql_query($sqlStudents);
while($a_student = mysql_fetch_array($resultStudents))
{
$a_Students[$a_student['id_user']] = $a_student;
}
}
}
//We want the students of a teacher
else{
$sql="SELECT srcru.id_user, CONCAT(user.lastname,' ',user.firstname) as name, user.email FROM $tbl_course_user as course_rel_user, $tbl_user as user, $tbl_session_course_user as srcru " .
"WHERE course_rel_user.user_id='$i_user_id' AND course_rel_user.status='1' AND course_rel_user.course_code=srcru.course_code AND srcru.id_user=user.user_id";
$resultIdStudents = api_sql_query($sql);
while($a_student = mysql_fetch_array($resultIdStudents))
{
$a_Students[$a_student['id_user']] = $a_student;
}
}
foreach($a_Students as $students)
{
if($i%2==0){
$s_css_class="row_odd";
}
else{
$s_css_class="row_even";
}
$i++;
?>
<tr class="<?php echo $s_css_class;?>">
<td>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?student=<?php echo $students['id_user']; ?>#infosStudent"><?php echo $students['name']; ?></a>
</td>
<td>
<?php
if(!empty($students['email']))
echo '<a href="mailto:'.$students['email'].'">'.$students['email'].'</a>';
else
echo get_lang('NoEmail');
?>
</td>
<td>
</td>
</tr>
<?php
}
?>
</table>
<?php
if(!empty($_GET['student']))
{
if(!empty($_GET['student']))
{
$statistics_database = Database :: get_statistic_database();
$a_usersOnline = WhoIsOnline($_GET['student'], $statistics_database, 30);
@ -297,9 +199,7 @@ else{
$resultCours = api_sql_query($sqlCours);
?>
<br/><br/>
<br/>
<a name="infosStudent">
<table class="data_table">
<tr>
@ -822,6 +722,8 @@ else{
{
while($a_cours = mysql_fetch_array($resultCours))
{
if($i_user_id == $a_cours['id_coach']){
if($i%2==0){
$s_css_class="row_odd";
}
@ -831,6 +733,10 @@ else{
$i++;
/**
* Calcul du score total de l'étudiant sur le cours courant
*/
$sqlScore = " SELECT exe_result,
exe_weighting
FROM $tbl_stats_exercices
@ -854,13 +760,17 @@ else{
$weighting = 0;
/**
* Calcul de la progression de l'étudiant sur les learning path du cours courant
*/
$sqlProgress = "SELECT COUNT( DISTINCT item_view.lp_item_id ) AS nbItem
FROM ".$a_cours['db_name'].".".$tbl_course_lp_view_item." AS item_view
INNER JOIN ".$a_cours['db_name'].".".$tbl_course_lp_view." AS lpview
ON lpview.user_id = ".$_GET['student']."
WHERE item_view.status = 'completed'
";
//echo $sqlProgress;
$resultProgress = api_sql_query($sqlProgress);
$a_nbItem = mysql_fetch_array($resultProgress);
@ -890,14 +800,13 @@ else{
</td>
<td align="center">
<?php
if($i_user_id == $a_cours['id_coach'])
{
echo '<a href="'.$_SERVER['PHP_SELF'].'?student='.$a_infosUser['user_id'].'&details=true&course='.$a_cours['code'].'#infosStudent"> -> </a>';
}
?>
</td>
</tr>
<?php
<?php }
}
$totalPourcentageScore = round(($totalScore*100)/$totalWeighting);
@ -933,10 +842,10 @@ else{
?>
</table>
<br />
<?php
<?php
if(!empty($_GET['details']))
{
?>
?>
<div align="left">
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?student=<?php echo $a_infosUser['user_id']; ?>#infosStudent"><?php echo get_lang('Back'); ?></a>
</div>
@ -1023,7 +932,7 @@ else{
Display :: display_error_message($exportResult);
}
}
}
/*
==============================================================================

@ -95,7 +95,7 @@ ob_start();
if($is_allowedCreateCourse){
$sqlSessions = " SELECT DISTINCT id_session, name
$sqlSessions = " SELECT DISTINCT $tbl_sessions.id, name
FROM $tbl_session_course as session_course, $tbl_course_user as course_rel_user, $tbl_sessions as session
WHERE session.id=session_course.id_session AND session_course.course_code=course_rel_user.course_code AND course_rel_user.status='1' AND (course_rel_user.user_id='".$_user['user_id']."' OR session_course.id_coach='".$_user['user_id']."')
";
@ -132,7 +132,7 @@ ob_start();
while($a_sessions = mysql_fetch_array($resultSessions))
{
$i_id_session=$a_sessions['id_session'];
$i_id_session=$a_sessions['id'];
/*
//On récupère tous les cours de la session courante
$sql="SELECT course.title FROM $tbl_course as course, $tbl_session_course as session_rel_course " .
@ -151,7 +151,7 @@ ob_start();
</tr>
';
$a_data[$i_user_id]["name"]=$a_sessions['name'];
$a_data[$i_id_session]["name"]=$a_sessions['name'];
}
echo '</table>';

@ -143,7 +143,7 @@ ob_start();
$s_course_code=$a_courses["course_code"];
$sqlStudents = "SELECT DISTINCT user.user_id,lastname,firstname,email FROM $tbl_session_course_user as srcru, $tbl_user as user WHERE srcru.id_user=user.user_id AND srcru.course_code='$s_course_code'";
$result_students=api_sql_query($sqlStudents);
echo $sqlStudents;
if(mysql_num_rows($result_students)>0){
while($a_students_temp=mysql_fetch_array($result_students)){
@ -310,13 +310,7 @@ ob_start();
'.get_lang('Email').'
</th>
<th>
'.get_lang('Tutor').'
</th>
<th>
'.get_lang('Courses').'
</th>
<th>
'.get_lang('TakenSessions').'
'.get_lang('Tracking').'
</th>
</tr>
';
@ -328,7 +322,7 @@ ob_start();
$s_css_class="row_odd";
if($i%20==0 && $i!=0){
echo '<tr>
/*echo '<tr>
<th>
'.get_lang('Lastname').'
</th>
@ -348,6 +342,21 @@ ob_start();
'.get_lang('TakenSessions').'
</th>
</tr>
';*/
echo '<tr>
<th>
'.get_lang('Lastname').'
</th>
<th>
'.get_lang('Firstname').'
</th>
<th>
'.get_lang('Email').'
</th>
<th>
'.get_lang('Tracking').'
</th>
</tr>
';
}
}
@ -360,10 +369,10 @@ ob_start();
echo '<tr class="'.$s_css_class.'">
<td>
';
echo $a_current_student[1];
echo "<a href='myStudents.php?student=".$a_current_student[0]."#infosStudent'>".$a_current_student[1]."</a>";
echo ' </td>
<td>
'.$a_current_student[2].'
<a href="myStudents.php?student='.$a_current_student[0].'#infosStudent">'.$a_current_student[2].'</a>
</td>
<td>
';
@ -377,20 +386,14 @@ ob_start();
}
echo ' </td>';
if($a_current_student["teacher"]==true){
echo '<td>
<a href="coaches.php?id_student='.$a_current_student[0].'">-></a>
</td>
<td>
<a href="cours.php?type=student&user_id='.$a_current_student[0].'">-></a>
</td>
<td align="center">
<a href="'.$_SERVER['PHP_SELF'].'?student='.$a_current_student[0].'#sessionSuivie"> -> </a>
</td>';
echo '<td align="center"><a href="coaches.php?id_student='.$a_current_student[0].'"><img src="'.api_get_path(WEB_IMG_PATH).'members.gif" alt="'.get_lang("StudentTutors").'" title="'.get_lang("StudentTutors").'"></a>&nbsp;<a href="cours.php?type=student&user_id='.$a_current_student[0].'"><img src="'.api_get_path(WEB_IMG_PATH).'course.gif" alt="'.get_lang("StudentCourses").'" title="'.get_lang("StudentCourses").'"></a>&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?student='.$a_current_student[0].'#sessionSuivie"><img src="'.api_get_path(WEB_IMG_PATH).'agenda.gif" alt="'.get_lang("StudentSessions").'" title="'.get_lang("StudentSessions").'"></a>';
}
else{
echo '<td colspan="3"></td>';
echo '<td></td>';
}
echo '</tr>';

Loading…
Cancel
Save