fixed informations about teachers inside drh interface - partial CT#603

skala
Cristian Fasanando 15 years ago
parent f53fb7c148
commit c0b9472500
  1. 2
      main/admin/session_course_user_list.php
  2. 32
      main/mySpace/course.php
  3. 6
      main/mySpace/myStudents.php
  4. 5
      main/mySpace/session.php
  5. 37
      main/mySpace/student.php
  6. 1
      main/mySpace/teachers.php

@ -57,7 +57,7 @@ $limit=20;
$from=$page * $limit;
$is_western_name_order = api_is_western_name_order();
$result=Database::query("SELECT user_id,".($is_western_name_order ? 'firstname,lastname' : 'lastname,firstname').",username FROM $tbl_session_rel_course_rel_user,$tbl_user WHERE user_id=id_user AND id_session='$id_session' AND course_code='".addslashes($course_code)."' ORDER BY $sort LIMIT $from,".($limit+1));
$result=Database::query("SELECT u.user_id,".($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname').", u.username FROM $tbl_session_rel_course_rel_user scru, $tbl_user u WHERE u.user_id=scru.id_user AND scru.id_session='$id_session' AND scru.status<>2 AND scru.course_code='".addslashes($course_code)."' ORDER BY $sort LIMIT $from,".($limit+1));
$Users=Database::store_result($result);
$nbr_results=sizeof($Users);

@ -61,12 +61,34 @@ Display :: display_header($nameTools);
$a_courses = array();
if (api_is_drh()) {
$a_courses = array_keys(CourseManager::get_courses_followed_by_drh($_user['user_id']));
$title = '';
if (empty($id_session)) {
if (isset($_GET['user_id'])) {
$user_id = intval($_GET['user_id']);
$user_info = api_get_user_info($user_id);
$title = get_lang('AssignedCoursesTo').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
$courses = CourseManager::get_course_list_of_user_as_course_admin($user_id);
} else {
$title = get_lang('YourCourseList');
$courses = CourseManager::get_courses_followed_by_drh($_user['user_id']);
}
} else {
$session_name = api_get_session_name($id_session);
$title = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession');
$courses = Tracking::get_courses_list_from_session($id_session);
}
$a_courses = array_keys($courses);
$menu_items[] = '<a href="index.php?view=drh_students">'.get_lang('Students').'</a>';
$menu_items[] = '<a href="teachers.php">'.get_lang('Teachers').'</a>';
$menu_items[] = get_lang('Courses');
if (empty($_GET['user_id']) && empty($id_session)) {
$menu_items[] = get_lang('Courses');
} else {
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
}
$menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>';
echo '<div class="actions-title" style ="font-size:10pt;">';
@ -83,7 +105,7 @@ if (api_is_drh()) {
echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> ';
}
echo '</div>';
echo '<br />';
echo '<h4>'.$title.'</h4>';
}
// Database Table Definitions
@ -156,7 +178,7 @@ if (is_array($a_courses)) {
$avg_assignments_in_course = $avg_messages_in_course = $avg_progress_in_course = $avg_score_in_course = $avg_time_spent_in_course = 0;
// students directly subscribed to the course
if (empty($session_id)) {
if (empty($id_session)) {
$sql = "SELECT user_id FROM $tbl_user_course as course_rel_user WHERE course_rel_user.status='5' AND course_rel_user.course_code='$course_code'";
} else {
$sql = "SELECT id_user as user_id FROM $tbl_session_course_user srcu WHERE srcu. course_code='$course_code' AND id_session = '$id_session' AND srcu.status<>2";

@ -7,7 +7,7 @@
*/
// 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', 'gradebook');
require '../inc/global.inc.php';
@ -892,7 +892,7 @@ if ($timezone !== null) {
get_lang('Time', ''),
get_lang('Progress', ''),
get_lang('Score', ''),
get_lang('AttendanceFaults', ''),
get_lang('AttendancesFaults', ''),
get_lang('Evaluations')
);
@ -933,7 +933,7 @@ if ($timezone !== null) {
<th>'.get_lang('Time').'</th>
<th>'.get_lang('Progress').'</th>
<th>'.get_lang('Score').'</th>
<th>'.get_lang('AttendanceFaults').'</th>
<th>'.get_lang('AttendancesFaults').'</th>
<th>'.get_lang('Evaluations').'</th>
<th>'.get_lang('Details').'</th>
</tr>';

@ -7,7 +7,7 @@
ob_start();
$nameTools= 'Sessions';
// name of the language file that needs to be included
$language_file = array ('registration', 'index', 'trad4all', 'tracking');
$language_file = array ('registration', 'index', 'trad4all', 'tracking', 'admin');
$cidReset = true;
require '../inc/global.inc.php';
@ -102,7 +102,8 @@ if (api_is_drh()) {
echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
}
echo '</div>';
echo '<h4>'.get_lang('YourSessionsList').'</h4>';
} else {
if (api_is_platform_admin()) {
$a_sessions = SessionManager::get_sessions_list();

@ -5,7 +5,7 @@
*/
// name of the language file that needs to be included
$language_file = array ('registration', 'index', 'tracking');
$language_file = array ('registration', 'index', 'tracking', 'admin');
$cidReset = true;
require '../inc/global.inc.php';
@ -106,12 +106,34 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
if (api_is_drh()) {
if (!isset($_GET['id_session'])) {
$students = array_keys(UserManager::get_users_followed_by_drh($_user['user_id'], STUDENT));
$courses_of_the_platform = CourseManager :: get_real_course_list();
$title = get_lang('YourStudents');
if (!isset($_GET['id_session'])) {
if (isset($_GET['user_id'])) {
$user_id = intval($_GET['user_id']);
$user_info = api_get_user_info($user_id);
$title = api_get_person_name($user_info['firstname'], $user_info['lastname']).' : '.get_lang('Students');
$courses_by_teacher = CourseManager::get_course_list_of_user_as_course_admin($user_id);
$students_by_course = array();
if (!empty($courses_by_teacher)) {
foreach ($courses_by_teacher as $course) {
$students_by_course = array_keys(CourseManager::get_student_list_from_course_code($course['course_code']));
if (count($students_by_course) > 0) {
foreach ($students_by_course as $student_by_course) {
$students[] = $student_by_course;
}
}
}
}
$students = array_unique($students);
} else {
$students = array_keys(UserManager::get_users_followed_by_drh($_user['user_id'], STUDENT));
}
$courses_of_the_platform = CourseManager :: get_real_course_list();
foreach ($courses_of_the_platform as $course) {
$courses[$course['code']] = $course['code'];
}
}
}
$menu_items[] = '<a href="index.php?view=drh_students">'.get_lang('Students').'</a>';
@ -134,7 +156,10 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
}
echo '</div>';
echo '<h4>'.get_lang('YourStudentsList').'</h4>';
echo '<h4>'.$title.'</h4>';
} else {
echo '<div align="left" style="float:left"><h4>'.$title.'</h4></div>
<div align="right">

@ -49,6 +49,7 @@ if (api_is_drh()) {
echo '<a href="'.api_get_self().'?export=xls"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsXLS').'</a>';
}
echo '</div>';
echo '<h4>'.get_lang('YourTeachers').'</h4>';
echo '<br />';
}

Loading…
Cancel
Save