diff --git a/main/auth/my_progress.php b/main/auth/my_progress.php index 50b0055f1b..337712d767 100755 --- a/main/auth/my_progress.php +++ b/main/auth/my_progress.php @@ -38,7 +38,6 @@ $tbl_course_quiz = Database :: get_course_table(TABLE_QUIZ_TEST); $tbl_access_rel_session = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); $tbl_access_rel_course = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); - // get course list if ($_configuration['multiple_access_urls']) { $sql = 'SELECT cu.course_code FROM '.$tbl_course_user.' cu INNER JOIN '.$tbl_access_rel_course.' a ON(a.course_code = cu.course_code) WHERE user_id='.intval($_user['user_id']).' AND relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND access_url_id = '.api_get_current_access_url_id().''; @@ -53,9 +52,7 @@ while($row = Database :: fetch_array($rs)) { $courses[$row['course_code']] = CourseManager::get_course_information($row['course_code']); } -// get the list of sessions where the user is subscribed as student - - +// Get the list of sessions where the user is subscribed as student if ($_configuration['multiple_access_urls']) { $sql = 'SELECT DISTINCT cu.course_code, id_session as session_id FROM '.$tbl_session_course_user.' cu INNER JOIN '.$tbl_access_rel_session.' a ON(a.session_id = cu.id_session) WHERE id_user='.$_user['user_id'].' AND access_url_id = '.api_get_current_access_url_id().''; } else { @@ -66,20 +63,20 @@ $rs = Database::query($sql); while($row = Database :: fetch_array($rs)) { $course_in_session[$row['session_id']][$row['course_code']] = CourseManager::get_course_information($row['course_code']); } -echo '
'; +/*echo '
'; echo $nameTools; -echo '
'; +echo '
';*/ if (!empty($courses)) { ?> - + @@ -87,17 +84,23 @@ if (!empty($courses)) { '; + if ($enreg['code'] == $_GET['course'] && empty($_GET['session_id'])) { + echo ''; + } else { + echo ''; + } + echo ''; echo ''; @@ -130,26 +133,22 @@ if (!empty($course_in_session)) { ?>
-
- +

'absmiddle', 'hspace' => '3px')); ?>
'.$enreg['title'].''.$time.'
- - - - - - - - - - - - -$session) { - echo ''; - echo ''; +

+$session) { + echo '

'.api_get_session_name($key).'

'; + ?> +
- -
'absmiddle', 'hspace' => '3px')); ?>
'.api_get_session_name($key).'
+ + + + + + + + + '; + } else { + echo ''; + } + echo ''; echo ''; @@ -189,9 +195,10 @@ if (!empty($course_in_session)) { echo ''; $i = $i ? 0 : 1; echo ''; - } + } + echo '
'absmiddle', 'hspace' => '3px')); ?>
'.$enreg['title'].' '.$time.'
'; } - echo ''; + } ?>

@@ -311,7 +318,7 @@ if (!empty($course_in_session)) { if (is_numeric($progress)) { $progress = $progress.'%'; } - echo $progress; + echo $progress; echo " "; diff --git a/main/inc/lib/events.lib.inc.php b/main/inc/lib/events.lib.inc.php index ebba82b834..2ad3b0d86f 100755 --- a/main/inc/lib/events.lib.inc.php +++ b/main/inc/lib/events.lib.inc.php @@ -379,7 +379,6 @@ function update_event_exercice($exeid, $exo_id, $score, $weighting,$session_id,$ status = '', start_date = '".api_get_utc_datetime($start_date)."' WHERE exe_id = '".Database::escape_string($exeid)."'"; - $res = @Database::query($sql); //Deleting control time session track @@ -438,8 +437,8 @@ function create_event_exercice($exo_id) { $expired_date = '0000-00-00 00:00:00'; } - $sql = "INSERT INTO $TABLETRACK_EXERCICES ( exe_user_id, exe_cours_id, expired_time_control, exe_exo_id) - VALUES ( ".$user_id.", '".api_get_course_id()."' ,'".$expired_date."','".$exo_id."')"; + $sql = "INSERT INTO $TABLETRACK_EXERCICES ( exe_user_id, exe_cours_id, expired_time_control, exe_exo_id, session_id) + VALUES ( ".$user_id.", '".api_get_course_id()."' ,'".$expired_date."','".$exo_id."','".api_get_session_id()."')"; $res = Database::query($sql); $id= Database::insert_id(); return $id; @@ -696,7 +695,7 @@ function get_all_exercise_event($exercise_id, $course_code, $session_id = 0) { $exercise_id = intval($exercise_id); $session_id = intval($session_id); - $sql = "SELECT * FROM $TABLETRACK_EXERCICES WHERE status = '' AND exe_cours_id = '$course_code' AND exe_exo_id = '$exercise_id' AND session_id = $session_id ORDER BY exe_id"; + $sql = "SELECT * FROM $TABLETRACK_EXERCICES WHERE status = '' AND exe_cours_id = '$course_code' AND exe_exo_id = '$exercise_id' AND session_id = $session_id AND orig_lp_id =0 AND orig_lp_item_id = 0 ORDER BY exe_id"; $res = api_sql_query($sql,__FILE__,__LINE__); $list = array(); diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 7a6f04258c..86a8279ad3 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -759,8 +759,9 @@ class Tracking { // Compose a filter based on optional session id $condition_session = ""; - if (isset($session_id)) { - $session_id = intval($session_id); + $session_id = intval($session_id); + + if (isset($session_id)) { if (count($lp_ids) > 0) { $condition_session = " AND session_id = $session_id "; } else { @@ -1643,6 +1644,7 @@ class Tracking { * @param string Course id * @return float average of test * @author isaac flores paz + * @deprecated get_avg_student_score should be use */ public static function get_average_test_scorm_and_lp ($user_id,$course_id) {