From 2dee7e8513b0bd9c7c83e25b24dffa9eb10bfd94 Mon Sep 17 00:00:00 2001 From: Julian Prud'homme Date: Fri, 3 Aug 2007 15:16:48 +0200 Subject: [PATCH] [svn r12872] Fix a bug --- main/newscorm/lp_stats.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index db689c7769..3ee149e4b8 100644 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -139,11 +139,22 @@ foreach ($list as $my_item_id) { if ($row['item_type'] != 'dokeos_chapter') { if($row['item_type'] == 'quiz'){ - if($_SESSION['status'][$_course["id"]] == 5){ - $correct_test_link = ''; + + if($origin != 'tracking'){ + $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 exe_cours_id="'.$_SESSION['_course']['id'].'" ORDER BY exe_date DESC LIMIT 1'; } else{ - $correct_test_link = ''; + $sql_last_attempt='SELECT exe_id FROM '.$tbl_stats_exercices.' WHERE exe_exo_id="'.$row['path'].'" AND exe_user_id="'.$_GET['student_id'].'" AND exe_cours_id="'.$_SESSION['_course']['id'].'" ORDER BY exe_date DESC LIMIT 1'; + } + + $resultLastAttempt = api_sql_query($sql_last_attempt); + $id_last_attempt=mysql_result($resultLastAttempt,0,0); + + if($origin != 'tracking'){ + $correct_test_link = ''; + } + else{ + $correct_test_link = ''; } } else{ @@ -296,7 +307,7 @@ foreach ($list as $my_item_id) { $resultLastAttempt = api_sql_query($sql_last_attempt); $id_last_attempt=mysql_result($resultLastAttempt,0,0); - if($_SESSION['status'][$_course["id"]] == 5){ + if($origin != 'tracking'){ $correct_test_link = ''; } else{