| $displayText | ".get_lang('CountOfSubscribedUsers')." |
|---|---|
| $entity | ".count($student)." |
| ".get_lang('GeneralTotal')." | $total |
| ".get_lang('Author')." | ".get_lang('LearningPathList')." | ".get_lang('CountOfSubscribedUsers')." | ".get_lang('StudentList')." |
|---|---|---|---|
| $printTeacherName | "; $hiddenField = 'student_show_'.$index; $hiddenFieldLink = 'student_show_'.$index.'_'; $lpCourseCode = $lpData['course_code']; $lpName = $lpData['name']; $courseStudent = isset($lpData['courseStudent']) ? $lpData['courseStudent'] : []; $courseStudentGroup = isset($lpData['courseStudentGroup']) ? $lpData['courseStudentGroup'] : []; $sessionStudent = isset($lpData['sessionStudent']) ? $lpData['sessionStudent'] : []; $htmlData .= "$lpName | ".count($courseStudent)." ( ".count($sessionStudent)." ) | "; $csv_row = []; $csv_row[] = $printTeacherName; $csv_row[] = $lpName; $csv_row[] = count($courseStudent).' ( '.count($sessionStudent)." )"; if (!empty($courseStudent) || !empty($courseStudentGroup) || !empty($sessionStudent) ) { $htmlData .= " "; } $htmlData .= " |
| ".get_lang('LearnpathsTotal')." ".count($teacher)." | $totalStudents |
| ".get_lang('NoDataAvailable').' |
|---|
| ".get_lang('Author')." | ".get_lang('ContentList')." | ".get_lang('Tariff')." | ".get_lang('CountOfSubscribedUsers')." | ".get_lang('ToInvoice')." | ".get_lang('StudentList')." | |
|---|---|---|---|---|---|---|
| ".$authorTemp['complete_name']." | "; } else { $table .= "||||||
| "; } $table .= " | $title | $price | "; $studentRegister = count($byCourse); $studentGroupsRegister = count($byCourseGroups); $studentRegisterBySession = count($bySession); $hiddenField = 'student_show_'.$index; $hiddenFieldLink = 'student_show_'.$index.'_'; if (0 != $studentRegister || 0 != $studentRegisterBySession || 0 != $studentGroupsRegister) { $tableTemp .= ""; } else { $tableTemp .= " | "; } $table .= " | $totalStudents | "; $invoicing = ($totalStudents * $price); $table .= "$invoicing | "; $total += $invoicing; $totalSudent += $totalStudents; $table .= $tableTemp."
| $totalSudent | $total |
| '.get_lang('Course').' | '; $head .= ''.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).' | '; $head .= ''.cut(get_lang('AvgStudentsProgress'), 6, true).' | '; $head .= ''.cut(get_lang('AvgCourseScore'), 6, true).' | '; $head .= ''.cut(get_lang('TotalNumberOfMessages'), 6, true).' | '; $head .= ''.cut(get_lang('TotalNumberOfAssignments'), 6, true).' | '; $head .= ''.get_lang('TotalExercisesScoreObtained').' | '; $head .= ''.cut(get_lang('TotalExercisesAnswered'), 6, true).' | '; $head .= ''.get_lang('LatestLogin').' | '; $head .= '
|---|
| '.$row->title.' | '; // get the users in the course $sql = "SELECT u.user_id FROM $tbl_user AS u INNER JOIN $tbl_session_rel_course_rel_user AS scu ON u.user_id = scu.user_id WHERE scu.session_id = '".$session_id."' AND scu.c_id = '".$courseId."'"; $result_users = Database::query($sql); $time_spent = 0; $progress = 0; $nb_progress_lp = 0; $score = 0; $nb_score_lp = 0; $nb_messages = 0; $nb_assignments = 0; $last_login_date = false; $total_score_obtained = 0; $total_score_possible = 0; $total_questions_answered = 0; while ($row_user = Database::fetch_object($result_users)) { // get time spent in the course and session $time_spent += Tracking::get_time_spent_on_the_course($row_user->user_id, $courseId, $session_id); $progress_tmp = Tracking::get_avg_student_progress($row_user->user_id, $row->code, [], $session_id, true); $progress += $progress_tmp[0]; $nb_progress_lp += $progress_tmp[1]; $score_tmp = Tracking::get_avg_student_score($row_user->user_id, $row->code, [], $session_id, true); if (is_array($score_tmp)) { $score += $score_tmp[0]; $nb_score_lp += $score_tmp[1]; } $nb_messages += Tracking::count_student_messages($row_user->user_id, $row->code, $session_id); $nb_assignments += Tracking::count_student_assignments($row_user->user_id, $row->code, $session_id); $last_login_date_tmp = Tracking::get_last_connection_date_on_the_course( $row_user->user_id, $courseInfo, $session_id, false ); if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned. $last_login_date = $last_login_date_tmp; } elseif ($last_login_date_tmp != false && $last_login_date != false) { // TODO: Repeated previous condition! To be cleaned. // Find the max and assign it to first_login_date if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) { $last_login_date = $last_login_date_tmp; } } $exercise_results_tmp = self::exercises_results($row_user->user_id, $row->code, $session_id); $total_score_obtained += $exercise_results_tmp['score_obtained']; $total_score_possible += $exercise_results_tmp['score_possible']; $total_questions_answered += $exercise_results_tmp['questions_answered']; } if ($nb_progress_lp > 0) { $avg_progress = round($progress / $nb_progress_lp, 2); } else { $avg_progress = 0; } if ($nb_score_lp > 0) { $avg_score = round($score / $nb_score_lp, 2); } else { $avg_score = '-'; } if ($last_login_date) { $last_login_date = api_convert_and_format_date( $last_login_date, DATE_FORMAT_SHORT, date_default_timezone_get() ); } else { $last_login_date = '-'; } if ($total_score_possible > 0) { $total_score_percentage = round($total_score_obtained / $total_score_possible * 100, 2); } else { $total_score_percentage = 0; } if ($total_score_percentage > 0) { $total_score = $total_score_obtained.'/'.$total_score_possible.' ('.$total_score_percentage.' %)'; } else { $total_score = '-'; } // time spent in the course $return .= ''.api_time_to_hms($time_spent).' | ';
// student progress in course
$return .= ' '.$avg_progress.' | ';
// student score
$return .= ' '.$avg_score.' | ';
// student messages
$return .= ' '.$nb_messages.' | ';
// student assignments
$return .= ' '.$nb_assignments.' | ';
// student exercises results (obtained score, maximum score, number of exercises answered, score percentage)
$return .= ''.$total_score.' | '; $return .= ''.$total_questions_answered.' | '; // last connection $return .= ''.$last_login_date.' | ';
$return .= '