[svn r17909] Logic change - Fixed score in exercise y lp into tracking and implemented qualify exercise attempts in learning path details - see FS#3479

skala
Cristian Fasanando 16 years ago
parent 50c30370b7
commit ee0c5a7c4c
  1. 10
      main/auth/my_progress.php
  2. 9
      main/exercice/exercice.php
  3. 4
      main/exercice/exercise_show.php
  4. 21
      main/mySpace/myStudents.php
  5. 93
      main/newscorm/lp_stats.php
  6. 23
      main/tracking/courseLog.php

@ -310,7 +310,9 @@ foreach($Courses as $enreg)
$sqlEssais = " SELECT COUNT(ex.exe_id) as essais
FROM $tbl_stats_exercices AS ex
WHERE ex.exe_user_id='".$_user['user_id']."' AND ex.exe_cours_id = '".$a_infosCours['code']."'
AND ex.exe_exo_id = ".$a_exercices['id']
AND ex.exe_exo_id = ".$a_exercices['id']."
AND orig_lp_id = 0
AND orig_lp_item_id = 0 "
;
$resultEssais = api_sql_query($sqlEssais);
$a_essais = Database::fetch_array($resultEssais);
@ -320,6 +322,8 @@ foreach($Courses as $enreg)
WHERE exe_user_id = ".$_user['user_id']."
AND exe_cours_id = '".$a_infosCours['code']."'
AND exe_exo_id = ".$a_exercices['id']."
AND orig_lp_id = 0
AND orig_lp_item_id = 0
ORDER BY exe_date DESC LIMIT 1"
;
@ -334,7 +338,7 @@ foreach($Courses as $enreg)
if ($weighting>0)
{
$pourcentageScore = round(($score*100)/$weighting);
$pourcentageScore = round(($score*100)/$weighting,1);
}
else
{
@ -361,7 +365,7 @@ foreach($Courses as $enreg)
<td align="center" width="25">
';
if($a_essais['essais']>0)
echo '<a href="../exercice/exercise_show.php?origin=student_progress&id='.$exe_id.'&cidReq='.$a_infosCours['code'].'&id_session='.$_GET['id_session'].'"> '.Display::return_icon('quiz.gif', get_lang('Quiz')).' </a>';
echo '<a href="../exercice/exercise_show.php?origin=myprogress&id='.$exe_id.'&cidReq='.$a_infosCours['code'].'&id_session='.$_GET['id_session'].'"> '.Display::return_icon('quiz.gif', get_lang('Quiz')).' </a>';
echo " </td>
</tr>
";

@ -1,4 +1,4 @@
<?php // $Id: exercice.php 17895 2009-01-21 15:21:40Z cvargas1 $
<?php // $Id: exercice.php 17909 2009-01-21 21:06:39Z cfasanando $
/*
==============================================================================
@ -272,13 +272,16 @@ api_mail_html($emailid, $emailid, $subject, $mess, $from_name, $from);
if (in_array($origin, array('tracking_course','user_course'))){
// update score when you qualify the exercises in Learning path detail
if (isset($_REQUEST['lp_item_id']) && isset($_REQUEST['lp_item_view_id']) && isset($_REQUEST['student_id']) && isset($_REQUEST['total_score'])) {
$lp_item_id = $_REQUEST['lp_item_id'];
$lp_item_view_id = $_REQUEST['lp_item_view_id'];
$student_id = $_REQUEST['student_id'];
if ($lp_item_id == strval(intval($lp_item_id)) && $lp_item_view_id == strval(intval($lp_item_view_id)) && $student_id == strval(intval($student_id))) {
$score = Database::escape_string($_REQUEST['total_score']);
$sql = "UPDATE $TBL_LP_ITEM_VIEW SET score = '$score' WHERE lp_item_id = '$lp_item_id'
AND lp_view_id = (SELECT id from $TBL_LP_VIEW WHERE user_id = '$student_id' and lp_id='$lp_item_view_id')";
api_sql_query($sql,__FILE__,__LINE__);
api_sql_query($sql,__FILE__,__LINE__);
}
}
}
//Redirect to the reporting
header('location: ../mySpace/myStudents.php?origin='.$origin.'&student='.$_GET['student'].'&details=true&course='.$_GET['course']);
}

@ -1038,7 +1038,9 @@ $totalWeighting+=$questionWeighting;
}
if ($origin=='learnpath' || $origin=='student_progress') {?>
<input type="button" onclick="top.location.href='../newscorm/lp_controller.php?cidReq=<?php echo api_get_course_id()?>&amp;action=view&amp;lp_id=<?php echo $learnpath_id ?>&amp;lp_item_id=<?php echo $learnpath_item_id ?>'" value="<?php echo get_lang('Finish'); ?>" />
<?php }?>
<?php } else if($origin=='myprogress') {?>
<input type="button" onclick="top.location.href='../auth/my_progress.php?course=<?php echo api_get_course_id()?>'" value="<?php echo get_lang('Finish'); ?>" />
<?php }?>
</td>
</tr>
</table>

@ -1,4 +1,4 @@
<?php //$Id: myStudents.php 17551 2009-01-06 19:31:15Z cfasanando $
<?php //$Id: myStudents.php 17909 2009-01-21 21:06:39Z cfasanando $
/* For licensing terms, see /dokeos_license.txt */
/**
* Implements the tracking of students in the Reporting pages
@ -237,11 +237,11 @@ if(!empty($_GET['student']))
$nb_courses++;
$avg_student_progress += Tracking :: get_avg_student_progress($a_infosUser['user_id'],$course_code);
//the score inside the Reporting table
$avg_student_score += Tracking :: get_avg_student_score($a_infosUser['user_id'],$course_code);
$avg_student_score += Tracking :: get_avg_student_score($a_infosUser['user_id'],$course_code);
}
}
$avg_student_progress = round($avg_student_progress / $nb_courses,2);
$avg_student_score = round($avg_student_score / $nb_courses,2);
}
$avg_student_progress = round($avg_student_progress,2);
$avg_student_score = round($avg_student_score,2);
$first_connection_date = Tracking::get_first_connection_date($a_infosUser['user_id']);
if($first_connection_date==''){
@ -253,9 +253,7 @@ if(!empty($_GET['student']))
$last_connection_date=get_lang('NoConnexion');
}
$time_spent_on_the_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($a_infosUser['user_id'], $course_code));
$time_spent_on_the_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($a_infosUser['user_id'], $_GET['course']));
// cvs informations
$csv_content[] = array(get_lang('Informations'));
$csv_content[] = array(get_lang('Name'), get_lang('Email'), get_lang('Tel'));
@ -646,8 +644,7 @@ if(!empty($_GET['student']))
}
//QUIZZ IN LP
$score = Tracking::get_avg_student_score(intval($_GET['student']), Database::escape_string($_GET['course']), array($a_learnpath['id']));
$score = Tracking::get_avg_student_score(intval($_GET['student']), Database::escape_string($_GET['course']), array($a_learnpath['id']));
if($i%2==0){
$s_css_class="row_odd";
@ -781,7 +778,7 @@ if(!empty($_GET['student']))
$pourcentageScore = 0;
if($weighting!=0)
{
$pourcentageScore = round(($score*100)/$weighting);
$pourcentageScore = round(($score*100)/$weighting,1);
}
$weighting = 0;
@ -963,7 +960,7 @@ if(!empty($_GET['student']))
$csv_content[] = array();
$csv_content[] = array(get_lang('Course'),get_lang('Time'),get_lang('Progress'),get_lang('Score'));
foreach($a_courses as $course_code)
{
{
if(CourseManager :: is_user_subscribed_in_course($student_id,$course_code, true)){
$course_infos = CourseManager :: get_course_information($course_code);
$time_spent_on_course = api_time_to_hms(Tracking :: get_time_spent_on_the_course($a_infosUser['user_id'], $course_code));

@ -106,10 +106,10 @@ if ($origin == 'tracking') {
}
if (!empty ($_GET['extend_all'])) {
$extend_all_link = '<a href="' . api_get_self() . '?action=stats' . $url_suffix . '"><img src="../img/view_less_stats.gif" alt="fold_view" border="0"></a>';
$extend_all_link = '<a href="' . api_get_self() . '?action=stats' . $url_suffix . '"><img src="../img/view_less_stats.gif" alt="fold_view" border="0" title="'.get_lang('HideAllAttempts').'"></a>';
$extend_all = 1;
} else {
$extend_all_link = '<a href="' . api_get_self() . '?action=stats&extend_all=1' . $url_suffix . '"><img src="../img/view_more_stats.gif" alt="extend_view" border="0"></a>';
$extend_all_link = '<a href="' . api_get_self() . '?action=stats&extend_all=1' . $url_suffix . '"><img src="../img/view_more_stats.gif" alt="extend_view" border="0" title="'.get_lang('ShowAllAttempts').'"></a>';
}
if ($origin != 'tracking') {
@ -194,7 +194,7 @@ foreach ($list as $my_item_id) {
$result = api_sql_query($sql, __FILE__, __LINE__);
$num = Database :: num_rows($result);
$num = Database :: num_rows($result);
$time_for_total = 'NaN';
if (($extend_this || $extend_all) && $num > 0) {
$row = Database :: fetch_array($result);
@ -233,6 +233,7 @@ foreach ($list as $my_item_id) {
if ($num > 0) {
if ($num > 1) {
while ($rowLA = Database :: fetch_row($resultLastAttempt)) {
$id_last_attempt = $rowLA[0];
if ($origin != 'tracking') {
$correct_test_link = '<a href="../exercice/exercise_show.php?origin=student_progress&id=' . $id_last_attempt . '&cidReq=' . $course_code . '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif"></a>';
@ -331,13 +332,46 @@ foreach ($list as $my_item_id) {
'not attempted' => 'ScormNotAttempted',
);
$my_lesson_status = htmlentities(get_lang($mylanglist[$lesson_status]), ENT_QUOTES, $dokeos_charset);
//$my_lesson_status = get_lang($mylanglist[$lesson_status]);
if ($row['item_type'] != 'dokeos_chapter') {
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . "<td>$extend_attempt_link</td>\n" . '<td colspan="3">' . htmlentities(get_lang('Attempt'), ENT_QUOTES, $dokeos_charset) . ' ' . $row['iv_view_count'] . "</td>\n"
//."<td><font color='$color'><div class='mystatus'>".htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."</div></font></td>\n"
. '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . "</div></font></td>\n" . '<td colspan="2"><div class="mystatus" align="center">' . ($score == 0 ? '-' : ($maxscore == 0 ? $score : $score . '/' . $maxscore)) . "</div></td>\n" . '<td colspan="2"><div class="mystatus">' . $time . "</div></td><td></td>\n" . "</tr>\n";
if (isset($_GET['lp_id']) && isset($_GET['my_lp_id'])) {
if ($origin != 'tracking') {
$sql_attempts = 'SELECT * FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . (int)$row['path'] . '" AND exe_user_id="' . (int)api_get_user_id() . '" AND orig_lp_id = "'.(int)$_GET['lp_id'].'" AND orig_lp_item_id = "'.(int)$_GET['my_lp_id'].'" AND exe_cours_id="' . Database :: escape_string($course_code) . '" AND status <> "incomplete" ORDER BY exe_date';
} else {
$sql_attempts = 'SELECT * FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . (int)$row['path'] . '" AND exe_user_id="' . (int)$_GET['student_id'] . '" AND orig_lp_id = "'.(int)$_GET['lp_id'].'" AND orig_lp_item_id = "'.(int)$_GET['my_lp_id'].'" AND exe_cours_id="' . Database :: escape_string($course_code) . '" AND status <> "incomplete" ORDER BY exe_date';
}
} else {
if ($origin != 'tracking') {
$sql_attempts = 'SELECT * FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . (int)$row['path'] . '" AND exe_user_id="' . (int)api_get_user_id() . '" AND orig_lp_id = "'.(int)$lp_id.'" AND orig_lp_item_id = "'.(int)$row['myid'].'" AND exe_cours_id="' . Database :: escape_string($course_code) . '" AND status <> "incomplete" ORDER BY exe_date';
} else {
$sql_attempts = 'SELECT * FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . (int)$row['path'] . '" AND exe_user_id="' . (int)$_GET['student_id'] . '" AND orig_lp_id = "'.(int)$lp_id.'" AND orig_lp_item_id = "'.(int)$row['myid'].'" AND exe_cours_id="' . Database :: escape_string($course_code) . '" AND status <> "incomplete" ORDER BY exe_date';
}
}
$res_attempts = api_sql_query($sql_attempts,__FILE__,__LINE__);
$num_attempts = Database :: num_rows($res_attempts);
if ($row['item_type'] != 'dokeos_chapter') {
if ($num_attempts > 0) {
$n=1;
while ($row_attempts = Database :: fetch_array($res_attempts)) {
$my_score = $row_attempts['exe_result'];
$my_maxscore = $row_attempts['exe_weighting'];
$my_exe_id = $row_attempts['exe_id'];
$my_orig_lp = $row_attempts['orig_lp_id'];
$my_orig_lp_item = $row_attempts['orig_lp_item_id'];
$output .= '<tr class="'.$oddclass.'"><td>&nbsp;</td><td>'.$extend_attempt_link.'</td><td colspan="3">' . htmlentities(get_lang('Attempt'), ENT_QUOTES, $dokeos_charset) . ' ' . $n . '</td>'
. '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . '</div></font></td><td colspan="2"><div class="mystatus" align="center">' . ($my_score == 0 ? '-' : ($my_maxscore == 0 ? $my_score : $my_score . '/' . $my_maxscore)) . '</div></td><td colspan="2"><div class="mystatus">' . $time . '</div></td>';
if ($origin != 'tracking') {
$output .= '<td><a href="../exercice/exercise_show.php?origin=student_progress&myid='.$my_orig_lp.'&my_lp_id='.$my_orig_lp_item.'&id=' . $my_exe_id . '&cidReq=' . $course_code . '&student=' . $_GET['student_id'] . '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" title="'.get_lang('ShowAttempt').'"></a></td>';
} else {
$output .= '<td><a href="../exercice/exercise_show.php?origin=tracking_course&myid='.$my_orig_lp.'&my_lp_id='.$my_orig_lp_item.'&id=' . $my_exe_id . '&cidReq=' . $course_code . '&student=' . $_GET['student_id'] . '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" title="'.get_lang('ShowAndQualifyAttempt').'"></a></td>';
}
$output .= '</tr>';
$n++;
}
}
}
$counter++;
@ -496,42 +530,28 @@ foreach ($list as $my_item_id) {
);
$my_lesson_status = htmlentities(get_lang($mylanglist[$lesson_status]), ENT_QUOTES, $dokeos_charset);
if ($row['item_type'] != 'dokeos_chapter') {
if ($row['item_type'] == 'quiz') {
$correct_test_link = '';
$my_url_suffix ='';
if ($origin != 'tracking' && $origin != 'tracking_course') {
$sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . $row['path'] . '" AND exe_user_id="' . api_get_user_id() . '" AND orig_lp_id = "'.$lp_id.'" AND orig_lp_item_id = "'.$row['myid'].'" AND exe_cours_id="' . $course_code . '" AND status <> "incomplete" ORDER BY exe_date ASC';
$my_url_suffix = '&course=' . api_get_course_id() . '&student_id=' . api_get_user_id() . '&lp_id=' . Security::remove_XSS($row['mylpid']);
$sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . $row['path'] . '" AND exe_user_id="' . api_get_user_id() . '" AND orig_lp_id = "'.$lp_id.'" AND orig_lp_item_id = "'.$row['myid'].'" AND exe_cours_id="' . $course_code . '" AND status <> "incomplete" ORDER BY exe_date DESC ';
} else {
$sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . $row['path'] . '" AND exe_user_id="' . Database :: escape_string($_GET['student_id']) . '" AND orig_lp_id = "'.$lp_id.'" AND orig_lp_item_id = "'.$row['myid'].'" AND exe_cours_id="' . Database :: escape_string($_GET['course']) . '" AND status <> "incomplete" ORDER BY exe_date';
$my_url_suffix = '&course=' . $_GET['course'] . '&student_id=' . Security::remove_XSS($_GET['student_id']) . '&lp_id=' . Security::remove_XSS($row['mylpid']);
$sql_last_attempt = 'SELECT exe_id FROM ' . $tbl_stats_exercices . ' WHERE exe_exo_id="' . $row['path'] . '" AND exe_user_id="' . Database :: escape_string($_GET['student_id']) . '" AND orig_lp_id = "'.$lp_id.'" AND orig_lp_item_id = "'.$row['myid'].'" AND exe_cours_id="' . Database :: escape_string($_GET['course']) . '" AND status <> "incomplete" ORDER BY exe_date DESC ';
}
$resultLastAttempt = api_sql_query($sql_last_attempt, __FILE__, __LINE__);
$num = Database :: num_rows($resultLastAttempt);
if ($num > 0) {
$my_id = $row['myid'];
$my_lp_id = $row['mylpid'];
if ($num > 1) {
$i = 1;
while ($rowLA = Database :: fetch_array($resultLastAttempt)) {
$laid = $rowLA['exe_id'];
if ($origin != 'tracking') {
$correct_test_link .= '<a href="../exercice/exercise_show.php?origin=student_progress&id=' . $laid . '&cidReq=' . $course_code . '" target="_parent" title="' . get_lang('Attempt') . ' ' . $i . '"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif"></a> ';
} else {
$correct_test_link .= '<a href="../exercice/exercise_show.php?origin=tracking_course&myid='.$my_id.'&my_lp_id='.$my_lp_id.'&id=' . $laid . '&cidReq=' . Security :: remove_XSS(Database :: escape_string($_GET['course'])) . '&student=' . $_GET['student_id'] . '" target="_parent" title="' . get_lang('Attempt') . ' ' . $i . '"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif"></a> ';
}
$i++;
}
$correct_test_link = substr($correct_test_link, 0, -1);
$my_lp_id = $row['mylpid'];
if (isset($_GET['extend_all']) && $_GET['extend_all'] == 1) {
$correct_test_link = '<a href="' . api_get_self() . '?action=stats' . $my_url_suffix . '"><img src="../img/view_less_stats.gif" alt="fold_view" border="0"></a>';
$extend_all = 1;
} else {
$id_last_attempt = Database :: result($resultLastAttempt, 0, 0);
if ($origin != 'tracking') {
$correct_test_link = '<a href="../exercice/exercise_show.php?origin=student_progress&id=' . $id_last_attempt . '&cidReq=' . $course_code . '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif"></a>';
} else {
$correct_test_link = '<a href="../exercice/exercise_show.php?origin=tracking_course&myid='.$my_id.'&my_lp_id='.$my_lp_id.'&id=' . $id_last_attempt . '&cidReq=' . Security :: remove_XSS(Database :: escape_string($_GET['course'])) . '&student=' . $_GET['student_id'] . '" target="_parent"><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif"></a>';
}
$correct_test_link = '<a href="' . api_get_self() . '?action=stats&extend_all=1'.$my_url_suffix.'&my_lp_id='.$my_id.'"><img src="../img/view_more_stats.gif" alt="extend_view" border="0" title="'.get_lang('ShowAllAttemptsByExercise').'"></a>';
}
} else {
$correct_test_link = '-';
@ -633,9 +653,10 @@ if (($counter % 2) == 0) {
$oddclass = "row_even";
}
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . '<td colspan="4"><div class="mystatus"><i>' . htmlentities(get_lang('AccomplishedStepsTotal'), ENT_QUOTES, $dokeos_charset) . "</i></div></td>\n"
//."<td><font color='$color'><div class='mystatus'>".htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."</div></font></td>\n"
. '<td colspan="2"></td>' . "\n" . '<td colspan="2"><div class="mystatus" align="center">' . $final_score . "</div></td>\n" . '<td colspan="2"><div class="mystatus">' . $total_time . '</div></td><td></td>' . "\n" . "</tr>\n";
if (empty($extend_all)) {
$output .= "<tr class='$oddclass'>\n" . "<td></td>\n" . '<td colspan="4"><div class="mystatus"><i>' . htmlentities(get_lang('AccomplishedStepsTotal'), ENT_QUOTES, $dokeos_charset) . "</i></div></td>\n"
. '<td colspan="2"></td>' . "\n" . '<td colspan="2"><div class="mystatus" align="center">' . $final_score . "</div></td>\n" . '<td colspan="2"><div class="mystatus">' . $total_time . '</div></td><td></td>' . "\n" . "</tr>\n";
}
$output .= "</table></td></tr></table>";

@ -78,10 +78,12 @@ $TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_
$TABLETRACK_LINKS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LINKS);
$TABLETRACK_DOWNLOADS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
$TABLETRACK_ACCESS_2 = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$TABLETRACK_EXERCISES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSE_LINKS = Database::get_course_table(TABLE_LINK);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$TABLEQUIZ = Database :: get_course_table(TABLE_QUIZ_TEST);
//$table_scormdata = Database::get_scorm_table(TABLE_SCORM_SCO_DATA);
//$table_scormmain = Database::get_scorm_table(TABLE_SCORM_MAIN);
@ -214,7 +216,7 @@ if($_GET['studentlist'] == 'false') {
<table class="data_table">';
$sql = "SELECT id, title
FROM ".Database :: get_course_table(TABLE_QUIZ_TEST);
FROM $TABLEQUIZ WHERE active <> -1";
$rs = api_sql_query($sql, __FILE__, __LINE__);
if ($export_csv) {
@ -227,12 +229,13 @@ if($_GET['studentlist'] == 'false') {
while($quiz = Database::fetch_array($rs)) {
$quiz_avg_score = 0;
// get the progress in learning pathes
// get the scorn in exercises
$sql = 'SELECT exe_result , exe_weighting
FROM '.Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES).'
FROM '.$TABLETRACK_EXERCISES.'
WHERE exe_exo_id = '.$quiz['id'].'
ORDER BY exe_date DESC
LIMIT 0, 1';
AND orig_lp_id = 0
AND orig_lp_item_id = 0
ORDER BY exe_date DESC';
$rsAttempt = api_sql_query($sql, __FILE__, __LINE__);
$nb_attempts = 0;
while ($attempt = Database::fetch_array($rsAttempt)) {
@ -502,8 +505,8 @@ if($_GET['studentlist'] == 'false') {
$avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0 ;
$nb_courses_student = 0;
$avg_time_spent = Tracking :: get_time_spent_on_the_course($student_id, $course_code);
$avg_student_score = Tracking :: get_avg_student_score($student_id, $course_code);
$avg_time_spent = Tracking :: get_time_spent_on_the_course($student_id, $course_code);
$avg_student_score = Tracking :: get_avg_student_score($student_id, $course_code);
$avg_student_progress = Tracking :: get_avg_student_progress($student_id, $course_code);
$total_assignments = Tracking :: count_student_assignments($student_id, $course_code);
$total_messages = Tracking :: count_student_messages($student_id, $course_code);
@ -511,8 +514,10 @@ if($_GET['studentlist'] == 'false') {
$row = array();
$row[] = $student_datas['official_code'];
$row[] = $student_datas['lastname'];
$row[] = $student_datas['firstname'];
$row[] = api_time_to_hms($avg_time_spent);
$row[] = $student_datas['firstname'];
$row[] = api_time_to_hms($avg_time_spent);
if (is_null($avg_student_score)) {$avg_student_score=0;}
if (is_null($avg_student_progress)) {$avg_student_progress=0;}
$row[] = $avg_student_progress.' %';
$row[] = $avg_student_score.' %';
$row[] = $total_assignments;

Loading…
Cancel
Save