1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036 |
- <?php
- /*
- * Created on 20 juil. 2006 by Elixir Interactive http://www.elixir-interactive.com
- */
-
- $langFile = array ('registration', 'index','trad4all', 'tracking');
- $cidReset=true;
- require ('../inc/global.inc.php');
-
- $this_section = "session_my_space";
-
- $nameTools=get_lang("MyStudents");
-
- if(isset($_GET["user_id"]) && $_GET["user_id"]!="" && !isset($_GET["type"])){
- $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
- $interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers'));
- }
-
- if(isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"]=="coach"){
- $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace'));
- $interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors'));
- }
-
- api_block_anonymous_users();
- Display :: display_header($nameTools);
-
- /*
- * ======================================================================================
- * FUNCTIONS
- * ======================================================================================
- */
-
- function exportCsv($a_infosUser,$tableTitle,$a_header,$a_dataLearnpath,$a_dataExercices,$a_dataProduction)
- {
- global $archiveDirName;
-
- $fileName = 'test.csv';
- $archivePath = api_get_path(SYS_PATH).$archiveDirName.'/';
- $archiveURL = api_get_path(WEB_CODE_PATH).'course_info/download.php?archive=';
-
- if(!$open = fopen($archivePath.$fileName,'w+'))
- {
- $message = get_lang('noOpen');
- }
- else
- {
- $info = '';
-
- $info .= $a_infosUser['name'];
- $info .= "\r\n";
- $info .= $a_infosUser['email'];
- $info .= "\r\n";
- $info .= $a_infosUser['phone'];
- /*$info .= "\r\n";
- $info .= $a_infosUser['adresse'];*/
-
- $info .= "\r\n";
- $info .= "\r\n";
- $info .= $tableTitle;
- $info .= "\r\n";
-
- for($i=0;$i<4;$i++)
- {
- $info .= $a_header[$i].';';
- }
- $info .= "\r\n";
-
- foreach($a_dataLearnpath as $a_learnpath)
- {
- foreach($a_learnpath as $learnpath)
- {
- $info .= $learnpath.';';
- }
- $info .= "\r\n";
- }
-
- for($i=4;$i<8;$i++)
- {
- $info .= $a_header[$i].';';
- }
- $info .= "\r\n";
-
- foreach($a_dataExercices as $a_exercice)
- {
- foreach($a_exercice as $exercice)
- {
- $info .= $exercice.';';
- }
- $info .= "\r\n";
- }
-
- for($i=8;$i<12;$i++)
- {
- $info .= $a_header[$i].';';
- }
-
- $info .= "\r\n";
-
- foreach($a_dataProduction as $a_production)
- {
- foreach($a_production as $production)
- {
- $info .= $production.';';
- }
- $info .= "\r\n";
- }
- fwrite($open,$info);
- fclose($open);
- chmod($fileName,0777);
- $message = get_lang('UsageDatacreated');
-
- header("Location:".$archiveURL.$fileName);
- }
-
- return $message;
- }
- /*
- *===============================================================================
- * MAIN CODE
- *===============================================================================
- */
-
- $tbl_user = Database :: get_main_table(MAIN_USER_TABLE);
- $tbl_session_user = Database :: get_main_table(MAIN_SESSION_USER_TABLE);
- $tbl_session = Database :: get_main_table(MAIN_SESSION_TABLE);
- $tbl_session_course = Database :: get_main_table(MAIN_SESSION_COURSE_TABLE);
- $tbl_session_course_user = Database :: get_main_table(MAIN_SESSION_COURSE_USER_TABLE);
- $tbl_course = Database :: get_main_table(MAIN_COURSE_TABLE);
- $tbl_course_user = Database :: get_main_table(MAIN_COURSE_USER_TABLE);
- $tbl_stats_exercices = Database :: get_statistic_table(STATISTIC_TRACK_E_EXERCICES_TABLE);
- //$tbl_course_lp_view = Database :: get_course_table('lp_view');
- //$tbl_course_lp_view_item = Database :: get_course_table('lp_item_view');
- //$tbl_course_lp_item = Database :: get_course_table('lp_item');
- $tbl_course_lp_view = 'lp_view';
- $tbl_course_lp_view_item = 'lp_item_view';
- $tbl_course_lp_item = 'lp_item';
- $tbl_course_lp = 'lp';
- $tbl_course_quiz = 'quiz';
- $course_quiz_question = 'quiz_question';
- $course_quiz_rel_question = 'quiz_rel_question';
- $course_quiz_answer = 'quiz_answer';
- $course_student_publication = Database::get_course_table(STUDENT_PUBLICATION_TABLE);
- api_display_tool_title($nameTools);
- if(isset($_GET["user_id"]) && $_GET["user_id"]!=""){
- $i_user_id=$_GET["user_id"];
- }
- else{
- $i_user_id=$_uid;
- }
- ?>
- <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']))
- {
-
- $statistics_database = Database :: get_statistic_database();
- $a_usersOnline = WhoIsOnline($_GET['student'], $statistics_database, 30);
- foreach($a_usersOnline as $a_online)
- {
- if(in_array($_GET['student'],$a_online))
- {
- $online = get_lang('Yes');
- }
- else
- {
- $online = get_lang('No');
- }
- }
- $sqlInfosUser = " SELECT user_id,
- CONCAT(firstname,' ',lastname) AS name,
- email,
- phone,
- picture_uri
- FROM $tbl_user
- WHERE user_id = ".$_GET['student']
- ;
- $resultInfosUser = api_sql_query($sqlInfosUser);
- $a_infosUser = mysql_fetch_array($resultInfosUser);
-
- $sqlCours = " SELECT DISTINCT course.title,
- course.code,
- course.db_name,
- CONCAT(user.firstname,' ',user.lastname) as tutor_name,
- sessionCourse.id_coach
- FROM $tbl_user as user,$tbl_course AS course
- INNER JOIN $tbl_session_course_user AS course_user
- ON course_user.course_code = course.code
- INNER JOIN $tbl_session_course as sessionCourse
- ON sessionCourse.course_code = course.code
- WHERE course_user.id_user = ".$_GET['student']."
- AND sessionCourse.id_coach = user.user_id
- ORDER BY course.title ASC
- ";
- $resultCours = api_sql_query($sqlCours);
-
- ?>
- <br/><br/>
- <br/>
- <a name="infosStudent">
- <table class="data_table">
- <tr>
- <td
- <?php
- if(empty($details))
- echo 'colspan="6"';
- else
- echo 'colspan="7"';
- ?>
- class="border">
- <table width="100%" border="0" >
- <tr>
-
- <?php
- if(!empty($a_infosUser['picture_uri']))
- {
- echo ' <td class="borderRight">
- <img src="'.$a_infosUser['picture_uri'].'" />
- </td>
- ';
- }
- ?>
-
- <td class="none">
- <table>
- <tr>
- <td class="none">
- <?php
- echo get_lang('Name').' : ';
- echo $a_infosUser['name'];
- ?>
- </td>
- </tr>
- <tr>
- <td class="none">
- <?php
- echo get_lang('Email').' : ';
- if(!empty($a_infosUser['email']))
- {
- echo '<a href="mailto:'.$students['email'].'">'.$a_infosUser['email'].'</a>';
- }
- else
- {
- echo get_lang('NoEmail');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td class="none">
- <?php
- echo get_lang('Tel').'. ';
-
- if(!empty($a_infosUser['phone']))
- {
- echo $a_infosUser['phone'];
- }
- else
- {
- echo get_lang('NoTel');
- }
- ?>
- </td>
- </tr>
- <tr>
- <td class="none">
- <?php
- echo get_lang('OnLine').' : ';
- echo $online;
- ?>
- </td>
- </tr>
- </table>
- </td>
- <?php
-
- if(!empty($_GET['details']))
- {
- $sendMail = Display::encrypted_mailto_link($a_infosUser['email'], '> '.get_lang('SendMail'));
-
- ?>
- <td class="borderLeft">
- <table width="100%">
- <tr>
- <th>
- <?php echo get_lang('Actions'); ?>
- </th>
- </tr>
- <tr>
-
- <?php
- if(!empty($a_infosUser['email']))
- {
- echo "<td class='none'>";
- echo $sendMail;
- echo "</td>";
- }
- else
- {
- echo "<td class='noLink none'>";
- echo '<strong> > '.get_lang('SendMail').'</strong>';
- echo "</td>";
- }
- ?>
-
- </tr>
- <tr>
- <td class="none">
- <?php echo "<a href=''>".'> '.get_lang('RdvAgenda')."</a>"; ?>
- </td>
- </tr>
- <tr>
- <td class="none">
- <?php echo "<a href=''>".'> '.get_lang('VideoConf')."</a>"; ?>
- </td>
- </tr>
- <tr>
- <td class="none">
- <?php echo "<a href=''>".'> '.get_lang('Chat')."</a>"; ?>
- </td>
- </tr>
- <tr>
- <td class="none">
-
- <?php echo "<a href='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."&csv=true#infosStudent'>".'> '.get_lang('ExcelFormat')."</a>"; ?>
- </td>
- </tr>
- </table>
- </td>
- <?php
- }
- ?>
- </tr>
- </table>
- </td>
- </tr>
- <tr><td colspan="5" style="border-width: 0px;"> </td></tr>
- </a>
- <?php
- if(!empty($_GET['details']))
- {
- ?>
- <br /><br />
- <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>
- <br />
- <?php
-
- $sqlInfosCourse = " SELECT course.code,
- course.title,
- course.db_name,
- CONCAT(user.firstname,' ',user.lastname) as tutor_name,
- session.date_start,
- session.date_end
- FROM $tbl_user as user, $tbl_course as course
- INNER JOIN $tbl_session_course as sessionCourse
- ON sessionCourse.course_code = course.code
- INNER JOIN $tbl_session AS session
- ON session.id = sessionCourse.id_session
- WHERE sessionCourse.id_coach = user.user_id
- AND course.code= '".$_GET['course']."'
- ";
-
- $resultInfosCourse = api_sql_query($sqlInfosCourse);
-
- $a_infosCours = mysql_fetch_array($resultInfosCourse);
-
- $a_date_start = explode('-',$a_infosCours['date_start']);
- $date_start = $a_date_start[2].'/'.$a_date_start[1].'/'.$a_date_start[0];
- $a_date_end = explode('-',$a_infosCours['date_end']);
- $date_end = $a_date_end[2].'/'.$a_date_end[1].'/'.$a_date_end[0];
- $dateSession = get_lang('Du').' '.$date_start.' '.get_lang('Au').' '.$date_end;
- $tableTitle = $a_infosCours['title'].'. '.get_lang('Tutor').' : '.$a_infosCours['tutor_name'].'. '.get_lang('Session').' : '.$dateSession;
-
-
- ?>
- <tr class="tableName">
- <td colspan="6">
- <strong><?php echo $tableTitle; ?></strong>
- </td>
- </tr>
- <tr>
- <th class="head">
- <?php echo get_lang('Learnpath'); ?>
- </th>
- <th class="head" colspan="2">
- <?php echo get_lang('Time'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Progress'); ?>
- </th>
- <th class="head" colspan="2">
- <?php echo get_lang('LastConnexion'); ?>
- </th>
- </tr>
- <?php
- $a_headerLearnpath = array(get_lang('Learnpath'),get_lang('Time'),get_lang('Progress'),get_lang('LastConnexion'));
-
- $sqlLearnpath = " SELECT lp.name,lp.id
- FROM ".$a_infosCours['db_name'].".".$tbl_course_lp." AS lp
- ";
- $resultLearnpath = api_sql_query($sqlLearnpath);
-
- if(mysql_num_rows($resultLearnpath)>0)
- {
- $i = 0;
- while($a_learnpath = mysql_fetch_array($resultLearnpath))
- {
- $sqlProgress = "SELECT COUNT(DISTINCT lp_item_id) AS nbItem
- FROM ".$a_infosCours['db_name'].".".$tbl_course_lp_view_item." AS item_view
- INNER JOIN ".$a_infosCours['db_name'].".".$tbl_course_lp_view." AS view
- ON item_view.lp_view_id = view.id
- AND view.lp_id = ".$a_learnpath['id']."
- AND view.user_id = ".$_GET['student']."
- WHERE item_view.status = 'completed'
- ";
- $resultProgress = api_sql_query($sqlProgress);
- $a_nbItem = mysql_fetch_array($resultProgress);
-
- $sqlTotalItem = " SELECT COUNT(item_type) AS totalItem
- FROM ".$a_infosCours['db_name'].".".$tbl_course_lp_item."
- WHERE lp_id = ".$a_learnpath['id']
- ;
- $resultItem = api_sql_query($sqlTotalItem);
- $a_totalItem = mysql_fetch_array($resultItem);
-
- $progress = round(($a_nbItem['nbItem'] * 100)/$a_totalItem['totalItem']);
-
- if($i%2==0){
- $s_css_class="row_odd";
- }
- else{
- $s_css_class="row_even";
- }
-
- $i++;
-
- ?>
- <tr class="<?php echo $s_css_class;?>">
- <td>
- <?php echo $a_learnpath['name']; ?>
- </td>
- <td colspan="2">
-
- </td>
- <td align="center">
- <?php echo $progress.'%'; ?>
- </td>
- <td colspan="2">
-
- </td>
- </tr>
-
- <?php
-
- $dataLearnpath[$i][] = $a_learnpath['name'];
- $dataLearnpath[$i][] = $progress.'%';
- $i++;
- }
-
- }
- else
- {
- echo " <tr>
- <td colspan='6'>
- ".get_lang('NoLearnpath')."
- </td>
- </tr>
- ";
- }
- ?>
- <tr>
- <th class="head">
- <?php echo get_lang('Exercices'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Score') ?>
- </th>
- <th class="head">
- <?php echo get_lang('Details'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Essais'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Correction'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Corriger'); ?>
- </th>
- </tr>
- <?php
- $a_headerExercices = array(get_lang('Exercices'),get_lang('Score'),get_lang('Essais'),get_lang('Correction'));
- $sqlExercices = " SELECT quiz.title,id
- FROM ".$a_infosCours['db_name'].".".$tbl_course_quiz." AS quiz
- ";
-
- $resultExercices = api_sql_query($sqlExercices);
- $i = 0;
- if(mysql_num_rows($resultExercices)>0)
- {
- while($a_exercices = mysql_fetch_array($resultExercices))
- {
- $sqlEssais = " SELECT COUNT(ex.exe_id) as essais
- FROM $tbl_stats_exercices AS ex
- WHERE ex.exe_cours_id = '".$a_infosCours['code']."'
- AND ex.exe_exo_id = ".$a_exercices['id']
- ;
- $resultEssais = api_sql_query($sqlEssais);
- $a_essais = mysql_fetch_array($resultEssais);
-
- $sqlScore = "SELECT exe_result,exe_weighting
- FROM $tbl_stats_exercices
- WHERE exe_user_id = ".$_GET['student']."
- AND exe_cours_id = '".$a_infosCours['code']."'
- AND exe_exo_id = ".$a_exercices['id']
- ;
-
- $resultScore = api_sql_query($sqlScore);
- $score = 0;
- while($a_score = mysql_fetch_array($resultScore))
- {
- $score = $score + $a_score['exe_result'];
- $weighting = $weighting + $a_score['exe_weighting'];
- }
- $pourcentageScore = round(($score*100)/$weighting);
-
- $weighting = 0;
-
- if($i%2==0){
- $s_css_class="row_odd";
- }
- else{
- $s_css_class="row_even";
- }
-
- $i++;
-
- echo "<tr class='$s_css_class'>
- <td>
- ";
- echo $a_exercices['title'];
- echo " </td>
- ";
- echo " <td align='center'>
- ";
- echo $pourcentageScore.'%';
- echo " </td>
- <td align='center'>
- ";
- echo "<a href='".$_SERVER['PHP_SELF']."?student=".$_GET['student']."&details=true&course=".$_GET['course']."&exe_id=".$a_exercices['id']."#infosExe'> -> </a>";
- echo " </td>
- <td align='center'>
- ";
- echo $a_essais['essais'];
- echo " </td>
- <td>
- ";
- echo " </td>
- <td align='center'>
- ";
- echo "<a href=''> -> </a>";
- echo " </td>
- </tr>
- ";
-
- $dataExercices[$i][] = $a_exercices['title'];
- $dataExercices[$i][] = $pourcentageScore.'%';
- $dataExercices[$i][] = $a_essais['essais'];
- //$dataExercices[$i][] = corrections;
- $i++;
-
- }
- }
- else
- {
- echo " <tr>
- <td colspan='6'>
- ".get_lang('NoExercice')."
- </td>
- </tr>
- ";
- }
- ?>
- <tr>
- <th class="head">
- <?php echo get_lang('Productions'); ?>
- </th>
- <th class="head" colspan="2">
- <?php echo get_lang('LimitDate'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('RemiseDate'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Remarques'); ?>
- </th>
- <th class="head">
- <?php echo get_lang('Annoter'); ?>
- </th>
- </tr>
- <?php
- $a_headerProductions = array(get_lang('Productions'),get_lang('LimitDate'),get_lang('RemiseDate'),get_lang('Remarques'));
- $sqlProduction = " SELECT title,sent_date
- FROM ".$a_infosCours['db_name'].".".$course_student_publication."
- ";
-
- $resultProduction = api_sql_query($sqlProduction);
- if(mysql_num_rows($resultProduction)>0)
- {
- $i = 0;
- while($a_production = mysql_fetch_array($resultProduction))
- {
-
- //$tmp_limitDate = $newDate = mktime(0 , 0 , 0 , date("m") , date("d") , date("Y"));
- $tmp_limitDate = $newDate = mktime(0 , 0 , 0 ,8 , 20 , 2006);
-
- $a_sentDate = explode(' ',$a_production['sent_date']);
- $a_sentDate = explode('-',$a_sentDate[0]);
- $tmp_sentDate = mktime(0,0,0,$a_sentDate[1],$a_sentDate[2],$a_sentDate[0]);
-
- $sentDate = $a_sentDate[2].'/'.$a_sentDate[1].'/'.$a_sentDate[0];
-
- if($i%2==0){
- $s_css_class="row_odd";
- }
- else{
- $s_css_class="row_even";
- }
-
- $i++;
-
- echo "<tr class='$s_css_class'>
- <td>
- ";
- echo $a_production['title'];
- echo " </td>
- ";
- echo " <td align='center' colspan='2'>
- ";
-
- echo " </td>
- ";
- if($tmp_sentDate > $tmp_limitDate)
- {
- echo "<td align='center' class='redText'>";
- $tmp_retard = $tmp_sentDate - $tmp_limitDate;
- $retard = round($tmp_retard/86400);
- echo $retard.' '.get_lang('DayOfDelay');
- echo "</td>";
- }
- else
- {
- echo "<td align='center'>";
- echo $sentDate;
- echo "</td>";
- }
- echo " <td align='center'>
- ";
- $remarque = '';
- if($remarque == '')
- {
- echo "--";
- }
-
- echo " </td>
- <td align='center'>
- ";
- echo "<a href=''> -> </a>";
- echo " </td>
- </tr>
- ";
-
- $dataProduction[$i][] = $a_production['title'];
- //$dataProduction[$i][] = $a_production['sent_date'];
- $dataProduction[$i][] = $a_production['sent_date'];
- //$dataProduction[$i][] = remarques;
- $i++;
-
- }
- }
- else
- {
- echo " <tr>
- <td colspan='6'>
- ".get_lang('NoProduction')."
- </td>
- </tr>
- ";
- }
-
- }
- else
- {
- ?>
- <tr>
- <th>
- <?php echo get_lang('Course'); ?>
- </th>
- <th>
- <?php echo get_lang('Time'); ?>
- </th>
- <th>
- <?php echo get_lang('Progress'); ?>
- </th>
- <th>
- <?php echo get_lang('Score'); ?>
- </th>
- <th>
- <?php echo get_lang('Details'); ?>
- </th>
- </tr>
- <?php
- if(mysql_num_rows($resultCours)>0)
- {
- while($a_cours = mysql_fetch_array($resultCours))
- {
- if($i%2==0){
- $s_css_class="row_odd";
- }
- else{
- $s_css_class="row_even";
- }
-
- $i++;
-
- $sqlScore = " SELECT exe_result,
- exe_weighting
- FROM $tbl_stats_exercices
- WHERE exe_user_id = ".$_GET['student']."
- AND exe_cours_id = '".$a_cours['code']."'
- ";
- $resultScore = api_sql_query($sqlScore);
- $i = 0;
- $score = 0;
- while($a_score = mysql_fetch_array($resultScore))
- {
- $score = $score + $a_score['exe_result'];
- $weighting = $weighting + $a_score['exe_weighting'];
- $i++;
- }
-
- $totalScore = $totalScore + $score;
- $totalWeighting = $totalWeighting + $weighting;
-
- $pourcentageScore = round(($score*100)/$weighting);
-
- $weighting = 0;
-
- $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);
-
- $table = $a_cours['db_name'].'.'.$tbl_course_lp_item;
- if(mysql_select_db($a_cours['db_name']))
- $nbTotalItem = Database::count_rows($table);
-
- $totalItem = $totalItem + $nbTotalItem;
-
- $totalProgress = $totalProgress + $a_nbItem['nbItem'];
-
- $progress = round(($a_nbItem['nbItem'] * 100)/$nbTotalItem);
-
- ?>
- <tr class="<?php echo $s_css_class;?>">
- <td>
- <?php echo $a_cours['title'].' - '.get_lang('Tutor').' : '.$a_cours['tutor_name']; ?>
- </td>
- <td>
-
- </td>
- <td align="center">
- <?php echo $progress.'%'; ?>
- </td>
- <td align="center">
- <?php echo $pourcentageScore.'%'; ?>
- </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
- }
-
- $totalPourcentageScore = round(($totalScore*100)/$totalWeighting);
- $progress = round(($totalProgress*100)/$totalItem);
- ?>
- <tr class='total'>
- <td>
- <strong>Total</strong>
- </td>
- <td>
- </td>
- <td align="center">
- <?php echo $progress.'%'; ?>
- </td>
- <td align="center">
- <?php echo $totalPourcentageScore.'%'; ?>
- </td>
- <td>
- </td>
- </tr>
- <?php
- }
- else
- {
- echo "<tr>
- <td colspan='5'>
- ".get_lang('NoCourse')."
- </td>
- </tr>
- ";
- }
- }//end of else !empty($details)
- ?>
- </table>
- <br />
- <?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>
- <br /><br />
- <?php
- }
- if(!empty($_GET['exe_id']))
- {
- $sqlExerciceDetails = " SELECT qq.question, qq.ponderation, qq.id
- FROM ".$a_infosCours['db_name'].".".$course_quiz_question." as qq
- INNER JOIN ".$a_infosCours['db_name'].".".$course_quiz_rel_question." as qrq
- ON qrq.question_id = qq.id
- AND qrq.exercice_id = ".$_GET['exe_id']
-
- ;
-
- $resultExerciceDetails = api_sql_query($sqlExerciceDetails);
-
-
- $sqlExName = " SELECT quiz.title
- FROM ".$a_infosCours['db_name'].".".$tbl_course_quiz." AS quiz
- WHERE quiz.id = ".$_GET['exe_id']
- ;
-
- $resultExName = api_sql_query($sqlExName);
- $a_exName = mysql_fetch_array($resultExName);
-
- echo "<table class='data_table'>
- <tr>
- <th colspan='2'>
- ".$a_exName['title']."
- </th>
- </tr>
- ";
-
- while($a_exerciceDetails = mysql_fetch_array($resultExerciceDetails))
- {
- $sqlAnswer = " SELECT qa.comment, qa.answer
- FROM ".$a_infosCours['db_name'].".".$course_quiz_answer." as qa
- WHERE qa.question_id = ".$a_exerciceDetails['id']
- ;
-
- $resultAnswer = api_sql_query($sqlAnswer);
-
- echo "<a name='infosExe'></a>";
- //print_r($a_exerciceDetails);
- echo"
- <tr>
- <td colspan='2'>
- <strong>".$a_exerciceDetails['question'].' /'.$a_exerciceDetails['ponderation']."</strong>
- </td>
- </tr>
- ";
- while($a_answer = mysql_fetch_array($resultAnswer))
- {
- echo"
- <tr>
- <td>
- ".$a_answer['answer']."
- </td>
- <td>
- ";
- if(!empty($a_answer['comment']))
- echo $a_answer['comment'];
- else
- echo get_lang('NoComment');
- echo "
- </td>
- </tr>
- ";
- }
- }
-
- echo "</table>";
-
-
-
- }
- $a_header = array_merge($a_headerLearnpath,$a_headerExercices,$a_headerProductions);
-
- if($_GET['csv'] == "true")
- {
- $exportResult = exportCsv($a_infosUser,$tableTitle,$a_header,$dataLearnpath,$dataExercices,$dataProduction);
- Display :: display_error_message($exportResult);
- }
-
- }
-
- /*
- ==============================================================================
- FOOTER
- ==============================================================================
- */
- Display::display_footer();
-
- ?>
|